I can't seem to limit my NPCs movement(or limiting pushing them away from their place), they don't stay within the spawn point. :/
Anyone know how to solve this?
the npc
and the script
Anyone know how to solve this?
the npc
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Yok" script="data/npc/scripts/Yok.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="134" head="39" body="95" legs="0" feet="39" addons="0"/>
<parameters>
<parameter key="message_greet" value="Greetings |PLAYERNAME|. You don't happen to have any questions about the {village}?" />
<parameter key="module_keywords" value="1" />
<parameter key="keywords" value="job;jailor;village" />
<parameter key="keyword_reply1" value="I work as a {jailor}." />
<parameter key="keyword_reply2" value="I see to it that any prisoners we might have, does not escape." />
<parameter key="keyword_reply3" value="I protect this wonderful village to the south from harm." />
</parameters>
</npc>
and the script
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
-- OTServ event handling functions end
npcHandler:addModule(FocusModule:new())
function onThink()
npcHandler:onThink()
talk = math.random(1,40)
if talk == 1 then
selfSay("Long live the king!")
end
if talk == 2 then
selfSay("<mumbles>")
end
end
Last edited: