diff options
| author | Shauren <shauren.trinity@gmail.com> | 2011-03-02 16:50:09 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2011-03-02 16:50:09 +0100 |
| commit | 6c020c72cc46388b04350adcfa4ffab7bc9b2c2c (patch) | |
| tree | c86b1e7d43ec853f8969973e4e6d88ae3d5f8127 /src/server/game/AI/SmartScripts | |
| parent | 2b9346e5a0ceacd6d73a7ac39c24840e450181b2 (diff) | |
Core/SAI: Implemented Gameobject action allowing to send SMSG_GAMEOBJECT_CUSTOM_ANIM with parameter set in param1
Diffstat (limited to 'src/server/game/AI/SmartScripts')
| -rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.cpp | 12 | ||||
| -rw-r--r-- | src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 1 | ||||
| -rw-r--r-- | src/server/game/AI/SmartScripts/SmartScriptMgr.h | 10 |
3 files changed, 21 insertions, 2 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 3ad48d1421f..7809ded8e78 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1455,6 +1455,18 @@ void SmartScript::ProcessAction(SmartScriptHolder &e, Unit* unit, uint32 var0, u break; } + case SMART_ACTION_SEND_GO_CUSTOM_ANIM: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) + if (IsGameObject((*itr))) + (*itr)->ToGameObject()->SendCustomAnim(e.action.sendGoCustomAnim.anim); + + break; + } default: sLog->outErrorDb("SmartScript::ProcessAction: Unhandled Action type %u", e.GetActionType()); break; diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index a25b52aa30b..127994648cc 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -769,6 +769,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder &e) case SMART_ACTION_SET_UNIT_FIELD_BYTES_1: case SMART_ACTION_REMOVE_UNIT_FIELD_BYTES_1: case SMART_ACTION_INTERRUPT_SPELL: + case SMART_ACTION_SEND_GO_CUSTOM_ANIM: break; default: sLog->outErrorDb("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 51f31e401ad..ec02d44b607 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -445,12 +445,13 @@ enum SMART_ACTION SMART_ACTION_RANDOM_MOVE = 89, // maxDist SMART_ACTION_SET_UNIT_FIELD_BYTES_1 = 90, // bytes, target - SMART_ACTION_REMOVE_UNIT_FIELD_BYTES_1 = 91, // bytes, target SMART_ACTION_INTERRUPT_SPELL = 92, - SMART_ACTION_END = 93, + SMART_ACTION_SEND_GO_CUSTOM_ANIM = 93, // anim id + + SMART_ACTION_END = 94, }; struct SmartAction @@ -829,6 +830,11 @@ struct SmartAction uint32 spell_id; bool withInstant; } interruptSpellCasting; + + struct + { + uint32 anim; + } sendGoCustomAnim; struct { uint32 param1; |
