diff options
| author | megamage <none@none> | 2009-08-06 08:53:29 -0500 |
|---|---|---|
| committer | megamage <none@none> | 2009-08-06 08:53:29 -0500 |
| commit | d4dca0c8cdf41225d61f1309ee2d238024197a74 (patch) | |
| tree | e35e12f7ca752f34fb440c7a6332f9f507725d26 /src | |
| parent | 8c875f2323b5a029bde1a30a87088a970b848245 (diff) | |
*Mirror Image By thenecromancer
*Fixes a bug when images loose name after they reset
*Fixes a bug when images consistently interrupt owner's cast
*Fixed a bug when images have very laggy follow movement
*Removed a line that made no sense
--HG--
branch : trunk
Diffstat (limited to 'src')
| -rw-r--r-- | src/bindings/scripts/scripts/npc/npcs_special.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/bindings/scripts/scripts/npc/npcs_special.cpp b/src/bindings/scripts/scripts/npc/npcs_special.cpp index 8a3a6e8b102..9b31a9282d1 100644 --- a/src/bindings/scripts/scripts/npc/npcs_special.cpp +++ b/src/bindings/scripts/scripts/npc/npcs_special.cpp @@ -1641,14 +1641,13 @@ CreatureAI* GetAI_mob_mojo(Creature *_Creature) struct TRINITY_DLL_DECL npc_mirror_image : SpellAI { - npc_mirror_image(Creature *c) : SpellAI(c) {} + npc_mirror_image(Creature *c) : SpellAI(c) {Reset();} void Reset() { Unit * owner = me->GetOwner(); if (!owner) return; - owner->SetLevel(owner->getLevel()); // Inherit Master's Threat List (not yet implemented) owner->CastSpell((Unit*)NULL, 58838, true); // here mirror image casts on summoner spell (not present in client dbc) 49866 @@ -1693,6 +1692,22 @@ struct TRINITY_DLL_DECL npc_mirror_image : SpellAI events.ScheduleEvent(spellId, (casttime ? casttime : 500) + GetAISpellInfo(spellId)->cooldown); } } + + void EnterEvadeMode() + { + if(me->IsInEvadeMode() || !me->isAlive()) + return; + + Unit *owner = me->GetCharmerOrOwner(); + + me->CombatStop(true); + if(owner && !me->hasUnitState(UNIT_STAT_FOLLOW) ) + { + me->GetMotionMaster()->Clear(false); + me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, m_creature->GetFollowAngle(), MOTION_SLOT_ACTIVE); + } + } + }; CreatureAI* GetAI_npc_mirror_image(Creature *_Creature) |
