• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

KeywordH andler

bybbzan

mapper
Joined
Aug 4, 2012
Messages
809
Solutions
2
Reaction score
136
Location
Sweden
Why do i get this error?
Whats wrong..


Code:
[16:18:39.510] [Error - NpcScript Interface]
[16:18:39.512] data/npc/scripts/default.lua
[16:18:39.514] Description:
[16:18:39.515] data/npc/scripts/default.lua:1: attempt to index global 'KeywordH
andler' (a nil value)
[16:18:39.519] [Warning - NpcEvents::NpcEvents] Cannot load script: data/npc/scr
ipts/default.lua

LUA:
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
function onPlayerEndTrade(cid)				npcHandler:onPlayerEndTrade(cid)			end
function onPlayerCloseChannel(cid)			npcHandler:onPlayerCloseChannel(cid)		end

npcHandler:addModule(FocusModule:new())
 
This means the locations that directs to the npcsystem files in the npc.lua/npcsystem.lua are not correct. So it can't find the npcsystem files. What you can do is change those locations or replace the whole lib folder in data/npc with the original one from your server (exe file).
 
This means the locations that directs to the npcsystem files in the npc.lua/npcsystem.lua are not correct. So it can't find the npcsystem files. What you can do is change those locations or replace the whole lib folder in data/npc with the original one from your server (exe file).

Okay i changed the lib, and now i got this.

Code:
[17:24:04.547] [Error - NpcScript Interface]
[17:24:04.549] data/npc/scripts/all loot.lua
[17:24:04.551] Description:
[17:24:04.552] data/npc/lib/npcsystem/modules.lua:1136: attempt to index local '
v' (a boolean value)
[17:24:04.556] [Warning - NpcEvents::NpcEvents] Cannot load script: data/npc/scr
ipts/all loot.lua

all loot.lua

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
function onPlayerEndTrade(cid)				npcHandler:onPlayerEndTrade(cid) end
function onPlayerCloseChannel(cid)			npcHandler:onPlayerCloseChannel(cid) end
-- OTServ event handling functions end
 
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
 
-------------------Sell to him-------------------
 
--ARMORS
shopModule:addSellableItem({'hibiscus dress'}, 8873, 3000, 'hibiscus dress')
shopModule:addSellableItem({'red robe'}, 2655, 10000, 'red robe')
shopModule:addSellableItem({'focus cape'}, 8871, 6000, 'focus cape')
shopModule:addSellableItem({'plate armor'}, 2463, 400, 'plate armor')
shopModule:addSellableItem({'noble armor'}, 2486, 900, 'noble armor')
shopModule:addSellableItem({'blue robe'}, 2656, 10000, 'blue robe')
shopModule:addSellableItem({'magma coat'}, 7899, 11000, 'magma coat')
shopModule:addSellableItem({'glacier robe'}, 7897, 11000, 'glacier robe')
shopModule:addSellableItem({'lightning robe'}, 7898, 11000, 'lightning robe')
shopModule:addSellableItem({'terra mantle'}, 7884, 11000, 'terra mantle')
shopModule:addSellableItem({'zaoan robe'}, 11356, 12000, 'zaoan robe')
shopModule:addSellableItem({'spellweavers robe'}, 11355, 22000, 'spellweavers robe')
shopModule:addSellableItem({'knight armor'}, 2476, 5000, 'knight armor')
shopModule:addSellableItem({'greenwood coat'}, 8869, 50000, 'greenwood coat')
shopModule:addSellableItem({'dragon robe'}, 8867, 50000, 'dragon robe')
shopModule:addSellableItem({'paladin armor'}, 8891, 15000, 'paladin armor')
shopModule:addSellableItem({'royal scale robe'}, 12643, 100000, 'royal scale robe')
shopModule:addSellableItem({'dragon robe'}, 8867, 50000, 'dragon robe')
shopModule:addSellableItem({'robe of the underworld'}, 8890, 100000, 'robe of the underworld')
shopModule:addSellableItem({'royal scale robe'}, 12643, 150000, 'royal scale robe')
shopModule:addSellableItem({'velvet mantle'}, 8868, 100000, 'velvet mantle')
shopModule:addSellableItem({'lavos armor'}, 8877, 100000, 'lavos armor')
shopModule:addSellableItem({'frozen plate'}, 8887, 100000, 'frozen plate')
shopModule:addSellableItem({'divine plate'}, 8885, 55000, 'divine plate')
shopModule:addSellableItem({'crown armor'}, 2487, 12000, 'crown armor')
shopModule:addSellableItem({'crystalline armor'}, 8878, 20000, 'crystalline armor')
shopModule:addSellableItem({'swamplair armor'}, 8880, 16000, 'swamplair armor')
shopModule:addSellableItem({'zaoan armor'}, 11301, 14000, 'zaoan armor')
shopModule:addSellableItem({'golden armor'}, 2466, 20000, 'golden armor')
shopModule:addSellableItem({'skullcracker armor'}, 8889, 18000, 'skullcracker armor')
shopModule:addSellableItem({'elite draken mail'}, 12607, 50000, 'elite draken mail')
shopModule:addSellableItem({'dragon scale mail'}, 2492, 40000, 'dragon scale mail')
shopModule:addSellableItem({'magic plate armor'}, 2472, 90000, 'magic plate armor')

