From 0c0a71a7d48ec211a5bd48aa438ec4fed6a16db6 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Thu, 16 May 2019 01:33:16 +0200 Subject: [PATCH] Scripts/TotFW: players will now properly be able to release their spirits when they die during a encounter in Throne of the Four winds --- .../instance_throne_of_the_four_winds.cpp | 6 ++++++ .../ThroneOfTheFourWinds/throne_of_the_four_winds.cpp | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-) 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 9d34c816542..a7af2a31fe0 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 @@ -151,6 +151,12 @@ class instance_throne_of_the_four_winds : public InstanceMapScript player->CastSpell(player, SPELL_SERENITY); } + void OnUnitDeath(Unit* unit) override + { + if (unit->GetTypeId() == TYPEID_PLAYER) + unit->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IS_OUT_OF_BOUNDS); + } + bool SetBossState(uint32 type, EncounterState state) override { if (!InstanceScript::SetBossState(type, state)) diff --git a/src/server/scripts/Kalimdor/ThroneOfTheFourWinds/throne_of_the_four_winds.cpp b/src/server/scripts/Kalimdor/ThroneOfTheFourWinds/throne_of_the_four_winds.cpp index b3c1bebfd6d..0e6385076fa 100644 --- a/src/server/scripts/Kalimdor/ThroneOfTheFourWinds/throne_of_the_four_winds.cpp +++ b/src/server/scripts/Kalimdor/ThroneOfTheFourWinds/throne_of_the_four_winds.cpp @@ -98,16 +98,13 @@ class at_totfw_catch_fall : public AreaTriggerScript else if (Creature* rohash = instance->GetCreature(DATA_ROHASH)) rohash->AI()->DoAction(ACTION_PLAYER_LEFT_PLATFORM); - if (instance->GetBossState(DATA_ALAKIR) != IN_PROGRESS) + if (!instance->IsEncounterInProgress()) { if (Creature* trigger = player->FindNearestCreature(NPC_WORLD_TRIGGER, 500.0f, true)) trigger->CastSpell(player, SPELL_CATCH_FALL, true); } else - { player->KillSelf(); - player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IS_OUT_OF_BOUNDS); - } return true; }