aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKittnz <frederik156@hotmail.com>2016-12-27 19:00:57 +0100
committerDoctorKraft <DoctorKraft@users.noreply.github.com>2018-03-18 00:19:39 +0100
commit61a838b599d044614d44a5ef59b943b9bb1a6a98 (patch)
tree7d9f710c0f01c823dd054b190e1504ace59fcf2b
parent88ba95e07d3d3f4a91853ead8b4c1e34f6c3121a (diff)
Core/SmartScript: update ACTION_GO_SET_GO_STATE
GO_STATE_ACTIVE = 0, // show in world as used and not reset (closed door open) GO_STATE_READY = 1, // show in world as ready (closed door close) GO_STATE_ACTIVE_ALTERNATIVE = 2 // show in world as used in alt way and not reset (closed door open by cannon fire) Credits to Sunwell (cherry picked from commit 072ea761c6dc9891d0e929f0e618b7ae2327c421) Tabs (cherry picked from commit 65e84d2f0a77ec179bc6b0eaae2e4dc6b1daf9ef)
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp14
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp1
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.h8
3 files changed, 22 insertions, 1 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index f5ccf93006b..48a74a3cd79 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -2234,6 +2234,20 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
delete targets;
break;
}
+ case SMART_ACTION_GO_SET_GO_STATE:
+ {
+ ObjectList* targets = GetTargets(e, unit);
+
+ if (!targets)
+ break;
+
+ for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
+ if (IsGameObject(*itr))
+ (*itr)->ToGameObject()->SetGoState((GOState)e.action.goState.state);
+
+ delete targets;
+ break;
+ }
case SMART_ACTION_SEND_TARGET_TO_TARGET:
{
ObjectList* targets = GetTargets(e, unit);
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index 3fb1093a39d..a2096248851 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -1458,6 +1458,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_JUMP_TO_POS:
case SMART_ACTION_SEND_GOSSIP_MENU:
case SMART_ACTION_GO_SET_LOOT_STATE:
+ case SMART_ACTION_GO_SET_GO_STATE:
case SMART_ACTION_SEND_TARGET_TO_TARGET:
case SMART_ACTION_SET_HOME_POS:
case SMART_ACTION_SET_HEALTH_REGEN:
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
index 87d142aa0ab..7b9e1ff5f3d 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
@@ -562,7 +562,8 @@ enum SMART_ACTION
SMART_ACTION_RANDOM_SOUND = 115, // soundId1, soundId2, soundId3, soundId4, soundId5, onlySelf
SMART_ACTION_SET_CORPSE_DELAY = 116, // timer
SMART_ACTION_DISABLE_EVADE = 117, // 0/1 (1 = disabled, 0 = enabled)
- // 118 - 127 : 3.3.5 reserved
+ SMART_ACTION_GO_SET_GO_STATE = 118, // state
+ // 119 - 127 : 3.3.5 reserved
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
@@ -1037,6 +1038,11 @@ struct SmartAction
struct
{
+ uint32 state;
+ } goState;
+
+ struct
+ {
uint32 group;
uint32 attackInvoker;
} creatureGroup;