예제 #1
0
    void SetData(uint32 uiType, uint32 uiData)
    {
        debug_log("SD2: Instance Ramparts: SetData received for type %u with data %u",uiType,uiData);

        switch(uiType)
        {
            case TYPE_VAZRUDEN:
                if (uiData == DONE && m_auiEncounter[1] == DONE)
                    DoRespawnGameObject(instance->IsRegularDifficulty() ? m_uiChestNGUID : m_uiChestHGUID, HOUR*IN_MILISECONDS);
                m_auiEncounter[0] = uiData;
                break;
            case TYPE_NAZAN:
                if (uiData == SPECIAL)
                {
                    ++m_uiSentryCounter;

                    if (m_uiSentryCounter == 2)
                        m_auiEncounter[1] = uiData;
                }
                if (uiData == DONE && m_auiEncounter[0] == DONE)
                {
                    DoRespawnGameObject(instance->IsRegularDifficulty() ? m_uiChestNGUID : m_uiChestHGUID, HOUR*IN_MILISECONDS);
                    m_auiEncounter[1] = uiData;
                }
                if (uiData == IN_PROGRESS)
                    m_auiEncounter[1] = uiData;
                break;
        }
    }
예제 #2
0
void instance_trial_of_the_crusader::DoHandleEventEpilogue()
{
    Player* pPlayer = GetPlayerInMap();
    if (!pPlayer)
        return;

    // Spawn Tirion and the mage
    if (Creature* pTirion = pPlayer->SummonCreature(NPC_TIRION_B, aSpawnPositions[12][0], aSpawnPositions[12][1], aSpawnPositions[12][2], aSpawnPositions[12][3], TEMPSUMMON_CORPSE_DESPAWN, 0))
        DoScriptText(SAY_TIRION_EPILOGUE, pTirion);

    pPlayer->SummonCreature(NPC_ARGENT_MAGE, aSpawnPositions[13][0], aSpawnPositions[13][1], aSpawnPositions[13][2], aSpawnPositions[13][3], TEMPSUMMON_CORPSE_DESPAWN, 0);

    DoRespawnGameObject(GO_PORTAL_DALARAN, 60 * MINUTE);

    // Spawn the chest for heroic difficulty
    if (IsHeroicDifficulty())
    {
        if (GetData(TYPE_WIPE_COUNT) == 0)
            DoRespawnGameObject(Is25ManDifficulty() ? GO_TRIBUTE_CHEST_25H_50 : GO_TRIBUTE_CHEST_10H_50, 60 * MINUTE);
        else if (GetData(TYPE_WIPE_COUNT) < 5)
            DoRespawnGameObject(Is25ManDifficulty() ? GO_TRIBUTE_CHEST_25H_45 : GO_TRIBUTE_CHEST_10H_45, 60 * MINUTE);
        else if (GetData(TYPE_WIPE_COUNT) < 25)
            DoRespawnGameObject(Is25ManDifficulty() ? GO_TRIBUTE_CHEST_25H_25 : GO_TRIBUTE_CHEST_10H_25, 60 * MINUTE);
        else
            DoRespawnGameObject(Is25ManDifficulty() ? GO_TRIBUTE_CHEST_25H_01 : GO_TRIBUTE_CHEST_10H_01, 60 * MINUTE);
    }
}
void instance_ramparts::SetData(uint32 uiType, uint32 uiData)
{
    debug_log("SD2: Instance Ramparts: SetData received for type %u with data %u",uiType,uiData);

    switch (uiType)
    {
        case TYPE_VAZRUDEN:
            if (uiData == DONE && m_auiEncounter[1] == DONE)
                DoRespawnGameObject(instance->IsRegularDifficulty() ? GO_FEL_IRON_CHEST : GO_FEL_IRON_CHEST_H, HOUR);
            if (uiData == FAIL && m_auiEncounter[0] != FAIL)
                DoFailVazruden();
            m_auiEncounter[0] = uiData;
            break;
        case TYPE_NAZAN:
            if (uiData == SPECIAL)
            {
                ++m_uiSentryCounter;

                if (m_uiSentryCounter == 2)
                    m_auiEncounter[1] = uiData;

                return;
            }
            if (uiData == DONE && m_auiEncounter[0] == DONE)
                DoRespawnGameObject(instance->IsRegularDifficulty() ? GO_FEL_IRON_CHEST : GO_FEL_IRON_CHEST_H, HOUR);
            if (uiData == FAIL && m_auiEncounter[1] != FAIL)
                DoFailVazruden();

            m_auiEncounter[1] = uiData;
            break;
    }
}
    void SetData(uint32 uiType, uint32 uiData)
    {
        switch(uiType)
        {
            case TYPE_MALYGOS:
                m_auiEncounter[0] = uiData;
                if(uiData == DONE)
                {
                    DoRespawnGameObject(m_uiGiftGUID, 30*MINUTE);
					DoRespawnGameObject(m_uiGiftHeroGUID, 30*MINUTE);
                }
                break;
            case TYPE_OUTRO_CHECK:
                m_uiOutroCheck = uiData;
                break;
        }
        OUT_SAVE_INST_DATA;
        std::ostringstream saveStream;
        saveStream << m_auiEncounter[0] << " " << m_uiOutroCheck;

        strInstData = saveStream.str();
        SaveToDB();
        OUT_SAVE_INST_DATA_COMPLETE;

    }
