More fixes for Mirror Image
When player loses target on the mirror image should still attack the current target
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-GPL2
|
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-GPL2
|
||||||
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
||||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||||
@@ -81,7 +81,7 @@ class npc_pet_mage_mirror_image : public CreatureScript
|
|||||||
|
|
||||||
((Minion*)me)->SetFollowAngle(angle);
|
((Minion*)me)->SetFollowAngle(angle);
|
||||||
me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle(), MOTION_SLOT_ACTIVE);
|
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)
|
// Xinef: Inherit Master's Threat List (not yet implemented)
|
||||||
//owner->CastSpell((Unit*)NULL, SPELL_MAGE_MASTERS_THREAT_LIST, true);
|
//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)
|
if (owner && owner->GetTypeId() == TYPEID_PLAYER)
|
||||||
{
|
{
|
||||||
Unit* selection = owner->ToPlayer()->GetSelectedUnit();
|
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->getThreatManager().resetAllAggro();
|
||||||
me->AddThreat(selection, 1000000.0f);
|
me->AddThreat(selection, 1000000.0f);
|
||||||
|
AttackStart(selection);
|
||||||
if (owner->IsInCombat())
|
|
||||||
AttackStart(selection);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!me->GetVictim() || !me->GetVictim()->IsAlive())
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Reset()
|
void Reset()
|
||||||
@@ -183,6 +171,9 @@ class npc_pet_mage_mirror_image : public CreatureScript
|
|||||||
if (events.GetTimer() < 1200)
|
if (events.GetTimer() < 1200)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!me->GetVictim() || !me->GetVictim()->IsAlive())
|
||||||
|
EnterEvadeMode();
|
||||||
|
|
||||||
if (!me->IsInCombat() || !me->GetVictim())
|
if (!me->IsInCombat() || !me->GetVictim())
|
||||||
{
|
{
|
||||||
MySelectNextTarget();
|
MySelectNextTarget();
|
||||||
@@ -190,23 +181,17 @@ class npc_pet_mage_mirror_image : public CreatureScript
|
|||||||
}
|
}
|
||||||
|
|
||||||
checktarget += diff;
|
checktarget += diff;
|
||||||
|
|
||||||
if (checktarget >= 1000)
|
if (checktarget >= 1000)
|
||||||
{
|
{
|
||||||
if (me->GetVictim()->HasBreakableByDamageCrowdControlAura() || !me->GetVictim()->IsAlive())
|
if (me->GetVictim()->HasBreakableByDamageCrowdControlAura() || !me->GetVictim()->IsAlive())
|
||||||
{
|
{
|
||||||
MySelectNextTarget();
|
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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
selectionTimer += diff;
|
|
||||||
if (selectionTimer >= 1000)
|
|
||||||
{
|
|
||||||
MySelectNextTarget();
|
|
||||||
selectionTimer = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user