a91160ecc6
Standarized logs to have different levels. Show by default only INFO, ERROR log messages. Dialogues: Standarized function for NPC chat messages. Removed trader.lua and trader_test.lua which are part of old 'mobs_npc' mod.
40 lines
941 B
Lua
Executable File
40 lines
941 B
Lua
Executable File
-- Advanced NPC mod by Zorman2000
|
|
local path = minetest.get_modpath("advanced_npc")
|
|
|
|
-- Intllib
|
|
local S
|
|
if minetest.get_modpath("intllib") then
|
|
S = intllib.Getter()
|
|
else
|
|
S = function(s, a, ...)
|
|
if a == nil then
|
|
return s
|
|
end
|
|
a = {a, ...}
|
|
return s:gsub("(@?)@(%(?)(%d+)(%)?)",
|
|
function(e, o, n, c)
|
|
if e == ""then
|
|
return a[tonumber(n)] .. (o == "" and c or "")
|
|
else
|
|
return "@" .. o .. n .. c
|
|
end
|
|
end)
|
|
end
|
|
end
|
|
mobs.intllib = S
|
|
|
|
dofile(path .. "/npc.lua")
|
|
dofile(path .. "/spawner.lua")
|
|
dofile(path .. "/relationships.lua")
|
|
dofile(path .. "/dialogue.lua")
|
|
dofile(path .. "/trade/trade.lua")
|
|
dofile(path .. "/trade/prices.lua")
|
|
dofile(path .. "/actions/actions.lua")
|
|
dofile(path .. "/actions/places.lua")
|
|
dofile(path .. "/actions/pathfinder.lua")
|
|
dofile(path .. "/actions/jumper.lua")
|
|
dofile(path .. "/actions/node_registry.lua")
|
|
dofile(path .. "/random_data.lua")
|
|
|
|
print (S("[Mod] Advanced NPC loaded"))
|