예제 #5
0
void instance_sunken_temple::DoSpawnAtalarionIfCan()
{
    // Return if already summoned
    if (GetSingleCreatureFromStorage(NPC_ATALARION))
    {
        return;
    }

    Player* pPlayer = GetPlayerInMap();
    if (!pPlayer)
    {
        return;
    }

    pPlayer->SummonCreature(NPC_ATALARION, aSunkenTempleLocation[0].m_fX, aSunkenTempleLocation[0].m_fY, aSunkenTempleLocation[0].m_fZ, aSunkenTempleLocation[0].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0);

    // Spawn the idol of Hakkar
    DoRespawnGameObject(GO_IDOL_OF_HAKKAR, 30 * MINUTE);

    // Spawn the big green lights
    for (GuidList::const_iterator itr = m_luiBigLightGUIDs.begin(); itr != m_luiBigLightGUIDs.end(); ++itr)
    {
        DoRespawnGameObject(*itr, 30 * MINUTE);
    }
}
예제 #6
0
        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);
                break;
            case DATA_EREGOS_EVENT:
                if (state == DONE)
                {
                    DoRespawnGameObject(eregosCache, 1*DAY);
                    DoRespawnGameObject(Rampenlicht, 1*DAY);
                }
                break;
            }

            return true;
        }
