aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp11
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp10
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.h9
3 files changed, 16 insertions, 14 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index 4cd0883d733..4ea727cbfe7 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -2354,18 +2354,11 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
target->ToUnit()->RemoveAllGameObjects();
break;
}
- case SMART_ACTION_REMOVE_MOVEMENT:
+ case SMART_ACTION_PAUSE_MOVEMENT:
{
for (WorldObject* const target : targets)
- {
if (IsUnit(target))
- {
- if (e.action.removeMovement.movementType && e.action.removeMovement.movementType < MAX_MOTION_TYPE)
- target->ToUnit()->GetMotionMaster()->Remove(MovementGeneratorType(e.action.removeMovement.movementType));
- if (e.action.removeMovement.forced)
- target->ToUnit()->StopMoving();
- }
- }
+ target->ToUnit()->PauseMovement(e.action.pauseMovement.pauseTimer, e.action.pauseMovement.movementSlot, e.action.pauseMovement.force);
break;
}
case SMART_ACTION_RESPAWN_BY_SPAWNID:
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index 21951cc1d6c..da5dbbad14d 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -1675,6 +1675,15 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
break;
}
+ case SMART_ACTION_PAUSE_MOVEMENT:
+ {
+ if (!e.action.pauseMovement.pauseTimer)
+ {
+ TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry " SI64FMTD " SourceType %u Event %u Action %u does not specify pause duration", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
+ return false;
+ }
+ break;
+ }
case SMART_ACTION_SET_MOVEMENT_SPEED:
{
if (e.action.movementSpeed.movementType >= MAX_MOVE_TYPE)
@@ -1777,7 +1786,6 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_REMOVE_ALL_GAMEOBJECTS:
case SMART_ACTION_SPAWN_SPAWNGROUP:
case SMART_ACTION_DESPAWN_SPAWNGROUP:
- case SMART_ACTION_REMOVE_MOVEMENT:
break;
default:
TC_LOG_ERROR("sql.sql", "SmartAIMgr: Not handled action_type(%u), event_type(%u), Entry " SI64FMTD " SourceType %u Event %u, skipped.", e.GetActionType(), e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id);
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
index 00e74aaab2a..7cc6f0440ed 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
@@ -592,7 +592,7 @@ enum SMART_ACTION
SMART_ACTION_LOAD_EQUIPMENT = 124, // id
SMART_ACTION_TRIGGER_RANDOM_TIMED_EVENT = 125, // id min range, id max range
SMART_ACTION_REMOVE_ALL_GAMEOBJECTS = 126,
- SMART_ACTION_REMOVE_MOVEMENT = 127, // movementType, forced
+ SMART_ACTION_PAUSE_MOVEMENT = 127, // MovementSlot (default = 0, active = 1, controlled = 2), PauseTime (ms), Force
SMART_ACTION_PLAY_ANIMKIT = 128, // id, type (0 = oneShot, 1 = aiAnim, 2 = meleeAnim, 3 = movementAnim)
SMART_ACTION_SCENE_PLAY = 129, // sceneId
SMART_ACTION_SCENE_CANCEL = 130, // sceneId
@@ -1166,9 +1166,10 @@ struct SmartAction
struct
{
- uint32 movementType;
- uint32 forced;
- } removeMovement;
+ uint32 movementSlot;
+ uint32 pauseTimer;
+ uint32 force;
+ } pauseMovement;
struct
{