data\npc\scripts->ryby.lua
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
local shopModule = ShopModule:new() npcHandler:addModule(shopModule)
shopModule:addBuyableItem({'ryba', 'fish'}, 2667, 10, 'ryby') shopModule:addBuyableItem({'sandacz', 'green perch'}, 7159, 20, 'zielony sandacz') shopModule:addBuyableItem({'szczupak', 'northern pike'}, 2669, 20, 'szczupak') shopModule:addBuyableItem({'pstrag', 'rainbow trout'}, 7158, 25, 'tenczowy pstrag') shopModule:addBuyableItem({'krewetka', 'shrimp'}, 2670, 30, 'krewetki')
npcHandler:addModule(FocusModule:new())
data\npc->rybak.xml
<?xml version="1.0"?>
<npc name="Edzio Rybaczek" script="data/npc/scripts/ryby.lua" access="1" lookdir="2" autowalk="25"> <mana now="800" max="800"/> <health now="200" max="200"/> <look type="251" head="113" body="113" legs="113" feet="57" addons="3"/> <parameters> <parameter key="message_greet" value="Siema |PLAYERNAME|. Sprzedaje rybki ktore masz na tablicy." /> <parameter key="message_needmoremoney" value="Nie masz tyle forsy." /> <parameter key="message_decline" value="Czy |TOTALCOST| to za duzo dla ciebie?" /> </parameters> </npc>
|