예제 #7
0
void instance_oculus::SetData(uint32 uiType, uint32 uiData)
{
    m_auiEncounter[uiType] = uiData;
    switch(uiType)
    {
        case TYPE_DRAKOS:
            if (uiData == DONE)
            {
                if (!instance->IsRegularDifficulty())
                    DoStartTimedAchievement(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, ACHIEV_MAKE_IT_COUNT);
                CheckVarosCentrifugeConstructState();
            }
            break;
        case TYPE_VAROS:
            if (uiData == DONE)
            {
                if (Creature* pUrom = GetSingleCreatureFromStorage(NPC_UROM))
                {
                    pUrom->InterruptNonMeleeSpells(false);
                    pUrom->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                }
            }
            break;
        case TYPE_UROM:
            if (uiData == DONE)
            {
                if (Creature* pEregos = GetSingleCreatureFromStorage(NPC_EREGOS))
                {
                    pEregos->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                }
            }
            break;
        case TYPE_EREGOS:
            if (uiData == DONE)
            {
                DoRespawnGameObject(instance->IsRegularDifficulty() ? GO_EREGOS_CACHE : GO_EREGOS_CACHE_H, 30*MINUTE);
                DoRespawnGameObject(GO_SPOTLIGHT, 30*MINUTE);
            }
            break;        
        default:
            break;
    }

    // Saving also SPECIAL for this instance
    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;
    }
}
예제 #8
0
void instance_oculus::SetData(uint32 type, uint32 data)
{
    switch(type)
    {
        case TYPE_DRAKOS:
            m_auiEncounter[type] = data;
            if (data == IN_PROGRESS)
                DoStartTimedAchievement(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, ACHIEV_START_EREGOS_ID);
            break;
        case TYPE_VAROS:
        case TYPE_UROM:
            m_auiEncounter[type] = data;
            break;
        case TYPE_EREGOS:
            m_auiEncounter[type] = data;
            if (data == DONE)
            {
                DoRespawnGameObject(m_bIsRegularMode ? GO_EREGOS_CACHE : GO_EREGOS_CACHE_H, HOUR);
                DoRespawnGameObject(GO_SPOTLIGHT, HOUR);
            }
            break;
        case TYPE_ROBOTS:
            m_auiEncounter[type] = m_auiEncounter[type] - data;
            if(m_auiEncounter[type] == 0)
            {
                if(Creature* pVaros = GetSingleCreatureFromStorage(NPC_VAROS))
                {
                    DoScriptText(SAY_VAROS_SPAWN, pVaros);
                    pVaros->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                    pVaros->InterruptNonMeleeSpells(false);
                    pVaros->RemoveAurasDueToSpell(50053);
                }
            }
            data = NOT_STARTED;
            break;
        case TYPE_UROM_PHASE:
            m_auiEncounter[type] = data;
            data = NOT_STARTED;
            break;
        default:
            return;
    }

    if (data == DONE)
    {
        OUT_SAVE_INST_DATA;
        std::ostringstream saveStream;
        for(uint8 i = 0; i < MAX_ENCOUNTERS; ++i)
            saveStream << m_auiEncounter[i] << " ";

        strSaveData = saveStream.str();

        SaveToDB();
        OUT_SAVE_INST_DATA_COMPLETE;
    }
}
    void SetData(uint32 uiType, uint32 uiData)
    {
        switch(uiType)
        {
            case DATA_CHAMPIONID_1:
                m_uiChampionId1 = uiData;
                break;
            case DATA_CHAMPIONID_2:
                m_uiChampionId2 = uiData;
                break;
            case DATA_CHAMPIONID_3:
                m_uiChampionId3 = uiData;
                break;
            case DATA_ARGENT_CHALLENGER:
                m_uiArgentChallengerID = uiData;
                break;
            case DATA_BLACK_KNIGHT_MINION:
                m_uiBlackKnightMinionID = uiData;
                break;
            case TYPE_GRAND_CHAMPIONS:
                m_auiEncounter[0] = uiData;
                if (uiData == DONE && m_uiChampionsLootGUID)
                    DoRespawnGameObject(m_uiChampionsLootGUID, 7*DAY);
                break;
            case TYPE_ARGENT_CHALLENGE:
                m_auiEncounter[1] = uiData;
                if (uiData == DONE)
                {
                    if (m_uiArgentChallenger == m_uiEadricGUID && m_uiEadricLootGUID)
                        DoRespawnGameObject(m_uiEadricLootGUID, 7*DAY);
                    if (m_uiArgentChallenger == m_uiPaletressGUID && m_uiPaletressLootGUID)
                        DoRespawnGameObject(m_uiPaletressLootGUID, 7*DAY);
                }
                break;
            case TYPE_BLACK_KNIGHT:
                m_auiEncounter[2] = uiData;
                break;
        }

        std::ostringstream saveStream;
        for(uint32 i = 0; i < MAX_ENCOUNTER; ++i)   //FIXME: should save more stuff to properly load in case of crash
            saveStream << m_auiEncounter[i] << " ";
        m_strInstData = saveStream.str();

        if (uiData == DONE)
        {
            OUT_SAVE_INST_DATA;
            SaveToDB();
            OUT_SAVE_INST_DATA_COMPLETE;
        }
    }
    void SetData(uint32 uiType, uint32 uiData)
    {
        switch(uiType)
        {
            case TYPE_MALYGOS:
            {
                if (uiData == NOT_STARTED)
                {
                    if (GameObject* pFocusingIris = GetSingleGameObjectFromStorage(m_uiFocusingIrisActualEntry))
                    {
                        pFocusingIris->SetGoState(GO_STATE_READY);
                        pFocusingIris->SetPhaseMask(1, true);
                    }
                    if (GameObject* pExitPortal = GetSingleGameObjectFromStorage(GO_EXIT_PORTAL))
                        pExitPortal->SetPhaseMask(1, true);
                    if (GameObject* pPlatform = GetSingleGameObjectFromStorage(GO_PLATFORM))
                        pPlatform->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_DESTROYED);
                }
                if (uiData == IN_PROGRESS)
                {
                    if (GameObject* pFocusingIris = GetSingleGameObjectFromStorage(m_uiFocusingIrisActualEntry))
                        pFocusingIris->SetPhaseMask(2, true);
                    if (GameObject* pExitPortal = GetSingleGameObjectFromStorage(GO_EXIT_PORTAL))
                        pExitPortal->SetPhaseMask(2, true);
                }
                if (uiData == DONE)
                {
                    if (GameObject* pExitPortal = GetSingleGameObjectFromStorage(GO_EXIT_PORTAL))
                        pExitPortal->SetPhaseMask(1, true);
                    DoRespawnGameObject(m_uiGiftActualGuid, HOUR*IN_MILLISECONDS);
                    DoRespawnGameObject(m_uiHeartActualGuid, HOUR*IN_MILLISECONDS);
                    //hack to make loot accessible
                    if (GameObject* pPlatform = GetSingleGameObjectFromStorage(GO_PLATFORM))
                    {
                        pPlatform->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_DESTROYED);
                        pPlatform->Respawn();
                    }
                }
                m_auiEncounter[0] = uiData;
                break;
            }
        }
        OUT_SAVE_INST_DATA;
        std::ostringstream saveStream;
        saveStream << m_auiEncounter[0];

        strInstData = saveStream.str();
        SaveToDB();
        OUT_SAVE_INST_DATA_COMPLETE;

    }