--LEGS
shopModule:addSellableItem({'zaoan legs'}, 11304, 14000,'zaoan legs')
shopModule:addSellableItem({'dwarven legs'}, 2504, 40000,'dwarven legs')
shopModule:addSellableItem({'dragon scale legs'}, 2469, 1000000,'dragon scale legs')
shopModule:addSellableItem({'demon legs'}, 2495, 750000,'demon legs')
shopModule:addSellableItem({'blue legs'}, 7730, 15000,'blue legs')
shopModule:addSellableItem({'bast skirt'}, 3983, 750,'bast skirt')
shopModule:addSellableItem({'crown legs'}, 2488, 12000,'crown legs')
shopModule:addSellableItem({'golden legs'}, 2470, 30000,'golden legs')
shopModule:addSellableItem({'knight legs'}, 2477, 5000,'knight legs')
shopModule:addSellableItem({'ranger legs'}, 2507, 100,'ranger legs')
shopModule:addSellableItem({'glacier kilt'}, 7896, 11000,'glacier kilt')
shopModule:addSellableItem({'magma legs'}, 7894, 11000,'magma legs')
shopModule:addSellableItem({'terra legs'}, 7885, 11000,'terra legs')
shopModule:addSellableItem({'lightning legs'}, 7895, 11000,'lightning legs')

--SHIELDS
shopModule:addBuyableItem({'spellbook'}, 2175, 50,'spellbook')
shopModule:addSellableItem({'spellbook of enlightenment'}, 8900, 4000,'spellbook of enlightenment')
shopModule:addSellableItem({'spellbook of warding'}, 8901, 8000,'spellbook of warding')
shopModule:addSellableItem({'spellbook of mind control'}, 8902, 13000,'spellbook of mind control')
shopModule:addSellableItem({'spellbook of lost souls'}, 8903, 19000,'spellbook of lost souls')
shopModule:addSellableItem({'spellscroll of prophecies'}, 8904, 125000,'spellscroll of prophecies')
shopModule:addSellableItem({'spellbook of dark mysteries'}, 8918, 250000,'spellbook of dark mysteries')
shopModule:addSellableItem({'snake god\'s wristguard'}, 12647, 500000, 'snake god\'s wristguard')
shopModule:addSellableItem({'ornamented shield'}, 2524, 1500,'ornamented shield')
shopModule:addSellableItem({'scarab shield'}, 2540, 2000,'scarab shield')
shopModule:addSellableItem({'ancient shield'}, 2532, 900,'ancient shield')
shopModule:addSellableItem({'beholder shield'}, 2518, 1200,'beholder shield')
shopModule:addSellableItem({'castle shield'}, 2535, 5000,'castle shield')
shopModule:addSellableItem({'norse shield'}, 7460, 1500,'norse shield')
shopModule:addSellableItem({'guardian shield'}, 2515, 2000,'guardian shield')
shopModule:addSellableItem({'dragon shield'}, 2516, 4000,'dragon shield')
shopModule:addSellableItem({'crown shield'}, 2519, 8000,'crown shield')
shopModule:addSellableItem({'tower shield'}, 2528, 8000,'tower shield')
shopModule:addSellableItem({'medusa shield'}, 2536, 9000,'medua shield')
shopModule:addSellableItem({'vampire shield'}, 2534, 15000,'vampire shield')
shopModule:addSellableItem({'warrior\'s shield'}, 15453, 9000,'warrior\'s shield')
shopModule:addSellableItem({'demon shield'}, 2520, 30000,'demon shield')
shopModule:addSellableItem({'mastermind shield'}, 2514, 50000,'mastermind shield')

