Table of Contents

Interface INPCEventHandler

Namespace
SampSharp.OpenMp.Core.Api
Assembly
SampSharp.OpenMp.Core.dll

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

npc INPC
newNodeId int
oldNodeId int

Returns

bool

OnNPCCreate(INPC)

Fired right after an NPC is created via Create(string).

void OnNPCCreate(INPC npc)

Parameters

npc INPC

OnNPCDeath(INPC, IPlayer, int)

Fired when the NPC dies.

void OnNPCDeath(INPC npc, IPlayer killer, int reason)

Parameters

npc INPC
killer IPlayer
reason int

OnNPCDestroy(INPC)

Fired when the NPC is destroyed.

void OnNPCDestroy(INPC npc)

Parameters

npc INPC

OnNPCFinishMove(INPC)

Fired when an NPC finishes a Move() command (reaches the target position).

void OnNPCFinishMove(INPC npc)

Parameters

npc INPC

OnNPCFinishMovePath(INPC, int)

Fired when the NPC finishes traversing all waypoints in a path.

void OnNPCFinishMovePath(INPC npc, int pathId)

Parameters

npc INPC
pathId int

OnNPCFinishMovePathPoint(INPC, int, int)

Fired when the NPC reaches a waypoint in path-based movement.

void OnNPCFinishMovePathPoint(INPC npc, int pathId, int pointId)

Parameters

npc INPC
pathId int
pointId int

OnNPCFinishNode(INPC, int)

Fired when the NPC finishes traversing all points in a node.

void OnNPCFinishNode(INPC npc, int nodeId)

Parameters

npc INPC
nodeId int

OnNPCFinishNodePoint(INPC, int, ushort)

Fired when the NPC finishes a waypoint in node-based movement.

void OnNPCFinishNodePoint(INPC npc, int nodeId, ushort pointId)

Parameters

npc INPC
nodeId int
pointId ushort

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

npc INPC
damaged IPlayer
damage float
weapon byte
bodyPart BodyPart

Returns

bool

OnNPCPlaybackEnd(INPC, int)

Fired when the NPC finishes playing a recording.

void OnNPCPlaybackEnd(INPC npc, int recordId)

Parameters

npc INPC
recordId int

OnNPCPlaybackStart(INPC, int)

Fired when the NPC starts playing a recording.

void OnNPCPlaybackStart(INPC npc, int recordId)

Parameters

npc INPC
recordId int

OnNPCRespawn(INPC)

Fired after the NPC respawns.

void OnNPCRespawn(INPC npc)

Parameters

npc INPC

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

npc INPC
bulletData PlayerBulletData

Returns

bool

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

npc INPC
target INPC
bulletData PlayerBulletData

Returns

bool

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

npc INPC
target IObject
bulletData PlayerBulletData

Returns

bool

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

npc INPC
target IPlayer
bulletData PlayerBulletData

Returns

bool

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

npc INPC
target IPlayerObject
bulletData PlayerBulletData

Returns

bool

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

npc INPC
target IVehicle
bulletData PlayerBulletData

Returns

bool

OnNPCSpawn(INPC)

Fired after the NPC spawns into the world.

void OnNPCSpawn(INPC npc)

Parameters

npc INPC

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

npc INPC
damager IPlayer
damage float
weapon byte
bodyPart BodyPart

Returns

bool

OnNPCWeaponStateChange(INPC, PlayerWeaponState, PlayerWeaponState)

Fired when the NPC's weapon state changes.

void OnNPCWeaponStateChange(INPC npc, PlayerWeaponState newState, PlayerWeaponState oldState)

Parameters

npc INPC
newState PlayerWeaponState
oldState PlayerWeaponState