Core/Scripts: Fixed some delayed enrage

Closes #15367

(cherry picked from commit 63c436f5fb)
This commit is contained in:
Keader
2018-02-14 17:32:29 -03:00
committed by Shauren
parent 9c3802c1de
commit cb8ea03175
10 changed files with 24 additions and 21 deletions

View File

@@ -106,11 +106,11 @@ public:
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)

View File

@@ -183,11 +183,11 @@ class boss_baltharus_the_warborn : public CreatureScript
if (!events.IsInPhase(PHASE_INTRO))
me->SetHealth(instance->GetData(DATA_BALTHARUS_SHARED_HEALTH));
events.Update(diff);
if (!events.IsInPhase(PHASE_INTRO) && me->HasUnitState(UNIT_STATE_CASTING))
return;
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)

View File

@@ -128,11 +128,11 @@ class boss_general_zarithrian : public CreatureScript
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)

View File

@@ -320,11 +320,14 @@ class boss_halion : public CreatureScript
if (events.IsInPhase(PHASE_TWO))
return;
if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_CASTING))
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)

View File

@@ -79,11 +79,11 @@ public:
if (!UpdateVictim())
return;
_events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
_events.Update(diff);
while (uint32 eventId = _events.ExecuteEvent())
{
switch (eventId)

View File

@@ -176,11 +176,11 @@ struct boss_gurtogg_bloodboil : public BossAI
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)

View File

@@ -201,11 +201,11 @@ struct boss_illidari_council : public BossAI
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)

View File

@@ -261,11 +261,11 @@ struct boss_reliquary_of_souls : public BossAI
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)

View File

@@ -170,11 +170,11 @@ struct boss_teron_gorefiend : public BossAI
if (!events.IsInPhase(PHASE_INTRO) && !UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)

View File

@@ -220,11 +220,14 @@ class boss_magtheridon : public CreatureScript
void UpdateAI(uint32 diff) override
{
if (me->HasUnitState(UNIT_STATE_CASTING))
if (!events.IsInPhase(PHASE_BANISH) && !UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
@@ -294,9 +297,6 @@ class boss_magtheridon : public CreatureScript
return;
}
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
}