--HELMETS
shopModule:addSellableItem({'crown helmet'}, 2491, 2500,'crown helmet')
shopModule:addSellableItem({'helmet of the deep'}, 5461, 1000,'helmet of the deep')
shopModule:addSellableItem({'hat of the mad'}, 2323, 2500,'hat of the mad')
shopModule:addSellableItem({'batwing hat'}, 10016, 8000,'batwing hat')
shopModule:addSellableItem({'cobra crown'}, 12630, 50000,'cobra crown')
shopModule:addSellableItem({'pirate hat'}, 6096, 1000,'pirate hat')
shopModule:addSellableItem({'witch hat'}, 10570, 5000,'witch hat')
shopModule:addSellableItem({'jade hat'}, 11368, 9000,'jade hat')
shopModule:addSellableItem({'terra hood'}, 7903, 2500,'terra hood')
shopModule:addSellableItem({'magma monocle'}, 7900, 2500,'magma monocle')
shopModule:addSellableItem({'glacier mask'}, 7902, 2500,'glacier mask')
shopModule:addSellableItem({'yalahari mask'}, 9778, 60000,'yalahari mask')
shopModule:addSellableItem({'dwarven helmet'}, 2502, 50000,'dwarven helmet')
shopModule:addSellableItem({'beholder helmet'}, 3972, 7500,'beholder helmet')
shopModule:addSellableItem({'devil helmet'}, 2462, 1000,'devil helmet')
shopModule:addSellableItem({'crusader helmet'}, 2497, 6000,'crusader helmet')
shopModule:addSellableItem({'warrior helmet'}, 2475, 5000,'warrior helmet')
shopModule:addSellableItem({'ceremonial mask'}, 2501, 62500,'ceremonial mask')
shopModule:addSellableItem({'skull helmet'}, 5741, 40000,'skull helmet')
shopModule:addSellableItem({'royal helmet'}, 2498, 30000,'royal helmet')
shopModule:addSellableItem({'zaoan helmet'}, 11302, 100000,'zaoan helmet')

--BOOTS
shopModule:addSellableItem({'boots of haste'}, 2195, 30000,'boots of haste')
shopModule:addSellableItem({'crocodile boots'}, 3982, 1000,'crocodile boots')
shopModule:addSellableItem({'zaoan shoes'}, 11303, 5000,'zaoan shoes')
shopModule:addSellableItem({'fur boots'}, 7457, 2000, 'fur boots')
shopModule:addSellableItem({'pirate boots'}, 5462, 3000,'pirate boots')
shopModule:addSellableItem({'patched boots'}, 2641, 2000,'patched boots')
shopModule:addSellableItem({'steel boots'}, 2645, 30000,'steel boots')
shopModule:addSellableItem({'lightning boots'}, 7893, 2500,'lightning boots')
shopModule:addSellableItem({'terra boots'}, 7886, 2500,'terra boots')
shopModule:addSellableItem({'magma boots'}, 7891, 2500,'magma boots')
shopModule:addSellableItem({'glacier boots'}, 7892, 2500,'glacier boots')
shopModule:addSellableItem({'crystal boots'}, 11117, 500000,'crystal boots')
shopModule:addSellableItem({'dragon scale boots'}, 11118, 500000,'dragon scale boots')
shopModule:addSellableItem({'guardian boots'}, 11240, 35000,'guardian boots')
shopModule:addSellableItem({'draken boots'}, 12646, 40000,'draken boots')

