Purpose

  1. NPCs talking on their own: each NPC in the list says its line to nearby players about every TalkInterval seconds (plus a random delay of 1 - 60 seconds so NPCs do not all talk at once).
  2. Taunting monsters: when a monster kills a player, the monster says a line. For monsters in the Taunts list, it can also announce to everyone.

How to enable

  1. The line LoadModule("NpcMessage\\NpcMessage") in Main.lua (enabled by default).
  2. Edit Includes\NpcMessage\Config.lua.
  3. Click Reload LuaAPI.

The module attaches OnTimerThread (if TalkEnable) and OnUserDie (if TauntEnable). No SQL needed.

Configuration (Config.lua, NpcMessageConfig table)

KeyValueDefaultMeaning
TalkEnabletrue / falsetrueNPCs talk on their own.
TalkIntervalseconds60Interval between two lines of one NPC (plus a random 1 - 60 seconds).
CheckRateseconds5Interval between two scans of the NPC list (the larger, the lighter on the server).
CheckPositiontrue / falsefalsetrue: only NPCs standing at the exact X, Y coordinates talk (255 = any position).
ShowInChattrue / falsefalsetrue: the line also appears in the chat window; false: only the bubble above the head is shown.
TauntEnabletrue / falsetrueMonsters taunt when they kill a player.
TauntAnnouncetrue / falsetrueAnnounces to everyone when a monster in the Taunts list kills a player.
DefaultTauntstring(built in)Line said by monsters that are not in Taunts.
Announcestring with %s(built in)Announcement content; the 3 %s values are: player, monster, monster.
Npcstable~35 NPCsEach row: Class (NPC number in Data\Monster\MonsterList.xml), X, Y, Message.
Tauntstable~14 monstersEach 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?" },
}