NpcSelectScheduleEvent
Passed to IDeadworksPlugin.OnNpcSelectSchedule when an NPC picks its next schedule.
public sealed class NpcSelectScheduleEvent
Namespace: DeadworksManaged.Api
Source: Events/NpcSelectScheduleEvent.cs#L4
Properties
NpcSelectScheduleEvent.Npc
The NPC. Use CBaseEntity.As<T> for its class, such as CNPC_Trooper.
Signature
public required CAI_BaseNPC Npc { get; init; }
Source: Events/NpcSelectScheduleEvent.cs#L6
NpcSelectScheduleEvent.Schedule
Schedule the game picked, such as SCHED_TROOPER_RUN_DOWN_LANE, or SCHED_FAIL after a failure. NPC classes rename some schedules, so CAI_BaseNPC.Schedule can differ once it runs.
Signature
public required string Schedule { get; init; }
Source: Events/NpcSelectScheduleEvent.cs#L12
NpcSelectScheduleEvent.Override
Schedule to run instead, such as SCHED_IDLE_STAND. Null keeps the game's pick. The last plugin to set it wins.
Signature
public string? Override { get; set; }
Notes
A schedule the NPC's class lacks runs SCHED_IDLE_STAND and logs "No CASE for Schedule Type".