--SWORDS
shopModule:addBuyableItem({'machete'}, 2420, 500,'machete')
shopModule:addSellableItem({'broad sword'}, 2413, 500, 'broad sword')
shopModule:addSellableItem({'spike sword'}, 2383, 1000,'spike sword')
shopModule:addSellableItem({'ice rapier'}, 2396, 1000,'ice rapier')
shopModule:addSellableItem({'serpent sword'}, 2409, 900,'serpent sword')
shopModule:addSellableItem({'crimson sword'}, 7385, 610, 'crimson sword')
shopModule:addSellableItem({'two handed sword'}, 2377, 450,'two handed sword')
shopModule:addSellableItem({'twin hooks'}, 11309, 500,'twin hooks')
shopModule:addSellableItem({'crystal sword'}, 7449, 600, 'crystal sword')
shopModule:addSellableItem({'wyvern fang'}, 7408, 1500, 'wyvern fang')
shopModule:addSellableItem({'haunted blade'}, 7407, 8000, 'haunted blade')
shopModule:addSellableItem({'fire sword'}, 2392, 4000, 'fire sword')
shopModule:addSellableItem({'epee'}, 2438, 8000, 'epee')
shopModule:addSellableItem({'bright sword'}, 2407, 6000, 'bright sword')
shopModule:addSellableItem({'blacksteel sword'}, 7406, 6000, 'blacksteel sword')
shopModule:addSellableItem({'djinn blade'}, 2451, 15000, 'djinn blade')
shopModule:addSellableItem({'assassin dagger'}, 7404, 20000, 'assassin dagger')
shopModule:addSellableItem({'mercenary sword'}, 7386, 12000, 'mercenary sword')
shopModule:addSellableItem({'dragon slayer'}, 7402, 15000, 'dragon slayer')
shopModule:addSellableItem({'pharaoh sword'}, 2446, 23000, 'pharaoh sword')
shopModule:addSellableItem({'relic sword'}, 7383, 30000, 'relic sword')
shopModule:addSellableItem({'thaian sword'}, 7391, 16000, 'thaian sword')
shopModule:addSellableItem({'sais'}, 11306, 16500, 'sais')
shopModule:addSellableItem({'giant sword'}, 2393, 17000, 'giant sword')
shopModule:addSellableItem({'bloody edge'}, 7416, 30000, 'bloody edge')
shopModule:addSellableItem({'zaoan sword'}, 11307, 30000, 'zaoan sword')
shopModule:addSellableItem({'twiceslicer'}, 12613, 28000, 'twiceslicer')
shopModule:addSellableItem({'mystic blade'}, 7384, 120000, 'mystic blade')
shopModule:addSellableItem({'demonrage sword'}, 7382, 36000, 'demonrage sword')
shopModule:addSellableItem({'crystalline sword'}, 18450, 75000, 'crystalline sword')
shopModule:addSellableItem({'berserker'}, 7403, 40000, 'berserker')
shopModule:addSellableItem({'runed sword'}, 7417, 45000, 'runed sword')
shopModule:addSellableItem({'nightmare blade'}, 7418, 35000, 'nightmare blade')
shopModule:addSellableItem({'havoc blade'}, 7405, 50000, 'havoc blade')
shopModule:addSellableItem({'the justice seeker'}, 7405, 40000, 'the justice seeker')
shopModule:addSellableItem({'the avenger'}, 6528, 62500, 'the avenger')
shopModule:addSellableItem({'blade of corruption'}, 12649, 60000, 'blade of corruption')

