diff options
author | Aokromes <aokromes@gmail.com> | 2019-04-17 23:59:02 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-11-30 23:10:57 +0100 |
commit | dad95d16b263b9c1cb8df6edac8043138fb4da9e (patch) | |
tree | e58454c90b110aad7fdc94a48414c10373ef9fea /src | |
parent | b02143118f830691412bbc7649c1d0c9ec32f3a9 (diff) |
Core/SmartScripts: Implement SMART_ACTION_PLAY_CINEMATIC
By Malcrom
(cherry picked from commit 63aa5d1e3559f580551544b71fb7dd63d6b54b60)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.cpp | 11 | ||||
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 10 | ||||
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScriptMgr.h | 7 |
3 files changed, 27 insertions, 1 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 1c80fd111e2..0a3ed95a6dc 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -2467,6 +2467,17 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u break; } + case SMART_ACTION_PLAY_CINEMATIC: + { + for (WorldObject* target : targets) + { + if (!IsPlayer(target)) + continue; + + target->ToPlayer()->SendCinematicStart(e.action.cinematic.entry); + } + break; + } default: TC_LOG_ERROR("sql.sql", "SmartScript::ProcessAction: Entry " SI64FMTD " 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 8340357ae73..7a2c896325f 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -1662,6 +1662,16 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) break; } + case SMART_ACTION_PLAY_CINEMATIC: + { + if (!sCinematicSequencesStore.LookupEntry(e.action.cinematic.entry)) + { + TC_LOG_ERROR("sql.sql", "SmartAIMgr: SMART_ACTION_PLAY_CINEMATIC Entry " SI64FMTD " SourceType %u Event %u Action %u uses invalid entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.cinematic.entry); + return false; + } + + break; + } case SMART_ACTION_SET_MOVEMENT_SPEED: { if (e.action.movementSpeed.movementType >= MAX_MOVE_TYPE) diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index b4587a0aaca..7822e8d554d 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -598,7 +598,7 @@ enum SMART_ACTION SMART_ACTION_DESPAWN_SPAWNGROUP = 132, // Group ID, min secs, max secs, spawnflags SMART_ACTION_RESPAWN_BY_SPAWNID = 133, // spawnType, spawnId SMART_ACTION_INVOKER_CAST = 134, // spellID, castFlags - SMART_ACTION_PLAY_CINEMATIC = 135, // reserved for future uses + SMART_ACTION_PLAY_CINEMATIC = 135, // entry, cinematic SMART_ACTION_SET_MOVEMENT_SPEED = 136, // movementType, speedInteger, speedFraction SMART_ACTION_PLAY_SPELL_VISUAL_KIT = 137, // spellVisualKitId, kitType (unknown values, copypaste from packet dumps), duration SMART_ACTION_CREATE_CONVERSATION = 143, // conversation_template.id @@ -1185,6 +1185,11 @@ struct SmartAction struct { + uint32 entry; + } cinematic; + + struct + { uint32 movementType; uint32 speedInteger; uint32 speedFraction; |