Fixed Mirror Image

close #730
This commit is contained in:
talamortis
2017-12-13 19:14:38 +00:00
parent 6d5f59d83a
commit a0d17509a2

View File

@@ -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)