diff --git a/src/server/scripts/Pet/pet_mage.cpp b/src/server/scripts/Pet/pet_mage.cpp index 6a3d8e320..39266cc38 100644 --- a/src/server/scripts/Pet/pet_mage.cpp +++ b/src/server/scripts/Pet/pet_mage.cpp @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2016+ AzerothCore , released under GNU GPL v2 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-GPL2 * Copyright (C) 2008-2016 TrinityCore * Copyright (C) 2005-2009 MaNGOS @@ -81,7 +81,7 @@ class npc_pet_mage_mirror_image : public CreatureScript ((Minion*)me)->SetFollowAngle(angle); me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle(), MOTION_SLOT_ACTIVE); - me->SetReactState(REACT_PASSIVE); + me->SetReactState(REACT_DEFENSIVE); // Xinef: Inherit Master's Threat List (not yet implemented) //owner->CastSpell((Unit*)NULL, SPELL_MAGE_MASTERS_THREAT_LIST, true); @@ -149,26 +149,14 @@ class npc_pet_mage_mirror_image : public CreatureScript if (owner && owner->GetTypeId() == TYPEID_PLAYER) { Unit* selection = owner->ToPlayer()->GetSelectedUnit(); - if (selection && selection != me->GetVictim()) - { - // target has cc, search target without cc! - if (selection->HasBreakableByDamageCrowdControlAura() || !me->IsValidAttackTarget(selection)) - { - EnterEvadeMode(); - return; - } + if (selection) + { me->getThreatManager().resetAllAggro(); me->AddThreat(selection, 1000000.0f); - - if (owner->IsInCombat()) - AttackStart(selection); - + AttackStart(selection); } } - - if (!me->GetVictim() || !me->GetVictim()->IsAlive()) - return; } void Reset() @@ -183,6 +171,9 @@ class npc_pet_mage_mirror_image : public CreatureScript if (events.GetTimer() < 1200) return; + if (!me->GetVictim() || !me->GetVictim()->IsAlive()) + EnterEvadeMode(); + if (!me->IsInCombat() || !me->GetVictim()) { MySelectNextTarget(); @@ -190,23 +181,17 @@ class npc_pet_mage_mirror_image : public CreatureScript } checktarget += diff; + if (checktarget >= 1000) { if (me->GetVictim()->HasBreakableByDamageCrowdControlAura() || !me->GetVictim()->IsAlive()) { MySelectNextTarget(); - me->InterruptNonMeleeSpells(true); // Stop casting if target is C or not Alive. + me->InterruptNonMeleeSpells(true); // Stop casting if target is CC or not Alive. return; } } - selectionTimer += diff; - if (selectionTimer >= 1000) - { - MySelectNextTarget(); - selectionTimer = 0; - } - if (me->HasUnitState(UNIT_STATE_CASTING)) return;