Created
December 1, 2011 13:32
-
-
Save DDuarte/1416754 to your computer and use it in GitHub Desktop.
SMART_ACTION_GO_SET_STATE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From a53f9c3f594256453154d054bf69c04542a81e94 Mon Sep 17 00:00:00 2001 | |
From: Nay <[email protected]> | |
Date: Thu, 1 Dec 2011 13:31:23 +0000 | |
Subject: [PATCH] Core/SAI: Add SMART_ACTION_GO_SET_STATE | |
See Malcrom? I can do it, sweetie. | |
--- | |
src/server/game/AI/SmartScripts/SmartScript.cpp | 13 +++++++++++++ | |
src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 1 + | |
src/server/game/AI/SmartScripts/SmartScriptMgr.h | 8 +++++++- | |
3 files changed, 21 insertions(+), 1 deletions(-) | |
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp | |
index ffe2153..3a5b94e 100644 | |
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp | |
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp | |
@@ -1807,6 +1807,19 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u | |
delete targets; | |
break; | |
} | |
+ case SMART_ACTION_GO_SET_STATE: | |
+ { | |
+ ObjectList* targets = GetTargets(e, unit); | |
+ if (!targets) | |
+ return; | |
+ | |
+ for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) | |
+ if (IsGameObject(*itr)) | |
+ (*itr)->ToGameObject()->SetGoState((GOState)e.action.goSetCustomAnim.state); | |
+ | |
+ delete targets; | |
+ 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 011ed75..54b6095 100644 | |
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | |
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | |
@@ -789,6 +789,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) | |
case SMART_ACTION_REMOVE_DYNAMIC_FLAG: | |
case SMART_ACTION_JUMP_TO_POS: | |
case SMART_ACTION_SEND_GOSSIP_MENU: | |
+ case SMART_ACTION_GO_SET_STATE: | |
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 ba986ae..39ec032 100644 | |
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h | |
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h | |
@@ -459,8 +459,9 @@ enum SMART_ACTION | |
SMART_ACTION_REMOVE_DYNAMIC_FLAG = 96, // Flags | |
SMART_ACTION_JUMP_TO_POS = 97, // speedXY, speedZ, targetX, targetY, targetZ | |
SMART_ACTION_SEND_GOSSIP_MENU = 98, // menuId, optionId | |
+ SMART_ACTION_GO_SET_STATE = 99, // state (0,1,2) | |
- SMART_ACTION_END = 99, | |
+ SMART_ACTION_END = 100, | |
}; | |
struct SmartAction | |
@@ -867,6 +868,11 @@ struct SmartAction | |
struct | |
{ | |
+ uint32 state; | |
+ } goSetCustomAnim; | |
+ | |
+ struct | |
+ { | |
uint32 param1; | |
uint32 param2; | |
uint32 param3; | |
-- | |
1.7.6.msysgit.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment