diff --git a/src/server/scripts/Kalimdor/LostCityOfTheTolvir/instance_lost_city_of_the_tolvir.cpp b/src/server/scripts/Kalimdor/LostCityOfTheTolvir/instance_lost_city_of_the_tolvir.cpp index bac3a4c354..369307f679 100644 --- a/src/server/scripts/Kalimdor/LostCityOfTheTolvir/instance_lost_city_of_the_tolvir.cpp +++ b/src/server/scripts/Kalimdor/LostCityOfTheTolvir/instance_lost_city_of_the_tolvir.cpp @@ -66,8 +66,8 @@ ObjectData const creatureData[] = ObjectData const gameObjectData[] = { - { GO_SIAMAT_PLATFORM, DATA_SIAMAT_PLATFORM }, - { 0, 0 } // End + { GO_SIAMATS_PLATFORM, DATA_SIAMAT_PLATFORM }, + { 0, 0 } // End }; class instance_lost_city_of_the_tolvir : public InstanceMapScript @@ -88,6 +88,14 @@ class instance_lost_city_of_the_tolvir : public InstanceMapScript void Initialize() { heroicAughSpawned = false; + if (IsSiamatEnabled()) + { + if (Creature* siamat = GetCreature(DATA_SIAMAT)) + siamat->setActive(true); + + instance->SetZoneWeather(ZONE_ID_LOST_CITY, WEATHER_STATE_HEAVY_RAIN, 1.0f); + instance->SummonCreatureGroup(SUMMON_GROUP_WIND_TUNNEL); + } } void OnCreatureCreate(Creature* creature) override @@ -100,6 +108,25 @@ class instance_lost_city_of_the_tolvir : public InstanceMapScript creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); } + void OnGameObjectCreate(GameObject* go) override + { + InstanceScript::OnGameObjectCreate(go); + + switch (go->GetEntry()) + { + case GO_SIAMATS_PLATFORM: + if (IsSiamatEnabled()) + { + go->setActive(true); + go->SetDestructibleState(GO_DESTRUCTIBLE_DESTROYED); + go->EnableCollision(true); + } + break; + default: + break; + } + } + bool SetBossState(uint32 type, EncounterState state) override { if (!InstanceScript::SetBossState(type, state)) @@ -122,7 +149,7 @@ class instance_lost_city_of_the_tolvir : public InstanceMapScript case DATA_GENERAL_HUSAM: case DATA_LOCKMAW_AND_AUGH: case DATA_HIGH_PROPHET_BARIM: - if (state == DONE && CheckSiamatsPlatform()) + if (state == DONE && IsSiamatEnabled()) { if (GameObject* platform = GetGameObject(DATA_SIAMAT_PLATFORM)) { @@ -142,7 +169,7 @@ class instance_lost_city_of_the_tolvir : public InstanceMapScript } break; case DATA_SIAMAT: // anti-cheat protection - if (state == IN_PROGRESS && !CheckSiamatsPlatform()) + if (state == IN_PROGRESS && !IsSiamatEnabled()) if (Creature* siamat = GetCreature(DATA_SIAMAT)) siamat->AI()->EnterEvadeMode(); if (state == DONE) @@ -193,7 +220,7 @@ class instance_lost_city_of_the_tolvir : public InstanceMapScript } } - bool CheckSiamatsPlatform() + bool IsSiamatEnabled() { for (LCTDataTypes boss : { DATA_GENERAL_HUSAM, DATA_LOCKMAW_AND_AUGH, DATA_HIGH_PROPHET_BARIM }) if (GetBossState(boss) != DONE) diff --git a/src/server/scripts/Kalimdor/LostCityOfTheTolvir/lost_city_of_the_tolvir.h b/src/server/scripts/Kalimdor/LostCityOfTheTolvir/lost_city_of_the_tolvir.h index 1595403bb1..ff06c1cb4a 100644 --- a/src/server/scripts/Kalimdor/LostCityOfTheTolvir/lost_city_of_the_tolvir.h +++ b/src/server/scripts/Kalimdor/LostCityOfTheTolvir/lost_city_of_the_tolvir.h @@ -77,7 +77,7 @@ enum LCTCreatureIds enum LCTGameObjectIds { - GO_SIAMAT_PLATFORM = 205365 + GO_SIAMATS_PLATFORM = 205365 }; enum LCTSpells