mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 01:15:35 +01:00
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:
@@ -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))
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user