diff options
| author | Vincent_Michael <Vincent_Michael@gmx.de> | 2013-02-02 18:18:27 +0100 |
|---|---|---|
| committer | Vincent_Michael <Vincent_Michael@gmx.de> | 2013-02-02 18:18:27 +0100 |
| commit | 9d7d68395c3d091f27bbb2e2d50f5052627f5e81 (patch) | |
| tree | 8942e10a4a8cfb54720016940f502b2caafa9565 /src/server/game/AI/SmartScripts | |
| parent | 73d2f315af9f45dacc20a9d6789e0cc86338e7a0 (diff) | |
Core/SmartAI: Implement SMART_ACTION_SET_ROOT (103)
Diffstat (limited to 'src/server/game/AI/SmartScripts')
| -rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.cpp | 6 | ||||
| -rw-r--r-- | src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 1 | ||||
| -rw-r--r-- | src/server/game/AI/SmartScripts/SmartScriptMgr.h | 8 |
3 files changed, 14 insertions, 1 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 86d86739bc9..23f6fbbb414 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1996,6 +1996,12 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u me->setRegeneratingHealth(e.action.setHealthRegen.regenHealth ? true : false); break; } + case SMART_ACTION_SET_ROOT: + { + if (me) + me->SetControlled(e.action.setRoot.root ? true : false, UNIT_STATE_ROOT); + break; + } default: sLog->outError(LOG_FILTER_SQL, "SmartScript::ProcessAction: Entry %d SourceType %u, Event %u, Unhandled Action type %u", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType()); break; diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index a49ae031e63..90534de327a 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -906,6 +906,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) case SMART_ACTION_SEND_TARGET_TO_TARGET: case SMART_ACTION_SET_HOME_POS: case SMART_ACTION_SET_HEALTH_REGEN: + case SMART_ACTION_SET_ROOT: break; default: sLog->outError(LOG_FILTER_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 c88ef206b00..88f9ce4f6f4 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -486,8 +486,9 @@ enum SMART_ACTION SMART_ACTION_SEND_TARGET_TO_TARGET = 100, // id SMART_ACTION_SET_HOME_POS = 101, // none SMART_ACTION_SET_HEALTH_REGEN = 102, // 0/1 + SMART_ACTION_SET_ROOT = 103, // off/on - SMART_ACTION_END = 103 + SMART_ACTION_END = 104 }; struct SmartAction @@ -919,6 +920,11 @@ struct SmartAction uint32 regenHealth; } setHealthRegen; + struct + { + uint32 root; + } setRoot; + //! Note for any new future actions //! All parameters must have type uint32 |
