当前位置: 首页>>代码示例>>C++>>正文


C++ DoUpdateWorldState函数代码示例

本文整理汇总了C++中DoUpdateWorldState函数的典型用法代码示例。如果您正苦于以下问题:C++ DoUpdateWorldState函数的具体用法?C++ DoUpdateWorldState怎么用?C++ DoUpdateWorldState使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DoUpdateWorldState函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnCreatureCreate

 void OnCreatureCreate(Creature* creature)
 {
     switch (creature->GetEntry())
     {
         case NPC_DRAKOS:
             drakosGUID = creature->GetGUID();
             break;
         case NPC_VAROS:
             varosGUID = creature->GetGUID();
             if (GetBossState(DATA_DRAKOS_EVENT) == DONE)
                creature->SetPhaseMask(1, true);
             break;
         case NPC_UROM:
             uromGUID = creature->GetGUID();
             if (GetBossState(DATA_VAROS_EVENT) == DONE)
                 creature->SetPhaseMask(1, true);
             break;
         case NPC_EREGOS:
             eregosGUID = creature->GetGUID();
             if (GetBossState(DATA_UROM_EVENT) == DONE)
                 creature->SetPhaseMask(1, true);
             break;
         case NPC_CENTRIFUGE_CONSTRUCT:
             if (creature->isAlive())
                 DoUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_AMOUNT, ++centrifugueConstructCounter);
             break;
         case NPC_BELGARISTRASZ:
             belgaristraszGUID = creature->GetGUID();
             if (GetBossState(DATA_DRAKOS_EVENT) == DONE)
                 creature->SetWalk(true),
                 creature->GetMotionMaster()->MovePoint(0, 941.453f, 1044.1f, 359.967f),
                 creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
             break;
         case NPC_ETERNOS:
             eternosGUID = creature->GetGUID();
             if (GetBossState(DATA_DRAKOS_EVENT) == DONE)
                 creature->SetWalk(true),
                 creature->GetMotionMaster()->MovePoint(0, 943.202f, 1059.35f, 359.967f),
                 creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
             break;
         case NPC_VERDISA:
             verdisaGUID = creature->GetGUID();
             if (GetBossState(DATA_DRAKOS_EVENT) == DONE)
                 creature->SetWalk(true),
                 creature->GetMotionMaster()->MovePoint(0, 949.188f, 1032.91f, 359.967f),
                 creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
             break;
         case NPC_GREATER_WHELP:
             if (GetBossState(DATA_UROM_EVENT) == DONE)
                 creature->SetPhaseMask(1, true);
                 gwhelpList.push_back(creature->GetGUID());
             break;
     }
 }
开发者ID:mryanlam,项目名称:Old-TrinityCore-Project-Script.me-,代码行数:54,代码来源:instance_oculus.cpp

示例2: SetData

            void SetData(uint32 type, uint32 data)
            {
                switch (type)
                {
                    case DATA_MEATHOOK_EVENT:
                        _encounterState[0] = data;
                        break;
                    case DATA_SALRAMM_EVENT:
                        _encounterState[1] = data;
                        break;
                    case DATA_EPOCH_EVENT:
                        _encounterState[2] = data;
                        break;
                    case DATA_MAL_GANIS_EVENT:
                        _encounterState[3] = data;

                        switch (_encounterState[3])
                        {
                            case NOT_STARTED:
                                HandleGameObject(_malGanisGate2GUID, true);
                                break;
                            case IN_PROGRESS:
                                HandleGameObject(_malGanisGate2GUID, false);
                                break;
                            case DONE:
                                HandleGameObject(_exitGateGUID, true);
                                if (GameObject* go = instance->GetGameObject(_malGanisChestGUID))
                                    go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND);
                                break;
                        }
                        break;
                    case DATA_INFINITE_EVENT:
                        _encounterState[4] = data;
                        break;
                    case DATA_CRATE_COUNT:
                        _crateCount = data;
                        if (_crateCount == 5)
                        {
                            if (Creature* bunny = instance->GetCreature(_genericBunnyGUID))
                                bunny->CastSpell(bunny, SPELL_CRATES_CREDIT, true);

                            // Summon Chromie and global whisper
                            if (Creature* chromie = instance->SummonCreature(NPC_CHROMIE_2, ChromieSummonPos))
                                if (!instance->GetPlayers().isEmpty())
                                    if (Player* player = instance->GetPlayers().getFirst()->getSource())
                                        sCreatureTextMgr->SendChat(chromie, SAY_CRATES_COMPLETED, player->GetGUID(), CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_MAP);
                        }
                        DoUpdateWorldState(WORLDSTATE_CRATES_REVEALED, _crateCount);
                        break;
                }

                if (data == DONE)
                    SaveToDB();
            }
