// Function that spawns next scourge wave
void instance_culling_of_stratholme::DoSpawnNextScourgeWave()
{
    Creature* pSummoner = GetSingleCreatureFromStorage(NPC_ARTHAS);
    if (!pSummoner)
        return;

    DoOrSimulateScriptTextForThisInstance(m_aScourgeWavesLocs[m_uiCurrentUndeadPos].m_iYellId, NPC_LORDAERON_CRIER);

    for (uint8 i = 0; i < MAX_SCOURGE_TYPE_PER_WAVE; ++i)
    {
        // get the mob entry
        uint32 uiEntry = GetRandomMobOfType(uiScourgeWaveDef[m_uiScourgeWaveCount - 1][i]);
        if (!uiEntry)
            continue;

        float fX, fY, fZ, fO;
        fO = m_aScourgeWavesLocs[m_uiCurrentUndeadPos].m_fO;

        // bosses get exact location
        if (uiScourgeWaveDef[m_uiScourgeWaveCount - 1][i] == SCOURGE_TYPE_BOSS || uiScourgeWaveDef[m_uiScourgeWaveCount - 1][i] == SCOURGE_TYPE_ACOLYTES)
        {
            fX = m_aScourgeWavesLocs[m_uiCurrentUndeadPos].m_fX;
            fY = m_aScourgeWavesLocs[m_uiCurrentUndeadPos].m_fY;
            fZ = m_aScourgeWavesLocs[m_uiCurrentUndeadPos].m_fZ;
        }
        // random position around point
        else
            pSummoner->GetRandomPoint(m_aScourgeWavesLocs[m_uiCurrentUndeadPos].m_fX, m_aScourgeWavesLocs[m_uiCurrentUndeadPos].m_fY, m_aScourgeWavesLocs[m_uiCurrentUndeadPos].m_fZ, 5.0f, fX, fY, fZ);

        // special requirement for acolytes - spawn a pack of 4
        if (uiScourgeWaveDef[m_uiScourgeWaveCount - 1][i] == SCOURGE_TYPE_ACOLYTES)
        {
            for (uint8 j = 0; j < 4; ++j)
            {
                pSummoner->GetRandomPoint(m_aScourgeWavesLocs[m_uiCurrentUndeadPos].m_fX, m_aScourgeWavesLocs[m_uiCurrentUndeadPos].m_fY, m_aScourgeWavesLocs[m_uiCurrentUndeadPos].m_fZ, 5.0f, fX, fY, fZ);
                pSummoner->SummonCreature(uiEntry, fX, fY, fZ, fO, TEMPSUMMON_DEAD_DESPAWN, 0);
            }
        }
        // spawn the selected mob
        else
            pSummoner->SummonCreature(uiEntry, fX, fY, fZ, fO, TEMPSUMMON_DEAD_DESPAWN, 0);
    }

    // start infinite curruptor event on the first wave
    if (m_uiScourgeWaveCount == 1 && !instance->IsRegularDifficulty() && GetData(TYPE_INFINITE_CORRUPTER) != DONE)
        SetData(TYPE_INFINITE_CORRUPTER, IN_PROGRESS);

    // get a random position that is different from the previous one for the next round
    uint8 uiCurrentPos = urand(POS_FESTIVAL_LANE, POS_ELDERS_SQUARE);

    while (uiCurrentPos == m_uiCurrentUndeadPos)
        uiCurrentPos = urand(POS_FESTIVAL_LANE, POS_ELDERS_SQUARE);

    m_uiCurrentUndeadPos = uiCurrentPos;
}
Example #2
0
        void Update(uint32 uiDiff)
        {          
            if (GetData(TYPE_CROWN) == IN_PROGRESS)
            {
                if (spawnCrazedTimer <= uiDiff)
                {
                    if (Creature* hummel = instance->GetCreature(hummelGUID))
                        hummel->AI()->DoAction(ACTION_SPAWN_CRAZED);
                    spawnCrazedTimer = urand(2000, 5000);
                }
                else
                    spawnCrazedTimer -= uiDiff;
            }

            if (GetData(TYPE_FENRUS) != DONE)
                return;

            Creature* pArchmage = instance->GetCreature(uiArchmageArugalGUID);

            if (!pArchmage || !pArchmage->IsAlive())
                return;

            if (uiPhase)
            {
                if (uiTimer <= uiDiff)
                {
                    switch (uiPhase)
                    {
                        case 1:
                        {
                            Creature* summon = pArchmage->SummonCreature(pArchmage->GetEntry(), SpawnLocation[4], TEMPSUMMON_TIMED_DESPAWN, 10000);
                            summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
                            summon->SetReactState(REACT_DEFENSIVE);
                            summon->CastSpell(summon, SPELL_ASHCROMBE_TELEPORT, true);
                            summon->AI()->Talk(SAY_ARCHMAGE);
                            uiTimer = 2000;
                            uiPhase = 2;
                            break;
                        }
                        case 2:
                        {
                            pArchmage->SummonCreature(NPC_ARUGAL_VOIDWALKER, SpawnLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
                            pArchmage->SummonCreature(NPC_ARUGAL_VOIDWALKER, SpawnLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
                            pArchmage->SummonCreature(NPC_ARUGAL_VOIDWALKER, SpawnLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
                            pArchmage->SummonCreature(NPC_ARUGAL_VOIDWALKER, SpawnLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
                            uiPhase = 0;
                            break;
                        }

                    }
                } else uiTimer -= uiDiff;
            }
        }
// function which will handle the Flame Leviathan backup spawns
void instance_ulduar::DoCallLeviathanHelp()
{
    Creature* pLeviathan = GetSingleCreatureFromStorage(NPC_LEVIATHAN);
    if (!pLeviathan)
        return;

    for (uint8 i = 0; i < countof(afReinforcementsNormal); ++i)
        pLeviathan->SummonCreature(afReinforcementsNormal[i].uiAllyEntry, afReinforcementsNormal[i].fX, afReinforcementsNormal[i].fY, afReinforcementsNormal[i].fZ, afReinforcementsNormal[i].fO, TEMPSUMMON_DEAD_DESPAWN, 0, true);

    if (!instance->IsRegularDifficulty())
    {
        for (uint8 i = 0; i < countof(afReinforcementsHeroic); ++i)
            pLeviathan->SummonCreature(afReinforcementsHeroic[i].uiAllyEntry, afReinforcementsHeroic[i].fX, afReinforcementsHeroic[i].fY, afReinforcementsHeroic[i].fZ, afReinforcementsHeroic[i].fO, TEMPSUMMON_DEAD_DESPAWN, 0, true);
    }
}
        void Update(uint32 uiDiff)
        {
            if (GetData(TYPE_CROWN) == IN_PROGRESS)
            {
                if (uiSpawnCrazedTimer <= uiDiff)
                {
                    if (Creature* pHummel = instance->GetCreature(uiHummelGUID))
                        pHummel->AI()->DoAction(ACTION_SPAWN_CRAZED);
                    uiSpawnCrazedTimer = urand(5000, 7500);
                } else uiSpawnCrazedTimer -= uiDiff;
            }

            if (GetData(TYPE_FENRUS) != DONE)
                return;

            Creature* pArchmage = instance->GetCreature(uiArchmageArugalGUID);
            Creature* pSummon = NULL;

            if (!pArchmage || !pArchmage->isAlive())
                return;

            if (uiPhase)
            {
                if (uiTimer <= uiDiff)
                {
                    switch(uiPhase)
                    {
                    case 1:
                        pSummon = pArchmage->SummonCreature(pArchmage->GetEntry(),SpawnLocation[4],TEMPSUMMON_TIMED_DESPAWN,10000);
                        pSummon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
                        pSummon->SetReactState(REACT_DEFENSIVE);
                        pSummon->CastSpell(pSummon,SPELL_ASHCROMBE_TELEPORT,true);
                        DoScriptText(SAY_ARCHMAGE,pSummon);
                        uiTimer = 2000;
                        uiPhase = 2;
                        break;
                    case 2:
                        pArchmage->SummonCreature(NPC_ARUGAL_VOIDWALKER,SpawnLocation[0],TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000);
                        pArchmage->SummonCreature(NPC_ARUGAL_VOIDWALKER,SpawnLocation[1],TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000);
                        pArchmage->SummonCreature(NPC_ARUGAL_VOIDWALKER,SpawnLocation[2],TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000);
                        pArchmage->SummonCreature(NPC_ARUGAL_VOIDWALKER,SpawnLocation[3],TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000);
                        uiPhase = 0;
                        break;

                    }
                } else uiTimer -= uiDiff;
            }
        }
Example #5
0
        bool OnTrigger(Player* player, AreaTriggerEntry const*) override
        {
            if (InstanceScript* is = player->GetInstanceScript())
            {
                if (is->instance->IsHeroic())
                {
                    Creature* executioner = nullptr;

                    is->instance->LoadGrid(Executioner.GetPositionX(), Executioner.GetPositionY());
                    if (Creature* kargath = ObjectAccessor::GetCreature(*player, is->GetGuidData(NPC_KARGATH_BLADEFIST)))
                    {
                        if (is->GetGuidData(NPC_SHATTERED_EXECUTIONER).IsEmpty())
                        {
                            executioner = kargath->SummonCreature(NPC_SHATTERED_EXECUTIONER, Executioner);
                            kargath->AI()->DoAction(ACTION_EXECUTIONER_TAUNT);
                        }
                    }

                    if (executioner)
                        for (uint8 i = 0; i < VictimCount; ++i)
                            executioner->SummonCreature(executionerVictims[i](is->GetData(DATA_TEAM_IN_INSTANCE)), executionerVictims[i].GetPos());
                }
            }

            return false;
        }
Example #6
0
    bool EffectDummy(Unit* pCaster, uint32 uiSpellId, SpellEffectIndex uiEffIndex, Object* pTarget, ObjectGuid /*originalCasterGuid*/) override
    {
        Creature *pCreatureTarget = pTarget->ToCreature();
        if (!pCreatureTarget)
            return true;

        if (uiSpellId == SPELL_THROW_GORDAWG_BOULDER && uiEffIndex == EFFECT_INDEX_0)
        {
            for (int i = 0; i < 3; ++i)
            {
                if (irand(i, 2))                        // 2-3 summons
                {
                    pCreatureTarget->SummonCreature(NPC_MINION_OF_GUROK, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 5000);
                }
            }

            if (pCreatureTarget->getVictim())
            {
                pCaster->DealDamage(pCreatureTarget, pCreatureTarget->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
                return true;
            }

            // If not in combat, no xp or loot
            pCreatureTarget->SetDeathState(JUST_DIED);
            pCreatureTarget->SetHealth(0);
            return true;
        }
        return true;
    }
void instance_pit_of_saron::OnCreatureEnterCombat(Creature* pCreature)
{
    if (pCreature->GetEntry() == NPC_YMIRJAR_DEATHBRINGER)
    {
        ++m_uiAmbushAggroCount;

        // Summon the rest of the mobs at the 2nd ambush
        if (m_uiAmbushAggroCount == 2)
        {
            Creature* pTyrannus = GetSingleCreatureFromStorage(NPC_TYRANNUS_INTRO);
            if (!pTyrannus)
                return;

            DoScriptText(SAY_TYRANNUS_AMBUSH_2, pTyrannus);
            pTyrannus->SetWalk(false);
            pTyrannus->GetMotionMaster()->MovePoint(0, afTyrannusMovePos[2][0], afTyrannusMovePos[2][1], afTyrannusMovePos[2][2]);

            // Spawn Mobs
            for (uint8 i = 0; i < countof(aEventSecondAmbushLocations); ++i)
            {
                if (Creature* pSummon = pTyrannus->SummonCreature(aEventSecondAmbushLocations[i].uiEntryHorde, aEventSecondAmbushLocations[i].fX, aEventSecondAmbushLocations[i].fY,
                                        aEventSecondAmbushLocations[i].fZ, aEventSecondAmbushLocations[i].fO, TEMPSUMMON_DEAD_DESPAWN, 0))
                {
                    pSummon->SetWalk(false);
                    pSummon->GetMotionMaster()->MovePoint(1, aEventSecondAmbushLocations[i].fMoveX, aEventSecondAmbushLocations[i].fMoveY, aEventSecondAmbushLocations[i].fMoveZ);
                }
            }
        }
    }
}
Example #8
0
bool ProcessEventId_event_spell_call_captain(uint32 uiEventId, Object* pSource, Object* /*pTarget*/, bool bIsStart)
{
    if (bIsStart && pSource->GetTypeId() == TYPEID_UNIT)
    {
        Creature* pVaros = (Creature*)pSource;
        if (!pVaros)
            return false;

        // each guardian has it's own spawn position
        for (uint8 i = 0; i < MAX_CAPTAIN_EVENTS; ++i)
        {
            if (uiEventId == aVarosCaptainData[i].uiEventId)
            {
                if (Creature* pGuardian = pVaros->SummonCreature(NPC_AZURE_RING_CAPTAIN, aVarosCaptainData[i].fX, aVarosCaptainData[i].fY, aVarosCaptainData[i].fZ, aVarosCaptainData[i].fO, TEMPSUMMON_DEAD_DESPAWN, 0))
                {
                    pGuardian->SetWalk(false);
                    pGuardian->GetMotionMaster()->MovePoint(1, aVarosCaptainData[i].fDestX, aVarosCaptainData[i].fDestY, aVarosCaptainData[i].fDestZ);
                }

                return true;
            }
        }
    }

    return false;
}
Example #9
0
        void AddWave()
        {
			if(uiWaveCount <= 1){
				DoUpdateWorldState(WORLD_STATE_VH, 1);
			}
            
            DoUpdateWorldState(WORLD_STATE_VH_WAVE_COUNT, uiWaveCount);

            switch (uiWaveCount)
            {
                case 6:
                    if (uiFirstBoss == 0)
                        uiFirstBoss = urand(1, 6);
                    if (Creature* pSinclari = instance->GetCreature(uiSinclari))
                    {
                        if (Creature* pPortal = pSinclari->SummonCreature(CREATURE_TELEPORTATION_PORTAL, MiddleRoomPortalSaboLocation, TEMPSUMMON_CORPSE_DESPAWN))
                            uiSaboteurPortal = pPortal->GetGUID();
                        if (Creature* pAzureSaboteur = pSinclari->SummonCreature(CREATURE_SABOTEOUR, MiddleRoomLocation, TEMPSUMMON_DEAD_DESPAWN))
                            pAzureSaboteur->CastSpell(pAzureSaboteur, SABOTEUR_SHIELD_EFFECT, false);
                    }
                    break;
                case 12:
                    if (uiSecondBoss == 0)
                        do
                        {
                            uiSecondBoss = urand(1, 6);
                        } while (uiSecondBoss == uiFirstBoss);
                    if (Creature* pSinclari = instance->GetCreature(uiSinclari))
                    {
                        if (Creature* pPortal = pSinclari->SummonCreature(CREATURE_TELEPORTATION_PORTAL, MiddleRoomPortalSaboLocation, TEMPSUMMON_CORPSE_DESPAWN))
                            uiSaboteurPortal = pPortal->GetGUID();
                        if (Creature* pAzureSaboteur = pSinclari->SummonCreature(CREATURE_SABOTEOUR, MiddleRoomLocation, TEMPSUMMON_DEAD_DESPAWN))
                            pAzureSaboteur->CastSpell(pAzureSaboteur, SABOTEUR_SHIELD_EFFECT, false);
                    }
                    break;
                case 18:
                {
                    Creature* pSinclari = instance->GetCreature(uiSinclari);
                    if (pSinclari)
                        pSinclari->SummonCreature(CREATURE_CYANIGOSA, CyanigosasSpawnLocation, TEMPSUMMON_DEAD_DESPAWN);
						uiCyanigosaEventPhase = 1;
                    break;
                }
                case 1:
                {
                    if (GameObject* pMainDoor = instance->GetGameObject(uiMainDoor))
                        pMainDoor->SetGoState(GO_STATE_READY);
                    DoUpdateWorldState(WORLD_STATE_VH_PRISON_STATE, 100);
                }
                default:
                    SpawnPortal();
                    break;
            }
        }
        void Update(uint32 uiDiff)
        {
            if (GetData(TYPE_FENRUS) != DONE)
                return;

            Creature* pArchmage = instance->GetCreature(uiArchmageArugalGUID);

            if (!pArchmage || !pArchmage->isAlive())
                return;

            if (uiPhase)
            {
                if (uiTimer <= uiDiff)
                {
                    switch (uiPhase)
                    {
                        case 1:
                        {
                            Creature* summon = pArchmage->SummonCreature(pArchmage->GetEntry(), SpawnLocation[4], TEMPSUMMON_TIMED_DESPAWN, 10000);
                            summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
                            summon->SetReactState(REACT_DEFENSIVE);
                            summon->CastSpell(summon, SPELL_ASHCROMBE_TELEPORT, true);
                            DoScriptText(SAY_ARCHMAGE, summon);
                            uiTimer = 2000;
                            uiPhase = 2;
                            break;
                        }
                        case 2:
                        {
                            pArchmage->SummonCreature(NPC_ARUGAL_VOIDWALKER, SpawnLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
                            pArchmage->SummonCreature(NPC_ARUGAL_VOIDWALKER, SpawnLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
                            pArchmage->SummonCreature(NPC_ARUGAL_VOIDWALKER, SpawnLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
                            pArchmage->SummonCreature(NPC_ARUGAL_VOIDWALKER, SpawnLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
                            uiPhase = 0;
                            break;
                        }

                    }
                } else uiTimer -= uiDiff;
            }
        }
Example #11
0
        void ProcessEvent(Unit* /*unit*/, uint32 eventId)
        {
            if (eventId != EVENT_CALL_DRAGON)
                return;

            Creature* varos = instance->GetCreature(varosGUID);

            if (!varos)
                return;

            if (Creature* drake = varos->SummonCreature(NPC_AZURE_RING_GUARDIAN, varos->GetPositionX(), varos->GetPositionY(), varos->GetPositionZ()+40))
                drake->AI()->DoAction(ACTION_CALL_DRAGON_EVENT);
        }
        void Update(uint32 Diff)
        {
            if (GetData(TYPE_FENRUS) != DONE)
                return;

            Creature* archmage = instance->GetCreature(ArchmageArugalGUID);
            Creature* summon = NULL;

            if (!archmage || !archmage->isAlive())
                return;

            if (Phase)
            {
                if (Timer <= Diff)
                {
                    switch (Phase)
                    {
                    case 1:
                        summon = archmage->SummonCreature(archmage->GetEntry(), SpawnLocation[4], TEMPSUMMON_TIMED_DESPAWN, 10000);
                        summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
                        summon->SetReactState(REACT_DEFENSIVE);
                        summon->CastSpell(summon, SPELL_ASHCROMBE_TELEPORT, true);
                        DoScriptText(SAY_ARCHMAGE, summon);
                        Timer = 2000;
                        Phase = 2;
                        break;
                    case 2:
                        archmage->SummonCreature(NPC_ARUGAL_VOIDWALKER, SpawnLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
                        archmage->SummonCreature(NPC_ARUGAL_VOIDWALKER, SpawnLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
                        archmage->SummonCreature(NPC_ARUGAL_VOIDWALKER, SpawnLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
                        archmage->SummonCreature(NPC_ARUGAL_VOIDWALKER, SpawnLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
                        Phase = 0;
                        break;
                    }
                } else Timer -= Diff;
            }
        }
    void KillHostage(uint8 index)
    {
        if(!HostagesGUID[index])
            return;
        Creature *hostage = (Creature*)(instance->GetUnit(HostagesGUID[index]));
        if(!hostage)
            return;

        WorldLocation wLoc;
        hostage->GetPosition(wLoc);
        Creature *corpse = hostage->SummonCreature(HostageInfo[index].deadnpc, wLoc.coord_x, wLoc.coord_y, wLoc.coord_z, wLoc.orientation, TEMPSUMMON_MANUAL_DESPAWN, 0);
        if(corpse)
        {
            corpse->SetStandState(UNIT_STAND_STATE_DEAD);
            // TODO: add some burn effect
        }
        hostage->Kill(hostage, false);
        hostage->RemoveCorpse();
    }
void instance_pit_of_saron::DoStartAmbushEvent()
{
    Creature* pTyrannus = GetSingleCreatureFromStorage(NPC_TYRANNUS_INTRO);
    if (!pTyrannus)
        return;

    DoScriptText(SAY_TYRANNUS_AMBUSH_1, pTyrannus);

    // Spawn Mobs
    for (uint8 i = 0; i < countof(aEventFirstAmbushLocations); ++i)
    {
        if (Creature* pSummon = pTyrannus->SummonCreature(aEventFirstAmbushLocations[i].uiEntryHorde, aEventFirstAmbushLocations[i].fX, aEventFirstAmbushLocations[i].fY,
                                aEventFirstAmbushLocations[i].fZ, aEventFirstAmbushLocations[i].fO, TEMPSUMMON_DEAD_DESPAWN, 0))
        {
            pSummon->SetWalk(false);
            pSummon->GetMotionMaster()->MovePoint(1, aEventFirstAmbushLocations[i].fMoveX, aEventFirstAmbushLocations[i].fMoveY, aEventFirstAmbushLocations[i].fMoveZ);
        }
    }
}
Example #15
0
void instance_sethekk_halls::FinishAnzuIntro()
{
    Creature* target = GetSingleCreatureFromStorage(NPC_INVIS_RAVEN_GOD_TARGET, true);
    target->SummonCreature(NPC_ANZU, -89.20406f, 287.9736f, 26.5665f, 3.001966f, TEMPSPAWN_MANUAL_DESPAWN, 0);
    static_cast<TemporarySpawn*>(target)->UnSummon();
    GuidVector casterVector;
    GetCreatureGuidVectorFromStorage(NPC_INVIS_RAVEN_GOD_CASTER, casterVector);
    for (ObjectGuid guid : casterVector)
        if (Creature* caster = instance->GetCreature(guid))
            static_cast<TemporarySpawn*>(caster)->UnSummon();
    Creature* portal = GetSingleCreatureFromStorage(NPC_INVIS_RAVEN_GOD_PORTAL, true);
    static_cast<TemporarySpawn*>(portal)->UnSummon();
    GameObject* ravensClaw = GetSingleGameObjectFromStorage(GO_RAVENS_CLAW);
    ravensClaw->SetRespawnTime(7 * DAY);
    ravensClaw->SetLootState(GO_JUST_DEACTIVATED);
    GameObject* moonstone = GetSingleGameObjectFromStorage(GO_MOONSTONE);
    moonstone->SetLootState(GO_JUST_DEACTIVATED);
    GameObject* testRift = GetSingleGameObjectFromStorage(GO_TEST_RIFT);
    testRift->SetLootState(GO_JUST_DEACTIVATED);
}
    void AddWave()
    {
        DoUpdateWorldState(WORLD_STATE_VH, 1);
        DoUpdateWorldState(WORLD_STATE_VH_WAVE_COUNT, uiWaveCount);
        DoUpdateWorldState(WORLD_STATE_VH_PRISON_STATE, 100); // TODO

        switch (uiWaveCount)
        {
            case 6:
                if (uiFirstBoss == 0)
                    uiFirstBoss = urand(1,6);
                StartBossEncounter(uiFirstBoss);
                break;
            case 12:
                if (uiSecondBoss == 0)
                    do 
                    {
                        uiSecondBoss = urand(1,6);
                    } while (uiSecondBoss == uiFirstBoss);
                StartBossEncounter(uiSecondBoss);
                break;
            case 18:
            {
                Creature *pSinclari = instance->GetCreature(uiSinclari);
                if (pSinclari)
                    pSinclari->SummonCreature(CREATURE_CYANIGOSA,PortalLocation[0],TEMPSUMMON_DEAD_DESPAWN);
                break;
            }
            case 1:
            {
                if (GameObject* pMainDoor = instance->GetGameObject(uiMainDoor))
                    pMainDoor->SetGoState(GO_STATE_READY);
            }
            default:
                if (!bWiped)
                    SpawnPortal();
                bWiped = false;
                break;
        }
    }
void instance_blackfathom_deeps::DoSpawnMobs(uint8 uiWaveIndex)
{
    Creature* pKelris = instance->GetCreature(m_uiKelrisGUID);
    if (!pKelris)
        return;

    float fX_resp, fY_resp, fZ_resp;

    pKelris->GetRespawnCoord(fX_resp, fY_resp, fZ_resp);

    for (uint8 i = 0; i < sizeof(aWaveSummonInformation) / sizeof(SummonInformation); ++i)
    {
        if (aWaveSummonInformation[i].m_uiWaveIndex != uiWaveIndex)
            continue;

        // Summon mobs at positions
        for (uint8 j = 0; j < MAX_COUNT_POS; ++j)
        {
            for (uint8 k = 0; k < aWaveSummonInformation[i].m_aCountAndPos[j].m_uiCount; ++k)
            {
                uint8 uiPos = aWaveSummonInformation[i].m_aCountAndPos[j].m_uiSummonPosition;
                float fPosX = aSpawnLocations[uiPos].m_fX;
                float fPosY = aSpawnLocations[uiPos].m_fY;
                float fPosZ = aSpawnLocations[uiPos].m_fZ;
                float fPosO = aSpawnLocations[uiPos].m_fO;

                // Adapt fPosY slightly in case of higher summon-counts
                if (aWaveSummonInformation[i].m_aCountAndPos[j].m_uiCount > 1)
                    fPosY = fPosY - INTERACTION_DISTANCE / 2 + k * INTERACTION_DISTANCE / aWaveSummonInformation[i].m_aCountAndPos[j].m_uiCount;

                if (Creature* pSummoned = pKelris->SummonCreature(aWaveSummonInformation[i].m_uiNpcEntry, fPosX, fPosY, fPosZ, fPosO, TEMPSUMMON_DEAD_DESPAWN, 0))
                {
                    pSummoned->GetMotionMaster()->MovePoint(0, fX_resp, fY_resp, fZ_resp);
                    m_lWaveMobsGuids[uiWaveIndex].push_back(pSummoned->GetGUIDLow());
                }
            }
        }
    }
}
void instance_blackfathom_deeps::DoSpawnMobs(uint8 uiWaveIndex)
{
    Creature* pKelris = GetSingleCreatureFromStorage(NPC_KELRIS);
    if (!pKelris || !pKelris->IsInWorld() || uiWaveIndex >= MAX_FIRES)
        return;

    float fX_resp, fY_resp, fZ_resp;

    pKelris->GetRespawnCoord(fX_resp, fY_resp, fZ_resp);

    for (uint8 i = 0; i < SUMMONS_COUNT; ++i)
    {
        if (aWaveSummonInformation[i].m_uiWaveIndex != uiWaveIndex)
            continue;

        // Summon mobs at positions
        for (uint8 j = 0; j < MAX_COUNT_POS; ++j)
        {
            for (uint8 k = 0; k < aWaveSummonInformation[i].m_aCountAndPos[j].m_uiCount; ++k)
            {
                uint8 uiPos = aWaveSummonInformation[i].m_aCountAndPos[j].m_uiSummonPosition;
                float fPosX = aSpawnLocations[uiPos].x;
                float fPosY = aSpawnLocations[uiPos].y;
                float fPosZ = aSpawnLocations[uiPos].z;
                float fPosO = aSpawnLocations[uiPos].o;

                // Adapt fPosY slightly in case of higher summon-counts
                if (aWaveSummonInformation[i].m_aCountAndPos[j].m_uiCount > 1)
                    fPosY = fPosY - INTERACTION_DISTANCE / 2 + k * INTERACTION_DISTANCE / aWaveSummonInformation[i].m_aCountAndPos[j].m_uiCount;

                if (Creature* pSummoned = pKelris->SummonCreature(aWaveSummonInformation[i].m_uiNpcEntry, fPosX, fPosY, fPosZ, fPosO, TEMPSUMMON_DEAD_DESPAWN, 0))
                {
                    pSummoned->GetMotionMaster()->MovePoint(0, fX_resp, fY_resp, fZ_resp);
                    m_lWaveMobsGuids[uiWaveIndex].push_back(pSummoned->GetObjectGuid());
                }
            }
        }
    }
}
    bool EffectDummy(Unit* pCaster, uint32 uiSpellId, SpellEffectIndex uiEffIndex, Object* pTarget, ObjectGuid /*originalCasterGuid*/) override
    {
        // always check spellid and effectindex
        if (uiSpellId == SPELL_JULES_RELEASE_DARKNESS && uiEffIndex == EFFECT_INDEX_0 && pTarget->GetEntry() == NPC_COLONEL_JULES)
        {
            Creature *pCreatureTarget = pTarget->ToCreature();
            Creature* pAnchorite = GetClosestCreatureWithEntry(pCreatureTarget, NPC_ANCHORITE_BARADA, 15.0f);
            if (!pAnchorite)
                return false;

            // get random point around the Anchorite
            float fX, fY, fZ;
            pCreatureTarget->GetNearPoint(pCreatureTarget, fX, fY, fZ, 5.0f, 10.0f, frand(0, M_PI_F / 2));

            // spawn a Darkness Released npc and move around the room
            if (Creature* pDarkness = pCreatureTarget->SummonCreature(NPC_DARKNESS_RELEASED, 0, 0, 0, 0, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 20000))
                pDarkness->GetMotionMaster()->MovePoint(0, fX, fY, fZ);

            // always return true when we are handling this spell and effect
            return true;
        }

        return false;
    }
Example #20
0
    void SetData(uint32 type, uint32 data)
    {
        switch(type)
        {
            case DATA_RAGEWINTERCHILLEVENT: Encounters[0] = data; break;
            case DATA_ANETHERONEVENT:       
                Encounters[1] = data;                
                break;
            case DATA_KAZROGALEVENT:        Encounters[2] = data; break;
            case DATA_AZGALOREVENT:    
                {
                    Encounters[3] = data; 
                    if(data==DONE)
                    {                    
                        if(ArchiYell)break;
                        ArchiYell = true;

                        Creature* pCreature = instance->GetCreatureInMap(Azgalor);
                        if(pCreature)
                        {                    
                            Creature* pUnit = pCreature->SummonCreature(21987,pCreature->GetPositionX(),pCreature->GetPositionY(),pCreature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,10000);
            
                            Map *map = pCreature->GetMap();
                            if (map->IsDungeon() && pUnit)
                            {
                                pUnit->SetVisibility(VISIBILITY_OFF);
                                Map::PlayerList const &PlayerList = map->GetPlayers();
                                if (PlayerList.isEmpty())
                                     return;
                              
                                for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
                                {
                                     if (i->getSource())
                                     {
                                        WorldPacket data(SMSG_MESSAGECHAT, 200);                
                                        pUnit->BuildMonsterChat(&data,CHAT_MSG_MONSTER_YELL,"All of your efforts have been in vain, for the draining of the World Tree has already begun. Soon the heart of your world will beat no more.",0,"Archimonde",i->getSource()->GetGUID());
                                        i->getSource()->GetSession()->SendPacket(&data);

                                        WorldPacket data2(SMSG_PLAY_SOUND, 4);
                                        data2 << 10986;
                                        i->getSource()->GetSession()->SendPacket(&data2);
                                     }
                                }
                            }
                        }
                    }
                }
                break;
            case DATA_ARCHIMONDEEVENT:      Encounters[4] = data; break;
            case DATA_RESET_TRASH_COUNT:    Trash = 0;            break;

            case DATA_TRASH:
                if(data) Trash = data;
                else     Trash--;
                UpdateWorldState(WORLD_STATE_ENEMYCOUNT, Trash);
                break;
            case DATA_ALLIANCE_RETREAT:                
                allianceRetreat = data;
                OpenDoor(HordeGate,true);
                SaveToDB();
                break;
            case DATA_HORDE_RETREAT: 
                hordeRetreat = data;
                OpenDoor(ElfGate,true);
                SaveToDB();
                break;
            case DATA_RAIDDAMAGE:
                RaidDamage += data;
                if(RaidDamage >= MINRAIDDAMAGE)
                    RaidDamage = MINRAIDDAMAGE;
                break;
            case DATA_RESET_RAIDDAMAGE:
                RaidDamage = 0;
                break;
        }

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

        if(data == DONE)
        {
            OUT_SAVE_INST_DATA;

            std::ostringstream saveStream;
            saveStream << Encounters[0] << " " << Encounters[1] << " " << Encounters[2] << " "
                << Encounters[3] << " " << Encounters[4]
                << " " << allianceRetreat << " " << hordeRetreat
                << " " << RaidDamage;

            str_data = saveStream.str();

            SaveToDB();
            OUT_SAVE_INST_DATA_COMPLETE;
        }

    }
Example #21
0
void instance_trial_of_the_crusader::JustDidDialogueStep(int32 iEntry)
{
    switch (iEntry)
    {
        case NPC_RAMSEY_1:
        case NPC_RAMSEY_2:
        case NPC_RAMSEY_3:
        case NPC_RAMSEY_4:
        case NPC_RAMSEY_5:
            DoSummonRamsey(iEntry);
            break;
        case SAY_VARIAN_BEAST_1:
            if (Player* pPlayer = GetPlayerInMap())
            {
                if (Creature* pBeasts = pPlayer->SummonCreature(NPC_BEASTS_COMBAT_STALKER, aSpawnPositions[0][0], aSpawnPositions[0][1], aSpawnPositions[0][2], aSpawnPositions[0][3], TEMPSUMMON_DEAD_DESPAWN, 0))
                {
                    Creature* pGormok = pBeasts->SummonCreature(NPC_GORMOK, aSpawnPositions[1][0], aSpawnPositions[1][1], aSpawnPositions[1][2], aSpawnPositions[1][3], TEMPSUMMON_DEAD_DESPAWN, 0);
                    if (!pGormok)
                        return;

                    // spawn the snobolds on his back
                    uint8 uiMaxSnobolds = Is25ManDifficulty() ? 5 : 4;
                    for (uint8 i = 0; i < uiMaxSnobolds; ++i)
                    {
                        if (Creature* pSnobold = pGormok->SummonCreature(NPC_SNOBOLD_VASSAL, pGormok->GetPositionX(), pGormok->GetPositionY(), pGormok->GetPositionZ(), 0, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 30000))
                            pSnobold->CastSpell(pGormok, SPELL_RIDE_VEHICLE_HARDCODED, TRIGGERED_OLD_TRIGGERED);
                    }
                }
            }
            break;
        case NPC_FIZZLEBANG:
            if (Player* pPlayer = GetPlayerInMap())
                pPlayer->SummonCreature(NPC_FIZZLEBANG, aSpawnPositions[5][0], aSpawnPositions[5][1], aSpawnPositions[5][2], aSpawnPositions[5][3], TEMPSUMMON_DEAD_DESPAWN, 0);
            break;
        case SAY_WILFRED_JARAXXUS_INTRO_1:
            DoUseDoorOrButton(GO_MAIN_GATE); // Close main gate
            break;
        case SAY_WILFRED_JARAXXUS_INTRO_2:
            if (Creature* pFizzlebang = GetSingleCreatureFromStorage(NPC_FIZZLEBANG))
            {
                pFizzlebang->SummonCreature(NPC_PURPLE_RUNE, aSpawnPositions[11][0], aSpawnPositions[11][1], aSpawnPositions[11][2], aSpawnPositions[11][3], TEMPSUMMON_TIMED_DESPAWN, 15000);
                pFizzlebang->CastSpell(pFizzlebang, SPELL_OPEN_PORTAL, TRIGGERED_NONE);
            }
            break;
        case EVENT_OPEN_PORTAL:
            if (Creature* pOpenPortalTarget = GetSingleCreatureFromStorage(NPC_OPEN_PORTAL_TARGET))
            {
                pOpenPortalTarget->CastSpell(pOpenPortalTarget, SPELL_WILFRED_PORTAL, TRIGGERED_OLD_TRIGGERED);
                pOpenPortalTarget->ForcedDespawn(9000);
            }
            break;
        case SAY_WILFRED_JARAXXUS_INTRO_3:
            if (Player* pPlayer = GetPlayerInMap())
                if (Creature* pJaraxxus = pPlayer->SummonCreature(NPC_JARAXXUS, aSpawnPositions[6][0], aSpawnPositions[6][1], aSpawnPositions[6][2], aSpawnPositions[6][3], TEMPSUMMON_DEAD_DESPAWN, 0))
                    pJaraxxus->GetMotionMaster()->MovePoint(POINT_COMBAT_POSITION, aMovePositions[3][0], aMovePositions[3][1], aMovePositions[3][2]);
            break;
        case EVENT_KILL_FIZZLEBANG:
            if (Creature* pJaraxxus = GetSingleCreatureFromStorage(NPC_JARAXXUS))
                pJaraxxus->CastSpell(pJaraxxus, SPELL_FEL_LIGHTNING_KILL, TRIGGERED_OLD_TRIGGERED);
            break;
        case EVENT_JARAXXUS_START_ATTACK:
            if (Creature* pJaraxxus = GetSingleCreatureFromStorage(NPC_JARAXXUS))
            {
                pJaraxxus->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PLAYER | UNIT_FLAG_IMMUNE_TO_NPC);
                pJaraxxus->RemoveAurasDueToSpell(SPELL_ENSLAVE_JARAXXUS);
            }
            break;
        case SAY_TIRION_PVP_INTRO_1:
        case TYPE_FACTION_CHAMPIONS:
            // skip if already summoned
            if (m_bCrusadersSummoned)
                break;

            if (Player* pPlayer = GetPlayerInMap())
            {
                // safety check
                uint8 uiMaxCrusaders = Is25ManDifficulty() ? MAX_CRUSADERS_25MAN : MAX_CRUSADERS_10MAN;
                if (m_vCrusadersEntries.empty() || m_vCrusadersEntries.size() < uiMaxCrusaders)
                {
                    script_error_log("Instance Trial of The Crusader: ERROR Crusaders entries are not properly selected. Please report this to the dev team!");
                    return;
                }

                // summon the crusaders
                m_vCrusadersGuidsVector.clear();
                float fX, fY, fZ, fO;
                for (uint8 i = 0; i < uiMaxCrusaders; ++i)
                {
                    fX = m_uiTeam == ALLIANCE ? aHordeCrusadersLoc[i].fSourceX : aAllyCrusadersLoc[i].fSourceX;
                    fY = m_uiTeam == ALLIANCE ? aHordeCrusadersLoc[i].fSourceY : aAllyCrusadersLoc[i].fSourceY;
                    fZ = m_uiTeam == ALLIANCE ? aHordeCrusadersLoc[i].fSourceZ : aAllyCrusadersLoc[i].fSourceZ;
                    fO = m_uiTeam == ALLIANCE ? aHordeCrusadersLoc[i].fSourceO : aAllyCrusadersLoc[i].fSourceO;

                    if (Creature* pCrusader = pPlayer->SummonCreature(m_vCrusadersEntries[i], fX, fY, fZ, fO, TEMPSUMMON_DEAD_DESPAWN, 0))
                        m_vCrusadersGuidsVector.push_back(pCrusader->GetObjectGuid());
                }

                m_bCrusadersSummoned = true;
            }
            break;
        case SAY_GARROSH_PVP_A_INTRO_2:
        {
            // make the champions jump
            uint8 uiMaxCrusaders = Is25ManDifficulty() ? MAX_CRUSADERS_25MAN : MAX_CRUSADERS_10MAN;

            float fX, fY, fZ;
            for (uint8 i = 0; i < uiMaxCrusaders; ++i)
            {
                fX = m_uiTeam == ALLIANCE ? aHordeCrusadersLoc[i].fTargetX : aAllyCrusadersLoc[i].fTargetX;
                fY = m_uiTeam == ALLIANCE ? aHordeCrusadersLoc[i].fTargetY : aAllyCrusadersLoc[i].fTargetY;
                fZ = m_uiTeam == ALLIANCE ? aHordeCrusadersLoc[i].fTargetZ : aAllyCrusadersLoc[i].fTargetZ;

                // ToDo: use spell 67382 when proper implemented in the core
                if (Creature* pCrusader = instance->GetCreature(m_vCrusadersGuidsVector[i]))
                    pCrusader->GetMotionMaster()->MoveJump(fX, fY, fZ, pCrusader->GetDistance2d(fX, fY) * 10.0f / 15.0f, 15.0f);
            }
            break;
        }
        case EVENT_CHAMPIONS_ATTACK:
        {
            // prepare champions combat
            uint8 uiMaxCrusaders = Is25ManDifficulty() ? MAX_CRUSADERS_25MAN : MAX_CRUSADERS_10MAN;
            for (uint8 i = 0; i < uiMaxCrusaders; ++i)
            {
                if (Creature* pCrusader = instance->GetCreature(m_vCrusadersGuidsVector[i]))
                {
                    pCrusader->CastSpell(pCrusader, SPELL_ANCHOR_HERE, TRIGGERED_OLD_TRIGGERED);
                    pCrusader->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PLAYER);

                    // some crusaders have to summon their pet
                    pCrusader->AI()->SendAIEvent(AI_EVENT_CUSTOM_A, pCrusader, pCrusader);
                }
            }
            break;
        }
        case EVENT_SUMMON_TWINS:
            if (Player* pPlayer = GetPlayerInMap())
            {
                // spawn the twin valkyrs; movement and the rest of spawns are handled in DB
                DoOpenMainGate(15000);

                pPlayer->SummonCreature(NPC_FJOLA, aSpawnPositions[7][0], aSpawnPositions[7][1], aSpawnPositions[7][2], aSpawnPositions[7][3], TEMPSUMMON_DEAD_DESPAWN, 0);
                pPlayer->SummonCreature(NPC_EYDIS, aSpawnPositions[8][0], aSpawnPositions[8][1], aSpawnPositions[8][2], aSpawnPositions[8][3], TEMPSUMMON_DEAD_DESPAWN, 0);
            }
            break;
        case EVENT_TWINS_ATTACK:
            if (Creature* pTwin = GetSingleCreatureFromStorage(NPC_FJOLA))
            {
                pTwin->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PLAYER | UNIT_FLAG_IMMUNE_TO_NPC);
                pTwin->CastSpell(pTwin, SPELL_TWIN_EMPATHY_LIGHT, TRIGGERED_OLD_TRIGGERED);
            }
            if (Creature* pTwin = GetSingleCreatureFromStorage(NPC_EYDIS))
            {
                pTwin->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PLAYER | UNIT_FLAG_IMMUNE_TO_NPC);
                pTwin->CastSpell(pTwin, SPELL_TWIN_EMPATHY_DARK, TRIGGERED_OLD_TRIGGERED);
            }
            break;
        case SAY_LKING_ANUB_INTRO_1:
            if (Player* pPlayer = GetPlayerInMap())
                pPlayer->SummonCreature(NPC_WORLD_TRIGGER_LARGE, aSpawnPositions[9][0], aSpawnPositions[9][1], aSpawnPositions[9][2], aSpawnPositions[9][3], TEMPSUMMON_DEAD_DESPAWN, 0);
            break;
        case EVENT_ARTHAS_PORTAL:
            if (Creature* pWorldTriggerLarge = GetSingleCreatureFromStorage(NPC_WORLD_TRIGGER_LARGE))
                pWorldTriggerLarge->CastSpell(pWorldTriggerLarge, SPELL_ARTHAS_PORTAL, TRIGGERED_OLD_TRIGGERED);
            break;
        case EVENT_SUMMON_THE_LICHKING:
            if (Player* pPlayer = GetPlayerInMap())
                pPlayer->SummonCreature(NPC_THE_LICHKING_VISUAL, aSpawnPositions[10][0], aSpawnPositions[10][1], aSpawnPositions[10][2], aSpawnPositions[10][3], TEMPSUMMON_DEAD_DESPAWN, 0);
            break;
        case EVENT_DESTROY_FLOOR:
            if (GameObject* pColiseumFloor = GetSingleGameObjectFromStorage(GO_COLISEUM_FLOOR))
            {
                pColiseumFloor->SetDisplayId(DISPLAYID_DESTROYED_FLOOR);
                pColiseumFloor->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK_10 | GO_FLAG_NODESPAWN);
                pColiseumFloor->SetGoState(GO_STATE_ACTIVE);
            }

            if (Creature* pLichKingVisual = GetSingleCreatureFromStorage(NPC_THE_LICHKING_VISUAL))
            {
                pLichKingVisual->CastSpell(pLichKingVisual, SPELL_FROSTNOVA, TRIGGERED_OLD_TRIGGERED);
                // pLichKingVisual->CastSpell(pLichKingVisual, SPELL_CORPSE_TELEPORT, TRIGGERED_OLD_TRIGGERED); // NYI
                pLichKingVisual->ForcedDespawn();
            }

            if (Creature* pLichKing = GetSingleCreatureFromStorage(NPC_THE_LICHKING))
                pLichKing->CastSpell(pLichKing, SPELL_DESTROY_FLOOR_KNOCKUP, TRIGGERED_OLD_TRIGGERED);

            if (Creature* pWorldTriggerLarge = GetSingleCreatureFromStorage(NPC_WORLD_TRIGGER_LARGE))
                pWorldTriggerLarge->ForcedDespawn();
            break;
    }
}
void instance_pit_of_saron::JustDidDialogueStep(int32 iEntry)
{
    switch (iEntry)
    {
        case SPELL_NECROMATIC_POWER:
            // Transfor all soldiers into undead
            if (Creature* pTyrannus = GetSingleCreatureFromStorage(NPC_TYRANNUS_INTRO))
                pTyrannus->CastSpell(pTyrannus, SPELL_NECROMATIC_POWER, TRIGGERED_OLD_TRIGGERED);
            break;
        case SAY_OUTRO_3:
            // Move Tyrannus into position
            if (Creature* pTyrannus = GetSingleCreatureFromStorage(NPC_TYRANNUS_INTRO))
            {
                pTyrannus->SetWalk(false);
                pTyrannus->GetMotionMaster()->MovePoint(0, afTyrannusMovePos[1][0], afTyrannusMovePos[1][1], afTyrannusMovePos[1][2]);
            }
            break;
        case SPELL_STRANGULATING:
            // Strangulate Krick
            if (Creature* pKrick = GetSingleCreatureFromStorage(NPC_KRICK))
            {
                pKrick->CastSpell(pKrick, SPELL_STRANGULATING, TRIGGERED_OLD_TRIGGERED);
                pKrick->SetLevitate(true);
                pKrick->GetMotionMaster()->MovePoint(0, pKrick->GetPositionX(), pKrick->GetPositionY(), pKrick->GetPositionZ() + 5.0f);
            }
            break;
        case SAY_TYRANNUS_KRICK_2:
            // Kill Krick
            if (Creature* pKrick = GetSingleCreatureFromStorage(NPC_KRICK))
            {
                pKrick->CastSpell(pKrick, SPELL_KRICK_KILL_CREDIT, TRIGGERED_OLD_TRIGGERED);
                pKrick->CastSpell(pKrick, SPELL_SUICIDE, TRIGGERED_OLD_TRIGGERED);
            }
            break;
        case SAY_JAINA_INTRO_3:
        case SAY_JAINA_KRICK_3:
            // Move Tyrannus to a safe position
            if (Creature* pTyrannus = GetSingleCreatureFromStorage(NPC_TYRANNUS_INTRO))
                pTyrannus->GetMotionMaster()->MovePoint(0, afTyrannusMovePos[0][0], afTyrannusMovePos[0][1], afTyrannusMovePos[0][2]);
            break;
        case NPC_TYRANNUS:
        {
            Creature* pTyrannus = GetSingleCreatureFromStorage(NPC_TYRANNUS);
            if (!pTyrannus)
                return;

            // Spawn tunnel end event mobs
            for (uint8 i = 0; i < countof(aEventTunnelEndLocations); ++i)
            {
                if (Creature* pSummon = pTyrannus->SummonCreature(m_uiTeam == HORDE ? aEventTunnelEndLocations[i].uiEntryHorde : aEventTunnelEndLocations[i].uiEntryAlliance,
                                        aEventTunnelEndLocations[i].fX, aEventTunnelEndLocations[i].fY, aEventTunnelEndLocations[i].fZ, aEventTunnelEndLocations[i].fO, TEMPSUMMON_DEAD_DESPAWN, 0))
                {
                    pSummon->SetWalk(false);
                    pSummon->GetMotionMaster()->MovePoint(0, aEventTunnelEndLocations[i].fMoveX, aEventTunnelEndLocations[i].fMoveY, aEventTunnelEndLocations[i].fMoveZ);
                }
            }
            break;
        }
        case NPC_RIMEFANG:
            // Eject Tyrannus and prepare for combat
            if (Creature* pRimefang = GetSingleCreatureFromStorage(NPC_RIMEFANG))
            {
                pRimefang->CastSpell(pRimefang, SPELL_EJECT_ALL_PASSENGERS, TRIGGERED_OLD_TRIGGERED);
                pRimefang->SetWalk(false);
                pRimefang->GetMotionMaster()->MovePoint(0, afTyrannusMovePos[3][0], afTyrannusMovePos[3][1], afTyrannusMovePos[3][2]);
            }
            if (Creature* pTyrannus = GetSingleCreatureFromStorage(NPC_TYRANNUS))
                pTyrannus->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
            break;
        case SAY_VICTUS_OUTRO_1:
        {
            Player* pPlayer = GetPlayerInMap();
            if (!pPlayer)
                return;

            // Spawn Sindragosa
            if (Creature* pSummon = pPlayer->SummonCreature(aEventOutroLocations[0].uiEntryHorde, aEventOutroLocations[0].fX, aEventOutroLocations[0].fY,
                                    aEventOutroLocations[0].fZ, aEventOutroLocations[0].fO, TEMPSUMMON_TIMED_DESPAWN, 2 * MINUTE * IN_MILLISECONDS))
            {
                pSummon->SetWalk(false);
                pSummon->GetMotionMaster()->MovePoint(0, aEventOutroLocations[0].fMoveX, aEventOutroLocations[0].fMoveY, aEventOutroLocations[0].fMoveZ);
            }
            // Spawn Jaina or Sylvanas
            if (Creature* pSummon = pPlayer->SummonCreature(m_uiTeam == HORDE ? aEventOutroLocations[1].uiEntryHorde : aEventOutroLocations[1].uiEntryAlliance,
                                    aEventOutroLocations[1].fX, aEventOutroLocations[1].fY, aEventOutroLocations[1].fZ, aEventOutroLocations[1].fO, TEMPSUMMON_TIMED_DESPAWN, 24 * HOUR * IN_MILLISECONDS))
            {
                pSummon->SetWalk(false);
                pSummon->GetMotionMaster()->MovePoint(0, aEventOutroLocations[1].fMoveX, aEventOutroLocations[1].fMoveY, aEventOutroLocations[1].fMoveZ);
            }
            break;
        }
        case SAY_JAINA_OUTRO_1:
            // Visual effect
            for (GuidList::const_iterator itr = m_lArcaneShieldBunniesGuidList.begin(); itr != m_lArcaneShieldBunniesGuidList.end(); ++itr)
            {
                if (Creature* pBunny = instance->GetCreature(*itr))
                    pBunny->CastSpell(pBunny, SPELL_ARCANE_FORM, TRIGGERED_OLD_TRIGGERED);
            }
            // Teleport players
            if (Creature* pTemp = GetSingleCreatureFromStorage(m_uiTeam == HORDE ? NPC_SYLVANAS_PART2 : NPC_JAINA_PART2))
            {
                pTemp->CastSpell(pTemp, m_uiTeam == HORDE ? SPELL_CALL_OF_SYLVANAS_2 : SPELL_JAINAS_CALL_2, TRIGGERED_OLD_TRIGGERED);
                pTemp->CastSpell(pTemp, m_uiTeam == HORDE ? SPELL_CALL_OF_SYLVANAS_2 : SPELL_JAINAS_CALL_2, TRIGGERED_OLD_TRIGGERED);
            }
            break;
        case SPELL_FROST_BOMB:
            // Frost bomb on the platform
            if (Creature* pSindragosa = GetSingleCreatureFromStorage(NPC_SINDRAGOSA))
                pSindragosa->CastSpell(pSindragosa, SPELL_FROST_BOMB, TRIGGERED_OLD_TRIGGERED);
            // Visual effect
            for (GuidList::const_iterator itr = m_lFrozenAftermathBunniesGuidList.begin(); itr != m_lFrozenAftermathBunniesGuidList.end(); ++itr)
            {
                if (Creature* pBunny = instance->GetCreature(*itr))
                    pBunny->CastSpell(pBunny, SPELL_FROZEN_AFTERMATH, TRIGGERED_OLD_TRIGGERED);
            }
            break;
        case NPC_JAINA_PART2:
            // Visual effect remove
            for (GuidList::const_iterator itr = m_lArcaneShieldBunniesGuidList.begin(); itr != m_lArcaneShieldBunniesGuidList.end(); ++itr)
            {
                if (Creature* pBunny = instance->GetCreature(*itr))
                    pBunny->RemoveAurasDueToSpell(SPELL_ARCANE_FORM);
            }
            // Sindragosa exit
            if (Creature* pSindragosa = GetSingleCreatureFromStorage(NPC_SINDRAGOSA))
                pSindragosa->GetMotionMaster()->MovePoint(0, 759.148f, 199.955f, 720.857f);
            // Jaina / Sylvanas starts moving (should use wp)
            if (Creature* pTemp = GetSingleCreatureFromStorage(m_uiTeam == HORDE ? NPC_SYLVANAS_PART2 : NPC_JAINA_PART2))
            {
                pTemp->SetWalk(true);
                pTemp->GetMotionMaster()->MovePoint(0, 1057.76f, 111.927f, 628.4123f);
            }
            break;
        case SAY_JAINA_OUTRO_2:
            if (Creature* pTemp = GetSingleCreatureFromStorage(m_uiTeam == HORDE ? NPC_SYLVANAS_PART2 : NPC_JAINA_PART2))
                pTemp->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);

            // ToDo: Jaina / Sylvanas should have some waypoint movement here and the door should be opened only when they get in front of it.
            DoUseDoorOrButton(GO_HALLS_OF_REFLECT_PORT);
            break;
    }
}
Example #23
0
void instance_arcatraz::JustDidDialogueStep(int32 iEntry)
{
    Creature* pMellichar = GetSingleCreatureFromStorage(NPC_MELLICHAR);
    if (!pMellichar)
        return;

    switch (iEntry)
    {
        case SPELL_TARGET_ALPHA:
            pMellichar->CastSpell(pMellichar, SPELL_TARGET_ALPHA, false);
            if (Creature* pTarget = GetSingleCreatureFromStorage(NPC_PRISON_APHPA_POD))
                pMellichar->SetFacingToObject(pTarget);
            SetData(TYPE_WARDEN_1, IN_PROGRESS);
            break;
        case YELL_MELLICHAR_RELEASE1:
            pMellichar->SummonCreature(urand(0, 1) ? NPC_BLAZING_TRICKSTER : NPC_PHASE_HUNTER, aSummonPosition[0].m_fX, aSummonPosition[0].m_fY, aSummonPosition[0].m_fZ, aSummonPosition[0].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0);
            break;
        case YELL_MELLICHAR_RELEASE2:
            if (Creature* pTarget = GetSingleCreatureFromStorage(NPC_PRISON_BETA_POD))
                pMellichar->SetFacingToObject(pTarget);
            break;
        case SPELL_TARGET_BETA:
            pMellichar->CastSpell(pMellichar, SPELL_TARGET_BETA, false);
            SetData(TYPE_WARDEN_2, IN_PROGRESS);
            break;
        case TYPE_WARDEN_2:
            pMellichar->SummonCreature(NPC_MILLHOUSE, aSummonPosition[1].m_fX, aSummonPosition[1].m_fY, aSummonPosition[1].m_fZ, aSummonPosition[1].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0);
            break;
        case SPELL_TARGET_DELTA:
            pMellichar->CastSpell(pMellichar, SPELL_TARGET_DELTA, false);
            if (Creature* pTarget = GetSingleCreatureFromStorage(NPC_PRISON_DELTA_POD))
                pMellichar->SetFacingToObject(pTarget);
            SetData(TYPE_WARDEN_3, IN_PROGRESS);
            break;
        case TYPE_WARDEN_3:
            pMellichar->SummonCreature(urand(0, 1) ? NPC_AKKIRIS : NPC_SULFURON, aSummonPosition[2].m_fX, aSummonPosition[2].m_fY, aSummonPosition[2].m_fZ, aSummonPosition[2].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0);
            pMellichar->CastSpell(pMellichar, SPELL_TARGET_OMEGA, false);
            if (Creature* pTarget = GetSingleCreatureFromStorage(NPC_PRISON_BOSS_POD))
                pMellichar->SetFacingToObject(pTarget);
            break;
        case YELL_MELLICHAR_RELEASE4:
            pMellichar->InterruptNonMeleeSpells(false);
            if (Creature* pTarget = GetSingleCreatureFromStorage(NPC_PRISON_GAMMA_POD))
                pMellichar->SetFacingToObject(pTarget);
            break;
        case SPELL_TARGET_GAMMA:
            pMellichar->CastSpell(pMellichar, SPELL_TARGET_GAMMA, false);
            if (Creature* pTarget = GetSingleCreatureFromStorage(NPC_PRISON_GAMMA_POD))
                pMellichar->SetFacingToObject(pTarget);
            SetData(TYPE_WARDEN_4, IN_PROGRESS);
            break;
        case TYPE_WARDEN_4:
            pMellichar->SummonCreature(urand(0, 1) ? NPC_TW_DRAKONAAR : NPC_BL_DRAKONAAR, aSummonPosition[3].m_fX, aSummonPosition[3].m_fY, aSummonPosition[3].m_fZ, aSummonPosition[3].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0);
            pMellichar->CastSpell(pMellichar, SPELL_TARGET_OMEGA, false);
            if (Creature* pTarget = GetSingleCreatureFromStorage(NPC_PRISON_BOSS_POD))
                pMellichar->SetFacingToObject(pTarget);
            break;
        case YELL_MELLICHAR_RELEASE5:
            pMellichar->InterruptNonMeleeSpells(false);
            SetData(TYPE_WARDEN_5, IN_PROGRESS);
            break;
        case TYPE_WARDEN_5:
            if (Creature* pSkyriss = pMellichar->SummonCreature(NPC_SKYRISS, aSummonPosition[4].m_fX, aSummonPosition[4].m_fY, aSummonPosition[4].m_fZ, aSummonPosition[4].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0))
                pSkyriss->CastSpell(pSkyriss, SPELL_SIMPLE_TELEPORT, false);
            break;
        case YELL_MELLICAR_WELCOME:
            if (Creature* pSkyriss = GetSingleCreatureFromStorage(NPC_SKYRISS))
                pSkyriss->CastSpell(pSkyriss, SPELL_MIND_REND, false);
            break;
        case SAY_SKYRISS_AGGRO:
            // Kill Mellichar and start combat
            if (Creature* pSkyriss = GetSingleCreatureFromStorage(NPC_SKYRISS))
            {
                pSkyriss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE);
                pMellichar->DealDamage(pMellichar, pMellichar->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
            }
            DoUseDoorOrButton(GO_SEAL_SPHERE);
            break;
    }
}
void instance_sunken_temple::Update(uint32 uiDiff)
{
    if (m_auiEncounter[TYPE_AVATAR] != IN_PROGRESS)
        return;

    // Summon random mobs around the circles
    if (m_uiAvatarSummonTimer)
    {
        if (m_uiAvatarSummonTimer <= uiDiff)
        {
            Creature* pShade = GetSingleCreatureFromStorage(NPC_SHADE_OF_HAKKAR);
            if (!pShade)
                return;

            // If no summon circles are spawned then return
            if (m_vuiCircleGUIDs.empty())
                return;

            if (m_bIsFirstHakkarWave)                       // First wave summoned
            {
                // Summon at all circles
                for (GuidVector::const_iterator itr = m_vuiCircleGUIDs.begin(); itr != m_vuiCircleGUIDs.end(); ++itr)
                {
                    if (GameObject* pCircle = instance->GetGameObject(*itr))
                        pShade->SummonCreature(NPC_HAKKARI_MINION, pCircle->GetPositionX(), pCircle->GetPositionY(), pCircle->GetPositionZ(), 0, TEMPSPAWN_DEAD_DESPAWN, 0);
                }

                // Summon Bloodkeeper at random circle
                if (GameObject* pCircle = instance->GetGameObject(m_vuiCircleGUIDs[urand(0, m_vuiCircleGUIDs.size() - 1)]))
                    pShade->SummonCreature(NPC_BLOODKEEPER, pCircle->GetPositionX(), pCircle->GetPositionY(), pCircle->GetPositionZ(), 0, TEMPSPAWN_DEAD_DESPAWN, 0);

                m_bCanSummonBloodkeeper = false;
                m_bIsFirstHakkarWave = false;
                m_uiAvatarSummonTimer = 50000;
            }
            else                                            // Later wave
            {
                uint32 uiRoll = urand(0, 99);
                uint8 uiMaxSummons = uiRoll < 75 ? 1 : uiRoll < 95 ? 2 : 3;

                if (m_bCanSummonBloodkeeper && roll_chance_i(30))
                {
                    // Summon a Bloodkeeper
                    if (GameObject* pCircle = instance->GetGameObject(m_vuiCircleGUIDs[urand(0, m_vuiCircleGUIDs.size() - 1)]))
                        pShade->SummonCreature(NPC_BLOODKEEPER, pCircle->GetPositionX(), pCircle->GetPositionY(), pCircle->GetPositionZ(), 0, TEMPSPAWN_DEAD_DESPAWN, 0);

                    m_bCanSummonBloodkeeper = false;
                    --uiMaxSummons;
                }

                for (uint8 i = 0; i < uiMaxSummons; ++i)
                {
                    if (GameObject* pCircle = instance->GetGameObject(m_vuiCircleGUIDs[urand(0, m_vuiCircleGUIDs.size() - 1)]))
                        pShade->SummonCreature(NPC_HAKKARI_MINION, pCircle->GetPositionX(), pCircle->GetPositionY(), pCircle->GetPositionZ(), 0, TEMPSPAWN_DEAD_DESPAWN, 0);
                }
                m_uiAvatarSummonTimer = urand(3000, 15000);
            }
        }
        else
            m_uiAvatarSummonTimer -= uiDiff;
    }

    // Summon nightmare suppressor after flame used
    if (m_uiSupressorTimer)
    {
        if (m_uiSupressorTimer <= uiDiff)
        {
            Creature* pShade = GetSingleCreatureFromStorage(NPC_SHADE_OF_HAKKAR);
            if (!pShade)
            {
                // Something went very wrong!
                return;
            }

            // Summon npc at random door; movement and script handled in DB
            uint8 uiSummonLoc = urand(0, 1);
            pShade->SummonCreature(NPC_SUPPRESSOR, aHakkariDoorLocations[uiSummonLoc].m_fX, aHakkariDoorLocations[uiSummonLoc].m_fY, aHakkariDoorLocations[uiSummonLoc].m_fZ, 0, TEMPSPAWN_DEAD_DESPAWN, 0);

            // This timer is finished now
            m_uiSupressorTimer = 0;
        }
        else
            m_uiSupressorTimer -= uiDiff;
    }
}
Example #25
0
void instance_dire_maul::SetData(uint32 uiType, uint32 uiData)
{
    switch(uiType)
    {
        // East
        case TYPE_PUSILLIN:
            m_auiEncounter[0] = uiData;
            break;
        case TYPE_ZEVRIM_THORNHOOF:
            m_auiEncounter[1] = uiData;
            if (uiData == DONE)
				if (Creature* pIronbark = GetSingleCreatureFromStorage(NPC_OLD_IRONBARK))
                {
                    pIronbark->UpdateEntry(NPC_IRONBARK_THE_REDEEMED);
                    pIronbark->AIM_Initialize();
                    DoScriptText(SAY_REDEEMED, pIronbark);
                }
            break;
        case TYPE_IRONBARK_THE_REDEEMED:
            m_auiEncounter[2] = uiData;
            if (uiData == DONE)
                HandleGameObject(GO_CONSERVATORY_DOOR, true);
            break;
        case TYPE_ALZZIN_THE_WILDSHAPER:
            m_auiEncounter[3] = uiData;
            switch(uiData)
            {
                case NOT_STARTED:
                    HandleGameObject(GO_CRUMBLE_WALL, false);

                    for(GUIDList::iterator itr = m_uiAlzzinsMinionGUID.begin(); itr != m_uiAlzzinsMinionGUID.end(); ++itr)
                    {
                        if (Creature* pMinion = instance->GetCreature(*itr))
                            pMinion->Respawn();
                    }
                    break;
                case DONE:														//Not sure why but boss stopped doing crumble wall when it dies so I had to remove SPECIAL case.
                    HandleGameObject(GO_CORRUPTED_CRYSTAL_VINE, true);
                    for(GUIDList::iterator itr = m_uiShardGUID.begin(); itr != m_uiShardGUID.end(); ++itr)
					{ DoRespawnGameObject(*itr, HOUR);}
                /*    break;
                case SPECIAL:*/
                    HandleGameObject(GO_CRUMBLE_WALL, true);

                    if (Creature* pAlzzin = GetSingleCreatureFromStorage(NPC_ALZZINS_THE_WILDSHAPER))
                    {
                        for(GUIDList::iterator itr = m_uiAlzzinsMinionGUID.begin(); itr != m_uiAlzzinsMinionGUID.end(); ++itr)
                        {
                            if (Creature* pMinion = instance->GetCreature(*itr))
                                pMinion->AI()->AttackStart(pAlzzin->getVictim());
                        }
                    }
                    break;
            }
            break;
        case TYPE_ISALIEN:
            m_auiEncounter[4] = uiData;
            break;
        // North
        case TYPE_STOMPER_KREEG:
            m_auiEncounter[5] = uiData;
            break;
        case TYPE_GUARD_MOLDAR:
            m_auiEncounter[6] = uiData;
            break;
        case TYPE_GUARD_FENGUS:
            m_auiEncounter[7] = uiData;
            break;
        case TYPE_GUARD_SLIPKIK:
            m_auiEncounter[8] = uiData;
            break;
        case TYPE_CAPTAIN_KROMCRUSH:
            m_auiEncounter[9] = uiData;
            break;
        case TYPE_CHORUSH_THE_OBSERVER:
            m_auiEncounter[10] = uiData;
            break;
        case TYPE_KING_GORDOK:
            m_auiEncounter[11] = uiData;
            if (uiData == DONE)
            {
                Creature* pChorush = GetSingleCreatureFromStorage(NPC_CHORUSH_THE_OBSERVER);
                if (pChorush && pChorush->isAlive() && m_auiEncounter[10] != DONE)
                {
                    pChorush->setFaction(FACTION_FRIENDLY);
                    pChorush->InterruptNonMeleeSpells(false);
                    pChorush->AI()->ResetToHome();

                    if (Creature* pMizzle = pChorush->SummonCreature(NPC_MIZZLE_THE_CRAFTY, 731.14f, 481.14f, 28.18f, 0.016f, TEMPSUMMON_DEAD_DESPAWN, 10000))
                    {
                        pMizzle->setFaction(FACTION_FRIENDLY);	
						// He should be running from spawn and then walk at point 0, can't get it to work. Walk all the way for now
                        pMizzle->GetMotionMaster()->MovePoint(0, 818.92f, 481.95f, 37.32f);
                        CreatureCreatePos pos(pMizzle->GetMap(), 818.92f, 481.95f, 37.32f, 4.32f);
                        pMizzle->SetSummonPoint(pos);
                    }
                }
            }
            break;
        case TYPE_TRIBUTE_RUN:
            m_auiEncounter[12] = uiData;
            if (uiData == DONE)
            {
                // Set Gordok friendly (spell 22799 seems to be buggy)
                for(GUIDList::iterator itr = m_uiGordokGUID.begin(); itr != m_uiGordokGUID.end(); ++itr)
                {
                    if (Creature* pGordok = instance->GetCreature(*itr))
                    {
                        pGordok->setFaction(FACTION_FRIENDLY);

                        // Return Captain Krom'crush back
                        if (pGordok->GetEntry() == NPC_CAPTAIN_KROMCRUSH && pGordok->isAlive())
                        {
                            pGordok->SetVisibility(VISIBILITY_ON);
                            pGordok->GetMotionMaster()->MoveTargetedHome();
                        }
                    }
                }

                uint32 uiCount = 0;
                ObjectGuid uiTributeGUID = ObjectGuid();

                for(uint8 i = 5; i <= 10; ++i)
                    if (m_auiEncounter[i] != DONE)
                        ++uiCount;

                for(GUIDList::iterator itr = m_uiGordokTributeGUID.begin(); itr != m_uiGordokTributeGUID.end(); ++itr)
                {
                    if (GameObject* pTribute = instance->GetGameObject(*itr))
                        if (pTribute->GetEntry() == aTribute[uiCount])
                        {
							uiTributeGUID = pTribute->GetObjectGuid();
                            break;
                        }
                }

                if (uiTributeGUID)
                    DoRespawnGameObject(uiTributeGUID, HOUR);
            }
            break;
        case TYPE_KNOT_THIMBLEJACK:
            m_auiEncounter[13] = uiData;
            if (uiData == DONE)
                DoRespawnGameObject(GO_KNOT_THIMBLEJACK_CACHE, HOUR);
            break;
        // West
        case TYPE_TENDRIS_WARPWOOD:
            m_auiEncounter[14] = uiData;
            if (uiData == IN_PROGRESS)
                CallProtectors();
            if (uiData == DONE)
            {
                if (Creature* pTendris = GetSingleCreatureFromStorage(NPC_TENDRIS_WARPWOOD))
                    pTendris->SummonCreature(NPC_ANCIENT_EQUINE_SPIRIT, 9.18f, 491.05f, -23.29f, 4.89f, TEMPSUMMON_DEAD_DESPAWN, 0);
            }
            break;
    /*    case TYPE_BARRIER:
            m_auiEncounter[15] = uiData;
            if (uiData == IN_PROGRESS)
            {
                --m_uiPylonCount;

                if (!m_uiPylonCount)
                    SetData(TYPE_BARRIER, DONE);
                else
                    debug_log("SD0: Instance Dire Maul: %u pylons left to activate.", m_uiPylonCount);
            }*/
            
        case TYPE_IMMOLTHAR:
            m_auiEncounter[15] = uiData;
            if (uiData == DONE)
            {
				
                if (Creature* pPrince = GetSingleCreatureFromStorage(NPC_PRINCE_TORTHELDRIN))
				{
					pPrince->setFaction(pPrince->GetCreatureInfo()->faction_A);	
					if (!bYell1 && pPrince)
						{
							DoScriptText(SAY_KILL_IMMOLTHAR, pPrince);					//TODO: still does the text twice.
							bYell1 = true;
						}
				}
			}

            break;
        case TYPE_PRINCE_TORTHELDRIN:
            m_auiEncounter[16] = uiData;
            if (uiData == DONE)
                DoRespawnGameObject(GO_THE_PRINCES_CHEST, HOUR);
            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();
                }
                /*if (Creature* pImmolthar = GetSingleCreatureFromStorage(NPC_IMMOLTHAR))
                    pImmolthar->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);*/			//Unused since barrier case is removed
            }
            break;
    }
        
    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] << " "
	<< m_auiEncounter[12] << " " << m_auiEncounter[13] << " " << m_auiEncounter[14] << " "
	<< m_auiEncounter[15] << " " << m_auiEncounter[16] << " " << m_auiEncounter[17];

    strInstData = saveStream.str();

    SaveToDB();
    OUT_SAVE_INST_DATA_COMPLETE;
}
    void SetData(uint32 type, uint32 data)
    {
        switch(type)
        {
            case DATA_RAGEWINTERCHILLEVENT: Encounters[0] = data; break;
            case DATA_ANETHERONEVENT:
                Encounters[1] = data;
                break;
            case DATA_KAZROGALEVENT:        Encounters[2] = data; break;
            case DATA_AZGALOREVENT:
                {
                    Encounters[3] = data;
                    if (data == DONE)
                    {
                        if (ArchiYell)break;
                        ArchiYell = true;

                        Creature* pCreature = instance->GetCreature(Azgalor);
                        if (pCreature)
                        {
                            Creature* pUnit = pCreature->SummonCreature(21987,pCreature->GetPositionX(),pCreature->GetPositionY(),pCreature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,10000);

                            Map* pMap = pCreature->GetMap();
                            if (pMap->IsDungeon() && pUnit)
                            {
                                pUnit->SetVisibility(VISIBILITY_OFF);
                                Map::PlayerList const &PlayerList = pMap->GetPlayers();
                                if (PlayerList.isEmpty())
                                     return;

                                for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
                                {
                                     if (i->getSource())
                                     {
                                        WorldPacket data(SMSG_MESSAGECHAT, 200);
                                        pUnit->BuildMonsterChat(&data,CHAT_MSG_MONSTER_YELL,YELL_EFFORTS,0,YELL_EFFORTS_NAME,i->getSource()->GetGUID());
                                        i->getSource()->GetSession()->SendPacket(&data);

                                        WorldPacket data2(SMSG_PLAY_SOUND, 4);
                                        data2 << 10986;
                                        i->getSource()->GetSession()->SendPacket(&data2);
                                     }
                                }
                            }
                        }
                    }
                }
                break;
            case DATA_ARCHIMONDEEVENT:      Encounters[4] = data; break;
            case DATA_RESET_TRASH_COUNT:    Trash = 0;            break;

            case DATA_TRASH:
                if (data) Trash = data;
                else     Trash--;
                UpdateWorldState(WORLD_STATE_ENEMYCOUNT, Trash);
                break;
            case DATA_ALLIANCE_RETREAT:
                allianceRetreat = data;
                OpenDoor(HordeGate,true);
                SaveToDB();
                break;
            case DATA_HORDE_RETREAT:
                hordeRetreat = data;
                OpenDoor(ElfGate,true);
                SaveToDB();
                break;
            case DATA_RAIDDAMAGE:
                RaidDamage += data;
                if (RaidDamage >= MINRAIDDAMAGE)
                    RaidDamage = MINRAIDDAMAGE;
                break;
            case DATA_RESET_RAIDDAMAGE:
                RaidDamage = 0;
                break;
        }

         debug_log("BSCR: Instance Hyjal: Instance data updated for event %u (Data=%u)",type,data);

        if (data == DONE)
            SaveToDB();
    }
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], TEMPSPAWN_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)
            {
                DoUseDoorOrButton(GO_GOLEM_ROOM_N);
                DoUseDoorOrButton(GO_GOLEM_ROOM_S);
            }
            m_auiEncounter[4] = uiData;
            break;
        case TYPE_IRON_HALL:
            switch (uiData)
            {
                case IN_PROGRESS:
                    DoUseDoorOrButton(GO_GOLEM_ROOM_N);
                    DoUseDoorOrButton(GO_GOLEM_ROOM_S);
                    break;
                case FAIL:
                    DoUseDoorOrButton(GO_GOLEM_ROOM_N);
                    DoUseDoorOrButton(GO_GOLEM_ROOM_S);
                    break;
                case DONE:
                    DoUseDoorOrButton(GO_GOLEM_ROOM_N);
                    DoUseDoorOrButton(GO_GOLEM_ROOM_S);
                    DoUseDoorOrButton(GO_THRONE_ROOM);
                    break;
            }
            m_auiEncounter[5] = uiData;
            break;
        case TYPE_QUEST_JAIL_BREAK:
            m_auiEncounter[6] = uiData;
            return;
        case TYPE_FLAMELASH:
            for (int i = 0; i < MAX_DWARF_RUNES; ++i)
                DoUseDoorOrButton(GO_DWARFRUNE_A01 + i);
            return;
        case TYPE_HURLEY:
            if (uiData == SPECIAL)
            {
                ++m_uiBrokenKegs;

                if (m_uiBrokenKegs == 3)
                {
                    if (Creature* pPlugger = GetSingleCreatureFromStorage(NPC_PLUGGER_SPAZZRING))
                    {
                        // Summon Hurley Blackbreath
                        Creature* pHurley = pPlugger->SummonCreature(NPC_HURLEY_BLACKBREATH, aHurleyPositions[0], aHurleyPositions[1], aHurleyPositions[2], aHurleyPositions[3], TEMPSPAWN_DEAD_DESPAWN, 0);

                        if (!pHurley)
                            return;

                        // Summon cronies around Hurley
                        for (uint8 i = 0; i < MAX_CRONIES; ++i)
                        {
                            float fX, fY, fZ;
                            pPlugger->GetRandomPoint(aHurleyPositions[0], aHurleyPositions[1], aHurleyPositions[2], 2.0f, fX, fY, fZ);
                            if (Creature* pSummoned = pPlugger->SummonCreature(NPC_BLACKBREATH_CRONY, fX, fY, fZ, aHurleyPositions[3], TEMPSPAWN_DEAD_DESPAWN, 0))
                            {
                                pSummoned->SetWalk(false);
                                // The cronies should not engage anyone until their boss does so
                                // the linking is done by DB
                                pSummoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
                                // The movement toward the kegs is handled by Hurley EscortAI
                                // and we want the cronies to follow him there
                                pSummoned->GetMotionMaster()->MoveFollow(pHurley, 1.0f, 0);
                            }
                        }
                        SetData(TYPE_HURLEY, IN_PROGRESS);
                    }
                }
            }
            else
                m_auiEncounter[8] = uiData;
            break;
        case TYPE_BRIDGE:
            m_auiEncounter[9] = uiData;
            return;
        case TYPE_BAR:
            if (uiData == IN_PROGRESS)
                HandleBarPatrol(0);
            m_auiEncounter[10] = uiData;
            break;
        case TYPE_PLUGGER:
            if (uiData == SPECIAL)
            {
                if (Creature* pPlugger = GetSingleCreatureFromStorage(NPC_PLUGGER_SPAZZRING))
                {
                    ++m_uiStolenAles;
                    if (m_uiStolenAles == 3)
                        uiData = IN_PROGRESS;
                }
            }
            m_auiEncounter[11] = uiData;
            break;
        case TYPE_NAGMARA:
            m_auiEncounter[12] = 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] << " " << m_auiEncounter[10] << " " << m_auiEncounter[11] << " "
                   << m_auiEncounter[12];

        m_strInstData = saveStream.str();

        SaveToDB();
        OUT_SAVE_INST_DATA_COMPLETE;
    }
}
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);
            }
            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);
            }
            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)
            {
                case IN_PROGRESS:
                    DoUseDoorOrButton(GO_GOLEM_ROOM_N);
                    DoUseDoorOrButton(GO_GOLEM_ROOM_S);
                    break;
                case FAIL:
                    DoUseDoorOrButton(GO_GOLEM_ROOM_N);
                    DoUseDoorOrButton(GO_GOLEM_ROOM_S);
                    break;
                case DONE:
                    DoUseDoorOrButton(GO_GOLEM_ROOM_N);
                    DoUseDoorOrButton(GO_GOLEM_ROOM_S);
                    DoUseDoorOrButton(GO_THRONE_ROOM);
                    break;
            }
            m_auiEncounter[5] = uiData;
            break;
        case TYPE_QUEST_JAIL_BREAK:
            m_auiEncounter[6] = uiData;
            return;
    }

    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_strInstData = saveStream.str();

        SaveToDB();
        OUT_SAVE_INST_DATA_COMPLETE;
    }
}
Example #29
0
        void SetData(uint32 type, uint32 data)
        {
            switch (type)
            {
                case DATA_RAGEWINTERCHILLEVENT:
                    m_auiEncounter[0] = data;
                    break;
                case DATA_ANETHERONEVENT:
                    m_auiEncounter[1] = data;
                    break;
                case DATA_KAZROGALEVENT:
                    m_auiEncounter[2] = data;
                    break;
                case DATA_AZGALOREVENT:
                    {
                        m_auiEncounter[3] = data;
                        if (data == DONE)
                        {
                            if (ArchiYell)
                                break;

                            ArchiYell = true;

                            Creature* creature = instance->GetCreature(Azgalor);
                            if (creature)
                            {
                                Creature* unit = creature->SummonCreature(21987, creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 10000);

                                Map* map = creature->GetMap();
                                if (map->IsDungeon() && unit)
                                {
                                    unit->SetVisible(false);
                                    Map::PlayerList const &PlayerList = map->GetPlayers();
                                    if (PlayerList.isEmpty())
                                         return;

                                    for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
                                    {
                                         if (i->getSource())
                                         {
                                            WorldPacket packet(SMSG_MESSAGECHAT, 200);
                                            unit->BuildMonsterChat(&packet, CHAT_MSG_MONSTER_YELL, YELL_EFFORTS, 0, YELL_EFFORTS_NAME, i->getSource()->GetGUID());
                                            i->getSource()->GetSession()->SendPacket(&packet);

                                            WorldPacket data2(SMSG_PLAY_SOUND, 4);
                                            data2 << uint32(10986);
                                            data2 << uint64(unit->GetGUID());
                                            i->getSource()->GetSession()->SendPacket(&data2);
                                         }
                                    }
                                }
                            }
                        }
                    }
                    break;
                case DATA_ARCHIMONDEEVENT:
                    m_auiEncounter[4] = data;
                    break;
                case DATA_RESET_TRASH_COUNT:
                    Trash = 0;
                    break;
                case DATA_TRASH:
                    if (data)
                        Trash = data;
                    else
                        Trash--;
                    DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, Trash);
                    break;
                case TYPE_RETREAT:
                    if (data == SPECIAL)
                    {
                        if (!m_uiAncientGemGUID.empty())
                        {
                            for (std::list<uint64>::const_iterator itr = m_uiAncientGemGUID.begin(); itr != m_uiAncientGemGUID.end(); ++itr)
                            {
                                //don't know how long it expected
                                DoRespawnGameObject(*itr, DAY);
                            }
                        }
                    }
                    break;
                case DATA_ALLIANCE_RETREAT:
                    allianceRetreat = data;
                    HandleGameObject(HordeGate, true);
                    SaveToDB();
                    break;
                case DATA_HORDE_RETREAT:
                    hordeRetreat = data;
                    HandleGameObject(ElfGate, true);
                    SaveToDB();
                    break;
                case DATA_RAIDDAMAGE:
                    RaidDamage += data;
                    if (RaidDamage >= MINRAIDDAMAGE)
                        RaidDamage = MINRAIDDAMAGE;
                    break;
                case DATA_RESET_RAIDDAMAGE:
                    RaidDamage = 0;
                    break;
            }

             TC_LOG_DEBUG(LOG_FILTER_TSCR, "Instance Hyjal: Instance data updated for event %u (Data=%u)", type, data);

            if (data == DONE)
            {
                OUT_SAVE_INST_DATA;

                std::ostringstream saveStream;
                saveStream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' '
                    << m_auiEncounter[3] << ' ' << m_auiEncounter[4]
                    << ' ' << allianceRetreat << ' ' << hordeRetreat
                    << ' ' << RaidDamage;

                str_data = saveStream.str();

                SaveToDB();
                OUT_SAVE_INST_DATA_COMPLETE;
            }

        }
