Skip to content

Commit

Permalink
Ulduar: Add different leashing check for hodir
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife committed Oct 7, 2024
1 parent c75ae4e commit 5c90dfd
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ struct boss_hodirAI : public BossAI
{
boss_hodirAI(Creature* creature) : BossAI(creature, HODIR_ACTIONS_MAX),
m_instance(dynamic_cast<instance_ulduar*>(creature->GetInstanceData())),
m_isRegularMode(creature->GetMap()->IsRegularDifficulty())
m_isRegularMode(creature->GetMap()->IsRegularDifficulty()),
m_eventFinished(false),
m_epilogueStage(0)
{
SetDataType(TYPE_HODIR);
AddOnAggroText(SAY_AGGRO);
Expand Down Expand Up @@ -144,8 +146,13 @@ struct boss_hodirAI : public BossAI
++m_epilogueStage;
});
SetDeathPrevention(true);
m_eventFinished = false;
m_epilogueStage = 0;
if (m_instance)
{
m_creature->GetCombatManager().SetLeashingCheck([](Unit* unit, float x, float y, float z)
{
return static_cast<ScriptedInstance*>(unit->GetInstanceData())->GetPlayerInMap(true, false) == nullptr;
});
}
}

instance_ulduar* m_instance;
Expand Down Expand Up @@ -183,13 +190,6 @@ struct boss_hodirAI : public BossAI
}
}

void KilledUnit(Unit* victim) override
{
BossAI::KilledUnit(victim);
if (!m_instance->GetPlayerInMap(true, false))
EnterEvadeMode();
}

void JustPreventedDeath(Unit* attacker) override
{
// Inform the faction helpers that the fight is over
Expand Down

0 comments on commit 5c90dfd

Please sign in to comment.