开发者ID:Exodius,项目名称:Atlantiss,代码行数:54,代码来源:instance_culling_of_stratholme.cpp

示例3: OnCreatureDeath

        void OnCreatureDeath(Creature* creature)
        {
            if (creature->GetEntry() != NPC_CENTRIFUGE_CONSTRUCT)
                return;

             DoUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_AMOUNT, --centrifugueConstructCounter);

             if (!centrifugueConstructCounter)
                if (Creature* varos = instance->GetCreature(varosGUID))
                    varos->RemoveAllAuras();
        }
开发者ID:Exodius,项目名称:TrilliumEMU,代码行数:11,代码来源:instance_oculus.cpp

示例4: switch

void instance_mount_hyjal::SetData(uint32 uiType, uint32 uiData)
{
    switch (uiType)
    {
        case TYPE_WINTERCHILL:
        case TYPE_ANETHERON:
        case TYPE_KAZROGAL:
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_AZGALOR:
            m_auiEncounter[uiType] = uiData;
            if (uiData == DONE)
                DoSpawnArchimonde();
            break;
        case TYPE_ARCHIMONDE:
            m_auiEncounter[uiType] = uiData;
            break;

        case TYPE_TRASH_COUNT:
            m_uiTrashCount = uiData;
            DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, m_uiTrashCount);
            break;

        case TYPE_RETREAT:
            if (uiData == SPECIAL)
            {
                if (!lAncientGemGuidList.empty())
                {
                    for (GuidList::const_iterator itr = lAncientGemGuidList.begin(); itr != lAncientGemGuidList.end(); ++itr)
                    {
                        // don't know how long it expected
                        DoRespawnGameObject(*itr, DAY);
                    }
                }
            }
            break;
    }

    debug_log("SD2: Instance Hyjal: Instance data updated for event %u (Data=%u)", uiType, uiData);

    if (uiData == DONE)
    {
        OUT_SAVE_INST_DATA;

        std::ostringstream saveStream;
        saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " "
                   << m_auiEncounter[3] << " " << m_auiEncounter[4];

        m_strSaveData = saveStream.str();

        SaveToDB();
        OUT_SAVE_INST_DATA_COMPLETE;
    }
}
开发者ID:Naincapable,项目名称:scriptdev2,代码行数:54,代码来源:instance_hyjal.cpp

示例5: SetData

        void SetData(uint32 type,uint32 data)
        {
            switch(type)
            {
                case DATA_BAINE:
                    uiEncounter[1] = data;
                    break;

                case DATA_JAINA:
                    uiEncounter[2] = data;
                    break;

                case DATA_SYLVANA:
                    uiEncounter[3] = data;
                    break;

                case DATA_TYRANDE:
                    uiEncounter[4] = data;
                    break;
                    
                case DATA_MUROZOND:
                    uiEncounter[5] = data;
                    break;

                case DATA_JAINA_PICKED_STATE:
                    switch (data)
                    {
                        case IN_PROGRESS:
                            DoUpdateWorldState(WORLDSTATE_SHOW_FRAGMENTS, 1);
                            break;
                        case DONE:
                            DoUpdateWorldState(WORLDSTATE_SHOW_FRAGMENTS, 0);
                            break;
                    }
                    JainaPickedState = data;
                    break;
            }
         
            if (data == DONE)
                SaveToDB();
        }
开发者ID:AwkwardDev,项目名称:WoWSource434,代码行数:41,代码来源:instance_end_time.cpp