예제 #11
0
void instance_karazhan::DoPrepareOperaStage(Creature* pOrganizer)
{
    if (!pOrganizer)
        return;

    debug_log("SD2: Barnes Opera Event - Introduction complete - preparing encounter %d", GetData(TYPE_OPERA_PERFORMANCE));

    // summon the bosses and respawn the stage background
    switch (GetData(TYPE_OPERA_PERFORMANCE))
    {
        case OPERA_EVENT_WIZARD_OZ:
            for (uint8 i = 0; i < MAX_OZ_OPERA_MOBS; ++i)
                pOrganizer->SummonCreature(aOperaLocOz[i].uiEntry, aOperaLocOz[i].fX, aOperaLocOz[i].fY, aOperaLocOz[i].fZ, aOperaLocOz[i].fO, TEMPSPAWN_DEAD_DESPAWN, 0);
            DoRespawnGameObject(GO_OZ_BACKDROP, 12 * HOUR);
            for (GuidList::const_iterator itr = m_lOperaHayGuidList.begin(); itr != m_lOperaHayGuidList.end(); ++itr)
                DoRespawnGameObject(*itr, 12 * HOUR);
            break;
        case OPERA_EVENT_RED_RIDING_HOOD:
            pOrganizer->SummonCreature(aOperaLocWolf.uiEntry, aOperaLocWolf.fX, aOperaLocWolf.fY, aOperaLocWolf.fZ, aOperaLocWolf.fO, TEMPSPAWN_DEAD_DESPAWN, 0);
            DoRespawnGameObject(GO_HOOD_BACKDROP, 12 * HOUR);
            DoRespawnGameObject(GO_HOOD_HOUSE,    12 * HOUR);
            for (GuidList::const_iterator itr = m_lOperaTreeGuidList.begin(); itr != m_lOperaTreeGuidList.end(); ++itr)
                DoRespawnGameObject(*itr, 12 * HOUR);
            break;
        case OPERA_EVENT_ROMULO_AND_JUL:
            pOrganizer->SummonCreature(aOperaLocJul.uiEntry, aOperaLocJul.fX, aOperaLocJul.fY, aOperaLocJul.fZ, aOperaLocJul.fO, TEMPSPAWN_DEAD_DESPAWN, 0);
            DoRespawnGameObject(GO_RAJ_BACKDROP, 12 * HOUR);
            DoRespawnGameObject(GO_RAJ_MOON,     12 * HOUR);
            DoRespawnGameObject(GO_RAJ_BALCONY,  12 * HOUR);
            break;
    }

    SetData(TYPE_OPERA, IN_PROGRESS);
}
		void TombOfSevenEnd() {
			DoRespawnGameObject(GoChestGUID, DAY);
			HandleGameObject(GoTombExitGUID, true); //event done, open exit door
			HandleGameObject(GoTombEnterGUID, true); //event done, open entrance door
			TombEventStarterGUID = 0;
			SetData(TYPE_TOMB_OF_SEVEN, DONE);
		}
 void SetData(uint32 uiType, uint32 uiData)
 {
     switch(uiType)
     {
         case TYPE_QUEST:
             m_auiEncounter[0] = uiData;
             break; 
         case TYPE_CRATES_COUNT:
             m_uiCratesCount = m_uiCratesCount + uiData;
             if(m_uiCratesCount == 5)
             {
                m_auiEncounter[0] = DONE;
                ChromiWhispers();
             }
             DoUpdateWorldState(WORLD_STATE_COS_CRATE_COUNT, m_uiCratesCount);
             break;
         case TYPE_INTRO:
             m_auiEncounter[1] = uiData;
             break;
         case TYPE_PHASE:
             m_auiEncounter[2] = uiData;
             break;
         case TYPE_ENCOUNTER:
             m_auiEncounter[3] = uiData;
             break;
         case TYPE_WING:
             m_auiEncounter[4] = uiData;
             break;
         case TYPE_BONUS:
             m_auiEncounter[5] = uiData;
             if(uiData == IN_PROGRESS)
             {
               if(Creature* Corruptor = GetSingleCreatureFromStorage(NPC_INFINITE_CORRUPTOR))
                  Corruptor->SetPhaseMask(1, true);
               DoUpdateWorldState(WORLD_STATE_COS_TIME_ON, 1);
               DoUpdateWorldState(WORLD_STATE_COS_TIME_COUNT, 25);  
             } 
             break;
         case TYPE_MALGANIS:
             m_auiEncounter[6] = uiData;
             if (uiData == DONE)
             {
                 DoRespawnGameObject(m_uiMalChestGUID, 30*MINUTE);
                 if (GameObject* pGo = GetSingleGameObjectFromStorage(GO_MALGANIS_CHEST))
                     pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND);
                 if (GameObject* pGo = GetSingleGameObjectFromStorage(GO_MALGANIS_CHEST_H))
                     pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND);                    
                 if (Creature* pChromi2 = GetSingleCreatureFromStorage(NPC_CHROMI02))
                     pChromi2->SetVisibility(VISIBILITY_OFF);
                 if (GameObject* pGo = GetSingleGameObjectFromStorage(GO_EXIT))
                     pGo->SetGoState(GO_STATE_ACTIVE);
             }
             break;
         case TYPE_ZOMBIEFEST:
             {
                 if(!m_bZombiefestInProgress)                   
                     m_bZombiefestInProgress = true;
             }
     }
 }
        bool SetBossState(uint32 type, EncounterState state) override
        {
            if (!InstanceScript::SetBossState(type, state))
                return false;

            switch (type)
            {
                case DATA_OPERA_PERFORMANCE:
                    if (state == DONE)
                    {
                        HandleGameObject(StageDoorLeftGUID, true);
                        HandleGameObject(StageDoorRightGUID, true);
                        if (GameObject* sideEntrance = instance->GetGameObject(SideEntranceDoor))
                            sideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
                        UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, 16812, NULL);
                    }
                    break;
                case DATA_CHESS:
                    if (state == DONE)
                        DoRespawnGameObject(DustCoveredChest, DAY);
                    break;
                default:
                    break;
            }

            return true;
        }
