diff options
author | Rushor <SBienati@web.de> | 2015-07-31 19:03:29 +0200 |
---|---|---|
committer | jackpoz <giacomopoz@gmail.com> | 2015-09-27 12:21:04 +0200 |
commit | 513b756ea8afcfeb65b97e8227669681e9cd9a40 (patch) | |
tree | ff4f22eef929330bf8d04408b083ae7af1958b2b | |
parent | 747a3f1d38abdb9b711877c168243f0d398b615f (diff) |
Merge pull request #15191 from Rushor/action
Core/SAI: Add SMART_ACTION_RISE_UP for Z Axis
(cherry picked from commit ba6da26e5db8cd6c3418d2a401e84d8701ac89f1)
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.cpp | 8 | ||||
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 1 | ||||
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScriptMgr.h | 3 |
3 files changed, 11 insertions, 1 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 4b43ac889c5..efee565e151 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1136,6 +1136,14 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u me->GetMotionMaster()->MovePoint(SMART_RANDOM_POINT, x, y, z); break; } + case SMART_ACTION_RISE_UP: + { + if (!me) + break; + + me->GetMotionMaster()->MovePoint(SMART_RANDOM_POINT, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + (float)e.action.moveRandom.distance); + break; + } case SMART_ACTION_SET_VISIBILITY: { if (me) diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index 6ccc581c54e..f0e3c3caff6 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -1198,6 +1198,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) case SMART_ACTION_ADD_GO_FLAG: case SMART_ACTION_REMOVE_GO_FLAG: case SMART_ACTION_SUMMON_CREATURE_GROUP: + case SMART_ACTION_RISE_UP: break; default: TC_LOG_ERROR("sql.sql", "SmartAIMgr: Not handled action_type(%u), event_type(%u), Entry %d 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 60a4ce5e8ed..2f9b032c14c 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -539,8 +539,9 @@ enum SMART_ACTION SMART_ACTION_GAME_EVENT_STOP = 111, // GameEventId SMART_ACTION_GAME_EVENT_START = 112, // GameEventId SMART_ACTION_START_CLOSEST_WAYPOINT = 113, // wp1, wp2, wp3, wp4, wp5, wp6, wp7 + SMART_ACTION_RISE_UP = 114, // distance - SMART_ACTION_END = 114 + SMART_ACTION_END = 115 }; struct SmartAction |