fix(Scripts/UBRS): The Beast should deaggro when walking over the fir… (#9201)
The Best should not use fireball and then fireblast at the same time. Fixes #9127
This commit is contained in:
+17
@@ -86,6 +86,9 @@ private:
|
|||||||
Creature* _me;
|
Creature* _me;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Used to make Hodir disengage whenever he leaves his room
|
||||||
|
constexpr static float FirewalPositionY = -505.f;
|
||||||
|
|
||||||
class boss_the_beast : public CreatureScript
|
class boss_the_beast : public CreatureScript
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -184,6 +187,12 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (me->GetPositionY() > FirewalPositionY)
|
||||||
|
{
|
||||||
|
EnterEvadeMode();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
events.Update(diff);
|
events.Update(diff);
|
||||||
|
|
||||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||||
@@ -217,10 +226,18 @@ public:
|
|||||||
case EVENT_FIREBALL:
|
case EVENT_FIREBALL:
|
||||||
DoCastVictim(SPELL_FIREBALL);
|
DoCastVictim(SPELL_FIREBALL);
|
||||||
events.ScheduleEvent(EVENT_FIREBALL, 8 * IN_MILLISECONDS, 21 * IN_MILLISECONDS);
|
events.ScheduleEvent(EVENT_FIREBALL, 8 * IN_MILLISECONDS, 21 * IN_MILLISECONDS);
|
||||||
|
if (events.GetNextEventTime(EVENT_FIREBLAST) < 3 * IN_MILLISECONDS)
|
||||||
|
{
|
||||||
|
events.RescheduleEvent(EVENT_FIREBLAST, 3 * IN_MILLISECONDS);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case EVENT_FIREBLAST:
|
case EVENT_FIREBLAST:
|
||||||
DoCastVictim(SPELL_FIREBLAST);
|
DoCastVictim(SPELL_FIREBLAST);
|
||||||
events.ScheduleEvent(EVENT_FIREBLAST, 5 * IN_MILLISECONDS, 8 * IN_MILLISECONDS);
|
events.ScheduleEvent(EVENT_FIREBLAST, 5 * IN_MILLISECONDS, 8 * IN_MILLISECONDS);
|
||||||
|
if (events.GetNextEventTime(EVENT_FIREBALL) < 3 * IN_MILLISECONDS)
|
||||||
|
{
|
||||||
|
events.RescheduleEvent(EVENT_FIREBALL, 3 * IN_MILLISECONDS);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user