--AXES
shopModule:addSellableItem({'golden sickle'}, 2418, 1000,'golden sickle')
shopModule:addSellableItem({'ripper lance'}, 3964, 500,'ripper lance')
shopModule:addSellableItem({'dwarven axe'}, 2435, 1500,'dwarven axe')
shopModule:addSellableItem({'obsidian lance'}, 2425, 500,'obsidian lance')
shopModule:addSellableItem({'knight axe'}, 2430, 2000,'knight axe')
shopModule:addSellableItem({'daramanian waraxe'}, 2440, 1000,'daramanian waraxe')
shopModule:addSellableItem({'naginata'}, 2426, 2000,'naginata')
shopModule:addSellableItem({'zaoan halberd'}, 11323, 500,'zaoan halberd')
shopModule:addSellableItem({'glorious axe'}, 7454, 3000,'glorious axe')
shopModule:addSellableItem({'beastslayer axe'}, 3962, 1500,'beastslayer axe')
shopModule:addSellableItem({'headchopper'}, 7380, 6000,'headchopper')
shopModule:addSellableItem({'fire axe'}, 2432, 8000,'fire axe')
shopModule:addSellableItem({'noble axe'}, 7456, 10000,'noble axe')
shopModule:addSellableItem({'dreaded cleaver'}, 7419, 15000,'dreaded cleaver')
shopModule:addSellableItem({'titan axe'}, 7413, 4000,'titan axe')
shopModule:addSellableItem({'butcher\'s axe'}, 7412, 18000,'butcher\'s axe')
shopModule:addSellableItem({'angelic axe'}, 7436, 5000,'angelic axe')
shopModule:addSellableItem({'ornamented axe'}, 7411, 20000,'ornamented axe')
shopModule:addSellableItem({'twin axe'}, 2447, 15000,'twin axe')
shopModule:addSellableItem({'guardian halberd'}, 2427, 11000,'guardian halberd')
shopModule:addSellableItem({'vile axe'}, 7388, 30000,'vile axe')
shopModule:addSellableItem({'drakinata'}, 11305, 10000,'drakinata')
shopModule:addSellableItem({'dragon lance'}, 2414, 9000,'dragon lance')
shopModule:addSellableItem({'heroic axe'}, 7389, 30000,'heroic axe')
shopModule:addSellableItem({'war axe'}, 2454, 12000,'war axe')
shopModule:addSellableItem({'ravenwing'}, 7433, 40000,'ravenwing')
shopModule:addSellableItem({'reaper\'s axe'}, 7420, 30000,'reaper\'s axe')
shopModule:addSellableItem({'ravager\'s axe'}, 2443, 30000,'ravager\'s axe')
shopModule:addSellableItem({'ruthless axe'}, 6553, 45000,'ruthless axe')
shopModule:addSellableItem({'royal axe'}, 7434, 40000,'royal axe')
shopModule:addSellableItem({'mythril axe'}, 7455, 62500,'mythril axe')
shopModule:addSellableItem({'executioner'}, 7453, 55000,'executioner')
shopModule:addSellableItem({'impaler'}, 7435, 55000,'impaler')

--CLUBS
shopModule:addSellableItem({'banana staff'}, 3966, 1000,'banana staff')
shopModule:addSellableItem({'furry club'}, 7432, 1000,'furry club')
shopModule:addSellableItem({'taurus mace'}, 7425, 500,'taurus mace')
shopModule:addSellableItem({'dragon hammer'}, 2434, 2000, 'dragon hammer')
shopModule:addSellableItem({'diamond sceptre'}, 7387, 3000, 'diamond sceptre')
shopModule:addSellableItem({'brutetamers staff'}, 7379, 1500, 'brutetamers staff')
shopModule:addSellableItem({'dragonbone staff'}, 7430, 3000, 'dragonbone staff')
shopModule:addSellableItem({'lunar staff'}, 7424, 5000, 'lunar staff')
shopModule:addSellableItem({'sapphire hammer'}, 7437, 7000, 'sapphire hammer')
shopModule:addSellableItem({'spiked squelcher'}, 7452, 5000, 'spiked squelcher')
shopModule:addSellableItem({'skull staff'}, 2436, 6000, 'skull staff')
shopModule:addSellableItem({'shadow sceptre'}, 7451, 10000, 'shadow sceptre')
shopModule:addSellableItem({'orcish maul'}, 7392, 6000, 'orcish maul')
shopModule:addSellableItem({'crystal mace'}, 2445, 12000, 'crystal mace')
shopModule:addSellableItem({'amber staff'}, 7426, 8000, 'amber staff')
shopModule:addSellableItem({'lich staff'}, 3961, 12500, 'lich staff')
shopModule:addSellableItem({'chaos mace'}, 7427, 9000, 'chaos mace')
shopModule:addSellableItem({'silver mace'}, 2424, 20000, 'silver mace')
shopModule:addSellableItem({'war hammer'}, 2391, 1200, 'war hammer')
shopModule:addSellableItem({'drachaku'}, 11308, 10000, 'drachaku')
shopModule:addSellableItem({'bonebreaker'}, 7428, 10000, 'bonebreaker')
shopModule:addSellableItem({'queens sceptre'}, 7410, 20000, 'queens sceptre')
shopModule:addSellableItem({'abyss hammer'}, 7414, 20000, 'abyss hammer')
shopModule:addSellableItem({'cranial basher'}, 7415, 30000, 'cranial basher')
shopModule:addSellableItem({'hammer of wrath'}, 2444, 30000, 'hammer of wrath')
shopModule:addSellableItem({'onyx flail'}, 7421, 22000, 'onyx flail')
shopModule:addSellableItem({'jade hammer'}, 7422, 25000, 'jade hammer')
shopModule:addSellableItem({'heavy mace'}, 2452, 50000, 'heavy mace')
shopModule:addSellableItem({'blessed sceptre'}, 7429, 40000, 'blessed sceptre')
shopModule:addSellableItem({'demonbone'}, 7431, 25000, 'demonbone')
shopModule:addSellableItem({'snake god\'s sceptre'}, 12648, 750000, 'snake god\'s sceptre')
 
