aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI/ScriptedAI
diff options
context:
space:
mode:
authorpete318 <pete318@hotmail.com>2015-06-28 23:42:47 +0000
committerpete318 <pete318@hotmail.com>2015-07-02 23:11:20 +0000
commit1e0213bc57922719d4f7e8897cb7e8871c138fdc (patch)
tree14ae56957aa9e87eb366bdc28707ae548a2b584a /src/server/game/AI/ScriptedAI
parent275bb9303438a3e6e21e90de514723fd4aba7b05 (diff)
The following stealth changes are implemented.
- Combat no longer removes stealth, only damage does - Creatures will pursue a stealthed unit they cannot see if they're already in combat with them - When a player is ~~3 yards~~ 8% + 1.5 yards away from the usual stealth detection distance, the creature will perform the "alerted" effect. - When sitting/sleeping creatures are distracted or alerted, they will stand up - Idle movement creatures will return to their original (spawn) orientation after distract/alert - When entering combat with a distracted/alerted creature, distract state is removed - NPC no longer have a limit to stealth visibility (granted by stealth modifier spells/buffs) - If alert visibility is greater than aggro range, no alert sent
Diffstat (limited to 'src/server/game/AI/ScriptedAI')
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp8
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp8
2 files changed, 14 insertions, 2 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
index ed87804474a..f1c53e2f9eb 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
@@ -120,7 +120,13 @@ void npc_escortAI::MoveInLineOfSight(Unit* who)
{
if (!me->GetVictim())
{
- who->RemoveAurasByType(SPELL_AURA_MOD_STEALTH);
+ // Clear distracted state on combat
+ if (me->HasUnitState(UNIT_STATE_DISTRACTED))
+ {
+ me->ClearUnitState(UNIT_STATE_DISTRACTED);
+ me->GetMotionMaster()->Clear();
+ }
+
AttackStart(who);
}
else if (me->GetMap()->IsDungeon())
diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
index 7fd21a8f791..8985f722cf2 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
@@ -117,7 +117,13 @@ void FollowerAI::MoveInLineOfSight(Unit* who)
{
if (!me->GetVictim())
{
- who->RemoveAurasByType(SPELL_AURA_MOD_STEALTH);
+ // Clear distracted state on combat
+ if (me->HasUnitState(UNIT_STATE_DISTRACTED))
+ {
+ me->ClearUnitState(UNIT_STATE_DISTRACTED);
+ me->GetMotionMaster()->Clear();
+ }
+
AttackStart(who);
}
else if (me->GetMap()->IsDungeon())