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


C++ DoUseDoorOrButton函数代码示例

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


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

示例1: switch

void instance_blackrock_depths::SetData(uint32 uiType, uint32 uiData)
{
    switch (uiType)
    {
        case TYPE_RING_OF_LAW:
            // If finished the arena event after theldren fight
            if (uiData == DONE && m_auiEncounter[0] == SPECIAL)
                DoRespawnGameObject(GO_ARENA_SPOILS, HOUR);
            else if (uiData == DONE)
            {
                for (GuidSet::const_iterator itr = m_sArenaCrowdNpcGuids.begin(); itr != m_sArenaCrowdNpcGuids.end(); ++itr)
                {
                    if (Creature* pSpectator = instance->GetCreature(*itr))
                        pSpectator->SetFactionTemporary(FACTION_ARENA_NEUTRAL, TEMPFACTION_RESTORE_RESPAWN);
                }
            }
            m_auiEncounter[0] = uiData;
            break;
        case TYPE_VAULT:
            if (uiData == SPECIAL)
            {
                ++m_uiCofferDoorsOpened;

                if (m_uiCofferDoorsOpened == MAX_RELIC_DOORS)
                {
                    SetData(TYPE_VAULT, IN_PROGRESS);

                    Creature* pConstruct = NULL;

                    // Activate vault constructs
                    for (GuidSet::const_iterator itr = m_sVaultNpcGuids.begin(); itr != m_sVaultNpcGuids.end(); ++itr)
                    {
                        pConstruct = instance->GetCreature(*itr);
                        if (pConstruct)
                            pConstruct->RemoveAurasDueToSpell(SPELL_STONED);
                    }

                    if (!pConstruct)
                        return;

                    // Summon doomgrip
                    pConstruct->SummonCreature(NPC_WATCHER_DOOMGRIP, aVaultPositions[0], aVaultPositions[1], aVaultPositions[2], aVaultPositions[3], TEMPSUMMON_DEAD_DESPAWN, 0);
                }
                // No need to store in this case
                return;
            }
            if (uiData == DONE)
            {
                DoUseDoorOrButton(GO_SECRET_DOOR);
                DoToggleGameObjectFlags(GO_SECRET_SAFE, GO_FLAG_NO_INTERACT, false);
            }
            m_auiEncounter[1] = uiData;
            break;
        case TYPE_ROCKNOT:
            if (uiData == SPECIAL)
                ++m_uiBarAleCount;
            else
            {
                if (uiData == DONE)
                {
                    HandleBarPatrons(PATRON_PISSED);
                    SetBarDoorIsOpen();
                }
                m_auiEncounter[2] = uiData;
            }
            break;
        case TYPE_TOMB_OF_SEVEN:
            // Don't set the same data twice
            if (uiData == m_auiEncounter[3])
                break;
            // Combat door
            DoUseDoorOrButton(GO_TOMB_ENTER);
            // Start the event
            if (uiData == IN_PROGRESS)
                DoCallNextDwarf();
            if (uiData == FAIL)
            {
                // Reset dwarfes
                for (uint8 i = 0; i < MAX_DWARFS; ++i)
                {
                    if (Creature* pDwarf = GetSingleCreatureFromStorage(aTombDwarfes[i]))
                    {
                        if (!pDwarf->isAlive())
                            pDwarf->Respawn();
                    }
                }

                m_uiDwarfRound = 0;
                m_uiDwarfFightTimer = 0;
            }
            if (uiData == DONE)
            {
                DoRespawnGameObject(GO_CHEST_SEVEN, HOUR);
                DoUseDoorOrButton(GO_TOMB_EXIT);
            }
            m_auiEncounter[3] = uiData;
            break;
        case TYPE_LYCEUM:
            if (uiData == DONE)
            {
//.........这里部分代码省略.........
开发者ID:ElunaLuaEngine,项目名称:ElunaMangosWotlk,代码行数:101,代码来源:instance_blackrock_depths.cpp

示例2: switch

void instance_draktharon_keep::SetData(uint32 uiType, uint32 uiData)
{
    switch(uiType)
    {
        case TYPE_TROLLGORE:
            if (uiData == IN_PROGRESS)
                m_bTrollgoreConsume = true;
            if (uiData == SPECIAL)
                m_bTrollgoreConsume = false;
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_NOVOS:
            if (uiData == IN_PROGRESS)
            {
                // Sort the dummies
                DoSortNovosDummies();

                // Cast some visual spells
                Creature* pTarget = instance->GetCreature(m_novosChannelGuid);
                for (uint8 i = 0; i < MAX_CRYSTALS; ++i)
                {
                    Creature* pCaster = instance->GetCreature(m_aNovosCrystalInfo[i].m_channelGuid);
                    if (pCaster && pTarget)
                        pCaster->CastSpell(pTarget, SPELL_BEAM_CHANNEL, false);

                    m_aNovosCrystalInfo[i].m_bWasUsed = false;
                }

                // Achievement related
                m_bNovosAddGrounded = false;
            }
            else if (uiData == SPECIAL)
            {
                // Achievement related
                m_bNovosAddGrounded = true;
            }
            else if (uiData == FAIL)
            {
                // Interrupt casted spells
                for (uint8 i = 0; i < MAX_CRYSTALS; ++i)
                {
                    Creature* pDummy = instance->GetCreature(m_aNovosCrystalInfo[i].m_channelGuid);
                    if (pDummy)
                        pDummy->InterruptNonMeleeSpells(false);
                    // And reset used crystals
                    if (m_aNovosCrystalInfo[i].m_bWasUsed)
                        DoUseDoorOrButton(m_aNovosCrystalInfo[i].m_crystalGuid);
                }
            }
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_KING_DRED:
            if (uiData == IN_PROGRESS)
                m_uiDreadAddsKilled = 0;
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_THARONJA:
            m_auiEncounter[uiType] = uiData;
            break;
    }

    if (uiData == DONE)
    {
        OUT_SAVE_INST_DATA;

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

        m_strInstData = saveStream.str();

        SaveToDB();
        OUT_SAVE_INST_DATA_COMPLETE;
    }
}
开发者ID:Calixa,项目名称:murlocs_434,代码行数:74,代码来源:instance_draktharon_keep.cpp

示例3: SetData

    void SetData(uint32 uiType, uint32 uiData)
    {
        switch(uiType)
        {
            case TYPE_MAGTHERIDON_EVENT:
                m_auiEncounter[0] = uiData;
                if (uiData == NOT_STARTED)
                    m_uiRespawnTimer = 10000;
                if (uiData != IN_PROGRESS)
                {
                    if (GameObject* pDoor = instance->GetGameObject(m_uiDoorGUID))
                        pDoor->SetGoState(GO_STATE_ACTIVE);
                }
                break;
            case TYPE_CHANNELER_EVENT:
                switch(uiData)
                {
                    case NOT_STARTED:                       // Reset all channelers once one is reset.
                        if (m_auiEncounter[1] != NOT_STARTED)
                        {
                            m_auiEncounter[1] = NOT_STARTED;

                            if (ChannelerGUID.empty())
                            {
                                debug_log("½Å±¾¿â£º Instance Magtheridon: Channeler GUID list are empty.");
                                break;
                            }

                            for(std::set<uint64>::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i)
                            {
                                if (Creature* pChanneler = instance->GetCreature(*i))
                                {
                                    if (pChanneler->isAlive())
                                        pChanneler->AI()->EnterEvadeMode();
                                    else
                                        pChanneler->Respawn();
                                }
                            }

                            m_uiCageTimer = 0;

                            if (GameObject* pDoor = instance->GetGameObject(m_uiDoorGUID))
                                pDoor->SetGoState(GO_STATE_ACTIVE);
                        }
                        break;
                    case IN_PROGRESS:                       // Event start.
                        if (m_auiEncounter[1] != IN_PROGRESS)
                        {
                            m_auiEncounter[1] = IN_PROGRESS;

                            // Let all five channelers aggro.
                            for(std::set<uint64>::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i)
                            {
                                Creature* pChanneler = instance->GetCreature(*i);

                                if (pChanneler && pChanneler->isAlive())
                                    AttackNearestTarget(pChanneler);
                            }

                            // Magtheridon breaks free after two minutes.
                            Creature* pMagtheridon = instance->GetCreature(m_uiMagtheridonGUID);

                            if (pMagtheridon && pMagtheridon->isAlive())
                                m_uiCageTimer = 120000;

                            if (GameObject* pDoor = instance->GetGameObject(m_uiDoorGUID))
                                pDoor->SetGoState(GO_STATE_READY);
                        }
                        break;
                    case DONE:                              // Add buff and check if all channelers are dead.
                        for(std::set<uint64>::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i)
                        {
                            Creature* pChanneler = instance->GetCreature(*i);

                            if (pChanneler && pChanneler->isAlive())
                            {
                                //Channeler->InterruptNonMeleeSpells(false);
                                //Channeler->CastSpell(Channeler, SPELL_SOUL_TRANSFER, false);
                                uiData = IN_PROGRESS;
                                break;
                            }
                        }
                        break;
                }
                m_auiEncounter[1] = uiData;
                break;
            case TYPE_HALL_COLLAPSE:
                // IN_PROGRESS - collapse / NOT_STARTED - reset
                for(std::set<uint64>::iterator i = ColumnGUID.begin(); i != ColumnGUID.end(); ++i)
                {
                    DoUseDoorOrButton(*i);
                }
                break;
        }
    }
开发者ID:cbcs,项目名称:ChgSD2,代码行数:95,代码来源:instance_magtheridons_lair.cpp

示例4: SetData

    void SetData(uint32 uiType, uint32 uiData)
    {
        switch (uiType)
        {
            case TYPE_ATTUMEN:              m_auiEncounter[0] = uiData; break;
            case TYPE_MOROES:
                if (m_auiEncounter[1] != DONE)
                    m_auiEncounter[1] = uiData;
                break;
            case TYPE_MAIDEN:               m_auiEncounter[2] = uiData; break;
            case TYPE_OPTIONAL_BOSS:        m_auiEncounter[3] = uiData; break;
            case TYPE_OPERA:
                m_auiEncounter[4] = uiData;
                if (uiData == DONE)
                {
                    DoUseDoorOrButton(m_uiStageDoorLeftGUID);
                    DoUseDoorOrButton(m_uiStageDoorRightGUID);
                    if (GameObject* pSideEntrance = instance->GetGameObject(m_uiSideEntranceDoor))
                        pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
                }
                break;
            case TYPE_CURATOR:              m_auiEncounter[5] = uiData; break;
            case TYPE_ARAN:
                m_auiEncounter[6] = uiData;
                if (uiData != IN_PROGRESS)
                    DoUseDoorOrButton(m_uiLibraryDoor);
                break;
            case TYPE_TERESTIAN:            m_auiEncounter[7] = uiData; break;
            case TYPE_NETHERSPITE:
                m_auiEncounter[8] = uiData;
                DoUseDoorOrButton(m_uiMassiveDoor);
                break;
            case TYPE_CHESS:
                if (uiData == DONE)
                    DoRespawnGameObject(m_uiDustCoveredChest,DAY);
                m_auiEncounter[9] = uiData;
                break;
            case TYPE_MALCHEZZAR:           m_auiEncounter[10] = uiData; break;
            case TYPE_NIGHTBANE:            m_auiEncounter[11] = uiData; break;
            case DATA_OPERA_OZ_DEATHCOUNT:
                if (uiData == SPECIAL)
                    ++m_uiOzDeathCount;
                else if (uiData == IN_PROGRESS)
                    m_uiOzDeathCount = 0;
                break;
        }

        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_auiEncounter[5] << " "
                << m_auiEncounter[6] << " " << m_auiEncounter[7] << " " << m_auiEncounter[8] << " "
                << m_auiEncounter[9] << " " << m_auiEncounter[10] << " " << m_auiEncounter[11];

            strInstData = saveStream.str();

            SaveToDB();
            OUT_SAVE_INST_DATA_COMPLETE;
        }
    }
开发者ID:Subv,项目名称:diamondcore,代码行数:63,代码来源:instance_karazhan.cpp

示例5: SetData

    void SetData(uint32 uiType, uint32 uiData)
    {
        switch(uiType)
        {
            case TYPE_ANUB_REKHAN:
                m_auiEncounter[0] = uiData;
                DoUseDoorOrButton(m_uiAnubDoorGUID);
                if (uiData == DONE)
                    DoUseDoorOrButton(m_uiAnubGateGUID);
                break;
            case TYPE_FAERLINA:
                m_auiEncounter[1] = uiData;
                DoUseDoorOrButton(m_uiFaerWebGUID);
                if (uiData == DONE)
                {
                    DoUseDoorOrButton(m_uiFaerDoorGUID);
                    DoUseDoorOrButton(m_uiMaexOuterGUID);
                }
                break;
            case TYPE_MAEXXNA:
                m_auiEncounter[2] = uiData;
                DoUseDoorOrButton(m_uiMaexInnerGUID, uiData);
                if (uiData == DONE)
                {
                    DoUseDoorOrButton(m_uiAracEyeRampGUID);
                    DoRespawnGameObject(m_uiAracPortalGUID, 30*MINUTE);
                }
                break;
            case TYPE_NOTH:
                m_auiEncounter[3] = uiData;
                DoUseDoorOrButton(m_uiNothEntryDoorGUID);
                if (uiData == DONE)
                {
                     DoUseDoorOrButton(m_uiNothExitDoorGUID);
                     DoUseDoorOrButton(m_uiHeigEntryDoorGUID);
                }
                break;
            case TYPE_HEIGAN:
                m_auiEncounter[4] = uiData;
                DoUseDoorOrButton(m_uiHeigEntryDoorGUID);
                if (uiData == DONE)
                     DoUseDoorOrButton(m_uiHeigExitDoorGUID);
                break;
            case TYPE_LOATHEB:
                m_auiEncounter[5] = uiData;
                DoUseDoorOrButton(m_uiLoathebDoorGUID);
                if (uiData == DONE)
                {
                    DoUseDoorOrButton(m_uiPlagEyeRampGUID);
                    DoRespawnGameObject(m_uiPlagPortalGUID, 30*MINUTE);
                }
                break;
            case TYPE_RAZUVIOUS:
                m_auiEncounter[6] = uiData;
                if (uiData == DONE)
                     DoUseDoorOrButton(m_uiGothikEntryDoorGUID);
                break;
            case TYPE_GOTHIK:
                m_auiEncounter[7] = uiData;
                DoUseDoorOrButton(m_uiGothikEntryDoorGUID);
                if (uiData == DONE)
                {
                     DoUseDoorOrButton(m_uiGothikExitDoorGUID);
                     DoUseDoorOrButton(m_uiHorsemenDoorGUID);
                }
                break;
            case TYPE_FOUR_HORSEMEN:
                m_auiEncounter[8] = uiData;
                DoUseDoorOrButton(m_uiHorsemenDoorGUID);
                if (uiData == DONE)
                {
                    DoUseDoorOrButton(m_uiMiliEyeRampGUID);
                    DoRespawnGameObject(m_uiMiliPortalGUID, 30*MINUTE);
                    DoRespawnGameObject(m_uiHorsemenChestGUID, 30*MINUTE);
                }
                break;
            case TYPE_PATCHWERK:
                m_auiEncounter[9] = uiData;
                if (uiData == DONE)
                    DoUseDoorOrButton(m_uiPathExitDoorGUID);
                break;
            case TYPE_GROBBULUS:
                m_auiEncounter[10] = uiData;
                break;
            case TYPE_GLUTH:
                m_auiEncounter[11] = uiData;
                if (uiData == DONE)
                {
                    DoUseDoorOrButton(m_uiGlutExitDoorGUID);
                    DoUseDoorOrButton(m_uiThadDoorGUID);
                }
                break;
            case TYPE_THADDIUS:
                m_auiEncounter[12] = uiData;
                DoUseDoorOrButton(m_uiThadDoorGUID, uiData);
                if (uiData == DONE)
                {
                    DoUseDoorOrButton(m_uiConsEyeRampGUID);
                    DoRespawnGameObject(m_uiConsPortalGUID, 30*MINUTE);
                }
//.........这里部分代码省略.........
开发者ID:Freestylerrr,项目名称:ScriptDev2,代码行数:101,代码来源:instance_naxxramas.cpp

示例6: switch

void instance_blackrock_depths::SetData(uint32 uiType, uint32 uiData)
{
    switch (uiType)
    {
        case TYPE_RING_OF_LAW:
            // If finished the arena event after theldren fight
            if (uiData == DONE && m_auiEncounter[0] == SPECIAL)
                DoRespawnGameObject(GO_ARENA_SPOILS, HOUR);
            else if (uiData == DONE)
            {
                for (GuidSet::const_iterator itr = m_sArenaCrowdNpcGuids.begin(); itr != m_sArenaCrowdNpcGuids.end(); ++itr)
                {
                    if (Creature* pSpectator = instance->GetCreature(*itr))
                        pSpectator->SetFactionTemporary(FACTION_ARENA_NEUTRAL, TEMPFACTION_RESTORE_RESPAWN);
                }
            }
            m_auiEncounter[0] = uiData;
            break;
        case TYPE_VAULT:
            if (uiData == SPECIAL)
            {
                ++m_uiCofferDoorsOpened;

                if (m_uiCofferDoorsOpened == MAX_RELIC_DOORS)
                {
                    SetData(TYPE_VAULT, IN_PROGRESS);

                    Creature* pConstruct = NULL;

                    // Activate vault constructs
                    for (GuidSet::const_iterator itr = m_sVaultNpcGuids.begin(); itr != m_sVaultNpcGuids.end(); ++itr)
                    {
                        pConstruct = instance->GetCreature(*itr);
                        if (pConstruct)
                            pConstruct->RemoveAurasDueToSpell(SPELL_STONED);
                    }

                    if (!pConstruct)
                        return;

                    // Summon doomgrip
                    pConstruct->SummonCreature(NPC_WATCHER_DOOMGRIP, aVaultPositions[0], aVaultPositions[1], aVaultPositions[2], aVaultPositions[3], TEMPSUMMON_DEAD_DESPAWN, 0);
                }
                // No need to store in this case
                return;
            }
            if (uiData == DONE)
            {
                DoUseDoorOrButton(GO_SECRET_DOOR);
                DoToggleGameObjectFlags(GO_SECRET_SAFE, GO_FLAG_NO_INTERACT, false);
            }
            m_auiEncounter[1] = uiData;
            break;
        case TYPE_BAR:
            if (uiData == SPECIAL)
                ++m_uiBarAleCount;
            else
                m_auiEncounter[2] = uiData;
            break;
        case TYPE_TOMB_OF_SEVEN:
            // Don't set the same data twice
            if (uiData == m_auiEncounter[3])
                break;
            // Combat door
            DoUseDoorOrButton(GO_TOMB_ENTER);
            // Start the event
            if (uiData == IN_PROGRESS)
                DoCallNextDwarf();
            if (uiData == FAIL)
            {
                // Reset dwarfes
                for (uint8 i = 0; i < MAX_DWARFS; ++i)
                {
                    if (Creature* pDwarf = GetSingleCreatureFromStorage(aTombDwarfes[i]))
                    {
                        if (!pDwarf->isAlive())
                            pDwarf->Respawn();
                    }
                }

                m_uiDwarfRound = 0;
                m_uiDwarfFightTimer = 0;
            }
            if (uiData == DONE)
            {
                DoRespawnGameObject(GO_CHEST_SEVEN, HOUR);
                DoUseDoorOrButton(GO_TOMB_EXIT);
            }
            m_auiEncounter[3] = uiData;
            break;
        case TYPE_LYCEUM:
            if (uiData == DONE)
            {
                DoUseDoorOrButton(GO_GOLEM_ROOM_N);
                DoUseDoorOrButton(GO_GOLEM_ROOM_S);
            }
            m_auiEncounter[4] = uiData;
            break;
        case TYPE_IRON_HALL:
            switch (uiData)
//.........这里部分代码省略.........
开发者ID:Exxenoz,项目名称:scriptdev2,代码行数:101,代码来源:instance_blackrock_depths.cpp

示例7: DoUseDoorOrButton

void instance_karazhan::DoFinishChessEvent()
{
    // doors and loot are not handled for friendly games
    if (GetData(TYPE_CHESS) != SPECIAL)
    {
        DoUseDoorOrButton(GO_GAMESMANS_HALL_EXIT_DOOR);
        DoRespawnGameObject(GO_DUST_COVERED_CHEST, DAY);
        DoToggleGameObjectFlags(GO_DUST_COVERED_CHEST, GO_FLAG_NO_INTERACT, false);
    }

    // cast game end spells
    if (Creature* pMedivh = GetSingleCreatureFromStorage(NPC_ECHO_MEDIVH))
    {
        pMedivh->CastSpell(pMedivh, SPELL_FORCE_KILL_BUNNY, TRIGGERED_OLD_TRIGGERED);
        pMedivh->CastSpell(pMedivh, SPELL_GAME_OVER, TRIGGERED_OLD_TRIGGERED);
        pMedivh->CastSpell(pMedivh, SPELL_CLEAR_BOARD, TRIGGERED_OLD_TRIGGERED);
    }    

    // remove silence debuff
    Map::PlayerList const& players = instance->GetPlayers();
    for (const auto& player : players)
    {
        if (Player* pPlayer = player.getSource())
            pPlayer->RemoveAurasDueToSpell(SPELL_GAME_IN_SESSION);
    }

    // chess figures stop attacking
    for (ObjectGuid guid : m_lChessPiecesAlliance)
    {
        if (Creature* pTemp = instance->GetCreature(guid))
        {
            pTemp->RemoveAurasDueToSpell(32226); // remove attack timer
            if (Unit* player = pTemp->GetCharmer())
            {
                player->RemoveAurasDueToSpell(30019); // remove charm effect on game end/fail
            }
        }
    }
    for (ObjectGuid guid : m_lChessPiecesHorde)
    {
        if (Creature* pTemp = instance->GetCreature(guid))
        {
            pTemp->RemoveAurasDueToSpell(32226);
            if (Unit* player = pTemp->GetCharmer())
            {
                player->RemoveAurasDueToSpell(30019);
            }
        }
    }

    for (ObjectGuid guid : m_vChessSquares)
    {
        if (Creature* square = instance->GetCreature(guid))
        {
            square->RemoveAurasDueToSpell(32745); // remove occupied square spells
            square->RemoveAurasDueToSpell(39400);
        }
    }

    m_bFriendlyGame = false;
    m_uiChessResetTimer = 35000;
    m_uiChessEndingTimer = 30000;
}
开发者ID:Phatcat,项目名称:mangos-wotlk,代码行数:63,代码来源:karazhan.cpp

示例8: switch

void instance_dire_maul::SetData(uint32 uiType, uint32 uiData)
{
    switch(uiType)
    {
        // East
        case TYPE_ZEVRIM:
            if (uiData == DONE)
            {
                // Update Old Ironbark so he can open the conservatory door
                if (Creature* pIronbark = GetSingleCreatureFromStorage(NPC_OLD_IRONBARK))
                {
                    DoScriptText(SAY_IRONBARK_REDEEM, pIronbark);
                    pIronbark->UpdateEntry(NPC_IRONBARK_REDEEMED);
                }
            }
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_IRONBARK:
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_ALZZIN:                                   // This Encounter is expected to be handled within Acid (reason handling at 50% hp)
            if (uiData == DONE)
            {
                if (!m_bWallDestroyed)
                {
                    DoUseDoorOrButton(GO_CRUMBLE_WALL);
                    m_bWallDestroyed = true;
                }

                DoUseDoorOrButton(GO_CORRUPT_VINE);

                if (!m_lFelvineShardGUIDs.empty())
                {
                    for(GUIDList::const_iterator i = m_lFelvineShardGUIDs.begin(); i != m_lFelvineShardGUIDs.end(); ++i)
                        DoRespawnGameObject(*i);
                }
            }
            else if (uiData == SPECIAL && !m_bWallDestroyed)
            {
                DoUseDoorOrButton(GO_CRUMBLE_WALL);
                m_bWallDestroyed = true;
            }
            m_auiEncounter[uiType] = uiData;
            break;

        // West
        case TYPE_IMMOLTHAR:
            if (uiData == DONE)
            {
                if (Creature* pPrince = GetSingleCreatureFromStorage(NPC_PRINCE_TORTHELDRIN))
                {
                    DoScriptText(SAY_FREE_IMMOLTHAR, pPrince);
                    pPrince->setFaction(FACTION_HOSTILE);
                    // Despawn Chest-Aura
                    if (GameObject* pChestAura = GetSingleGameObjectFromStorage(GO_PRINCES_CHEST_AURA))
                        pChestAura->Use(pPrince);
                }
            }
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_PRINCE:
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_PYLON_1:
        case TYPE_PYLON_2:
        case TYPE_PYLON_3:
        case TYPE_PYLON_4:
        case TYPE_PYLON_5:
            m_auiEncounter[uiType] = uiData;
            if (uiData == DONE)
            {
                DoUseDoorOrButton(m_aCrystalGeneratorGuid[uiType - TYPE_PYLON_1]);
                if (CheckAllGeneratorsDestroyed())
                    ProcessForceFieldOpening();
            }
            break;

        // North
        case TYPE_KING_GORDOK:
            m_auiEncounter[uiType] = uiData;
            if (uiData == DONE)
            {
                // Apply Aura to players in the map
                Map::PlayerList const& players = instance->GetPlayers();
                for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
                {
                    if (Player* pPlayer = itr->getSource())
                        pPlayer->CastSpell(pPlayer, SPELL_KING_OF_GORDOK, true);
                }
            }
            break;
    }

    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_auiEncounter[5] << " "
//.........这里部分代码省略.........
开发者ID:KalimdorGaming,项目名称:scriptdev0,代码行数:101,代码来源:instance_dire_maul.cpp

示例9: switch

void instance_stratholme::SetData(uint32 uiType, uint32 uiData)
{
    // TODO: Remove the hard-coded indexes from array accessing
    switch (uiType)
    {
        case TYPE_BARON_RUN:
            switch (uiData)
            {
                case IN_PROGRESS:
                    if (m_auiEncounter[uiType] == IN_PROGRESS || m_auiEncounter[uiType] == FAIL)
                        break;

                    // Baron ultimatum starts: summon Ysida in the cage
                    if (Creature* pBaron = GetSingleCreatureFromStorage(NPC_BARON))
                    {
                        DoOrSimulateScriptTextForThisInstance(SAY_ANNOUNCE_RUN_START, NPC_BARON);
                        pBaron->SummonCreature(NPC_YSIDA, aStratholmeLocation[7].m_fX, aStratholmeLocation[7].m_fY, aStratholmeLocation[7].m_fZ, aStratholmeLocation[7].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0);
                    }

                    m_uiBaronRunTimer = 45 * MINUTE * IN_MILLISECONDS;
                    debug_log("SD2: Instance Stratholme: Baron run in progress.");
                    break;
                case FAIL:
                    // may add code to remove aura from players, but in theory the time should be up already and removed.
                    break;
                case DONE:
                    m_uiBaronRunTimer = 0;
                    break;
            }
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_BARONESS:
        case TYPE_NERUB:
        case TYPE_PALLID:
            m_auiEncounter[uiType] = uiData;
            if (uiData == DONE)
            {
                DoSortZiggurats();
                DoUseDoorOrButton(m_zigguratStorage[uiType - TYPE_BARONESS].m_doorGuid);
            }
            if (uiData == SPECIAL)
                StartSlaugtherSquare();
            break;
        case TYPE_RAMSTEIN:
            if (uiData == SPECIAL)
            {
                if (m_auiEncounter[uiType] != SPECIAL && m_auiEncounter[uiType] != DONE)
                {
                    m_uiSlaugtherSquareTimer = 20000;       // TODO - unknown, also possible that this is not the very correct place..
                    DoUseDoorOrButton(GO_PORT_GAUNTLET);
                }

                uint32 uiCount = m_sAbomnationGUID.size();
                for (GuidSet::iterator itr = m_sAbomnationGUID.begin(); itr != m_sAbomnationGUID.end();)
                {
                    if (Creature* pAbom = instance->GetCreature(*itr))
                    {
                        ++itr;
                        if (!pAbom->isAlive())
                            --uiCount;
                    }
                    else
                    {
                        // Remove obsolete guid from set and decrement count
                        m_sAbomnationGUID.erase(itr++);
                        --uiCount;
                    }
                }

                if (!uiCount)
                {
                    // Old Comment: a bit itchy, it should close GO_ZIGGURAT_DOOR_4 door after 10 secs, but it doesn't. skipping it for now.
                    // However looks like that this door is no more closed
                    DoUseDoorOrButton(GO_ZIGGURAT_DOOR_4);

                    // No more handlng of Abomnations
                    m_uiSlaugtherSquareTimer = 0;

                    if (Creature* pBaron = GetSingleCreatureFromStorage(NPC_BARON))
                    {
                        DoScriptText(SAY_ANNOUNCE_RAMSTEIN, pBaron);
                        if (Creature* pRamstein = pBaron->SummonCreature(NPC_RAMSTEIN, aStratholmeLocation[2].m_fX, aStratholmeLocation[2].m_fY, aStratholmeLocation[2].m_fZ, aStratholmeLocation[2].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0))
                            pRamstein->GetMotionMaster()->MovePoint(0, aStratholmeLocation[3].m_fX, aStratholmeLocation[3].m_fY, aStratholmeLocation[3].m_fZ);

                        debug_log("SD2: Instance Stratholme - Slaugther event: Ramstein spawned.");
                    }
                }
                else
                    debug_log("SD2: Instance Stratholme - Slaugther event: %u Abomnation left to kill.", uiCount);
            }
            // After fail aggroing Ramstein means wipe on Ramstein, so close door again
            if (uiData == IN_PROGRESS && m_auiEncounter[uiType] == FAIL)
                DoUseDoorOrButton(GO_PORT_GAUNTLET);
            if (uiData == DONE)
            {
                // Open side gate and start summoning skeletons
                DoUseDoorOrButton(GO_PORT_SLAUGHTER_GATE);
                // use this timer as a bool just to start summoning
                m_uiMindlessSummonTimer = 500;
                m_uiMindlessCount = 0;
//.........这里部分代码省略.........
开发者ID:Caydan,项目名称:mangos-classic,代码行数:101,代码来源:instance_stratholme.cpp

示例10: switch

void instance_sunken_temple::SetData(uint32 uiType, uint32 uiData)
{
    switch(uiType)
    {
        case TYPE_ATALARION:
            if (uiData == SPECIAL)
                DoSpawnAtalarionIfCan();
            m_auiEncounter[0] = uiData;
            break;
        case TYPE_PROTECTORS:
            if (uiData == DONE)
            {
                --m_uiProtectorsRemaining;
                if (!m_uiProtectorsRemaining)
                {
                    m_auiEncounter[1] = uiData;
                    DoUseDoorOrButton(GO_JAMMALAN_BARRIER);
                    // Intro yell
                    DoOrSimulateScriptTextForThisInstance(SAY_JAMMALAN_INTRO, NPC_JAMMALAN);
                }
            }
            break;
        case TYPE_JAMMALAN:
            m_auiEncounter[2] = uiData;
            break;
        case TYPE_MALFURION:
            m_auiEncounter[3] = uiData;
            break;
        case TYPE_AVATAR:
            if (uiData == SPECIAL)
            {
                ++m_uiFlameCounter;

                Creature* pShade = GetSingleCreatureFromStorage(NPC_SHADE_OF_HAKKAR);
                if (!pShade)
                    return;

                switch (m_uiFlameCounter)
                {
                    // Yells on each flame
                    // TODO It might be possible that these yells should be ordered randomly, however this is the seen state
                    case 1: DoScriptText(SAY_AVATAR_BRAZIER_1, pShade); break;
                    case 2: DoScriptText(SAY_AVATAR_BRAZIER_2, pShade); break;
                    case 3: DoScriptText(SAY_AVATAR_BRAZIER_3, pShade); break;
                    // Summon the avatar of all flames are used
                    case MAX_FLAMES:
                        DoScriptText(SAY_AVATAR_BRAZIER_4, pShade);
                        pShade->CastSpell(pShade, SPELL_SUMMON_AVATAR, true);
                        m_uiAvatarSummonTimer = 0;
                        m_uiSupressorTimer = 0;
                        break;
                }

                // Summon the suppressors only after the flames are doused
                // Summon timer is confusing random; timers were: 13, 39 and 52 secs;
                if (m_uiFlameCounter != MAX_FLAMES)
                    m_uiSupressorTimer = urand(15000, 45000);

                return;
            }

            // Prevent double processing
            if (m_auiEncounter[4] == uiData)
                return;

            if (uiData == IN_PROGRESS)
            {
                m_uiSupressorTimer = 0;
                DoUpdateFlamesFlags(false);

                // Summon timer; use a small delay
                m_uiAvatarSummonTimer = 3000;
                m_bIsFirstHakkarWave = true;

                // Summon the shade
                Player* pPlayer = GetPlayerInMap();
                if (!pPlayer)
                    return;

                if (Creature* pShade = pPlayer->SummonCreature(NPC_SHADE_OF_HAKKAR, aSunkenTempleLocation[1].m_fX, aSunkenTempleLocation[1].m_fY, aSunkenTempleLocation[1].m_fZ, aSunkenTempleLocation[1].m_fO, TEMPSUMMON_MANUAL_DESPAWN, 0))
                {
                    m_mNpcEntryGuidStore[NPC_SHADE_OF_HAKKAR] = pShade->GetObjectGuid();
                    pShade->SetRespawnDelay(DAY);
                }

                // Respawn circles
                for (GUIDVector::const_iterator itr = m_vuiCircleGUIDs.begin(); itr != m_vuiCircleGUIDs.end(); ++itr)
                    DoRespawnGameObject(*itr, 30*MINUTE);
            }
            else if (uiData == FAIL)
            {
                // In case of wipe during the summoning ritual the shade is despawned
                // The trash mobs stay in place, they are not despawned; the avatar is not sure if it's despawned or not but most likely he'll stay in place

                // Despawn the shade and the avatar if needed -- TODO, avatar really?
                if (Creature* pShade = GetSingleCreatureFromStorage(NPC_SHADE_OF_HAKKAR))
                    pShade->ForcedDespawn();

                // Reset flames
                DoUpdateFlamesFlags(true);
//.........这里部分代码省略.........
开发者ID:KalimdorGaming,项目名称:scriptdev0,代码行数:101,代码来源:instance_sunken_temple.cpp

示例11: switch

void instance_naxxramas::SetData(uint32 uiType, uint32 uiData)
{
    switch(uiType)
    {
        case TYPE_ANUB_REKHAN:
            m_auiEncounter[uiType] = uiData;
            DoUseDoorOrButton(m_uiAnubDoorGUID);
            if (uiData == DONE)
                DoUseDoorOrButton(m_uiAnubGateGUID);
            break;
        case TYPE_FAERLINA:
            DoUseDoorOrButton(m_uiFaerWebGUID);
            if (uiData == DONE)
            {
                DoUseDoorOrButton(m_uiFaerDoorGUID);
                DoUseDoorOrButton(m_uiMaexOuterGUID);
            }
            if (uiData == FAIL)
            {
                for (GUIDList::const_iterator itr = m_lFaerlinaAddGUIDs.begin(); itr != m_lFaerlinaAddGUIDs.end(); ++itr)
                {
                    Creature* pAdd = instance->GetCreature(*itr);
                    if (pAdd && !pAdd->isAlive())
                        pAdd->Respawn();
                }
            }
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_MAEXXNA:
            m_auiEncounter[uiType] = uiData;
            DoUseDoorOrButton(m_uiMaexInnerGUID, uiData);
            if (uiData == DONE)
            {
                DoUseDoorOrButton(m_uiAracEyeRampGUID);
                DoRespawnGameObject(m_uiAracPortalGUID, 30*MINUTE);
                DoTaunt();
            }
            break;
        case TYPE_NOTH:
            m_auiEncounter[uiType] = uiData;
            DoUseDoorOrButton(m_uiNothEntryDoorGUID);
            if (uiData == DONE)
            {
                DoUseDoorOrButton(m_uiNothExitDoorGUID);
                DoUseDoorOrButton(m_uiHeigEntryDoorGUID);
            }
            break;
        case TYPE_HEIGAN:
            m_auiEncounter[uiType] = uiData;
            DoUseDoorOrButton(m_uiHeigEntryDoorGUID);
            if (uiData == DONE)
                DoUseDoorOrButton(m_uiHeigExitDoorGUID);
            break;
        case TYPE_LOATHEB:
            m_auiEncounter[uiType] = uiData;
            DoUseDoorOrButton(m_uiLoathebDoorGUID);
            if (uiData == DONE)
            {
                DoUseDoorOrButton(m_uiPlagEyeRampGUID);
                DoRespawnGameObject(m_uiPlagPortalGUID, 30*MINUTE);
                DoTaunt();
            }
            break;
        case TYPE_RAZUVIOUS:
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_GOTHIK:
            switch(uiData)
            {
                case IN_PROGRESS:
                    DoUseDoorOrButton(m_uiGothikEntryDoorGUID);
                    DoUseDoorOrButton(m_uiGothCombatGateGUID);
                    break;
                case SPECIAL:
                    DoUseDoorOrButton(m_uiGothCombatGateGUID);
                    break;
                case FAIL:
                    if (m_auiEncounter[uiType] == IN_PROGRESS)
                        DoUseDoorOrButton(m_uiGothCombatGateGUID);

                    DoUseDoorOrButton(m_uiGothikEntryDoorGUID);
                    break;
                case DONE:
                    DoUseDoorOrButton(m_uiGothikEntryDoorGUID);
                    DoUseDoorOrButton(m_uiGothikExitDoorGUID);
                    DoUseDoorOrButton(m_uiHorsemenDoorGUID);
                    break;
            }
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_FOUR_HORSEMEN:
            m_auiEncounter[uiType] = uiData;
            DoUseDoorOrButton(m_uiHorsemenDoorGUID);
            if (uiData == DONE)
            {
                DoUseDoorOrButton(m_uiMiliEyeRampGUID);
                DoRespawnGameObject(m_uiMiliPortalGUID, 30*MINUTE);
                DoRespawnGameObject(m_uiHorsemenChestGUID, 30*MINUTE);
                DoTaunt();
            }
//.........这里部分代码省略.........
开发者ID:ryzu,项目名称:scriptdev0,代码行数:101,代码来源:instance_naxxramas.cpp

示例12: switch

void instance_pinnacle::SetData(uint32 uiType, uint32 uiData)
{
    switch (uiType)
    {
        case TYPE_SVALA:
            if (uiData == IN_PROGRESS || uiData == FAIL)
                SetSpecialAchievementCriteria(TYPE_ACHIEV_INCREDIBLE_HULK, false);
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_GORTOK:
            if (uiData == IN_PROGRESS)
            {
                if (Creature* pOrb = instance->GetCreature(m_gortokEventTriggerGuid))
                {
                    pOrb->SetLevitate(true);
                    pOrb->CastSpell(pOrb, SPELL_ORB_VISUAL, true);
                    pOrb->GetMotionMaster()->MovePoint(0, aOrbPositions[0][0], aOrbPositions[0][1], aOrbPositions[0][2]);

                    m_uiGortokOrbTimer = 2000;
                }
            }
            if (uiData == FAIL)
            {
                if (Creature* pOrb = instance->GetCreature(m_gortokEventTriggerGuid))
                {
                    if (!pOrb->isAlive())
                        pOrb->Respawn();
                    else
                        pOrb->RemoveAllAuras();

                    // For some reasone the Orb doesn't evade automatically
                    pOrb->GetMotionMaster()->MoveTargetedHome();
                }

                for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
                {
                    // Reset each miniboss
                    if (Creature* pTemp = GetSingleCreatureFromStorage(aGortokMiniBosses[i]))
                    {
                        if (!pTemp->isAlive())
                            pTemp->Respawn();

                        pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                    }
                }

                m_uiGortokOrbPhase = 0;
            }
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_SKADI:
            if (uiData == IN_PROGRESS)
            {
                DoStartTimedAchievement(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, ACHIEV_START_SKADI_ID);
            }
            if (uiData == DONE)
                DoUseDoorOrButton(GO_DOOR_SKADI);

            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_YMIRON:
            if (uiData == DONE)
                DoUseDoorOrButton(GO_DOOR_YMIRON);
            if (uiData == IN_PROGRESS)
                SetSpecialAchievementCriteria(TYPE_ACHIEV_KINGS_BANE, true);
            if (uiData == SPECIAL)
                SetSpecialAchievementCriteria(TYPE_ACHIEV_KINGS_BANE, false);
            m_auiEncounter[uiType] = uiData;
            break;
        default:
            script_error_log("Instance Pinnacle: SetData = %u for type %u does not exist/not implemented.", uiType, uiData);
            return;
    }

    // Saving also SPECIAL for this instance
    if (uiData == DONE || uiData == SPECIAL)
    {
        OUT_SAVE_INST_DATA;

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

        m_strInstData = saveStream.str();

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

示例13: switch

void instance_naxxramas::SetData(uint32 uiType, uint32 uiData)
{
    switch (uiType)
    {
        case TYPE_ANUB_REKHAN:
            m_auiEncounter[uiType] = uiData;
            DoUseDoorOrButton(GO_ARAC_ANUB_DOOR);
            if (uiData == DONE)
            {
                DoUseDoorOrButton(GO_ARAC_ANUB_GATE);
                DoStartTimedAchievement(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, ACHIEV_START_MAEXXNA_ID);
            }
            break;
        case TYPE_FAERLINA:
            DoUseDoorOrButton(GO_ARAC_FAER_WEB);
            if (uiData == IN_PROGRESS)
                SetSpecialAchievementCriteria(TYPE_ACHIEV_KNOCK_YOU_OUT, true);
            if (uiData == DONE)
            {
                DoUseDoorOrButton(GO_ARAC_FAER_DOOR);
                DoUseDoorOrButton(GO_ARAC_MAEX_OUTER_DOOR);
            }
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_MAEXXNA:
            m_auiEncounter[uiType] = uiData;
            DoUseDoorOrButton(GO_ARAC_MAEX_INNER_DOOR, uiData);
            if (uiData == DONE)
            {
                DoUseDoorOrButton(GO_ARAC_EYE_RAMP);
                DoUseDoorOrButton(GO_ARAC_EYE_BOSS);
                DoRespawnGameObject(GO_ARAC_PORTAL, 30 * MINUTE);
                DoToggleGameObjectFlags(GO_ARAC_PORTAL, GO_FLAG_NO_INTERACT, false);
                m_uiTauntTimer = 5000;
            }
            break;
        case TYPE_NOTH:
            m_auiEncounter[uiType] = uiData;
            DoUseDoorOrButton(GO_PLAG_NOTH_ENTRY_DOOR);
            if (uiData == DONE)
            {
                DoUseDoorOrButton(GO_PLAG_NOTH_EXIT_DOOR);
                DoUseDoorOrButton(GO_PLAG_HEIG_ENTRY_DOOR);
            }
            break;
        case TYPE_HEIGAN:
            m_auiEncounter[uiType] = uiData;
            DoUseDoorOrButton(GO_PLAG_HEIG_ENTRY_DOOR);
            if (uiData == IN_PROGRESS)
                SetSpecialAchievementCriteria(TYPE_ACHIEV_SAFETY_DANCE, true);
            if (uiData == DONE)
                DoUseDoorOrButton(GO_PLAG_HEIG_EXIT_DOOR);
            break;
        case TYPE_LOATHEB:
            m_auiEncounter[uiType] = uiData;
            DoUseDoorOrButton(GO_PLAG_LOAT_DOOR);
            if (uiData == IN_PROGRESS)
                SetSpecialAchievementCriteria(TYPE_ACHIEV_SPORE_LOSER, true);
            if (uiData == DONE)
            {
                DoUseDoorOrButton(GO_PLAG_EYE_RAMP);
                DoUseDoorOrButton(GO_PLAG_EYE_BOSS);
                DoRespawnGameObject(GO_PLAG_PORTAL, 30 * MINUTE);
                DoToggleGameObjectFlags(GO_PLAG_PORTAL, GO_FLAG_NO_INTERACT, false);
                m_uiTauntTimer = 5000;
            }
            break;
        case TYPE_RAZUVIOUS:
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_GOTHIK:
            switch (uiData)
            {
                case IN_PROGRESS:
                    DoUseDoorOrButton(GO_MILI_GOTH_ENTRY_GATE);
                    DoUseDoorOrButton(GO_MILI_GOTH_COMBAT_GATE);
                    break;
                case SPECIAL:
                    DoUseDoorOrButton(GO_MILI_GOTH_COMBAT_GATE);
                    break;
                case FAIL:
                    if (m_auiEncounter[uiType] == IN_PROGRESS)
                        DoUseDoorOrButton(GO_MILI_GOTH_COMBAT_GATE);

                    DoUseDoorOrButton(GO_MILI_GOTH_ENTRY_GATE);
                    break;
                case DONE:
                    DoUseDoorOrButton(GO_MILI_GOTH_ENTRY_GATE);
                    DoUseDoorOrButton(GO_MILI_GOTH_EXIT_GATE);
                    DoUseDoorOrButton(GO_MILI_HORSEMEN_DOOR);

                    m_dialogueHelper.StartNextDialogueText(NPC_THANE);
                    break;
            }
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_FOUR_HORSEMEN:
            // Skip if already set
            if (m_auiEncounter[uiType] == uiData)
                return;
//.........这里部分代码省略.........
开发者ID:TurboDot,项目名称:SCRIPTS,代码行数:101,代码来源:instance_naxxramas.cpp

示例14: switch

void instance_halls_of_stone::SetData(uint32 uiType, uint32 uiData)
{
    switch (uiType)
    {
        case TYPE_TRIBUNAL:
            m_auiEncounter[uiType] = uiData;
            switch (uiData)
            {
                case IN_PROGRESS:
                    SortFaces();
                    break;
                case DONE:
                    // Cast achiev check spell - Note: it's not clear who casts this spell, but for the moment we'll use Abedneum
                    if (Creature* pEye = instance->GetCreature(m_aFaces[1].m_leftEyeGuid))
                        pEye->CastSpell(pEye, SPELL_ACHIEVEMENT_CHECK, true);
                    // Spawn the loot
                    DoRespawnGameObject(instance->IsRegularDifficulty() ? GO_TRIBUNAL_CHEST : GO_TRIBUNAL_CHEST_H, 30 * MINUTE);
                    DoToggleGameObjectFlags(instance->IsRegularDifficulty() ? GO_TRIBUNAL_CHEST : GO_TRIBUNAL_CHEST_H, GO_FLAG_NO_INTERACT, false);
                    // Door workaround because of the missing Bran event
                    DoUseDoorOrButton(GO_DOOR_SJONNIR);
                    break;
                case FAIL:
                    for (uint8 i = 0; i < MAX_FACES; ++i)
                    {
                        // Shut down the faces
                        if (m_aFaces[i].m_bIsActive)
                            DoUseDoorOrButton(m_aFaces[i].m_goFaceGuid);
                        m_aFaces[i].m_bIsActive = false;
                        m_aFaces[i].m_uiTimer = 1000;
                    }
                    break;
                case SPECIAL:
                    for (uint8 i = 0; i < MAX_FACES; ++i)
                    {
                        m_aFaces[i].m_bIsActive = false;
                        m_aFaces[i].m_uiTimer = 1000;
                        // TODO - Check which stay red and how long (also find out how they get red..)

                        // Cleanup when finished
                        if (Creature* pEye = instance->GetCreature(m_aFaces[i].m_leftEyeGuid))
                            pEye->CastSpell(pEye, SPELL_KILL_TRIBUNAL_ADD, true);
                        if (Creature* pEye = instance->GetCreature(m_aFaces[i].m_rightEyeGuid))
                            pEye->CastSpell(pEye, SPELL_KILL_TRIBUNAL_ADD, true);
                    }
                    break;
            }
            break;
        case TYPE_MAIDEN:
            m_auiEncounter[uiType] = uiData;
            if (uiData == IN_PROGRESS)
                DoStartTimedAchievement(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, ACHIEV_START_MAIDEN_ID);
            break;
        case TYPE_KRYSTALLUS:
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_SJONNIR:
            m_auiEncounter[uiType] = uiData;
            DoUseDoorOrButton(GO_DOOR_SJONNIR);
            if (uiData == IN_PROGRESS)
                m_uiIronSludgeKilled = 0;
            break;
    }

    if (uiData == DONE)
    {
        OUT_SAVE_INST_DATA;

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

        m_strInstData = saveStream.str();

        SaveToDB();
        OUT_SAVE_INST_DATA_COMPLETE;
    }
}
开发者ID:mynew4,项目名称:RustEmu-Core,代码行数:76,代码来源:instance_halls_of_stone.cpp

示例15: GetSingleCreatureFromStorage

void instance_stratholme::Update(uint32 uiDiff)
{
    if (m_uiBarthilasRunTimer)
    {
        if (m_uiBarthilasRunTimer <= uiDiff)
        {
            Creature* pBarthilas = GetSingleCreatureFromStorage(NPC_BARTHILAS);
            if (pBarthilas && pBarthilas->isAlive() && !pBarthilas->isInCombat())
                pBarthilas->NearTeleportTo(aStratholmeLocation[1].m_fX, aStratholmeLocation[1].m_fY, aStratholmeLocation[1].m_fZ, aStratholmeLocation[1].m_fO);

            SetData(TYPE_BARTHILAS_RUN, DONE);
            m_uiBarthilasRunTimer = 0;
        }
        else
            m_uiBarthilasRunTimer -= uiDiff;
    }

    // Timer to summon Aurius into the Slaughter House once Baron is engaged
    if (m_uiAuriusSummonTimer)
    {
        if (m_uiAuriusSummonTimer <= uiDiff)
        {
            SetData(TYPE_AURIUS, IN_PROGRESS);
            m_uiAuriusSummonTimer = 0;
        }
        else
            m_uiAuriusSummonTimer -= uiDiff;
    }

    // Check changes for Baron ultimatum timer only if Baron is not already in combat
    if (m_uiBaronRunTimer && GetData(TYPE_BARON) != IN_PROGRESS)
    {
        if (m_uiYellCounter == 0 && m_uiBaronRunTimer <= 10 * MINUTE * IN_MILLISECONDS)
        {
            DoOrSimulateScriptTextForThisInstance(SAY_ANNOUNCE_RUN_10_MIN, NPC_BARON);
            ++m_uiYellCounter;
        }
        else if (m_uiYellCounter == 1 && m_uiBaronRunTimer <= 5 * MINUTE * IN_MILLISECONDS)
        {
            DoOrSimulateScriptTextForThisInstance(SAY_ANNOUNCE_RUN_5_MIN, NPC_BARON);
            ++m_uiYellCounter;
        }
        // Used to create a delay of 10s between Baron speech and Ysida's answer
        else if (m_uiYellCounter == 2 && m_uiBaronRunTimer <= (5 * MINUTE - 10) * IN_MILLISECONDS)
        {
            DoOrSimulateScriptTextForThisInstance(YSIDA_SAY_RUN_5_MIN, NPC_YSIDA);
            ++m_uiYellCounter;
        }

        if (m_uiBaronRunTimer <= uiDiff)
        {
            if (GetData(TYPE_BARON_RUN) != FAIL)
            {
                SetData(TYPE_BARON_RUN, FAIL);

                // Open the cage and let Ysida face her doom
                if (Creature* pYsida = GetSingleCreatureFromStorage(NPC_YSIDA))
                {
                    pYsida->GetMotionMaster()->MovePoint(0, aStratholmeLocation[8].m_fX, aStratholmeLocation[8].m_fY, aStratholmeLocation[8].m_fZ, aStratholmeLocation[8].m_fO);
                    DoUseDoorOrButton(GO_YSIDA_CAGE);
                }

                DoOrSimulateScriptTextForThisInstance(SAY_ANNOUNCE_RUN_FAIL, NPC_BARON);

                m_uiBaronRunTimer = 8000;  // We reset the timer so the speech of Ysida is not said at the same time than the Baron's one
            }
            else
            {
                // Baron ultimatum failed: let the Baron kill her
                if (Creature* pYsida = GetSingleCreatureFromStorage(NPC_YSIDA))
                    if (Creature* pBaron = GetSingleCreatureFromStorage(NPC_BARON))
                        pBaron->CastSpell(pYsida, SPELL_BARON_SOUL_DRAIN, true);

                DoOrSimulateScriptTextForThisInstance(YSIDA_SAY_RUN_FAIL, NPC_YSIDA);

                m_uiBaronRunTimer = 0;  // event done for good, no more speech
                debug_log("SD2: Instance Stratholme: Baron run event reached end. Event has state %u.", GetData(TYPE_BARON_RUN));
            }
        }
        else
            m_uiBaronRunTimer -= uiDiff;
    }

    if (m_uiMindlessSummonTimer)
    {
        if (m_uiMindlessCount < 30)
        {
            if (m_uiMindlessSummonTimer <= uiDiff)
            {
                if (Creature* pBaron = GetSingleCreatureFromStorage(NPC_BARON))
                {
                    // Summon mindless skeletons and move them to random point in the center of the square
                    if (Creature* pTemp = pBaron->SummonCreature(NPC_MINDLESS_UNDEAD, aStratholmeLocation[4].m_fX, aStratholmeLocation[4].m_fY, aStratholmeLocation[4].m_fZ, aStratholmeLocation[4].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0))
                    {
                        float fX, fY, fZ;
                        pBaron->GetRandomPoint(aStratholmeLocation[5].m_fX, aStratholmeLocation[5].m_fY, aStratholmeLocation[5].m_fZ, 20.0f, fX, fY, fZ);
                        pTemp->GetMotionMaster()->MovePoint(0, fX, fY, fZ);
                        m_luiUndeadGUIDs.push_back(pTemp->GetObjectGuid());
                        ++m_uiMindlessCount;
                    }
//.........这里部分代码省略.........
开发者ID:Caydan,项目名称:mangos-classic,代码行数:101,代码来源:instance_stratholme.cpp


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