mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-30 21:57:01 +01:00
Core/SmartScripts: Implement SMART_ACTION_PLAY_CINEMATIC
By Malcrom
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user