Core/SmartScripts: Implement SMART_ACTION_PLAY_CINEMATIC

By Malcrom

(cherry picked from commit 63aa5d1e35)
This commit is contained in:
Aokromes
2019-04-17 23:59:02 +02:00
committed by Shauren
parent b02143118f
commit dad95d16b2
3 changed files with 27 additions and 1 deletions

View File

@@ -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;

View File

@@ -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)

View File

@@ -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
@@ -1183,6 +1183,11 @@ struct SmartAction
uint32 sceneId;
} scene;
struct
{
uint32 entry;
} cinematic;
struct
{
uint32 movementType;