예제 #15
0
    void SetData(uint32 uiType, uint32 uiData)
    {
        switch(uiType)
        {
            case TYPE_TRIBUNAL:
                m_auiEncounter[0] = uiData;
                if (uiData == DONE)
                    DoRespawnGameObject(m_uiTribunalChestGUID);
                break;
            case TYPE_MAIDEN:
                m_auiEncounter[1] = uiData;
                break;
            case TYPE_KRYSTALLUS:
                m_auiEncounter[2] = uiData;
                break;
            case TYPE_SJONNIR:
                m_auiEncounter[3] = uiData;
                break;
        }

        // should be opened by Brann Bronzebeard in escort event
        if (m_auiEncounter[1] == DONE && m_auiEncounter[2] == DONE)
        {
            if (GameObject *pGo = instance->GetGameObject(m_uiSjonnirDoorGUID))
                pGo->SetGoState(GO_STATE_ACTIVE);
        }
    }
void instance_wailing_caverns::OnPlayerEnter(Player* pPlayer)
{
    // Respawn the Mysterious chest if one of the players who enter the instance has the quest in his log
    if (pPlayer->GetQuestStatus(QUEST_FORTUNE_AWAITS) == QUEST_STATUS_COMPLETE &&
            !pPlayer->GetQuestRewardStatus(QUEST_FORTUNE_AWAITS))
        DoRespawnGameObject(GO_MYSTERIOUS_CHEST, HOUR);
}
            bool SetBossState(uint32 type, EncounterState state)
            {
			    if (!InstanceScript::SetBossState(type, state))
				    return false;

                switch (type)
                {
                    case DATA_MUROZOND:
                        if (state == DONE)
                            DoRespawnGameObject(uiMurozondCacheGUID, DAY);
                        break;
                    case DATA_ECHO_OF_JAINA:
                    case DATA_ECHO_OF_BAINE:
                    case DATA_ECHO_OF_TYRANDE:
                    case DATA_ECHO_OF_SYLVANAS:
                        if (state == DONE)
                        {
                            if (first_encounter != DONE)
                                first_encounter = DONE;
                            else
                                second_encounter = DONE;

                            SaveToDB();
                        }
                        break;
                }

			    return true;
            }
