<?xml version="1.0" encoding="UTF-8"?>
<npc name="Soya" script="default.lua" walkinterval="5000">
<look type="136" head="149" body="78" legs="79" feet="132" addons="1" />
<parameters>
<parameter key="message_greet" value="Ah, a customer! Be greeted, |PLAYERNAME|!" />
<parameter key="module_shop" value="1" />
<parameter key="shop_buyable" value="" />
<parameter key="shop_sellable" value="
abyss hammer, 7414, 20000;
amber staff, 7426, 8000;
ancient amulet, 2142, 200;
assassin daggerf, 7404, 20000;
bandana, 5917, 150;
beastslayer axe, 3962, 1500;
berserker, 7403, 40000;
bone shield, 2541, 80;
bonelord helmet, 3972, 7500;
brutetamer's staff, 7379, 1500;
castle shield, 2535, 5000;
chain bolter, 8850, 40000;
chaos mace, 7427, 9000;
coconut shoes, 9931, 500;
composite hornbow, 8855, 25000;
cranial basher, 7415, 30000;
crocodile boots, 3982, 1000;
crystal mace, 2445, 12000;
crystal necklace, 2125, 400;
crystal ring, 2124, 250;
crystal sword, 7449, 600;
crystalline armor, 8878, 16000;
daramanian mace, 2439, 110;
daramanian waraxe, 2440, 1000;
dark shield, 2521, 400;
death ring, 6300, 1000;
demon shield, 2520, 30000;
demonbone amulet, 2136, 32000;
demonrage sword, 7382, 36000;
devil helmet, 2462, 1000;
diamond sceptre, 7387, 3000;
djinn blade, 2451, 15000;
doll, 2110, 200;
dragon scale mail, 2492, 40000;
dragon slayer, 7402, 15000;
dragonbone staff, 7430, 3000;
dreaded cleaver, 7419, 10000;
dwarven armor, 2503, 30000;
earth cranial basher, 7866, 30000;
earth dragon slayer, 7858, 15000;
earth heroic axe, 7861, 30000;
earth mystic blade, 7856, 30000;
earth relic sword, 7855, 25000;
earth war axe, 7863, 12000;
emerald bangle, 2127, 800;
energy cranial basher, 7881, 30000;
energy dragon slayer, 7873, 15000;
energy heroic axe, 7876, 30000;
energy mystic blade, 7871, 30000;
energy relic sword, 7870, 25000;
energy war axe, 7878, 12000;
epee, 2438, 8000;
fiery cranial basher, 7756, 30000;
fiery dragon slayer, 7748, 15000;
fiery heroic axe, 7751, 30000;
fiery mystic blade, 7746, 30000;
fiery relic sword, 7745, 25000;
fiery war axe, 7753, 12000;
flower wreath, 9927, 500;
fur boots, 7457, 2000;
furry club, 7432, 1000;
glacier amulet, 7888, 1500;
glacier kilt, 7896, 11000;
glacier mask, 7902, 2500;
glacier robe, 7897, 11000;
glacier shoes, 7892, 2500;
gold ring, 2179, 8000;
golden armor, 2466, 20000;
golden legs, 2470, 30000;
guardian halberd, 2427, 11000;
hammer of wrath, 2444, 30000;
heavy mace, 2452, 50000;
heavy machete, 2442, 90;
heroic axe, 7389, 30000;
hibiscus dress, 8873, 3000;
icy cranial basher, 7775, 30000;
icy dragon slayer, 7767, 15000;
icy heroic axe, 7770, 30000;
icy mystic blade, 7765, 30000;
icy relic sword, 7764, 25000;
icy war axe, 7772, 12000;
jade hammer, 7422, 25000;
krimhorn helmet, 7461, 200;
lavos armor, 8877, 16000;
leaf legs, 9928, 500;
leopard armor, 3968, 1000;
light shovel, 5710, 300;
lightning boots, 7893, 2500;
lightning headband, 7901, 2500;
lightning legs, 7895, 11000;
lightning pendant, 7889, 1500;
lightning robe, 7898, 11000;
lunar staff, 7424, 5000;
magic plate armor, 2472, 90000;
magma amulet, 7890, 1500;
magma boots, 7891, 2500;
magma coat, 7899, 11000;
magma legs, 7894, 11000;
magma monocle, 7900, 2500;
mammoth fur cape, 7463, 6000;
mammoth fur shorts, 7464, 850;
mammoth whopper, 7381, 300;
mastermind shield, 2514, 50000;
medusa shield, 2536, 9000;
mercenary sword, 7386, 12000;
mystic blade, 7384 ,30000;
naginata, 2426, 2000;
nightmare blade, 7418, 35000;
noble axe, 7456, 10000;
norse shield, 7460, 1500;
paladin armor, 8891, 15000;
patched boots, 2641, 2000;
pharaoh sword, 2446, 23000;
pirate boots, 5462, 3000;
pirate hat, 6096, 1000;
pirate knee breeches, 5918, 200;
pirate shirt, 6095, 500;
pirate voodoo doll, 5810, 500;
platinum amulet, 2171, 2500;
ragnir helmet, 7462, 400;
relic sword, 7383, 25000;
ring of the sky, 2123, 30000;
ruby necklace, 2133, 2000;
ruthless axe, 6553, 45000;
sacred tree amulet, 10219, 3000;
sapphire hammer, 7437, 7000;
scarab amulet, 2135, 200;
scarab shield, 2540, 2000;
shockwave amulet, 10221, 3000;
silver brooch, 2134, 150;
silver dagger, 2402, 500;
skull helmet, 5741, 40000;
skullcracker armor, 8889, 18000;
spiked squelcher, 7452, 5000;
steel boots, 2645, 30000;
swamplair armor, 8880, 16000;
taurus mace, 7425, 500;
tempest shield, 2542, 35000;
terra amulet, 7887, 1500;
terra boots, 7886, 2500;
terra hood, 7903, 2500;
terra legs, 7885, 11000;
terra mantle, 7884, 11000;
tortoise shield, 6131, 150;
vile axe, 7388, 30000;
voodoo doll, 3955, 400;
war axe, 2454, 12000;
wyvern fang, 7408, 1500
" />
</parameters>
</npc>
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Soya" script="data/npc/scripts/soya.lua" walkinterval="5000">
<look type="136" head="149" body="78" legs="79" feet="132" addons="1" />
<parameters>
<parameter key="message_greet" value="Ah, a customer! Be greeted, |PLAYERNAME|!" />
</parameters>
</npc>
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
local shopWindow = {}
local STORAGE = 1234
local t = {
-- [ITEMID TO SELL] = {Buy cost (0 = not buyable), sell cost (0 = not sellable)}
--[[abyss hammer]] [7414] = {price = 20000},
--[[amber staff]] [7426] = {price = 8000},
--[[ancient amulet]] [2142] = {price = 200},
--[[assassin daggerf]] [7404] = {price = 20000},
--[[bandana]] [5917] = {price = 150},
--[[beastslayer axe]] [3962] = {price = 1500},
--[[berserker]] [7403] = {price = 40000},
--[[bone shield]] [2541] = {price = 80},
--[[bonelord helmet]] [3972] = {price = 7500},
--[[brutetamer's staff]] [7379] = {price = 1500},
--[[castle shield]] [2535] = {price = 5000},
--[[chain bolter]] [8850] = {price = 40000},
--[[chaos mace]] [7427] = {price = 9000},
--[[coconut shoes]] [9931] = {price = 500},
--[[composite hornbow]] [8855] = {price = 25000},
--[[cranial basher]] [7415] = {price = 30000},
--[[crocodile boots]] [3982] = {price = 1000},
--[[crystal mace]] [2445] = {price = 12000},
--[[crystal necklace]] [2125] = {price = 400},
--[[crystal ring]] [2124] = {price = 250},
--[[crystal sword]] [7449] = {price = 600},
--[[crystalline armor]] [8878] = {price = 16000},
--[[daramanian mace]] [2439] = {price = 110},
--[[daramanian waraxe]] [2440] = {price = 1000},
--[[dark shield]] [2521] = {price = 400},
--[[death ring]] [6300] = {price = 1000},
--[[demon shield]] [2520] = {price = 30000},
--[[demonbone amulet]] [2136] = {price = 32000},
--[[demonrage sword]] [7382] = {price = 36000},
--[[devil helmet]] [2462] = {price = 1000},
--[[diamond sceptre]] [7387] = {price = 3000},
--[[djinn blade]] [2451] = {price = 15000},
--[[doll]] [2110] = {price = 200},
--[[dragon scale mail]] [2492] = {price = 40000},
--[[dragon slayer]] [7402] = {price = 15000},
--[[dragonbone staff]] [7430] = {price = 3000},
--[[dreaded cleaver]] [7419] = {price = 10000},
--[[dwarven armor]] [2503] = {price = 30000},
--[[earth cranial basher]] [7866] = {price = 30000},
--[[earth dragon slayer]] [7858] = {price = 15000},
--[[earth heroic axe]] [7861] = {price = 30000},
--[[earth mystic blade]] [7856] = {price = 30000},
--[[earth relic sword]] [7855] = {price = 25000},
--[[earth war axe]] [7863] = {price = 12000},
--[[emerald bangle]] [2127] = {price = 800},
--[[energy cranial basher]] [7881] = {price = 30000},
--[[energy dragon slayer]] [7873] = {price = 15000},
--[[energy heroic axe]] [7876] = {price = 30000},
--[[energy mystic blade]] [7871] = {price = 30000},
--[[energy relic sword]] [7870] = {price = 25000},
--[[energy war axe]] [7878] = {price = 12000},
--[[epee]] [2438] = {price = 8000},
--[[fiery cranial basher]] [7756] = {price = 30000},
--[[fiery dragon slayer]] [7748] = {price = 15000},
--[[fiery heroic axe]] [7751] = {price = 30000},
--[[fiery mystic blade]] [7746] = {price = 30000},
--[[fiery relic sword]] [7745] = {price = 25000},
--[[fiery war axe]] [7753] = {price = 12000},
--[[flower wreath]] [9927] = {price = 500},
--[[fur boots]] [7457] = {price = 2000},
--[[furry club]] [7432] = {price = 1000},
--[[glacier amulet]] [7888] = {price = 1500},
--[[glacier kilt]] [7896] = {price = 11000},
--[[glacier mask]] [7902] = {price = 2500},
--[[glacier robe]] [7897] = {price = 11000},
--[[glacier shoes]] [7892] = {price = 2500},
--[[gold ring]] [2179] = {price = 8000},
--[[golden armor]] [2466] = {price = 20000},
--[[golden legs]] [2470] = {price = 30000},
--[[guardian halberd]] [2427] = {price = 11000},
--[[hammer of wrath]] [2444] = {price = 30000},
--[[heavy mace]] [2452] = {price = 50000},
--[[heavy machete]] [2442] = {price = 90},
--[[heroic axe]] [7389] = {price = 30000},
--[[hibiscus dress]] [8873] = {price = 3000},
--[[icy cranial basher]] [7775] = {price = 30000},
--[[icy dragon slayer]] [7767] = {price = 15000},
--[[icy heroic axe]] [7770] = {price = 30000},
--[[icy mystic blade]] [7765] = {price = 30000},
--[[icy relic sword]] [7764] = {price = 25000},
--[[icy war axe]] [7772] = {price = 12000},
--[[jade hammer]] [7422] = {price = 25000},
--[[krimhorn helmet]] [7461] = {price = 200},
--[[lavos armor]] [8877] = {price = 16000},
--[[leaf legs]] [9928] = {price = 500},
--[[leopard armor]] [3968] = {price = 1000},
--[[light shovel]] [5710] = {price = 300},
--[[lightning boots]] [7893] = {price = 2500},
--[[lightning headband]] [7901] = {price = 2500},
--[[lightning legs]] [7895] = {price = 11000},
--[[lightning pendant]] [7889] = {price = 1500},
--[[lightning robe]] [7898] = {price = 11000},
--[[lunar staff]] [7424] = {price = 5000},
--[[magic plate armor]] [2472] = {price = 90000},
--[[magma amulet]] [7890] = {price = 1500},
--[[magma boots]] [7891] = {price = 2500},
--[[magma coat]] [7899] = {price = 11000},
--[[magma legs]] [7894] = {price = 11000},
--[[magma monocle]] [7900] = {price = 2500},
--[[mammoth fur cape]] [7463] = {price = 6000},
--[[mammoth fur shorts]] [7464] = {price = 850},
--[[mammoth whopper]] [7381] = {price = 300},
--[[mastermind shield]] [2514] = {price = 50000},
--[[medusa shield]] [2536] = {price = 9000},
--[[mercenary sword]] [7386] = {price = 12000},
--[[mystic blade]] [7384] = {price = 30000},
--[[naginata]] [2426] = {price = 2000},
--[[nightmare blade]] [7418] = {price = 35000},
--[[noble axe]] [7456] = {price = 10000},
--[[norse shield]] [7460] = {price = 1500},
--[[paladin armor]] [8891] = {price = 15000},
--[[patched boots]] [2641] = {price = 2000},
--[[pharaoh sword]] [2446] = {price = 23000},
--[[pirate boots]] [5462] = {price = 3000},
--[[pirate hat]] [6096] = {price = 1000},
--[[pirate knee breeches]] [5918] = {price = 200},
--[[pirate shirt]] [6095] = {price = 500},
--[[pirate voodoo doll]] [5810] = {price = 500},
--[[platinum amulet]] [2171] = {price = 2500},
--[[ragnir helmet]] [7462] = {price = 400},
--[[relic sword]] [7383] = {price = 25000},
--[[ring of the sky]] [2123] = {price = 30000},
--[[ruby necklace]] [2133] = {price = 2000},
--[[ruthless axe]] [6553] = {price = 45000},
--[[sacred tree amulet]] [10219] = {price = 3000},
--[[sapphire hammer]] [7437] = {price = 7000},
--[[scarab amulet]] [2135] = {price = 200},
--[[scarab shield]] [2540] = {price = 2000},
--[[shockwave amulet]] [10221] = {price = 3000},
--[[silver brooch]] [2134] = {price = 150},
--[[silver dagger]] [2402] = {price = 500},
--[[skull helmet]] [5741] = {price = 40000},
--[[skullcracker armor]] [8889] = {price = 18000},
--[[spiked squelcher]] [7452] = {price = 5000},
--[[steel boots]] [2645] = {price = 30000},
--[[swamplair armor]] [8880] = {price = 16000},
--[[taurus mace]] [7425] = {price = 500},
--[[tempest shield]] [2542] = {price = 35000},
--[[terra amulet]] [7887] = {price = 1500},
--[[terra boots]] [7886] = {price = 2500},
--[[terra hood]] [7903] = {price = 2500},
--[[terra legs]] [7885] = {price = 11000},
--[[terra mantle]] [7884] = {price = 11000},
--[[tortoise shield]] [6131] = {price = 150},
--[[vile axe]] [7388] = {price = 30000},
--[[voodoo doll]] [3955] = {price = 400},
--[[war axe]] [2454] = {price = 12000},
--[[wyvern fang]] [7408] = {price = 1500}
}
local onSell = function(cid, item, subType, amount, ignoreCap, inBackpacks)
doPlayerRemoveItem(cid, item, amount)
if getPlayerStorageValue(cid, STORAGE) == 1 then
doPlayerAddMoney(cid, t[item].price*amount)
npcHandler:say("You have sold " .. amount .. "x " .. getItemNameById(item) .. " for " .. t[item].price*amount .. " gold.", cid)
else
doPlayerAddMoney(cid, ((t[item].price)-(t[item].price)*0.5)*amount)
npcHandler:say("You have sold " .. amount .. "x " .. getItemNameById(item) .. " for " .. ((t[item].price)-(t[item].price)*0.5)*amount .. " gold.", cid)
end
return true
end
if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then
if getPlayerStorageValue(cid, STORAGE) == 1 then
for var, ret in pairs(t) do
table.insert(shopWindow, {id = var, subType = 0, sell = ret.price, name = getItemNameById(var)})
end
openShopWindow(cid, shopWindow, onBuy, onSell)
else
for var, ret in pairs(t) do
table.insert(shopWindow, {id = var, subType = 0, sell = ((ret.price)-((ret.price)*0.5)), name = getItemNameById(var)})
end
openShopWindow(cid, shopWindow, onBuy, onSell)
end
return true
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())