本文整理汇总了C++中GetAchievementStore函数的典型用法代码示例。如果您正苦于以下问题:C++ GetAchievementStore函数的具体用法?C++ GetAchievementStore怎么用?C++ GetAchievementStore使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetAchievementStore函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: JustDied
void JustDied(Unit* pKiller)
{
DoScriptText(SAY_DEATH, m_creature);
if (m_pInstance)
m_pInstance->SetData(TYPE_LOKEN, DONE);
if (!m_bIsRegularMode)
{
if (m_bIsAchievInTime)
{
AchievementEntry const *AchievTimelyDeath = GetAchievementStore()->LookupEntry(ACHIEV_TIMELY_DEATH);
if (AchievTimelyDeath)
{
Map* pMap = m_creature->GetMap();
if (pMap && pMap->IsDungeon())
{
Map::PlayerList const &players = pMap->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
itr->getSource()->CompletedAchievement(AchievTimelyDeath);
}
}
}
}
}
示例2: JustDied
void JustDied(Unit* /*killer*/)
{
DoScriptText(SAY_DEATH, me);
if (pInstance)
{
/*if (IsHeroic() && !bMoreThanTwoIntenseCold)
pInstance->DoCompleteAchievement(ACHIEV_INTENSE_COLD);*/
if (IsHeroic())
{
AchievementEntry const *achievIntenseCold = GetAchievementStore()->LookupEntry(ACHIEV_INTENSE_COLD);
if (achievIntenseCold)
{
Map::PlayerList const &players = pInstance->instance->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
if (lMoreThanTwoIntenseCold.find(itr->getSource()->GetGUID()) != lMoreThanTwoIntenseCold.end())
continue;
else
itr->getSource()->CompletedAchievement(achievIntenseCold);
}
}
}
pInstance->SetData(DATA_KERISTRASZA_EVENT, DONE);
}
}
示例3: HandleAchievementAddCommand
static bool HandleAchievementAddCommand(ChatHandler* handler, const char *args)
{
if (!*args)
return false;
uint32 achievementId = atoi((char*)args);
if (!achievementId)
{
if (char* cId = handler->extractKeyFromLink((char*)args, "Hachievement"))
achievementId = atoi(cId);
if (!achievementId)
return false;
}
Player* target = handler->getSelectedPlayer();
if (!target)
{
handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
handler->SetSentErrorMessage(true);
return false;
}
if (AchievementEntry const* pAE = GetAchievementStore()->LookupEntry(achievementId))
target->CompletedAchievement(pAE);
return true;
}
示例4: OnGossipHello
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
const AchievementEntry * achiCrusader = GetAchievementStore()->LookupEntry(pPlayer->GetTeam() == TEAM_HORDE ? ACHI_CRUSADER_H : ACHI_CRUSADER_A);
if (pPlayer->HasTitle(TITLE_CRUSADER) || pPlayer->GetAchievementMgr().HasAchieved(achiCrusader))
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
return true;
}
示例5: OnQuestReward
bool OnQuestReward(Player* pPlayer, Creature* /*pCreature*/, Quest const* pQuest, uint32 /*opt*/)
{
if(pQuest->GetQuestId() == 11023 && IsHolidayActive(HOLIDAY_FEAST_OF_WINTER_VEIL) && pPlayer->HasAura(62061))
{
if(AchievementEntry const* pAchievement = GetAchievementStore()->LookupEntry(1282))
pPlayer->CompletedAchievement(pAchievement);
}
return true;
}
示例6: GetAchievementStore
// Complete Achievement for all players in instance
void InstanceScript::DoCompleteAchievement(uint32 achievement)
{
AchievementEntry const* pAE = GetAchievementStore()->LookupEntry(achievement);
Map::PlayerList const &PlayerList = instance->GetPlayers();
if(!pAE)
return;
if(!PlayerList.isEmpty()) {
for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if(Player* pPlayer = i->getSource())
pPlayer->CompletedAchievement(pAE);
}
}
示例7: GetAchievementStore
// Complete Achievement for all players in instance
void InstanceScript::DoCompleteAchievement(uint32 achievement)
{
AchievementEntry const* pAE = GetAchievementStore()->LookupEntry(achievement);
Map::PlayerList const &PlayerList = instance->GetPlayers();
if (!pAE)
{
sLog->outError("TSCR: DoCompleteAchievement called for not existing achievement %u", achievement);
return;
}
if (!PlayerList.isEmpty())
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player *pPlayer = i->getSource())
pPlayer->CompletedAchievement(pAE);
}
示例8: JustDied
void JustDied(Unit* killer)
{
DoScriptText(SAY_DEATH, m_creature);
if (pInstance)
pInstance->SetData(DATA_MAIDEN_OF_GRIEF_EVENT, DONE);
AchievementEntry const *AchievGoodGrief = GetAchievementStore()->LookupEntry(ACHIEVEMENT_GOOD_GRIEF);
Map* pMap = m_creature->GetMap();
if (IsHeroic() && AchievTimer < 60000 && pMap && pMap->IsDungeon() && AchievGoodGrief)
{
Map::PlayerList const &players = pMap->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
itr->getSource()->CompletedAchievement(AchievGoodGrief);
}
}
示例9: GetAchievementStore
// *****************************************************
// *******************Reward System*********************
// *****************************************************
void BattlefieldWG::DoCompleteOrIncrementAchievement(uint32 achievement, Player *player, uint8 /*incrementNumber */ )
{
AchievementEntry const* AE = GetAchievementStore()->LookupEntry(achievement);
switch (achievement)
{
case ACHIEVEMENTS_WIN_WG_100:
{
// player->GetAchievementMgr().UpdateAchievementCriteria();
}
default:
{
if (player)
player->CompletedAchievement(AE);
}
break;
}
}
示例10: JustDied
void JustDied(Unit* /*killer*/)
{
DoScriptText(SAY_DEATH, me);
AchievementEntry const *achievSnakes = GetAchievementStore()->LookupEntry(ACHIEV_SNAKES);
if (achievSnakes && IsHeroic())
{
for (std::set<uint64>::const_iterator itr = lUnWrappedPlayers.begin(); itr != lUnWrappedPlayers.end(); ++itr)
{
Player* temp = Unit::GetPlayer(*me, *itr);
if (temp && temp->isAlive() && (temp->GetDistance2d(me) < 100))
temp->CompletedAchievement(achievSnakes);
}
}
if (pInstance)
pInstance->SetData(DATA_SLAD_RAN_EVENT, DONE);
}
示例11: JustDied
void JustDied(Unit* /*killer*/)
{
DoScriptText(SAY_DEATH, me);
if (pInstance)
{
AchievementEntry const *achievIntenseCold = GetAchievementStore()->LookupEntry(ACHIEV_INTENSE_COLD);
if (achievIntenseCold && IsHeroic())
{
for (std::set<uint64>::const_iterator itr = lIntenseColdPlayers.begin(); itr != lIntenseColdPlayers.end(); ++itr)
{
Player* temp = Unit::GetPlayer(*me, *itr);
if (temp && temp->isAlive() && (temp->GetDistance2d(me) < 50))
temp->CompletedAchievement(achievIntenseCold);
}
}
pInstance->SetData(DATA_KERISTRASZA_EVENT, DONE);
}
}
示例12: JustDied
void JustDied(Unit* killer)
{
DoScriptText(SAY_DEATH, m_creature);
if (pInstance)
{
pInstance->SetData(DATA_PRINCE_TALDARAM_EVENT, DONE);
//The Party's Over achievement:
AchievementEntry const *AchievThePartyIsOver = GetAchievementStore()->LookupEntry(ACHIEVEMENT_THE_PARTY_IS_OVER);
Map* pMap = m_creature->GetMap();
if (pMap && pMap->IsDungeon() && HeroicMode && AchievThePartyIsOver)
{
Map::PlayerList const &players = pMap->GetPlayers();
if (players.getSize() < 5)
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
itr->getSource()->CompletedAchievement(AchievThePartyIsOver);
}
}
}
示例13: JustDied
void JustDied(Unit* pKiller)
{
DoScriptText(SAY_DEATH, m_creature);
if(m_pInstance)
m_pInstance->SetData(TYPE_HEIGAN, DONE);
if (!m_bIsPlayerDeath)
{
AchievementEntry const *AchievSafetyDance = GetAchievementStore()->LookupEntry(m_bIsRegularMode ? ACHIEV_SAFETY_DANCE : H_ACHIEV_SAFETY_DANCE);
if (AchievSafetyDance)
{
Map* pMap = m_creature->GetMap();
if (pMap && pMap->IsDungeon())
{
Map::PlayerList const &players = pMap->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
itr->getSource()->CompletedAchievement(AchievSafetyDance);
}
}
}
}
示例14: JustDied
void JustDied(Unit* /*killer*/)
{
DoScriptText(SAY_DEATH, me);
if (IsHeroic() && !ShatterFrostTomb)
{
AchievementEntry const *AchievOnTheRocks = GetAchievementStore()->LookupEntry(ACHIEVEMENT_ON_THE_ROCKS);
if (AchievOnTheRocks)
{
Map* pMap = me->GetMap();
if (pMap && pMap->IsDungeon())
{
Map::PlayerList const &players = pMap->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
itr->getSource()->CompletedAchievement(AchievOnTheRocks);
}
}
}
if (pInstance)
pInstance->SetData(DATA_PRINCEKELESETH_EVENT, DONE);
}
示例15: JustDied
void JustDied(Unit* killer)
{
DoScriptText(SAY_SLAY_3,m_creature);
if (HeroicMode && !DeadAhnkaharGuardian)
{
AchievementEntry const *AchievRespectYourElders = GetAchievementStore()->LookupEntry(ACHIEVEMENT_RESPECT_YOUR_ELDERS);
if (AchievRespectYourElders)
{
Map* pMap = m_creature->GetMap();
if (pMap && pMap->IsDungeon())
{
Map::PlayerList const &players = pMap->GetPlayers();
for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
itr->getSource()->CompletedAchievement(AchievRespectYourElders);
}
}
}
if (pInstance)
pInstance->SetData(DATA_ELDER_NADOX_EVENT, DONE);
}