aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI/CreatureAI.cpp
diff options
context:
space:
mode:
authorMrSmite <mrsmite@att.net>2012-09-22 02:11:31 +0100
committerNay <dnpd.dd@gmail.com>2012-09-22 02:11:31 +0100
commitce6785d9db569b31cb88e5d3e65077ffbced40e8 (patch)
tree255294a34d0260ce52b1e679764be77f47002bc8 /src/server/game/AI/CreatureAI.cpp
parent53cd8cf684234c1fbd6e446eee3d90ca6014a5b4 (diff)
Core/Combat: Fix Evade Mechanics
- Can now kite mobs beyond ThreatRadius (CONF) if continuing to damage them. World bosses still use ThreatRadius to prevent pulling them to cities - A mob that is beyond the ThreatRadius, it will return home (evade) after 10 seconds of no damage if there are no valid targets within attack distance of it, otherwise it will still attack - Mobs now properly report "Evade" if attacked while returning home. (modified - Nayd) Closes #830 Closes #7748
Diffstat (limited to 'src/server/game/AI/CreatureAI.cpp')
-rwxr-xr-xsrc/server/game/AI/CreatureAI.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index 17cef3ec1a1..e5868117da8 100755
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -153,13 +153,20 @@ void CreatureAI::EnterEvadeMode()
me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle(), MOTION_SLOT_ACTIVE);
}
else
+ {
+ // Required to prevent attacking creatures that are evading and cause them to reenter combat
+ // Does not apply to MoveFollow
+ me->AddUnitState(UNIT_STATE_EVADE);
me->GetMotionMaster()->MoveTargetedHome();
+ }
}
Reset();
if (me->IsVehicle()) // use the same sequence of addtoworld, aireset may remove all summons!
me->GetVehicleKit()->Reset(true);
+
+ me->SetLastDamagedTime(0);
}
/*void CreatureAI::AttackedBy(Unit* attacker)