soul4soul
Intermediate OT User
this NPC sells and buys every food item available to buy on cip servers at cip price.
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
-- Start shop
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
--shopModule:addSellableItem({'Juice Squeezer'}, 5865, 100)
shopModule:addSellableItem({'Meat'}, 2666, 2, 'Meat')
shopModule:addSellableItem({'Ham'}, 2671, 15)
--shopModule:addSellableItem({'Green Perch'}, 7159, 10000)
--shopModule:addSellableItem({'Northern Pike'}, 2669, 5000)
--shopModule:addSellableItem({'Rainbow Trout'}, 7158, 15000)
shopModule:addSellableItem({'Cheese'}, 2696, 2)
shopModule:addSellableItem({'Carrot'}, 2684, 1)
shopModule:addSellableItem({'Salmon'}, 2668, 2)
shopModule:addSellableItem({'Blueberry'}, 2677, 1, 5)
shopModule:addSellableItem({'Cherry'}, 2679, 1)
shopModule:addSellableItem({'Cookie'}, 2687, 1)
shopModule:addSellableItem({'Cocktail Glass'}, 10150, 50)
shopModule:addSellableItem({'Golden Mug'}, 2033, 250)
-------------------player buys
--food
shopModule:addBuyableItem({'Meat'}, 2666, 10, 1)
shopModule:addBuyableItem({'Pumpkin'}, 2683, 10, 1)
shopModule:addBuyableItem({'Ham'}, 2671, 15, 1)
shopModule:addBuyableItem({'Bread'}, 2689, 8, 1)
shopModule:addBuyableItem({'Brown Bread'}, 2691, 4, 1)
shopModule:addBuyableItem({'Cake'}, 6278, 50, 1)
shopModule:addBuyableItem({'Dragon Ham'}, 2672, 25, 1)
shopModule:addBuyableItem({'Ice Cream Cone'}, 8208, 10, 1)
shopModule:addBuyableItem({'Melon'}, 2682, 13, 1)
shopModule:addBuyableItem({'Cheese'}, 2696, 12, 1)
shopModule:addBuyableItem({'Mango'}, 5097, 10, 1)
shopModule:addBuyableItem({'Scarab Cheese'}, 8112, 100, 1)
shopModule:addBuyableItem({'Fish'}, 2667, 6, 1)
shopModule:addBuyableItem({'Valentine\'s Cake'}, 6393, 100, 1)
shopModule:addBuyableItem({'Corncob'}, 2686, 3, 1)
shopModule:addBuyableItem({'Roll'}, 2690, 2, 1)
shopModule:addBuyableItem({'Carrot'}, 2684, 8, 1)
shopModule:addBuyableItem({'Salmon'}, 2668, 7, 1)
shopModule:addBuyableItem({'Jalapeño Pepper'}, 8844, 2, 1)
shopModule:addBuyableItem({'Cucumber'}, 8842, 5, 1)
shopModule:addBuyableItem({'Grapes'}, 2681, 8, 1)
shopModule:addBuyableItem({'Bulb of Garlic'}, 9114, 4)
shopModule:addBuyableItem({'Onion'}, 8843, 2, 1)
shopModule:addBuyableItem({'Pear'}, 2673, 5, 1)
shopModule:addBuyableItem({'Beetroot'}, 8845, 2, 1)
shopModule:addBuyableItem({'Plum'}, 8839, 3, 1)
shopModule:addBuyableItem({'Red Apple'}, 2674, 5, 1)
shopModule:addBuyableItem({'Banana'}, 2676, 5, 1)
shopModule:addBuyableItem({'Blueberry'}, 2677, 1, 1)
shopModule:addBuyableItem({'Cherry'}, 2679, 1, 1)
shopModule:addBuyableItem({'Lemon'}, 8841, 3, 1)
shopModule:addBuyableItem({'Raspberry'}, 8840, 1, 1)
shopModule:addBuyableItem({'Potato'}, 8838, 5, 1)
shopModule:addBuyableItem({'Tomato'}, 2685, 10, 1)
shopModule:addBuyableItem({'Red Mushroom'}, 2788, 12, 1)
shopModule:addBuyableItem({'Strawberry'}, 2680, 2, 1)
shopModule:addBuyableItem({'Orange'}, 2675, 10, 1)
shopModule:addBuyableItem({'Cookie'}, 2687, 5, 1)
shopModule:addBuyableItem({'White Mushroom'}, 2787, 10, 1)
shopModule:addBuyableItem({'Brown Mushroom'}, 2789, 10, 1)
--liquid containers
shopModule:addBuyableItem({'Amphora'}, 2023, 4, 1)
shopModule:addBuyableItem({'Bottle'}, 2007, 3, 1)
shopModule:addBuyableItem({'Bucket'}, 2005, 4, 1)
shopModule:addBuyableItem({'Cup'}, 2013, 3, 1)
shopModule:addBuyableItem({'Jug'}, 2014, 10, 1)
shopModule:addBuyableItem({'Mug'}, 2012, 4, 1)
shopModule:addBuyableItem({'Pot'}, 2562, 30, 1)
shopModule:addBuyableItem({'Rum Flask'}, 5553, 150, 1)
shopModule:addBuyableItem({'Vase'}, 2008, 3, 1)
shopModule:addBuyableItem({'Waterskin'}, 2031, 10, 1)
shopModule:addBuyableItem({'Holy Water'}, 7494, 200000, 1)
-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())
Code:
<npc name="Tom" script="data/npc/scripts/food.lua" walkinterval="25000" floorchange="0" access="3">
<health now="150" max="150"/>
<look type="128" head="20" body="100" legs="50" feet="99" corpse="2212" addons="3"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|. Welcome to my bar!" />
<parameter key="keywords" value="help;quest;sacrific;sweet;bar of chocolate" />
<parameter key="keyword_reply1" value="There is not much i can help you with." />
<parameter key="keyword_reply2" value="I only know of one quest that requires you to sacrifice something." />
<parameter key="keyword_reply3" value="The other day I over head some men talking they said there is a sign that says you need something sweet." />
<parameter key="keyword_reply4" value="Well i dont have anything sweet this is a pub not a candy shop." />
<parameter key="keyword_reply5" value="Yes, yes that may work now you just need to find some chocolate. Maybe you can find some in the jungle its very easy to lose things there." />
</parameters>
</npc>