Scripts/TotFW: players will now properly be able to release their spirits when they die during a encounter in Throne of the Four winds

This commit is contained in:
Ovahlord
2019-05-16 01:33:16 +02:00
parent 212c7a9b51
commit 0c0a71a7d4
2 changed files with 7 additions and 4 deletions

View File

@@ -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))

View File

@@ -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;
}