mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
@@ -52,6 +52,7 @@ class npc_pet_mage_mirror_image : public CreatureScript
|
||||
|
||||
uint32 selectionTimer;
|
||||
uint64 _ebonGargoyleGUID;
|
||||
uint32 checktarget;
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
@@ -135,7 +136,7 @@ class npc_pet_mage_mirror_image : public CreatureScript
|
||||
}
|
||||
}
|
||||
|
||||
bool MySelectNextTarget()
|
||||
void MySelectNextTarget()
|
||||
{
|
||||
if (_ebonGargoyleGUID)
|
||||
{
|
||||
@@ -153,21 +154,27 @@ class npc_pet_mage_mirror_image : public CreatureScript
|
||||
// target has cc, search target without cc!
|
||||
if (selection->HasBreakableByDamageCrowdControlAura() || !me->IsValidAttackTarget(selection))
|
||||
{
|
||||
return false;
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
|
||||
me->getThreatManager().resetAllAggro();
|
||||
me->AddThreat(selection, 1000000.0f);
|
||||
|
||||
if (owner->IsInCombat())
|
||||
AttackStart(selection);
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
if (!me->GetVictim() || !me->GetVictim()->IsAlive())
|
||||
return;
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
selectionTimer = 0;
|
||||
checktarget = 0;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
@@ -182,13 +189,16 @@ class npc_pet_mage_mirror_image : public CreatureScript
|
||||
return;
|
||||
}
|
||||
|
||||
checktarget += diff;
|
||||
if (checktarget >= 1000)
|
||||
{
|
||||
if (me->GetVictim()->HasBreakableByDamageCrowdControlAura() || !me->GetVictim()->IsAlive())
|
||||
{
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
if (!MySelectNextTarget())
|
||||
EnterEvadeMode();
|
||||
MySelectNextTarget();
|
||||
me->InterruptNonMeleeSpells(true); // Stop casting if target is C or not Alive.
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
selectionTimer += diff;
|
||||
if (selectionTimer >= 1000)
|
||||
|
||||
Reference in New Issue
Block a user