Purpose
Every few minutes (Interval), the module checks each monster spawn point and spawns more monsters to replace those that were killed, never exceeding Count. The player who kills one of these monsters receives a reward item. Monsters are removed when LuaAPI is reloaded or the GameServer is shut down, and respawned when the script starts.
How to enable
- Remove the
--in front ofLoadModule("MonsterSpawn\\MonsterSpawn")inMain.lua. - Edit
Includes\MonsterSpawn\Config.lua. - Click Reload LuaAPI.
No SQL needed. The module attaches OnReadScript, OnTimerThread, OnMonsterDie.
Configuration (Config.lua, MonsterSpawnConfig table)
| Key | Value | Default | Meaning |
|---|---|---|---|
Enable | true / false | true | Turns the module on / off. |
Interval | seconds | 300 | Interval between two checks. |
SpawnMessage | string, %s = map name | "Monsters have appeared in %s!" | Notice to players in the map when monsters appear; "" = no notice. |
Points | table | 2 sample points | One row per point: Map (MAP_* constant), X, Y (center of the area), Range (size of the square area), Class (monster number in Data\Monster\MonsterList.xml), Count (number of monsters kept alive). |
Reward | table or nil | Jewel of Bless x1 | Item for the killer: Item = { group, index }, Level, Count. nil = no reward. |
Text | table | (built in) | Reward: message when the reward is received; NoSpace: message when the inventory is full. |
Points = {
{ Map = MAP_LORENCIA, X = 141, Y = 127, Range = 10, Class = 10, Count = 5 },
},
Reward = { Item = { 14, 13 }, Level = 0, Count = 1 },
A point on a map that this GameServer does not run is skipped. The reward needs free space in the inventory; if the inventory is full the reward is lost (the player is notified).