npcHandler:addModule(FocusModule:new())
 
Is it just this script or also other shop npc scripts like runes.lua from Eryn? If you have other shop npc lua scripts that work, try to change the addSellableItem lines to same way so they match with your modules.lua.
 
try to catch another file from another engine, change it and try run. I had interrupted lib, I changed file to original as my engine to original and It works.

If I helped, don't thanks, i'm pleasure ~unix
 
Do you have a shop npc lua script that works, like runes.lua from Eryn? Then try to change the shopModule:addSellableItem lines the same way as in the working script so they match with your modules.lua.
 
Do you have a shop npc lua script that works, like runes.lua from Eryn? Then try to change the shopModule:addSellableItem lines the same way as in the working script so they match with your modules.lua.

Tried that, actually the runes.lua and all loot.lua is basically the same script, except the runes.lua works :S
 
runes.lua
LUA:
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

local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

shopModule:addBuyableItem({'spellbook'}, 2175, 150, 'spellbook')
shopModule:addBuyableItem({'magic lightwand'}, 2163, 400, 'magic lightwand')

shopModule:addBuyableItem({'small health'}, 8704, 20, 1, 'small health potion')
shopModule:addBuyableItem({'health potion'}, 7618, 45, 1, 'health potion')
shopModule:addBuyableItem({'mana potion'}, 7620, 50, 1, 'mana potion')
shopModule:addBuyableItem({'strong health'}, 7588, 100, 1, 'strong health potion')
shopModule:addBuyableItem({'strong mana'}, 7589, 80, 1, 'strong mana potion')
shopModule:addBuyableItem({'great health'}, 7591, 190, 1, 'great health potion')
shopModule:addBuyableItem({'great mana'}, 7590, 120, 1, 'great mana potion')
shopModule:addBuyableItem({'great spirit'}, 8472, 190, 1, 'great spirit potion')
shopModule:addBuyableItem({'ultimate health'}, 8473, 310, 1, 'ultimate health potion')
shopModule:addBuyableItem({'antidote potion'}, 8474, 50, 1, 'antidote potion')

shopModule:addSellableItem({'normal potion flask', 'normal flask'}, 7636, 5, 'empty small potion flask')
shopModule:addSellableItem({'strong potion flask', 'strong flask'}, 7634, 10, 'empty strong potion flask')
shopModule:addSellableItem({'great potion flask', 'great flask'}, 7635, 15, 'empty great potion flask')

