mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 18:40:28 +00:00
fix(Scripts/OnyxiasLair): Force Onyxia to enter evade mode if pulled out of her room (#10890)
This commit is contained in:
@@ -106,14 +106,12 @@ static sOnyxMove OnyxiaMoveData[] =
|
||||
|
||||
enum Yells
|
||||
{
|
||||
// Say
|
||||
SAY_AGGRO = 0,
|
||||
SAY_KILL = 1,
|
||||
SAY_PHASE_2_TRANS = 2,
|
||||
SAY_PHASE_3_TRANS = 3,
|
||||
|
||||
// Emote
|
||||
EMOTE_BREATH = 4
|
||||
EMOTE_BREATH = 4,
|
||||
SAY_EVADE = 5
|
||||
};
|
||||
|
||||
struct boss_onyxia : public BossAI
|
||||
@@ -187,6 +185,8 @@ public:
|
||||
instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); // just in case at reset some players already left the instance
|
||||
instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
|
||||
BossAI::EnterCombat(who);
|
||||
|
||||
me->SummonCreature(NPC_ONYXIAN_LAIR_GUARD, -167.837936f, -200.549332f, -66.343231f, 5.598287f, TEMPSUMMON_MANUAL_DESPAWN);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
|
||||
@@ -204,11 +204,18 @@ public:
|
||||
|
||||
void JustSummoned(Creature* summon) override
|
||||
{
|
||||
summons.Summon(summon);
|
||||
|
||||
if (summon->GetEntry() != NPC_ONYXIAN_WHELP && summon->GetEntry() != NPC_ONYXIAN_LAIR_GUARD)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (summon->GetEntry() == NPC_ONYXIAN_LAIR_GUARD && Phase != PHASE_LANDED)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (Unit* target = summon->SelectNearestTarget(300.0f))
|
||||
{
|
||||
summon->AI()->AttackStart(target);
|
||||
@@ -287,9 +294,21 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
bool CheckInRoom()
|
||||
{
|
||||
if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 95.0f)
|
||||
{
|
||||
Talk(SAY_EVADE);
|
||||
EnterEvadeMode();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
if (!UpdateVictim() || !CheckInRoom())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user