Example #30
0
/*
Tribute Event
*/
void instance_dire_maul::GordokTributeEvent(uint32 diff)
{
	if(1<2)return;
	Creature* pChoRush = instance->GetCreature(m_uiChoRushGUID);
	Creature* pMizzle = instance->GetCreature(m_uiMizzleGUID);
	Creature* pTrigger = instance->GetCreature(m_uiTributeTriggerGUID);

	Map* pMap;
	pMap = pChoRush->GetMap();

	Map::PlayerList const &PlayerList = pMap->GetPlayers();

	if ((GetData(TYPE_KING_GORDOK) == DONE) && pMap->GetCreature(m_uiChoRushGUID)->isAlive() && !pChoRushHome)
	{
		pChoRush->SetFlag(UNIT_NPC_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PASSIVE);
		pChoRush->setFaction(35);
		pChoRush->DeleteThreatList();
		pChoRush->CombatStop();
		pChoRush->SetCanAttackPlayer(false);
		pChoRush->AI()->EnterEvadeMode();

		pChoRushHome = true;
		GossipStepGordok = 1;
		Text_Timer_Event = 1000;
	}
	else if ((TYPE_KING_GORDOK == DONE) && pMap->GetCreature(m_uiChoRushGUID)->isDead())
	{
		for(Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
		{
			Player* pPlayer = itr->getSource();
			if (pPlayer->IsWithinDistInMap(pTrigger, 30.0f))
					pTrigger->CastSpell(pPlayer, SPELL_KING_OF_GORDOK, false);
		}
	}

	if(pChoRushHome)
	{
		if (Text_Timer_Event<diff)
		{
			switch (GossipStepGordok)
			{
				case 1:
				DoScriptText(ChoRush_SAY_1, pChoRush);
				pChoRush->HandleEmote(EMOTE_STATE_TALK);
				pChoRush->SummonCreature(NPC_MIZZLE_THE_CRAFTY, 817.666f, 478.371f, 37.3182f, 3.07057f, TEMPSUMMON_TIMED_DESPAWN, 9000000);
				Text_Timer_Event = 5000;
				break;

				case 2:
				pChoRush->HandleEmote(EMOTE_STATE_SIT);
				DoScriptText(Mizzle_SAY_1, pMizzle);
				pMizzle->HandleEmote(EMOTE_STATE_TALK);
				Text_Timer_Event = 5000;
				break;

				case 3:
				DoScriptText(Mizzle_SAY_2, pMizzle);
				pMizzle->HandleEmote(EMOTE_STATE_TALK);
				Text_Timer_Event = 8000;
				break;

				case 4:
				for(Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
				{
					Player* pPlayer = itr->getSource();
					if (pPlayer->IsWithinDistInMap(pMizzle, 50.0f))
							pMizzle->CastSpell(pPlayer, SPELL_KING_OF_GORDOK, false);
				}
				if (pMap->GetCreature(m_uiMoldarGUID)->isAlive() && pMap->GetCreature(m_uiMizzleGUID)->isAlive() && pMap->GetCreature(m_uiFengusGUID)->isAlive())
				{
					pMizzle->SummonObject(pMap, GO_GORDOK_TRIBUTE, 809.899719f, 482.306366f, 37.318359f, 0.212846f);
					pMizzle->HandleEmote(EMOTE_ONESHOT_APPLAUD);
				}
				pChoRushHome = false;
				break;
			}
		}
		else Text_Timer_Event -= diff;
	}
}