fix(Scripts/SSC): Fix Leotheras running in melee range in demon phase (#20507)
* fix(Scripts/SSC): Fix Leotheras running in melee range in demon phase * Update boss_leotheras_the_blind.cpp
This commit is contained in:
+11
-9
@@ -128,6 +128,14 @@ struct boss_leotheras_the_blind : public BossAI
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AttackStart(Unit* who) override
|
||||||
|
{
|
||||||
|
if (me->HasAura(SPELL_METAMORPHOSIS))
|
||||||
|
AttackStartCaster(who, 40.0f);
|
||||||
|
else
|
||||||
|
ScriptedAI::AttackStart(who);
|
||||||
|
}
|
||||||
|
|
||||||
void DoAction(int32 actionId) override
|
void DoAction(int32 actionId) override
|
||||||
{
|
{
|
||||||
if (actionId == ACTION_CHECK_SPELLBINDERS)
|
if (actionId == ACTION_CHECK_SPELLBINDERS)
|
||||||
@@ -172,16 +180,14 @@ struct boss_leotheras_the_blind : public BossAI
|
|||||||
|
|
||||||
void MoveToTargetIfOutOfRange(Unit* target)
|
void MoveToTargetIfOutOfRange(Unit* target)
|
||||||
{
|
{
|
||||||
if (me->GetDistance2d(target) > 40.0f)
|
if (!me->IsWithinDistInMap(target, 40.0f))
|
||||||
{
|
{
|
||||||
me->GetMotionMaster()->MoveChase(target, 5.0f, 0);
|
me->GetMotionMaster()->MoveChase(target, 40.0f, 0);
|
||||||
me->AddThreat(target, 0.0f);
|
me->AddThreat(target, 0.0f);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
me->GetMotionMaster()->Clear();
|
me->GetMotionMaster()->Clear();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void DemonTime()
|
void DemonTime()
|
||||||
{
|
{
|
||||||
@@ -204,7 +210,7 @@ struct boss_leotheras_the_blind : public BossAI
|
|||||||
{
|
{
|
||||||
DoResetThreatList();
|
DoResetThreatList();
|
||||||
me->LoadEquipment();
|
me->LoadEquipment();
|
||||||
me->GetMotionMaster()->MoveChase(me->GetVictim(), 0.0f);
|
me->ResumeChasingVictim();
|
||||||
me->RemoveAurasDueToSpell(SPELL_METAMORPHOSIS);
|
me->RemoveAurasDueToSpell(SPELL_METAMORPHOSIS);
|
||||||
scheduler.CancelGroup(GROUP_DEMON);
|
scheduler.CancelGroup(GROUP_DEMON);
|
||||||
ElfTime();
|
ElfTime();
|
||||||
@@ -223,10 +229,8 @@ struct boss_leotheras_the_blind : public BossAI
|
|||||||
if (me->GetDisplayId() == me->GetNativeDisplayId())
|
if (me->GetDisplayId() == me->GetNativeDisplayId())
|
||||||
{
|
{
|
||||||
if (me->GetReactState() != REACT_PASSIVE)
|
if (me->GetReactState() != REACT_PASSIVE)
|
||||||
{
|
|
||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (me->isAttackReady(BASE_ATTACK))
|
else if (me->isAttackReady(BASE_ATTACK))
|
||||||
{
|
{
|
||||||
if (DoCastVictim(SPELL_CHAOS_BLAST) != SPELL_CAST_OK)
|
if (DoCastVictim(SPELL_CHAOS_BLAST) != SPELL_CAST_OK)
|
||||||
@@ -235,11 +239,9 @@ struct boss_leotheras_the_blind : public BossAI
|
|||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
me->setAttackTimer(BASE_ATTACK, 2000);
|
me->setAttackTimer(BASE_ATTACK, 2000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
private:
|
private:
|
||||||
bool _recentlySpoken;
|
bool _recentlySpoken;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user