fix(Core/Util): EventMap::RepeatEvent when eventId is retrieved by ExecuteEvent() call (#3426)

This commit is contained in:
Andrius Peleckas
2020-10-17 15:59:22 +03:00
committed by GitHub
parent 32da0eeb9e
commit ab5933effa
131 changed files with 558 additions and 1012 deletions

View File

@@ -97,14 +97,13 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch (events.GetEvent())
switch (events.ExecuteEvent())
{
case EVENT_CHECK_HEALTH:
if (HealthBelowPct(25))
{
Talk(SAY_SUMMON);
me->CastSpell(me, SPELL_SUMMON_AVATAR, false);
events.PopEvent();
return;
}
events.RepeatEvent(2000);
@@ -190,7 +189,7 @@ public:
return;
events.Update(diff);
if (events.GetEvent() == EVENT_STOLEN_SOUL_SPELL)
if (events.ExecuteEvent() == EVENT_STOLEN_SOUL_SPELL)
{
switch (myClass)
{

View File

@@ -98,7 +98,7 @@ public:
void UpdateAI(uint32 diff)
{
events.Update(diff);
uint32 eventId = events.GetEvent();
uint32 eventId = events.ExecuteEvent();
if (eventId == EVENT_SPELL_INHIBIT_MAGIC)
{
@@ -157,11 +157,9 @@ public:
case EVENT_SPELL_FOCUS_FIRE_2:
if (Unit* flare = ObjectAccessor::GetCreature(*me, focusGUID))
me->CastSpell(flare, SPELL_FOCUS_CAST, true);
events.PopEvent();
break;
case EVENT_SPELL_FOCUS_FIRE_3:
me->SetControlled(false, UNIT_STATE_ROOT);
events.PopEvent();
break;
}

View File

@@ -125,7 +125,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch (events.GetEvent())
switch (events.ExecuteEvent())
{
case EVENT_SPELL_FROST_NOVA:
me->CastSpell(me, SPELL_FROSTNOVA, false);
@@ -139,7 +139,6 @@ public:
break;
case EVENT_SPELL_BLINK:
me->CastSpell(me, SPELL_BLINK, false);
events.PopEvent();
events.RescheduleEvent(EVENT_SPELL_FR_FI, 0);
break;
case EVENT_SPELL_BEACON:

View File

@@ -81,7 +81,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch (events.GetEvent())
switch (events.ExecuteEvent())
{
case EVENT_VOID_BLAST:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))

View File

@@ -105,7 +105,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch (events.GetEvent())
switch (events.ExecuteEvent())
{
case EVENT_SPELL_ARCANE_VOLLEY:
me->CastSpell(me, SPELL_ARCANE_VOLLEY_N, false);
@@ -124,7 +124,6 @@ public:
if (me->HealthBelowPct(20))
{
me->CastSpell(me, SPELL_MANA_SHIELD, false);
events.PopEvent();
return;
}
events.RepeatEvent(1000);
@@ -145,7 +144,6 @@ public:
case EVENT_SPELL_BLINK_2:
me->CastSpell(me, SPELL_ARCANE_EXPLOSION_N, false);
me->CastSpell(me, SPELL_ARCANE_BUBBLE, true);
events.PopEvent();
break;
}
@@ -271,7 +269,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING | UNIT_STATE_STUNNED))
return;
switch (events.GetEvent())
switch (events.ExecuteEvent())
{
case EVENT_SPELL_SCREECH:
me->CastSpell(me, SPELL_PARALYZING_SCREECH, false);
@@ -294,7 +292,6 @@ public:
if (me->HealthBelowPct(66))
{
SummonBroods();
events.PopEvent();
events.DelayEvents(10000);
return;
}
@@ -304,7 +301,6 @@ public:
if (me->HealthBelowPct(33))
{
SummonBroods();
events.PopEvent();
events.DelayEvents(10000);
return;
}

View File

@@ -133,7 +133,7 @@ public:
}
events.Update(diff);
switch (events.GetEvent())
switch (events.ExecuteEvent())
{
case EVENT_SPELL_CORROSIVE:
me->CastSpell(me->GetVictim(), SPELL_CORROSIVE_ACID, false);
@@ -145,7 +145,6 @@ public:
break;
case EVENT_SPELL_ENRAGE:
me->CastSpell(me->GetVictim(), SPELL_ENRAGE, false);
events.PopEvent();
break;
}

View File

@@ -94,11 +94,10 @@ public:
return;
events.Update(diff);
switch (events.GetEvent())
switch (events.ExecuteEvent())
{
case EVENT_INCITE_WAIT:
InciteChaos = false;
events.PopEvent();
break;
case EVENT_SPELL_INCITE:
{

View File

@@ -155,7 +155,7 @@ public:
return;
events.Update(diff);
switch (events.GetEvent())
switch (events.ExecuteEvent())
{
case EVENT_SPELL_SHADOWBOLT:
me->CastSpell(me, SPELL_SHADOWBOLT_VOLLEY, false);

View File

@@ -91,7 +91,7 @@ public:
return;
events.Update(diff);
switch (events.GetEvent())
switch (events.ExecuteEvent())
{
case EVENT_SPELL_SONIC_BOOM:
Talk(EMOTE_SONIC_BOOM);
@@ -102,7 +102,6 @@ public:
return;
case EVENT_SPELL_SONIC_BOOM_EFFECT:
me->CastSpell(me, DUNGEON_MODE(SPELL_SONIC_BOOM_EFFECT_N, SPELL_SONIC_BOOM_EFFECT_H), true);
events.PopEvent();
break;
case EVENT_SPELL_MURMURS_TOUCH:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 80.0f, true))