crazy bastard
New Member
- Joined
- Jul 27, 2008
- Messages
- 22
- Reaction score
- 0
/The Forgotten King does not work in my server. It gets to when a player answers yes and then nothing. How can I fix
<?xml version="1.0" encoding="UTF-8"?>
<npc name="King" script="data/npc/scripts/king.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="130" head="0" body="79" legs="119" feet="79" addons="3"/>
<parameters>
<parameter key="message_greet" value="Welcome |PLAYERNAME|" />
<parameter key="module_keywords" value="1" />
<parameter key="keywords" value="job;kingdom" />
<parameter key="keyword_reply1" value="My job is be the best king in this {kingdom}." />
<parameter key="keyword_reply2" value="This is the best kingdom in this continent, i am the best king, my guards are very justice and... well.. i am the best king" />
</parameters>
</npc>
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
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
local node1 = keywordHandler:addKeyword({'promotion'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can promote you for 20000 gold coins. Do you want be promoted?'})
node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20000, level = 20, text = 'Congratulations! You are now promoted.'})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Allright then. Come back when you are ready.', reset = true})
npcHandler:addModule(FocusModule:new())
Try this...
data/npcs/King.xml
Code:<?xml version="1.0" encoding="UTF-8"?> <npc name="King" script="data/npc/scripts/king.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="130" head="0" body="79" legs="119" feet="79" addons="3"/> <parameters> <parameter key="message_greet" value="Welcome |PLAYERNAME|" /> <parameter key="module_keywords" value="1" /> <parameter key="keywords" value="job;kingdom" /> <parameter key="keyword_reply1" value="My job is be the best king in this {kingdom}." /> <parameter key="keyword_reply2" value="This is the best kingdom in this continent, i am the best king, my guards are very justice and... well.. i am the best king" /> </parameters> </npc>
data/npcs/scripts/king.lua
Code:local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 local node1 = keywordHandler:addKeyword({'promotion'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can promote you for 20000 gold coins. Do you want be promoted?'}) node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20000, level = 20, text = 'Congratulations! You are now promoted.'}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Allright then. Come back when you are ready.', reset = true}) npcHandler:addModule(FocusModule:new())