示例6: SetData

 void SetData(uint32 type, uint32 data)
 {
     switch (type)
     {
         case DATA_COLOSSUS:
             ColossusData = data;
             if (data == 2)
             {
                 if (Creature* Leviathan = instance->GetCreature(LeviathanGUID))
                     Leviathan->AI()->DoAction(ACTION_MOVE_TO_CENTER_POSITION);
                 if (GameObject* gameObject = instance->GetGameObject(LeviathanGateGUID))
                     gameObject->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE);
                 SaveToDB();
             }
             break;
         case DATA_HODIR_RARE_CACHE:
             HodirRareCacheData = data;
             if (!HodirRareCacheData)
             {
                 if (Creature* Hodir = instance->GetCreature(HodirGUID))
                     if (GameObject* gameObject = instance->GetGameObject(HodirRareCacheGUID))
                         Hodir->RemoveGameObject(gameObject, false);
             }
             break;
         case DATA_UNBROKEN:
             Unbroken = bool(data);
             break;
         case EVENT_DESPAWN_ALGALON:
             DoUpdateWorldState(WORLD_STATE_ALGALON_TIMER_ENABLED, 1);
             DoUpdateWorldState(WORLD_STATE_ALGALON_DESPAWN_TIMER, 60);
             _algalonTimer = 60;
             _events.ScheduleEvent(EVENT_DESPAWN_ALGALON, 3600000);
             _events.ScheduleEvent(EVENT_UPDATE_ALGALON_TIMER, 60000);
             break;
         case DATA_ALGALON_SUMMON_STATE:
             _algalonSummoned = true;
             break;
         default:
             break;
     }
 }
开发者ID:FirstCore,项目名称:GaryMoveOut_4.3.4,代码行数:41,代码来源:instance_ulduar.cpp

示例7: DoWipe

        // Wipe has been detected. Perform cleanup and reset.
        void DoWipe()
        {

            if (GetData(DATA_MARWYN_EVENT) != DONE) {

                SetData(DATA_WAVE_COUNT, FAIL);
                uiWaveCount = 0;
                events.Reset();
                DoUpdateWorldState(WORLD_STATE_HOR, 1);
                DoUpdateWorldState(WORLD_STATE_HOR_WAVE_COUNT, uiWaveCount);
                OpenDoor(uiFrontDoor);

            // TODO
            // in case of wipe, the event is normally restarted by jumping into the center of the room.
            // As I can't find a trigger area there, just respawn Jaina/Sylvanas so the event may be restarted.
            if (Creature* pFalric = instance->GetCreature(uiFalric))
                pFalric->SetVisible(false);
            if (Creature* pMarwyn = instance->GetCreature(uiMarwyn))
                pMarwyn->SetVisible(false);
            }
        }
开发者ID:Josemurillo,项目名称:frokTinkel,代码行数:22,代码来源:instance_halls_of_reflection.cpp

示例8: switch

void instance_old_hillsbrad::OnCreatureEnterCombat(Creature* pCreature)
{
    switch (pCreature->GetEntry())
    {
        case NPC_DRAKE:
            SetData(TYPE_DRAKE, IN_PROGRESS);
            DoUpdateWorldState(WORLD_STATE_OH, 0);
            break;
        case NPC_SKARLOC: SetData(TYPE_SKARLOC, IN_PROGRESS); break;
        case NPC_EPOCH:   SetData(TYPE_EPOCH, IN_PROGRESS);   break;
    }
}
开发者ID:Donniedarkoz,项目名称:mangos-scriptdev2,代码行数:12,代码来源:instance_old_hillsbrad.cpp