shopModule:addBuyableItem({'instense healing'}, 2265, 95, 1, 'intense healing rune')
shopModule:addBuyableItem({'ultimate healing'}, 2273, 175, 1, 'ultimate healing rune')
shopModule:addBuyableItem({'magic wall'}, 2293, 350, 3, 'magic wall rune')
shopModule:addBuyableItem({'destroy field'}, 2261, 45, 3, 'destroy field rune')
shopModule:addBuyableItem({'light magic missile'}, 2287, 40, 10, 'light magic missile rune')
shopModule:addBuyableItem({'heavy magic missile'}, 2311, 120, 10, 'heavy magic missile rune')
shopModule:addBuyableItem({'great fireball'}, 2304, 180, 4, 'great fireball rune')
shopModule:addBuyableItem({'explosion'}, 2313, 250, 6, 'explosion rune')
shopModule:addBuyableItem({'sudden death'}, 2268, 350, 3, 'sudden death rune')
shopModule:addBuyableItem({'death arrow'}, 2263, 300, 3, 'death arrow rune')
shopModule:addBuyableItem({'paralyze'}, 2278, 700, 1, 'paralyze rune')
shopModule:addBuyableItem({'animate dead'}, 2316, 375, 1, 'animate dead rune')
shopModule:addBuyableItem({'convince creature'}, 2290, 80, 1, 'convince creature rune')
shopModule:addBuyableItem({'chameleon'}, 2291, 210, 1, 'chameleon rune')
shopModule:addBuyableItem({'desintegrate'}, 2310, 80,  3, 'desintegreate rune')

shopModule:addBuyableItemContainer({'bp slhp'}, 2000, 8704, 400, 1, 'backpack of small health potions')
shopModule:addBuyableItemContainer({'bp hp'}, 2000, 7618, 900, 1, 'backpack of health potions')
shopModule:addBuyableItemContainer({'bp mp'}, 2001, 7620, 1000, 1, 'backpack of mana potions')
shopModule:addBuyableItemContainer({'bp shp'}, 2000, 7588, 2000, 1, 'backpack of strong health potions')
shopModule:addBuyableItemContainer({'bp smp'}, 2001, 7589, 1600, 1, 'backpack of strong mana potions')
shopModule:addBuyableItemContainer({'bp ghp'}, 2000, 7591, 3800, 1, 'backpack of great health potions')
shopModule:addBuyableItemContainer({'bp gmp'}, 2001, 7590, 2400, 1, 'backpack of great mana potions')
shopModule:addBuyableItemContainer({'bp gsp'}, 1999, 8472, 3800, 1, 'backpack of great spirit potions')
shopModule:addBuyableItemContainer({'bp uhp'}, 2000, 8473, 6200, 1, 'backpack of ultimate health potions')
shopModule:addBuyableItemContainer({'bp ap'}, 2002, 8474, 2000, 1, 'backpack of antidote potions')

shopModule:addBuyableItem({'wand of vortex', 'vortex'}, 2190, 500, 'wand of vortex')
shopModule:addBuyableItem({'wand of dragonbreath', 'dragonbreath'}, 2191, 1000, 'wand of dragonbreath')
shopModule:addBuyableItem({'wand of decay', 'decay'}, 2188, 5000, 'wand of decay')
shopModule:addBuyableItem({'wand of draconia', 'draconia'}, 8921, 7500, 'wand of draconia')
shopModule:addBuyableItem({'wand of cosmic energy', 'cosmic energy'}, 2189, 10000, 'wand of cosmic energy')
shopModule:addBuyableItem({'wand of inferno', 'inferno'}, 2187, 15000, 'wand of inferno')
shopModule:addBuyableItem({'wand of starstorm', 'starstorm'}, 8920, 18000, 'wand of starstorm')
shopModule:addBuyableItem({'wand of voodoo', 'voodoo'}, 8922, 22000, 'wand of voodoo')

shopModule:addBuyableItem({'snakebite rod', 'snakebite'}, 2182, 500, 'snakebite rod')
shopModule:addBuyableItem({'moonlight rod', 'moonlight'}, 2186, 1000, 'moonlight rod')
shopModule:addBuyableItem({'necrotic rod', 'necrotic'}, 2185, 5000, 'necrotic rod')
shopModule:addBuyableItem({'northwind rod', 'northwind'}, 8911, 7500, 'northwind rod')
shopModule:addBuyableItem({'terra rod', 'terra'}, 2181, 10000, 'terra rod')
shopModule:addBuyableItem({'hailstorm rod', 'hailstorm'}, 2183, 15000, 'hailstorm rod')
shopModule:addBuyableItem({'springsprout rod', 'springsprout'}, 8912, 18000, 'springsprout rod')
shopModule:addBuyableItem({'underworld rod', 'underworld'}, 8910, 22000, 'underworld rod')

