Hooks
Hooks provided by the NPC Spawner module for managing NPC spawning and zones.
Overview
The NPC Spawner module adds automatic npc spawns at points, the ability for admins to force spawns, logging of spawn actions, and configuration for spawn intervals.. It provides comprehensive hook integration for customizing managing npc spawning and zones and extending functionality.
CanNPCSpawn
đ Purpose
Called to determine if an NPC can spawn.
â° When Called
Before spawning an NPC in a zone.
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
zone |
table | The spawn zone data |
npcType |
string | The NPC class to spawn |
group |
string | The spawn group identifier |
âŠī¸ Returns
boolean - Return false to prevent spawn
đ Realm
Server
Overview
The NPC Spawner module adds automatic npc spawns at points, the ability for admins to force spawns, logging of spawn actions, and configuration for spawn intervals.. It provides comprehensive hook integration for customizing managing npc spawning and zones and extending functionality.
OnNPCForceSpawn
đ Purpose
Called when an admin forces an NPC to spawn.
â° When Called
When the force spawn command is executed.
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
client |
Player | The admin who forced the spawn |
selectedSpawner |
string | The spawner/group identifier |
âŠī¸ Returns
nil
đ Realm
Server
Overview
The NPC Spawner module adds automatic npc spawns at points, the ability for admins to force spawns, logging of spawn actions, and configuration for spawn intervals.. It provides comprehensive hook integration for customizing managing npc spawning and zones and extending functionality.
OnNPCGroupSpawned
đ Purpose
Called when a group of NPCs has been spawned in a zone.
â° When Called
After all NPCs for a group have been spawned.
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
zone |
table | The spawn zone data |
group |
string | The spawn group identifier |
spawned |
number | The number of NPCs spawned |
âŠī¸ Returns
nil
đ Realm
Server
Overview
The NPC Spawner module adds automatic npc spawns at points, the ability for admins to force spawns, logging of spawn actions, and configuration for spawn intervals.. It provides comprehensive hook integration for customizing managing npc spawning and zones and extending functionality.
OnNPCSpawned
đ Purpose
Called when a single NPC has been spawned.
â° When Called
After an NPC is created and spawned.
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
npc |
NPC | The NPC entity that was spawned |
zone |
table | The spawn zone data |
group |
string | The spawn group identifier |
âŠī¸ Returns
nil
đ Realm
Server
Overview
The NPC Spawner module adds automatic npc spawns at points, the ability for admins to force spawns, logging of spawn actions, and configuration for spawn intervals.. It provides comprehensive hook integration for customizing managing npc spawning and zones and extending functionality.
PostNPCSpawn
đ Purpose
Called after an NPC spawn is complete.
â° When Called
After the NPC is spawned and added to the zone.
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
npc |
NPC | The NPC entity that was spawned |
zone |
table | The spawn zone data |
group |
string | The spawn group identifier |
âŠī¸ Returns
nil
đ Realm
Server
Overview
The NPC Spawner module adds automatic npc spawns at points, the ability for admins to force spawns, logging of spawn actions, and configuration for spawn intervals.. It provides comprehensive hook integration for customizing managing npc spawning and zones and extending functionality.
PostNPCSpawnCycle
đ Purpose
Called after a complete NPC spawn cycle has finished.
â° When Called
After all zones have been processed.
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
zones |
table | All spawn zones for the current map |
âŠī¸ Returns
nil
đ Realm
Server
Overview
The NPC Spawner module adds automatic npc spawns at points, the ability for admins to force spawns, logging of spawn actions, and configuration for spawn intervals.. It provides comprehensive hook integration for customizing managing npc spawning and zones and extending functionality.
PostProcessNPCZone
đ Purpose
Called after a zone has been processed for spawning.
â° When Called
After all NPCs for a zone have been spawned (or skipped).
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
zone |
table | The spawn zone data |
group |
string | The spawn group identifier |
spawned |
number | The number of NPCs spawned in this zone |
âŠī¸ Returns
nil
đ Realm
Server
Overview
The NPC Spawner module adds automatic npc spawns at points, the ability for admins to force spawns, logging of spawn actions, and configuration for spawn intervals.. It provides comprehensive hook integration for customizing managing npc spawning and zones and extending functionality.
PreNPCSpawn
đ Purpose
Called before an NPC is spawned.
â° When Called
Before creating and spawning the NPC entity.
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
zone |
table | The spawn zone data |
npcType |
string | The NPC class to spawn |
group |
string | The spawn group identifier |
âŠī¸ Returns
nil
đ Realm
Server
Overview
The NPC Spawner module adds automatic npc spawns at points, the ability for admins to force spawns, logging of spawn actions, and configuration for spawn intervals.. It provides comprehensive hook integration for customizing managing npc spawning and zones and extending functionality.
PreNPCSpawnCycle
đ Purpose
Called before a complete NPC spawn cycle begins.
â° When Called
At the start of the spawn timer cycle.
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
zones |
table | All spawn zones for the current map |
âŠī¸ Returns
nil
đ Realm
Server
Overview
The NPC Spawner module adds automatic npc spawns at points, the ability for admins to force spawns, logging of spawn actions, and configuration for spawn intervals.. It provides comprehensive hook integration for customizing managing npc spawning and zones and extending functionality.
PreProcessNPCZone
đ Purpose
Called before a zone is processed for spawning.
â° When Called
Before checking and spawning NPCs in a zone.
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
zone |
table | The spawn zone data |
group |
string | The spawn group identifier |
âŠī¸ Returns
nil
đ Realm
Server