void instance_molten_core::SetData(uint32 uiType, uint32 uiData)
{
    switch (uiType)
    {
        case TYPE_LUCIFRON:
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_MAGMADAR:
        case TYPE_GEHENNAS:
        case TYPE_GARR:
        case TYPE_SHAZZRAH:
        case TYPE_GEDDON:
        case TYPE_GOLEMAGG:
        case TYPE_SULFURON:
            m_auiEncounter[uiType] = uiData;
            if (uiData == DONE)
            {
                for (auto m_aMoltenCoreRune : m_aMoltenCoreRunes)
                {
                    if (m_aMoltenCoreRune.m_uiType == uiType)
                    {
                        if (GameObject* pGo = GetSingleGameObjectFromStorage(m_aMoltenCoreRune.m_uiFlamesCircleEntry))
                            pGo->SetLootState(GO_JUST_DEACTIVATED);
                        break;
                    }
                }
            }
            break;
        case TYPE_MAJORDOMO:
            m_auiEncounter[uiType] = uiData;
            if (uiData == DONE)
                DoRespawnGameObject(GO_CACHE_OF_THE_FIRE_LORD, HOUR);
            break;
        case TYPE_RAGNAROS:
            m_auiEncounter[uiType] = uiData;
            break;
    }

    // Check if Majordomo can be summoned
    if (uiData == SPECIAL)
        DoSpawnMajordomoIfCan(false);

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

        m_strInstData = saveStream.str();

        SaveToDB();
        OUT_SAVE_INST_DATA_COMPLETE;
    }
}
void instance_molten_core::SetData(uint32 uiType, uint32 uiData)
{
    switch (uiType)
    {
        case TYPE_LUCIFRON:
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_MAGMADAR:
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_GEHENNAS:
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_GARR:
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_SHAZZRAH:
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_GEDDON:
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_GOLEMAGG:
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_SULFURON:
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_MAJORDOMO:
            m_auiEncounter[uiType] = uiData;
            if (uiData == DONE)
                DoRespawnGameObject(GO_CACHE_OF_THE_FIRE_LORD, HOUR);
            break;
        case TYPE_RAGNAROS:
            m_auiEncounter[uiType] = uiData;
            break;
    }

    // Check if Majordomo can be summoned
    if (uiData == SPECIAL)
        DoSpawnMajordomoIfCan(false);

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

        m_strInstData = saveStream.str();

        SaveToDB();
        OUT_SAVE_INST_DATA_COMPLETE;
    }
}
예제 #20
0
    void SetData(uint32 uiType, uint32 uiData)
    {
        switch(uiType)
        {
            case TYPE_MALYGOS:
            {
                if (uiData == NOT_STARTED)
                {
                    if (GameObject* pFocusingIris = instance->GetGameObject(m_uiFocusingIrisGUID))
                    {
                        pFocusingIris->SetGoState(GO_STATE_READY);
                        pFocusingIris->SetPhaseMask(1, true);
                    }
                    if (GameObject* pExitPortal = instance->GetGameObject(m_uiExitPortalGUID))
                        pExitPortal->SetPhaseMask(1, true);
                    if (GameObject* pPlatform = instance->GetGameObject(m_uiPlatformGUID))
                        pPlatform->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK_11);
                }
                if (uiData == IN_PROGRESS)
                {
                    if (GameObject* pFocusingIris = instance->GetGameObject(m_uiFocusingIrisGUID))
                        pFocusingIris->SetPhaseMask(2, true);
                    if (GameObject* pExitPortal = instance->GetGameObject(m_uiExitPortalGUID))
                        pExitPortal->SetPhaseMask(2, true);
                }
                if (uiData == DONE)
                {
                    if (GameObject* pExitPortal = instance->GetGameObject(m_uiExitPortalGUID))
                        pExitPortal->SetPhaseMask(1, true);
                    DoRespawnGameObject(m_uiGiftGUID, HOUR*IN_MILLISECONDS);
                    DoRespawnGameObject(m_uiHeartGUID, HOUR*IN_MILLISECONDS);
                }
                m_auiEncounter[0] = uiData;
                break;
            }
        }
        OUT_SAVE_INST_DATA;
        std::ostringstream saveStream;
        saveStream << m_auiEncounter[0];

        strInstData = saveStream.str();
        SaveToDB();
        OUT_SAVE_INST_DATA_COMPLETE;

    }
    void SetData(uint32 uiType, uint32 uiData)
    {
        sLog.outDebug("TSCR: Instance Ramparts: SetData received for type %u with data %u",uiType,uiData);

        switch(uiType)
        {
            case TYPE_VAZRUDEN:
                if (uiData == DONE && m_auiEncounter[1] == DONE)
                    DoRespawnGameObject(instance->IsHeroic() ? m_uiChestHGUID : m_uiChestNGUID, HOUR*IN_MILLISECONDS);
                m_auiEncounter[0] = uiData;
                break;
            case TYPE_NAZAN:
                if (uiData == DONE && m_auiEncounter[0] == DONE)
                    DoRespawnGameObject(instance->IsHeroic() ? m_uiChestHGUID : m_uiChestNGUID, HOUR*IN_MILLISECONDS);
                m_auiEncounter[1] = uiData;
                break;
        }
    }