示例9: DoWipe

        // Wipe has been detected. Perform cleanup and reset.
        void DoWipe()
        {
            uiWaveCount = 0;
            events.Reset();
            DoUpdateWorldState(WORLD_STATE_HOR, 1);
            DoUpdateWorldState(WORLD_STATE_HOR_WAVE_COUNT, uiWaveCount);
            HandleGameObject(uiFrontDoor, true);

            // TODO
            // in case of wipe, the event is normally restarted by jumping into the center of the room.
            // As I can't find a trigger area there, just respawn Jaina/Sylvanas so the event may be restarted.
            if (Creature* pJaina = instance->GetCreature(uiJainaPart1))
                pJaina->Respawn();
            if (Creature* pSylvanas = instance->GetCreature(uiSylvanasPart1))
                pSylvanas->Respawn();

            if (Creature* pFalric = instance->GetCreature(uiFalric))
                pFalric->SetVisibility(VISIBILITY_OFF);
            if (Creature* pMarwyn = instance->GetCreature(uiMarwyn))
                pMarwyn->SetVisibility(VISIBILITY_OFF);
        }
开发者ID:AdrElecTro,项目名称:CactusEMU,代码行数:22,代码来源:instance_halls_of_reflection.cpp

示例10: SetData

 void SetData(uint32 type, uint32 data)
 {
     switch (type)
     {
         case DATA_ZULAMAN_STATE:
         {
             if (data == IN_PROGRESS)
             {
                 DoUpdateWorldState(WORLD_STATE_ZULAMAN_TIMER_ENABLED, 1);
                 DoUpdateWorldState(WORLD_STATE_ZULAMAN_TIMER, 15);
                 events.ScheduleEvent(EVENT_UPDATE_ZULAMAN_TIMER, 60000);
                 SpeedRunTimer = 15;
                 ZulAmanState = data;
                 SaveToDB();
             }
             break;
         }
         default:
             break;
     }
 }
开发者ID:Drasgon,项目名称:WoD,代码行数:21,代码来源:instance_zulaman.cpp

示例11: SetBossState

        bool SetBossState(uint32 type, EncounterState state)
        {
            if (!InstanceScript::SetBossState(type, state))
                return false;

            switch (type)
            {
                case DATA_DRAKOS_EVENT:
                    if (state == DONE)
                    {
                        DoUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_SHOW, 1);
                        DoUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_AMOUNT, centrifugueConstructCounter);
                        OpenCageDoors();
                    }
                    break;
                case DATA_VAROS_EVENT:
                    if (state == DONE)
                    {
                        DoUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_SHOW, 0);
                        if (Creature* urom = instance->GetCreature(uromGUID))
                        {
                            urom->RestoreFaction();
                            urom->RemoveAllAuras();
                            urom->AI()->DoCast(SPELL_EVOCATION);
                        }
                    }
                    break;
                case DATA_UROM_EVENT:
                    if (state == DONE)
                        if (Creature* eregos = instance->GetCreature(eregosGUID))
                            eregos->RestoreFaction();
                    break;
                case DATA_EREGOS_EVENT:
                    if (state == DONE)
                        DoRespawnGameObject(eregosCacheGUID, 7*DAY);
                    break;
            }

            return true;
        }
开发者ID:Firearm,项目名称:TrinityCore,代码行数:40,代码来源:instance_oculus.cpp

示例12: AddWave

    void AddWave()
    {
        DoUpdateWorldState(WORLD_STATE_VH, 1);
        DoUpdateWorldState(WORLD_STATE_VH_WAVE_COUNT, uiWaveCount);
        DoUpdateWorldState(WORLD_STATE_VH_PRISON_STATE, 100); // TODO

        switch (uiWaveCount)
        {
            case 6:
                if (uiFirstBoss == 0)
                    uiFirstBoss = urand(1,6);
                StartBossEncounter(uiFirstBoss);
                break;
            case 12:
                if (uiSecondBoss == 0)
                    do 
                    {
                        uiSecondBoss = urand(1,6);
                    } while (uiSecondBoss == uiFirstBoss);
                StartBossEncounter(uiSecondBoss);
                break;
            case 18:
            {
                Creature *pSinclari = instance->GetCreature(uiSinclari);
                if (pSinclari)
                    pSinclari->SummonCreature(CREATURE_CYANIGOSA,PortalLocation[0],TEMPSUMMON_DEAD_DESPAWN);
                break;
            }
            case 1:
            {
                if (GameObject* pMainDoor = instance->GetGameObject(uiMainDoor))
                    pMainDoor->SetGoState(GO_STATE_READY);
            }
            default:
                if (!bWiped)
                    SpawnPortal();
                bWiped = false;
                break;
        }
    }
