Interface INPCEventHandler
Provides the events for GetEventDispatcher().
[OpenMpEventHandler]
public interface INPCEventHandler : IEventHandler<INPCEventHandler>
- Inherited Members
Methods
OnNPCChangeNode(INPC, int, int)
Fired when the NPC changes to a different node. Return false to cancel the change.
bool OnNPCChangeNode(INPC npc, int newNodeId, int oldNodeId)
Parameters
Returns
OnNPCCreate(INPC)
Fired right after an NPC is created via Create(string).
void OnNPCCreate(INPC npc)
Parameters
npcINPC
OnNPCDeath(INPC, IPlayer, int)
Fired when the NPC dies.
void OnNPCDeath(INPC npc, IPlayer killer, int reason)
Parameters
OnNPCDestroy(INPC)
Fired when the NPC is destroyed.
void OnNPCDestroy(INPC npc)
Parameters
npcINPC
OnNPCFinishMove(INPC)
Fired when an NPC finishes a Move() command (reaches the target position).
void OnNPCFinishMove(INPC npc)
Parameters
npcINPC
OnNPCFinishMovePath(INPC, int)
Fired when the NPC finishes traversing all waypoints in a path.
void OnNPCFinishMovePath(INPC npc, int pathId)
Parameters
OnNPCFinishMovePathPoint(INPC, int, int)
Fired when the NPC reaches a waypoint in path-based movement.
void OnNPCFinishMovePathPoint(INPC npc, int pathId, int pointId)
Parameters
OnNPCFinishNode(INPC, int)
Fired when the NPC finishes traversing all points in a node.
void OnNPCFinishNode(INPC npc, int nodeId)
Parameters
OnNPCFinishNodePoint(INPC, int, ushort)
Fired when the NPC finishes a waypoint in node-based movement.
void OnNPCFinishNodePoint(INPC npc, int nodeId, ushort pointId)
Parameters
OnNPCGiveDamage(INPC, IPlayer, float, byte, BodyPart)
Fired when the NPC gives damage to a player. Return false to cancel the damage.
bool OnNPCGiveDamage(INPC npc, IPlayer damaged, float damage, byte weapon, BodyPart bodyPart)
Parameters
Returns
OnNPCPlaybackEnd(INPC, int)
Fired when the NPC finishes playing a recording.
void OnNPCPlaybackEnd(INPC npc, int recordId)
Parameters
OnNPCPlaybackStart(INPC, int)
Fired when the NPC starts playing a recording.
void OnNPCPlaybackStart(INPC npc, int recordId)
Parameters
OnNPCRespawn(INPC)
Fired after the NPC respawns.
void OnNPCRespawn(INPC npc)
Parameters
npcINPC
OnNPCShotMissed(INPC, ref PlayerBulletData)
Fired when the NPC fires a shot that misses all targets. Return false to cancel.
bool OnNPCShotMissed(INPC npc, ref PlayerBulletData bulletData)
Parameters
npcINPCbulletDataPlayerBulletData
Returns
OnNPCShotNPC(INPC, INPC, ref PlayerBulletData)
Fired when the NPC shoots and hits another NPC. Return false to cancel.
bool OnNPCShotNPC(INPC npc, INPC target, ref PlayerBulletData bulletData)
Parameters
npcINPCtargetINPCbulletDataPlayerBulletData
Returns
OnNPCShotObject(INPC, IObject, ref PlayerBulletData)
Fired when the NPC shoots and hits a world object. Return false to cancel.
bool OnNPCShotObject(INPC npc, IObject target, ref PlayerBulletData bulletData)
Parameters
npcINPCtargetIObjectbulletDataPlayerBulletData
Returns
OnNPCShotPlayer(INPC, IPlayer, ref PlayerBulletData)
Fired when the NPC shoots and hits a player. Return false to cancel.
bool OnNPCShotPlayer(INPC npc, IPlayer target, ref PlayerBulletData bulletData)
Parameters
npcINPCtargetIPlayerbulletDataPlayerBulletData
Returns
OnNPCShotPlayerObject(INPC, IPlayerObject, ref PlayerBulletData)
Fired when the NPC shoots and hits a player-object. Return false to cancel.
bool OnNPCShotPlayerObject(INPC npc, IPlayerObject target, ref PlayerBulletData bulletData)
Parameters
npcINPCtargetIPlayerObjectbulletDataPlayerBulletData
Returns
OnNPCShotVehicle(INPC, IVehicle, ref PlayerBulletData)
Fired when the NPC shoots and hits a vehicle. Return false to cancel.
bool OnNPCShotVehicle(INPC npc, IVehicle target, ref PlayerBulletData bulletData)
Parameters
npcINPCtargetIVehiclebulletDataPlayerBulletData
Returns
OnNPCSpawn(INPC)
Fired after the NPC spawns into the world.
void OnNPCSpawn(INPC npc)
Parameters
npcINPC
OnNPCTakeDamage(INPC, IPlayer, float, byte, BodyPart)
Fired when the NPC takes damage from a player. Return false to cancel the damage.
bool OnNPCTakeDamage(INPC npc, IPlayer damager, float damage, byte weapon, BodyPart bodyPart)
Parameters
Returns
OnNPCWeaponStateChange(INPC, PlayerWeaponState, PlayerWeaponState)
Fired when the NPC's weapon state changes.
void OnNPCWeaponStateChange(INPC npc, PlayerWeaponState newState, PlayerWeaponState oldState)
Parameters
npcINPCnewStatePlayerWeaponStateoldStatePlayerWeaponState