예제 #22
0
/// Function that respawns a despawned GO that is stored in m_mGoEntryGuidStore
void ScriptedInstance::DoRespawnGameObject(uint32 uiEntry, uint32 uiTimeToDespawn)
{
    EntryGuidMap::iterator find = m_mGoEntryGuidStore.find(uiEntry);
    if (find != m_mGoEntryGuidStore.end())
        DoRespawnGameObject(find->second, uiTimeToDespawn);
    else
        // Output log, possible reason is not added GO to storage, or not yet loaded;
        debug_log("SD2: Script call DoRespawnGameObject(by Entry), but no gameobject of entry %u was created yet, or it was not stored by script for map %u.", uiEntry, instance->GetId());
}
예제 #23
0
void instance_eye_of_eternity::JustDidDialogueStep(int32 iEntry)
{
    switch (iEntry)
    {
        case SPELL_ALEXSTRASZAS_GIFT_BEAM:
            if (Creature* pAlextrasza = GetSingleCreatureFromStorage(NPC_ALEXSTRASZA))
                pAlextrasza->CastSpell(pAlextrasza, SPELL_ALEXSTRASZAS_GIFT_BEAM, false);
            break;
        case NPC_ALEXSTRASZAS_GIFT:
            if (Creature* pGift = GetSingleCreatureFromStorage(NPC_ALEXSTRASZAS_GIFT))
                pGift->CastSpell(pGift, SPELL_ALEXSTRASZAS_GIFT_VISUAL, false);
            DoRespawnGameObject(instance->IsRegularDifficulty() ? GO_ALEXSTRASZAS_GIFT : GO_ALEXSTRASZAS_GIFT_H, 30 * MINUTE);
            break;
        case GO_PLATFORM:
            // ToDo: respawn the platform and the portal
            DoRespawnGameObject(instance->IsRegularDifficulty() ? GO_HEART_OF_MAGIC : GO_HEART_OF_MAGIC_H, 30 * MINUTE);
            break;
    }
}
예제 #24
0
void instance_sunken_temple::DoSpawnAtalarionIfCan()
{
    // return if already summoned
    if (m_uiAtalarionGUID)
        return;

    Player* pPlayer = GetPlayerInMap();
    if (!pPlayer)
        return;

    pPlayer->SummonCreature(NPC_ATALARION, aSunkenTempleLocation[0].m_fX, aSunkenTempleLocation[0].m_fY, aSunkenTempleLocation[0].m_fZ, aSunkenTempleLocation[0].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0);

    // Spawn the idol of Hakkar
    DoRespawnGameObject(m_uiIdolOfHakkarGUID, 30 * MINUTE);

    // Spawn the big green lights
    for (std::list<uint64>::const_iterator itr = m_luiBigLightGUIDs.begin(); itr != m_luiBigLightGUIDs.end(); ++itr)
        DoRespawnGameObject(*itr, 30*MINUTE*IN_MILLISECONDS);
}
예제 #25
0
    void SetData(uint32 uiType, uint32 uiData)
    {
        switch (uiType)
        {
            case TYPE_SULFURON:
                m_auiEncounter[0] = uiData;
                break;
            case TYPE_GEDDON:
                m_auiEncounter[1] = uiData;
                break;
            case TYPE_SHAZZRAH:
                m_auiEncounter[2] = uiData;
                break;
            case TYPE_GOLEMAGG:
                m_auiEncounter[3] = uiData;
                break;
            case TYPE_GARR:
                m_auiEncounter[4] = uiData;
                break;
            case TYPE_MAGMADAR:
                m_auiEncounter[5] = uiData;
                break;
            case TYPE_GEHENNAS:
                m_auiEncounter[6] = uiData;
                break;
            case TYPE_LUCIFRON:
                m_auiEncounter[7] = uiData;
                break;
            case TYPE_MAJORDOMO:
                if (uiData == DONE)
                    DoRespawnGameObject(m_uiFirelordCacheGUID);
                m_auiEncounter[8] = uiData;
                break;
            case TYPE_RAGNAROS:
                m_auiEncounter[9] = 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_auiEncounter[4] << " " << m_auiEncounter[5] << " "
                << m_auiEncounter[6] << " " << m_auiEncounter[7] << " " << m_auiEncounter[8] << " "
                << m_auiEncounter[9];

            strInstData = saveStream.str();

            SaveToDB();
            OUT_SAVE_INST_DATA_COMPLETE;
        }
    }
예제 #26
0
        bool SetBossState(uint32 id, EncounterState state)
        {
            if (!InstanceScript::SetBossState(id, state))
                return false;

            switch (id)
            {
                case BOSS_KOLOGARN:
                    if (state == DONE)
                        HandleGameObject(uiKologarnBridge, false);
                    break;
                case BOSS_HODIR:
                    CheckKeepersState();
                    break;
                case BOSS_THORIM:
                    if (GameObject* pThorimLever = instance->GetGameObject(uiThorimLever))
                    {
                        if (state == IN_PROGRESS)
                            pThorimLever->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1);
                    }
                    CheckKeepersState();
                    break;
                case BOSS_MIMIRON:
                    CheckKeepersState();
                    break;
                case BOSS_FREYA:
                    CheckKeepersState();
                    break;
                case BOSS_VEZAX:
                    if (state == DONE)
                    {
                        // Keeper's Images
                        if (Creature* pFreya = instance->GetCreature(uiFreyaImage))
                            pFreya->SetVisible(true);
                        if (Creature* pThorim = instance->GetCreature(uiThorimImage))
                            pThorim->SetVisible(true);
                        if (Creature* pMimiron = instance->GetCreature(uiMimironImage))
                            pMimiron->SetVisible(true);
                        if (Creature* pHodir = instance->GetCreature(uiHodirImage))
                            pHodir->SetVisible(true);
                    }
                    break;
                case BOSS_ALGALON:
                    if (GameObject* pCelestialDoor = instance->GetGameObject(uiCelestialDoor))
                        pCelestialDoor->SetGoState(GO_STATE_READY);
                    if (GameObject* pUniverseFloorCelestial = instance->GetGameObject(uiUniverseFloorCelestial))
                        pUniverseFloorCelestial->SetGoState(GO_STATE_READY);
                    if (state == DONE)
                        DoRespawnGameObject(uiAlagonLoot, 30*MINUTE);
                    break;
            }

            return true;
        }
