Core/SmartScripts: Implement SMART_ACTION_PLAY_CINEMATIC

By Malcrom
This commit is contained in:
Aokromes
2019-04-17 23:59:02 +02:00
parent 91bcf20b02
commit 63aa5d1e35
3 changed files with 18 additions and 1 deletions

View File

@@ -2285,6 +2285,17 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
TC_LOG_ERROR("sql.sql", "SmartScript::ProcessAction: Entry %d SourceType %u, Event %u - tries to respawn by spawnId but does not provide a map", e.entryOrGuid, e.GetScriptType(), e.event_id);
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 %d SourceType %u, Event %u, Unhandled Action type %u", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
break;

View File

@@ -1578,6 +1578,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_SPAWN_SPAWNGROUP:
case SMART_ACTION_DESPAWN_SPAWNGROUP:
case SMART_ACTION_REMOVE_MOVEMENT:
case SMART_ACTION_PLAY_CINEMATIC:
break;
default:
TC_LOG_ERROR("sql.sql", "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);

View File

@@ -582,8 +582,8 @@ 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, // entry, cinematic
SMART_ACTION_PLAY_CINEMATIC = 135, // don't use on 3.3.5a
SMART_ACTION_END = 136
};
@@ -1134,6 +1134,11 @@ struct SmartAction
uint32 spawnId;
} respawnData;
struct
{
uint32 entry;
} cinematic;
//! Note for any new future actions
//! All parameters must have type uint32