mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-09 08:17:56 +00:00
fix(Scripts/EmeraldDragons): fix summon player spam (#12573)
This commit is contained in:
@@ -64,6 +64,7 @@ enum Events
|
|||||||
EVENT_SEEPING_FOG = 1,
|
EVENT_SEEPING_FOG = 1,
|
||||||
EVENT_NOXIOUS_BREATH,
|
EVENT_NOXIOUS_BREATH,
|
||||||
EVENT_TAIL_SWEEP,
|
EVENT_TAIL_SWEEP,
|
||||||
|
EVENT_SUMMON_PLAYER,
|
||||||
|
|
||||||
// Ysondre
|
// Ysondre
|
||||||
EVENT_LIGHTNING_WAVE,
|
EVENT_LIGHTNING_WAVE,
|
||||||
@@ -102,6 +103,7 @@ struct emerald_dragonAI : public WorldBossAI
|
|||||||
events.ScheduleEvent(EVENT_TAIL_SWEEP, 4000);
|
events.ScheduleEvent(EVENT_TAIL_SWEEP, 4000);
|
||||||
events.ScheduleEvent(EVENT_NOXIOUS_BREATH, urand(7500, 15000));
|
events.ScheduleEvent(EVENT_NOXIOUS_BREATH, urand(7500, 15000));
|
||||||
events.ScheduleEvent(EVENT_SEEPING_FOG, urand(12500, 20000));
|
events.ScheduleEvent(EVENT_SEEPING_FOG, urand(12500, 20000));
|
||||||
|
events.ScheduleEvent(EVENT_SUMMON_PLAYER, 1s);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Target killed during encounter, mark them as suspectible for Aura Of Nature
|
// Target killed during encounter, mark them as suspectible for Aura Of Nature
|
||||||
@@ -133,6 +135,12 @@ struct emerald_dragonAI : public WorldBossAI
|
|||||||
DoCast(me, SPELL_TAIL_SWEEP);
|
DoCast(me, SPELL_TAIL_SWEEP);
|
||||||
events.ScheduleEvent(EVENT_TAIL_SWEEP, 2000);
|
events.ScheduleEvent(EVENT_TAIL_SWEEP, 2000);
|
||||||
break;
|
break;
|
||||||
|
case EVENT_SUMMON_PLAYER:
|
||||||
|
if (Unit* target = me->GetVictim())
|
||||||
|
if (!target->IsWithinRange(me, 50.f))
|
||||||
|
DoCast(target, SPELL_SUMMON_PLAYER);
|
||||||
|
events.ScheduleEvent(EVENT_SUMMON_PLAYER, 500ms);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,9 +157,6 @@ struct emerald_dragonAI : public WorldBossAI
|
|||||||
while (uint32 eventId = events.ExecuteEvent())
|
while (uint32 eventId = events.ExecuteEvent())
|
||||||
ExecuteEvent(eventId);
|
ExecuteEvent(eventId);
|
||||||
|
|
||||||
if (Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 0, -50.0f, true))
|
|
||||||
DoCast(target, SPELL_SUMMON_PLAYER);
|
|
||||||
|
|
||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user