shopModule:addSellableItem({'wand of vortex', 'vortex'}, 2190, 250, 'wand of vortex')
shopModule:addSellableItem({'wand of dragonbreath', 'dragonbreath'}, 2191, 500, 'wand of dragonbreath')
shopModule:addSellableItem({'wand of decay', 'decay'}, 2188, 2500, 'wand of decay')
shopModule:addSellableItem({'wand of draconia', 'draconia'}, 8921, 3750, 'wand of draconia')
shopModule:addSellableItem({'wand of cosmic energy', 'cosmic energy'}, 2189, 5000, 'wand of cosmic energy')
shopModule:addSellableItem({'wand of inferno', 'inferno'},2187, 7500, 'wand of inferno')
shopModule:addSellableItem({'wand of starstorm', 'starstorm'}, 8920, 9000, 'wand of starstorm')
shopModule:addSellableItem({'wand of voodoo', 'voodoo'}, 8922, 11000, 'wand of voodoo')

shopModule:addSellableItem({'snakebite rod', 'snakebite'}, 2182, 250,'snakebite rod')
shopModule:addSellableItem({'moonlight rod', 'moonlight'}, 2186, 500,   'moonlight rod')
shopModule:addSellableItem({'necrotic rod', 'necrotic'}, 2185, 2500, 'necrotic rod')
shopModule:addSellableItem({'northwind rod', 'northwind'}, 8911, 3750, 'northwind rod')
shopModule:addSellableItem({'terra rod', 'terra'}, 2181, 5000, 'terra rod')
shopModule:addSellableItem({'hailstorm rod', 'hailstorm'}, 2183, 7500, 'hailstorm rod')
shopModule:addSellableItem({'springsprout rod', 'springsprout'}, 8912, 9000, 'springsprout rod')
shopModule:addSellableItem({'underworld rod', 'underworld'}, 8910, 11000, 'underworld rod')

local items = {[1] = 2190, [2] = 2182, [5] = 2190, [6] = 2182}
function creatureSayCallback(cid, type, msg)
	if(not npcHandler:isFocused(cid)) then
		return false
	end

	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
	if(msgcontains(msg, 'first rod') or msgcontains(msg, 'first wand')) then
		if(isSorcerer(cid) or isDruid(cid)) then
			if(getPlayerStorageValue(cid, 30002) <= 0) then
				selfSay('So you ask me for a {' .. getItemNameById(items[getPlayerVocation(cid)]) .. '} to begin your advanture?', cid)
				talkState[talkUser] = 1
			else
				selfSay('What? I have already gave you one {' .. getItemNameById(items[getPlayerVocation(cid)]) .. '}!', cid)
			end
		else
			selfSay('Sorry, you aren\'t a druid either a sorcerer.', cid)
		end
	elseif(msgcontains(msg, 'yes')) then
		if(talkState[talkUser] == 1) then
			doPlayerAddItem(cid, items[getPlayerVocation(cid)], 1)
			selfSay('Here you are young adept, take care yourself.', cid)
			setPlayerStorageValue(cid, 30002, 1)
		end
		talkState[talkUser] = 0
	elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser])) then
		selfSay('Ok then.', cid)
		talkState[talkUser] = 0
	end

	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Try to change it the same way as this
LUA:
shopModule:addSellableItem({'wand of vortex', 'vortex'}, 2190, 250, 'wand of vortex')
 
Yes, with different names, itemid and price then.

Okay, that might take a while, hope it works!
ill report when im done.

Actually i dont know how i should do it.

Code:
shopModule:addSellableItem({'wand of vortex', '[COLOR="#FF0000"]vortex[/COLOR]'}, 2190, 250, 'wand of vortex')

Where the vortex is red, what should i put there on etc zaoan helmet?
 
Last edited:
Back
Top