예제 #27
0
        void SetData(uint32 type, uint32 Data)
        {
            switch (type)
            {
                case TYPE_ATTUMEN:              Encounter[0] = Data; break;
                case TYPE_MOROES:
                    if (Encounter[1] == DONE)
                        break;
                    Encounter[1] = Data;
                    break;
                case TYPE_MAIDEN:               Encounter[2] = Data; break;
                case TYPE_OPTIONAL_BOSS:        Encounter[3] = Data; break;
                case TYPE_OPERA:
                    Encounter[4] = Data;
                    if (Data == DONE)
                        UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, 16812, NULL);
                    break;
                case TYPE_CURATOR:              Encounter[5] = Data; break;
                case TYPE_ARAN:                 Encounter[6] = Data; break;
                case TYPE_TERESTIAN:            Encounter[7] = Data; break;
                case TYPE_NETHERSPITE:          Encounter[8] = Data; break;
                case TYPE_CHESS:
                    if (Data == DONE)
                        DoRespawnGameObject(DustCoveredChest, DAY);
                    Encounter[9]  = Data;
                    break;
                case TYPE_MALCHEZZAR:           Encounter[10] = Data; break;
                case TYPE_NIGHTBANE:
                    if (Encounter[11] != DONE)
                        Encounter[11] = Data;
                    break;
                case DATA_OPERA_OZ_DEATHCOUNT:
                    if (Data == SPECIAL)
                        ++OzDeathCount;
                    else if (Data == IN_PROGRESS)
                        OzDeathCount = 0;
                    break;
            }

            if (Data == DONE)
            {
                OUT_SAVE_INST_DATA;

                std::ostringstream saveStream;
                saveStream << Encounter[0] << ' ' << Encounter[1] << ' ' << Encounter[2] << ' '
                    << Encounter[3] << ' ' << Encounter[4] << ' ' << Encounter[5] << ' ' << Encounter[6] << ' '
                    << Encounter[7] << ' ' << Encounter[8] << ' ' << Encounter[9] << ' ' << Encounter[10] << ' ' << Encounter[11];

                strSaveData = saveStream.str();

                SaveToDB();
                OUT_SAVE_INST_DATA_COMPLETE;
            }
        }
예제 #28
0
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;
    }
}
 void SetData(uint32 uiType, uint32 uiData)
 {
     switch(uiType)
     {
         case TYPE_QUEST:
             m_auiEncounter[0] = uiData;
             break; 
         case TYPE_CRATES_COUNT:
             m_uiCratesCount = m_uiCratesCount + uiData;
             if(m_uiCratesCount == 5)
             {
                m_auiEncounter[0] = DONE;
                ChromiWhispers();
             }
             DoUpdateWorldState(WORLD_STATE_COS_CRATE_COUNT, m_uiCratesCount);
             break;
         case TYPE_INTRO:
             m_auiEncounter[1] = uiData;
             break;
         case TYPE_PHASE:
             m_auiEncounter[2] = uiData;
             break;
         case TYPE_ENCOUNTER:
             m_auiEncounter[3] = uiData;
             break;
         case TYPE_WING:
             m_auiEncounter[4] = uiData;
             break;
         case TYPE_BONUS:
             m_auiEncounter[5] = uiData;
             if(uiData == IN_PROGRESS)
             {
               if(Creature* Corruptor = instance->GetCreature(m_uiCorruptorGUID))
                  Corruptor->SetPhaseMask(1, true);
               DoUpdateWorldState(WORLD_STATE_COS_TIME_ON, 1);
               DoUpdateWorldState(WORLD_STATE_COS_TIME_COUNT, 25);  
             } 
             break;
         case TYPE_MALGANIS:
             m_auiEncounter[6] = uiData;
             if (uiData == DONE)
             {
                 DoRespawnGameObject(m_uiMalChestGUID, 30*MINUTE);
                 if (GameObject* pGo = instance->GetGameObject(m_uiMalChestGUID))
                     pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND);
                 if (Creature* pChromi2 = instance->GetCreature(m_uiChromi02GUID))
                     pChromi2->SetVisibility(VISIBILITY_OFF);
                 if (GameObject* pGo = instance->GetGameObject(m_uiExitGUID))
                     pGo->SetGoState(GO_STATE_ACTIVE);
             }
             break;
     }
 }
void instance_eye_of_eternity::JustDidDialogueStep(int32 iEntry)
{
    switch (iEntry)
    {
        case SPELL_ALEXSTRASZAS_GIFT_BEAM:
            if (Creature* pAlextrasza = GetSingleCreatureFromStorage(NPC_ALEXSTRASZA))
                pAlextrasza->CastSpell(pAlextrasza, SPELL_ALEXSTRASZAS_GIFT_BEAM, TRIGGERED_NONE);
            break;
        case NPC_ALEXSTRASZAS_GIFT:
            if (Creature* pGift = GetSingleCreatureFromStorage(NPC_ALEXSTRASZAS_GIFT))
                pGift->CastSpell(pGift, SPELL_ALEXSTRASZAS_GIFT_VISUAL, TRIGGERED_NONE);
            DoRespawnGameObject(instance->IsRegularDifficulty() ? GO_ALEXSTRASZAS_GIFT : GO_ALEXSTRASZAS_GIFT_H, 30 * MINUTE);
            break;
        case GO_PLATFORM:
            // ToDo: respawn the portal
            if (GameObject* pPlatform = GetSingleGameObjectFromStorage(GO_PLATFORM))
                pPlatform->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK_11);
            // Spawn the Heart of Malygos
            DoRespawnGameObject(instance->IsRegularDifficulty() ? GO_HEART_OF_MAGIC : GO_HEART_OF_MAGIC_H, 30 * MINUTE);
            break;
    }
}