mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 05:06:24 +00:00
refactor(Core/ScriptedAI): few improvements with threat methods (#13146)
improve threat scripts Co-authored-by: Maelthyrr <lynethris@protonmail.ch>
This commit is contained in:
@@ -124,7 +124,7 @@ public:
|
||||
me->CastSpell(target, SPELL_INCITE_CHAOS_B, true);
|
||||
}
|
||||
|
||||
DoResetThreat();
|
||||
DoResetThreatList();
|
||||
InciteChaos = true;
|
||||
events.DelayEvents(15000);
|
||||
events.RepeatEvent(40000);
|
||||
|
||||
@@ -247,7 +247,7 @@ public:
|
||||
if (me->IsWithinMeleeRange(me->GetVictim()))
|
||||
{
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
DoResetThreat();
|
||||
DoResetThreatList();
|
||||
me->GetVictim()->InterruptNonMeleeSpells(false);
|
||||
me->AddThreat(me->GetVictim(), 1000000.0f);
|
||||
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
{
|
||||
events.CancelEventGroup(EVENT_GROUP_ABILITIES);
|
||||
events.ScheduleEvent(EVENT_SWITCH_PHASE, 60000);
|
||||
DoResetThreat();
|
||||
DoResetThreatList();
|
||||
|
||||
if (!run)
|
||||
{
|
||||
@@ -167,7 +167,7 @@ public:
|
||||
case EVENT_SWITCH_TARGET:
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
|
||||
{
|
||||
DoResetThreat();
|
||||
DoResetThreatList();
|
||||
me->AddThreat(target, 5000000.0f);
|
||||
Talk(EMOTE_NEW_TARGET);
|
||||
}
|
||||
|
||||
@@ -553,7 +553,7 @@ public:
|
||||
me->CastSpell(me, SPELL_VANISH_OUT, false);
|
||||
break;
|
||||
case EVENT_SPELL_ENRAGE:
|
||||
DoResetThreat();
|
||||
DoResetThreatList();
|
||||
if (Creature* council = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_ILLIDARI_COUNCIL)))
|
||||
council->GetAI()->DoAction(ACTION_ENRAGE);
|
||||
break;
|
||||
|
||||
@@ -120,7 +120,7 @@ public:
|
||||
void SetForm(bool corrupt, bool initial)
|
||||
{
|
||||
events.CancelEventGroup(GROUP_ABILITIES);
|
||||
DoResetThreat();
|
||||
DoResetThreatList();
|
||||
|
||||
if (corrupt)
|
||||
{
|
||||
|
||||
@@ -203,7 +203,7 @@ public:
|
||||
{
|
||||
if (me->GetDisplayId() != me->GetNativeDisplayId())
|
||||
{
|
||||
DoResetThreat();
|
||||
DoResetThreatList();
|
||||
me->LoadEquipment();
|
||||
me->RemoveAurasDueToSpell(SPELL_METAMORPHOSIS);
|
||||
events.ScheduleEvent(EVENT_SPELL_WHIRLWIND, 10000);
|
||||
@@ -223,7 +223,7 @@ public:
|
||||
events.ScheduleEvent(EVENT_HEALTH_CHECK, 1000);
|
||||
break;
|
||||
case EVENT_SWITCH_TO_DEMON:
|
||||
DoResetThreat();
|
||||
DoResetThreatList();
|
||||
Talk(SAY_SWITCH_TO_DEMON);
|
||||
me->LoadEquipment(0, true);
|
||||
me->GetMotionMaster()->MoveChase(me->GetVictim(), 25.0f);
|
||||
@@ -234,7 +234,7 @@ public:
|
||||
events.ScheduleEvent(EVENT_SWITCH_TO_ELF, 60000);
|
||||
break;
|
||||
case EVENT_SWITCH_TO_ELF:
|
||||
DoResetThreat();
|
||||
DoResetThreatList();
|
||||
me->LoadEquipment();
|
||||
me->GetMotionMaster()->MoveChase(me->GetVictim(), 0.0f);
|
||||
me->RemoveAurasDueToSpell(SPELL_METAMORPHOSIS);
|
||||
|
||||
@@ -201,7 +201,7 @@ public:
|
||||
head->AI()->Talk(threatYell - 1);
|
||||
events.ScheduleEvent(threatYell, 3000);
|
||||
|
||||
DoResetThreat();
|
||||
DoResetThreatList();
|
||||
me->AddThreat(target, 10.0f);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_RESET_THREAT, 30000);
|
||||
|
||||
@@ -480,7 +480,7 @@ public:
|
||||
events2.CancelEvent(EVENT_PREFIGHT_PHASE71);
|
||||
Talk(SAY_PHASE4_INTRO2);
|
||||
phase = PHASE_FINAL;
|
||||
DoResetThreat();
|
||||
DoResetThreatList();
|
||||
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE);
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
|
||||
AttackStart(target);
|
||||
|
||||
Reference in New Issue
Block a user