Purpose
- NPCs talking on their own: each NPC in the list says its line to nearby players about every
TalkIntervalseconds (plus a random delay of 1 - 60 seconds so NPCs do not all talk at once). - Taunting monsters: when a monster kills a player, the monster says a line. For monsters in the
Tauntslist, it can also announce to everyone.
How to enable
- The line
LoadModule("NpcMessage\\NpcMessage")inMain.lua(enabled by default). - Edit
Includes\NpcMessage\Config.lua. - Click Reload LuaAPI.
The module attaches OnTimerThread (if TalkEnable) and OnUserDie (if TauntEnable). No SQL needed.
Configuration (Config.lua, NpcMessageConfig table)
| Key | Value | Default | Meaning |
|---|---|---|---|
TalkEnable | true / false | true | NPCs talk on their own. |
TalkInterval | seconds | 60 | Interval between two lines of one NPC (plus a random 1 - 60 seconds). |
CheckRate | seconds | 5 | Interval between two scans of the NPC list (the larger, the lighter on the server). |
CheckPosition | true / false | false | true: only NPCs standing at the exact X, Y coordinates talk (255 = any position). |
ShowInChat | true / false | false | true: the line also appears in the chat window; false: only the bubble above the head is shown. |
TauntEnable | true / false | true | Monsters taunt when they kill a player. |
TauntAnnounce | true / false | true | Announces to everyone when a monster in the Taunts list kills a player. |
DefaultTaunt | string | (built in) | Line said by monsters that are not in Taunts. |
Announce | string with %s | (built in) | Announcement content; the 3 %s values are: player, monster, monster. |
Npcs | table | ~35 NPCs | Each row: Class (NPC number in Data\Monster\MonsterList.xml), X, Y, Message. |
Taunts | table | ~14 monsters | Each row: Class (monster number), Name (name shown in the announcement), Message (line the monster says). |
NpcMessageConfig.Npcs = {
{ Class = 240, X = 255, Y = 255, Message = "Your warehouse is safe with me!" },
}
NpcMessageConfig.Taunts = {
{ Class = 459, Name = "Selupan", Message = "Who dares to bring his corpse here?" },
}