<?xml version="1.0" encoding="UTF-8"?>
<npc name="A Neard" script="data/npc/scripts/neard.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="22" head="0" body="0" legs="0" feet="0"/>
<parameters>
<parameter key="message_greet" value="Hum Humm! Welcume |PLAYERNAME|." />
<parameter key="message_decline" value="Alright then. Come back when you got the neccessary items." />
<parameter key="message_walkaway" value="Farewell, human." />
<parameter key="module_keywords" value="1" />
<parameter key="keywords" value="job" />
<parameter key="keyword_reply1" value="I'm an forger." />
</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
-- XVX FORGER START --
function amulet(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
if getPlayerItemCount(cid,5879) >= 1 then
if doPlayerRemoveItem(cid,5879,1) then
npcHandler:say('Here is your item!', cid)
doPlayerAddItem(cid,5957,1)
end
else
npcHandler:say('You don\'t have these items!', cid)
end
end
-- XVX FORGER END --
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can need spider silks!!"})
local node1 = keywordHandler:addKeyword({'amulet'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Hum Humm! Welcume lil. I can do unbroken but Big Ben want spider silks. Yes or no??'})
node1:addChildKeyword({'yes'}, amulet, {npcHandler = npcHandler, onlyFocus = true, reset = true})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got the neccessary items.', reset = true})
npcHandler:addModule(FocusModule:new())
Npc
PHP:<?xml version="1.0" encoding="UTF-8"?> <npc name="A Neard" script="data/npc/scripts/neard.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="22" head="0" body="0" legs="0" feet="0"/> <parameters> <parameter key="message_greet" value="Hum Humm! Welcume |PLAYERNAME|." /> <parameter key="message_decline" value="Alright then. Come back when you got the neccessary items." /> <parameter key="message_walkaway" value="Farewell, human." /> <parameter key="module_keywords" value="1" /> <parameter key="keywords" value="job" /> <parameter key="keyword_reply1" value="I'm an forger." /> </parameters> </npc>
neard.lua
UntestedLUA: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 -- XVX FORGER START -- function amulet(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false end if getPlayerItemCount(cid,5879) >= 1 then if doPlayerRemoveItem(cid,5879,1) then npcHandler:say('Here is your item!', cid) doPlayerAddItem(cid,5957,1) end else npcHandler:say('You don\'t have these items!', cid) end end -- XVX FORGER END -- keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can need spider silks!!"}) local node1 = keywordHandler:addKeyword({'amulet'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Hum Humm! Welcume lil. I can do unbroken but Big Ben want spider silks. Yes or no??'}) node1:addChildKeyword({'yes'}, amulet, {npcHandler = npcHandler, onlyFocus = true, reset = true}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got the neccessary items.', reset = true}) npcHandler:addModule(FocusModule:new())
post if it dont work
![]()