當前位置: 首頁>>代碼示例>>C++>>正文


C++ GetAchievementStore函數代碼示例

本文整理匯總了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);
                    }
                }
            }
        }
    }
開發者ID:xXNembiXx,項目名稱:ScriptDev2_333,代碼行數:25,代碼來源:boss_loken.cpp

示例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);
            }
        }
開發者ID:Jekls,項目名稱:trinity,代碼行數:26,代碼來源:boss_keristrasza.cpp

示例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;
    }
開發者ID:wuhongyi1977,項目名稱:StrawberryCore,代碼行數:27,代碼來源:cs_achievement.cpp

示例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;
    }
開發者ID:AlexTheBest,項目名稱:ACore,代碼行數:9,代碼來源:icecrown.cpp

示例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;
    }
開發者ID:Darkelmo,項目名稱:MythCore,代碼行數:10,代碼來源:blades_edge_mountains.cpp

示例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);
    }
}
開發者ID:Desch,項目名稱:MythCore,代碼行數:15,代碼來源:InstanceScript.cpp

示例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);
}
開發者ID:ProjectStarGate,項目名稱:StarGateEmu-Projekt,代碼行數:17,代碼來源:InstanceScript.cpp

示例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);
        }
    }
開發者ID:Ickybad,項目名稱:diamondcore2,代碼行數:17,代碼來源:boss_maiden_of_grief.cpp

示例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;
    }
}
開發者ID:Gosa1979,項目名稱:ArkCORE2,代碼行數:21,代碼來源:BattlefieldWG.cpp

示例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);
        }
開發者ID:St3ve,項目名稱:TrinityCore,代碼行數:18,代碼來源:boss_slad_ran.cpp

示例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);
            }
        }
開發者ID:Expecto,項目名稱:chaoscore,代碼行數:20,代碼來源:boss_keristrasza.cpp

示例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);
            }
        }
    }
開發者ID:LordVoldemort,項目名稱:Shindorei,代碼行數:20,代碼來源:boss_prince_taldaram.cpp

示例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);
                }
            }
        }
    }
開發者ID:xXNembiXx,項目名稱:scriptdev2_335,代碼行數:22,代碼來源:boss_heigan.cpp

示例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);
        }
開發者ID:ALive-WoW,項目名稱:RC2,代碼行數:22,代碼來源:boss_keleseth.cpp

示例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);
    }
開發者ID:pfchrono,項目名稱:mangos-mods,代碼行數:22,代碼來源:boss_elder_nadox.cpp


注:本文中的GetAchievementStore函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。