开发者ID:Ickybad,项目名称:diamondcore2,代码行数:40,代码来源:instance_violet_hold.cpp

示例13: Load

            void Load(char const* str)
            {
                if (!str)
                {
                    OUT_LOAD_INST_DATA_FAIL;
                    return;
                }

                OUT_LOAD_INST_DATA(str);

                char dataHead1, dataHead2;

                std::istringstream loadStream(str);
                loadStream >> dataHead1 >> dataHead2;

                if (dataHead1 == 'Z' && dataHead2 == 'A')
                {
                    for (uint8 i = 0; i < EncounterCount; ++i)
                    {
                        uint32 tmpState;
                        loadStream >> tmpState;
                        if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
                            tmpState = NOT_STARTED;

                        SetBossState(i, EncounterState(tmpState));
                    }

                    loadStream >> ZulAmanState;
                    loadStream >> SpeedRunTimer;
                    loadStream >> ZulAmanBossCount;

                    if (ZulAmanState == IN_PROGRESS && SpeedRunTimer && SpeedRunTimer <= 15)
                    {
                        events.ScheduleEvent(EVENT_UPDATE_ZULAMAN_TIMER, 60000);
                        DoUpdateWorldState(WORLD_STATE_ZULAMAN_TIMER_ENABLED, 1);
                        DoUpdateWorldState(WORLD_STATE_ZULAMAN_TIMER, SpeedRunTimer);
                    }
                }
                else
开发者ID:Drasgon,项目名称:WoD,代码行数:39,代码来源:instance_zulaman.cpp

示例14: DoWipe

        void DoWipe()
        {
            if (GetData(DATA_FALRIC_EVENT) == DONE && GetData(DATA_MARWYN_EVENT) != DONE)
                WaveCnt = 5;
            else
                WaveCnt = 0;

            events.Reset();

            DoUpdateWorldState(WORLD_STATE_HOR, 0);
            DoUpdateWorldState(WORLD_STATE_HOR_WAVE_COUNT, WaveCnt);

            OpenDoor(FrontDoorGUID);

            if (Creature * Falric = instance->GetCreature(FalricGUID))
                if (Falric->isAlive())
                    Falric->AI()->EnterEvadeMode();

            if (Creature * Marwyn = instance->GetCreature(MarwynGUID))
                if (Marwyn->isAlive())
                    Marwyn->AI()->EnterEvadeMode();
        }
开发者ID:ivansiwi,项目名称:TrinityCore,代码行数:22,代码来源:instance_halls_of_reflection.cpp

示例15: SetBossState

        bool SetBossState(uint32 type, EncounterState state)
        {
            if (!InstanceScript::SetBossState(type, state))
                return false;

            switch (type)
            {
                case DATA_DRAKOS_EVENT:
                    if (state == DONE)
                    {
                        DoUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_SHOW, 1);
                        DoUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_AMOUNT, centrifugueConstructCounter);
                        OpenCageDoors();
                        FreeDragons();
                        if (Creature* varos = instance->GetCreature(varosGUID))
                            varos->SetPhaseMask(1, true);
                    }
                    break;
                case DATA_VAROS_EVENT:
                    if (state == DONE)
                        DoUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_SHOW, 0);
                        if (Creature* urom = instance->GetCreature(uromGUID))
                            urom->SetPhaseMask(1, true);
                    break;
                case DATA_UROM_EVENT:
                    if (state == DONE)
                        if (Creature* eregos = instance->GetCreature(eregosGUID))
                            eregos->SetPhaseMask(1, true);
                            GreaterWhelps();
                    break;
                case DATA_EREGOS_EVENT:
                    if (state == DONE)
                        DoRespawnGameObject(eregosCacheGUID, 7*DAY);
                    break;
            }

            return true;
        }
开发者ID:Carbinfibre,项目名称:Script-Land,代码行数:38,代码来源:instance_oculus.cpp


注:本文中的DoUpdateWorldState函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。