local talk_start = 0
local focus = 0
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler
nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler
nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler
nCreatureSay(cid, type, msg) end
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
shopModule:addSellableItem({'voodoo doll', 'voodoo doll'}, 3955, 400, 'voodoo doll')
shopModule:addSellableItem({'doll', 'doll'}, 2110, 400, 'doll')
shopModule:addSellableItem({'light shovel', 'light shovel'}, 5710, 300, 'light shovel')
shopModule:addSellableItem({'silver brooch', 'silver brooch'}, 2134, 150, 'silver brooch')
shopModule:addSellableItem({'scarab amulet', 'scarab amulet'}, 2135, 200, 'scarab amulet')
shopModule:addSellableItem({'ruby necklace', 'ruby necklace'}, 2133, 2000, 'ruby necklace')
shopModule:addSellableItem({'ring of the sky', 'ring of the sky'}, 2123, 30000, 'ring of the sky')
shopModule:addSellableItem({'platinum amulet', 'platinum amulet'}, 2171, 2500, 'platinum amulet')
shopModule:addSellableItem({'golden ring', 'golden ring'}, 2179, 8000, 'golden ring')
shopModule:addSellableItem({'glacier amulet', 'glacier amulet'}, 7888, 1500, 'glacier amulet')
shopModule:addSellableItem({'emerald bangle', 'emerald bangle'}, 2127, 800, 'emerald bangle')
shopModule:addSellableItem({'demonbone amulet', 'demonbone amulet'}, 2136, 32000, 'demonbone amulet')
shopModule:addSellableItem({'death ring', 'death ring'}, 6300, 1000, 'death ring')
shopModule:addSellableItem({'crystal ring', 'crystal ring'}, 2124, 250, 'crystal ring')
shopModule:addSellableItem({'crystal necklace', 'crystal necklace'}, 2125, 400, 'crystal necklace')
shopModule:addSellableItem({'ancient amulet', 'ancient amulet'}, 2142, 200, 'ancient amulet')
shopModule:addSellableItem({'spiked squelcher', 'spiked squelcher'}, 7452, 5000, 'spiked squelcher')
shopModule:addSellableItem({'relic sword', 'relic sword'}, 7383, 25000, 'relic sword')
shopModule:addSellableItem({'noble axe', 'noble axe'}, 7456, 6000, 'noble axe')
shopModule:addSellableItem({'nightmare blade', 'nightmare blade'}, 7418, 35000, 'nightmare blade')
shopModule:addSellableItem({'mystic blade', 'mystic blade'}, 7384, 30000, 'mystic blade')
shopModule:addSellableItem({'mercenary sword', 'mercenary sword'}, 7386, 12000, 'mercenary sword')
shopModule:addSellableItem({'heroic axe', 'heroic axe'}, 7389, 30000, 'heroic axe')
shopModule:addSellableItem({'guardian halberd', 'guardian halberd'}, 2427, 11000, 'guardian halberd')
shopModule:addSellableItem({'dreaded cleaver', 'dreaded cleaver'}, 7419, 10000, 'dreaded cleaver')
shopModule:addSellableItem({'demonrage sword', 'demonrage sword'}, 7382, 36000, 'demonrage sword')
shopModule:addSellableItem({'cranial basher', 'cranial basher'}, 7415, 30000, 'cranial basher')
shopModule:addSellableItem({'chaos mace', 'chaos mace'}, 7427, 12000, 'chaos mace')
shopModule:addSellableItem({'tortoise shield', 'tortoise shield'}, 6131, 150, 'tortoise shield')
shopModule:addSellableItem({'norse shield', 'norse shield'}, 7460, 1500, 'norse shield')
shopModule:addSellableItem({'spellbook of enlightenment', 'spellbook of enlightenment'}, 8900, 4000, 'spellbook of enlightenment')
shopModule:addSellableItem({'mammoth fur shorts', 'mammoth fur shorts'}, 7464, 850, 'mammoth fur shorts')
shopModule:addSellableItem({'skullcracker armor', 'skullcracker armor'}, 8889, 18000, 'skullcracker armor')
shopModule:addSellableItem({'paladin armor', 'paladin armor'}, 8891, 15000, 'paladin armor')
shopModule:addSellableItem({'glacier mask', 'glacier mask'}, 7902, 2500, 'glacier mask')
shopModule:addSellableItem({'glacier robe', 'glacier robe'}, 7897, 11000, 'glacier robe')
shopModule:addSellableItem({'glacier kilt', 'glacier kilt'}, 7896, 11000, 'glacier kilt')
shopModule:addSellableItem({'glacier shoes', 'glacier shoes'}, 7892, 2500, 'glacier shoes')
shopModule:addSellableItem({'lightning headband', 'lightning headband'}, 7901, 2500, 'lightning headband')
shopModule:addSellableItem({'lightning robe', 'lightning robe'}, 7898, 11000, 'lightning robe')
shopModule:addSellableItem({'lightning legs', 'lightning legs'}, 7895, 11000, 'lightning legs')
shopModule:addSellableItem({'lightning boots', 'lightning boots'}, 7893, 2500, 'lightning boots')
shopModule:addSellableItem({'magma monocle', 'magma monocle'}, 7900, 2500, 'magma monocle')
shopModule:addSellableItem({'magma coat', 'magma coat'}, 7899, 11000, 'magma coat')
shopModule:addSellableItem({'magma legs', 'magma legs'}, 7894, 11000, 'magma legs')
shopModule:addSellableItem({'magma boots', 'magma boots'}, 7891, 2500, 'magma boots')
shopModule:addSellableItem({'terra hood', 'terra hood'}, 7903, 2500, 'terra hood')
shopModule:addSellableItem({'terra mantle', 'terra mantle'}, 7884, 11000, 'terra mantle')
shopModule:addSellableItem({'terra legs', 'terra legs'}, 7885, 11000, 'terra legs')
shopModule:addSellableItem({'terra boots', 'terra boots'}, 7885, 2500, 'terra boots')
shopModule:addSellableItem({'hibiscus dress', 'hibiscus dress'}, 8873, 3000, 'hibiscus dress')
shopModule:addSellableItem({'ornamented axe', 'ornamented axe'}, 7411, 11000, 'ornamented axe')
shopModule:addSellableItem({'scarab shield', 'scarab shield'}, 2540, 2000, 'scarab shield')
shopModule:addSellableItem({'castle shield', 'castle shield'}, 2535, 5000, 'castle shield')
shopModule:addSellableItem({'medusa shield', 'medusa shield'}, 2536, 9000, 'medusa shield')
shopModule:addSellableItem({'demon shield', 'demon shield'}, 2520, 30000, 'demon shield')
shopModule:addSellableItem({'pirate knee breeches', 'pirate knee breeches'}, 5918, 200, 'pirate knee breeches')
shopModule:addSellableItem({'crocodile boots', 'crocodile boots'}, 3982, 1000, 'crocodile boots')
shopModule:addSellableItem({'fur boots', 'fur boots'}, 7457, 2000, 'fur boots')
shopModule:addSellableItem({'pirate boots', 'pirate boots'}, 5462, 3000, 'pirate boots')
shopModule:addSellableItem({'steel boots', 'steel boots'}, 2645, 30000, 'steel boots')
shopModule:addSellableItem({'krimhorn helmet', 'krimhorn helmet'}, 7461, 200, 'krimhorn helmet')
shopModule:addSellableItem({'ragnir helmet', 'ragnir helmet'}, 7462, 400, 'ragnir helmet')
shopModule:addSellableItem({'pirate hat', 'pirate hat'}, 6096, 1000, 'pirate hat')
shopModule:addSellableItem({'devil helmet', 'devil helmet'}, 2462, 1000, 'devil helmet')
shopModule:addSellableItem({'beholder helmet', 'beholder helmet'}, 3972, 7500, 'beholder helmet')
shopModule:addSellableItem({'skull helmet', 'skull helmet'}, 5741, 40000, 'skull helmet')
shopModule:addSellableItem({'pirate shirt', 'pirate shirt'}, 6095, 500, 'pirate shirt')
shopModule:addSellableItem({'leopard armor', 'leopard armor'}, 3968, 1000, 'leopard armor')
shopModule:addSellableItem({'mammoth fur cape', 'mammoth fur cape'}, 7463, 6000, 'mammoth fur cape')
shopModule:addSellableItem({'golden armor', 'golden armor'}, 2466, 20000, 'golden armor')
shopModule:addSellableItem({'dwarven armor', 'dwarven armor'}, 2503, 30000, 'dwarven armor')
shopModule:addSellableItem({'dragon scale mail', 'dragon scale mail'}, 2492, 40000, 'dragon scale mail')
shopModule:addSellableItem({'heavy machete', 'heavy machete'}, 2442, 90, 'heavy machete')
shopModule:addSellableItem({'daramanian mace', 'daramanian mace'}, 2439, 110, 'daramanian mace')
shopModule:addSellableItem({'mammoth whopper', 'mammoth whopper'}, 7381, 300, 'mammoth whopper')
shopModule:addSellableItem({'silver dagger', 'silver dagger'}, 2402, 500, 'silver dagger')
shopModule:addSellableItem({'taurus mace', 'taurus mace'}, 7425, 500, 'taurus mace')
shopModule:addSellableItem({'crystal sword', 'crystal sword'}, 7449, 600, 'crystal sword')
shopModule:addSellableItem({'furry club', 'furry club'}, 7432, 1000, 'furry club')
shopModule:addSellableItem({'daramanian waraxe', 'daramanian waraxe'}, 2440, 1000, 'daramanian waraxe')
shopModule:addSellableItem({'wyvern fang', 'wyvern fang'}, 7408, 1500, 'wyvern fang')
shopModule:addSellableItem({'brutetamers staff', 'brutetamers staff'}, 7379, 1500, 'brutetamers staff')
shopModule:addSellableItem({'beastslayer axe', 'beastslayer axe'}, 3962, 1500, 'beastslayer axe')
shopModule:addSellableItem({'dragonbone staff', 'dragonbone staff'}, 7430, 3000, 'dragonbone staff')
shopModule:addSellableItem({'diamond sceptre', 'diamond sceptre'}, 7387, 3000, 'diamond sceptre')
shopModule:addSellableItem({'lunar staff', 'lunar staff'}, 7424, 5000, 'lunar staff')
shopModule:addSellableItem({'sapphire hammer', 'sapphire hammer'}, 7437, 7000, 'sapphire hammer')
shopModule:addSellableItem({'amber staff', 'amber staff'}, 7426, 8000, 'amber staff')
shopModule:addSellableItem({'dragon slayer', 'dragon slayer'}, 7402, 15000, 'dragon slayer')
shopModule:addSellableItem({'war axe', 'war axe'}, 2453, 9000, 'war axe')
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
local myNewPos = {
[1] = {x=1484, y=734, z=7},
[2] = {x=1152, y=828, z=5},
[3] = {x=742, y=1041, z=4}
}
local TpTime = 10800 --secs
local myLastTP = 0
local a = 1
function onThink()
if myLastTP == 0 then
myLastTP = os.time()
end
if os.difftime (os.time(), myLastTP) >= TpTime then
myLastTP = os.time()
doCreatureSay(getNpcCid(), "See you, Now Im going to the next city!", TALKTYPE_SAY)
doTeleportThing(getNpcCid(), myNewPos[a], FALSE)
if (a + 1) < 3 then
a = a + 1
else
a = 1
end
end
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('I don\t got all the day!')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good bye then.')
focus = 0
end
end
npcHandler
nThink()
end