From d7d6838c3d5f868ffb9952f2b365b74cd2e3d2b6 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Sun, 18 Nov 2018 03:43:03 +0100 Subject: [PATCH] Scripts/TotFW: added LightOverride visual data to Al'akir's encounter and corrected weather handling --- .../ThroneOfTheFourWinds/boss_alakir.cpp | 2 -- .../instance_throne_of_the_four_winds.cpp | 31 +++++++++++++++---- .../throne_of_the_four_winds.h | 4 ++- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/src/server/scripts/Kalimdor/ThroneOfTheFourWinds/boss_alakir.cpp b/src/server/scripts/Kalimdor/ThroneOfTheFourWinds/boss_alakir.cpp index d6f42550d8c..e6b47f72eb3 100644 --- a/src/server/scripts/Kalimdor/ThroneOfTheFourWinds/boss_alakir.cpp +++ b/src/server/scripts/Kalimdor/ThroneOfTheFourWinds/boss_alakir.cpp @@ -352,7 +352,6 @@ struct boss_alakir : public BossAI { _EnterEvadeMode(); instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); - instance->SetData(DATA_ACID_RAIN_WEATHER, NOT_STARTED); instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_ACID_RAIN_DAMAGE); summons.DespawnAll(); @@ -373,7 +372,6 @@ struct boss_alakir : public BossAI _JustDied(); Talk(SAY_DEATH); instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); - instance->SetData(DATA_ACID_RAIN_WEATHER, NOT_STARTED); instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_ACID_RAIN_DAMAGE); instance->DoCastSpellOnPlayers(SPELL_SERENITY); DoCastSelf(SPELL_SUMMON_CHEST, true); diff --git a/src/server/scripts/Kalimdor/ThroneOfTheFourWinds/instance_throne_of_the_four_winds.cpp b/src/server/scripts/Kalimdor/ThroneOfTheFourWinds/instance_throne_of_the_four_winds.cpp index e5572307210..94af4ba3eb3 100644 --- a/src/server/scripts/Kalimdor/ThroneOfTheFourWinds/instance_throne_of_the_four_winds.cpp +++ b/src/server/scripts/Kalimdor/ThroneOfTheFourWinds/instance_throne_of_the_four_winds.cpp @@ -69,11 +69,6 @@ class instance_throne_of_the_four_winds : public InstanceMapScript SetHeaders(DataHeader); SetBossNumber(EncounterCount); LoadObjectData(creatureData, gameObjectData); - Initialize(); - } - - void Initialize() - { } void OnCreatureCreate(Creature* creature) override @@ -128,6 +123,20 @@ class instance_throne_of_the_four_winds : public InstanceMapScript go->setActive(true); go->SetFarVisible(true); + + switch (go->GetEntry()) + { + case GO_SKYWALL_RAID_CENTER_PLATFORM: + if (GetBossState(DATA_ALAKIR) == DONE) + go->SetDestructibleState(GO_DESTRUCTIBLE_DESTROYED); + break; + case GO_SKYWALL_WIND_DRAFT_EFFECT_CENTER: + if (GetBossState(DATA_ALAKIR) == DONE) + go->UseDoorOrButton(); + break; + default: + break; + } } void OnPlayerEnter(Player* player) override @@ -192,7 +201,16 @@ class instance_throne_of_the_four_winds : public InstanceMapScript break; case DATA_ALAKIR: if (state == FAIL) + { _relentlessStormVehicleGUIDs.clear(); + instance->SetZoneWeather(ZONE_ID_THRONE_OF_THE_FOUR_WINDS, WEATHER_STATE_FINE, 1.0f); + instance->SetZoneOverrideLight(ZONE_ID_THRONE_OF_THE_FOUR_WINDS, LIGHT_OVERRIDE_ID_DEFAULT, 3000); + } + else if (state == DONE) + { + instance->SetZoneWeather(ZONE_ID_THRONE_OF_THE_FOUR_WINDS, WEATHER_STATE_FOG, 0.0f); + instance->SetZoneOverrideLight(ZONE_ID_THRONE_OF_THE_FOUR_WINDS, LIGHT_OVERRIDE_ID_DEFAULT, 3000); + } default: break; } @@ -205,7 +223,8 @@ class instance_throne_of_the_four_winds : public InstanceMapScript switch (data) { case DATA_ACID_RAIN_WEATHER: - instance->SetZoneWeather(ZONE_ID_THRONE_OF_THE_FOUR_WINDS, WEATHER_STATE_HEAVY_RAIN, value == IN_PROGRESS ? 1.0f : 0.0f); + instance->SetZoneWeather(ZONE_ID_THRONE_OF_THE_FOUR_WINDS, WEATHER_STATE_HEAVY_RAIN, 1.0f); + instance->SetZoneOverrideLight(ZONE_ID_THRONE_OF_THE_FOUR_WINDS, LIGHT_OVERRIDE_ID_ACID_RAIN, 3000); break; default: break; diff --git a/src/server/scripts/Kalimdor/ThroneOfTheFourWinds/throne_of_the_four_winds.h b/src/server/scripts/Kalimdor/ThroneOfTheFourWinds/throne_of_the_four_winds.h index c449df84e4d..9bc09478d65 100644 --- a/src/server/scripts/Kalimdor/ThroneOfTheFourWinds/throne_of_the_four_winds.h +++ b/src/server/scripts/Kalimdor/ThroneOfTheFourWinds/throne_of_the_four_winds.h @@ -118,7 +118,9 @@ enum TFWActions enum TFWMisc { - ZONE_ID_THRONE_OF_THE_FOUR_WINDS = 5638 + ZONE_ID_THRONE_OF_THE_FOUR_WINDS = 5638, + LIGHT_OVERRIDE_ID_ACID_RAIN = 2810, + LIGHT_OVERRIDE_ID_DEFAULT = 2768 }; template