• 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!

NPC Examples for TFS for tibia 8.31 or 8.4

Sentielo

Advanced OT User
Joined
Feb 3, 2008
Messages
2,388
Reaction score
226
Location
I am from Holland, where the fack you from :)
I deleted the npcs because I have to add te xml files too and I have to fix bugs ;).
After I fixed that I will publish them here again.

Please be patience.
Sentielo

This is a ammunition seller/buyer.
Ammu.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Ammu" script="data/npc/scripts/distans.lua" walkinterval="0" floorchange="0">
	<health now="100" max="100"/>
	<look type="137" head="96" body="121" legs="102" feet="119" addons="3"/>
	<parameters>
	<parameter key="module_shop" value="3" />
	<parameter key="message_greet" value="Welcome |PLAYERNAME]! This is my ammunition shop for paladins, just ask me for a {trade}." />
        <parameter key="message_farewell" value="Goodbye and I hope you love my ammunition, |PLAYERNAME|." />
	<parameter key="message_walkaway" value="Don't you like my ammunition?" />
	</parameters>
</npc>
Distans.lua
Code:
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

shopModule:addBuyableItem({'bow'}, 2456, 400, 1, 'bow')
shopModule:addBuyableItem({'crossbow'}, 2455, 500, 1, 'crossbow')
shopModule:addBuyableItem({'royal spear'}, 7378, 15, 1, 'royal spear')
shopModule:addBuyableItem({'spear'}, 2389, 10, 1, 'spear')
shopModule:addBuyableItem({'arrow'}, 2544, 3, 1, 'arrow')
shopModule:addBuyableItem({'sniper arrow'}, 7364, 5, 1, 'sniper arrow')
shopModule:addBuyableItem({'bolt'}, 2543, 4, 1, 'bolt')
shopModule:addBuyableItem({'earth arrow'}, 7851, 5, 1, 'earth arrow')
shopModule:addBuyableItem({'flaming arrow'}, 7840, 5, 1, 'flaming arrow')
shopModule:addBuyableItem({'flash arrow'}, 7838, 5, 1, 'flash arrow')
shopModule:addBuyableItem({'onyx arrow'}, 7365, 7, 1, 'onyx arrow')
shopModule:addBuyableItem({'power bolt'}, 2547, 7, 1, 'power bolt')
shopModule:addBuyableItem({'throwing star'}, 2399, 42, 1, 'throwing star')
shopModule:addBuyableItem({'shiver arrow'}, 7839, 5, 1, 'shiver arrow')
shopModule:addBuyableItem({'piercing bolt'}, 7362, 5, 1, 'piercing bolt')
shopModule:addBuyableItem({'assassin star'}, 7368, 100, 1, 'assassin star')
shopModule:addBuyableItem({'throwing knife'}, 2410, 25, 1, 'throwing knife')

shopModule:addSellableItem({'bow'}, 2456, 130, 1, 'bow')
shopModule:addSellableItem({'crossbow'}, 2455, 160, 1, 'crossbow')
shopModule:addSellableItem({'spear'}, 2389, 3, 1, 'spear')
shopModule:addSellableItem({'hunting spear'}, 3965, 25, 1, 'hunting spear')

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

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

This is a druid which sells all the 5 blessings in one row.
Blessia.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Blessia" script="data/npc/scripts/blessing.lua" walkinterval="0" floorchange="0">
	<health now="100" max="100"/>
	<look type="150" head="95" body="9" legs="87" feet="95" addons="3"/>
	<parameters>
	<parameter key="module_shop" value="3" />
	<parameter key="message_greet" value="Hello |PLAYERNAME]! My name is Blessia and I sells the 5 blessings in a row, when you just say {blessings}." />
        <parameter key="message_farewell" value="Blessia Blessings! |PLAYERNAME|." />
	<parameter key="message_walkaway" value="Good bye..." />
	</parameters>
</npc>

Blessing.lua
Code:
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 onSay(cid, words, param)
    if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
        doPlayerSendCancel(cid,'You have already got one or more blessings!')
    else
        if doPlayerRemoveMoney(cid, 50000) == TRUE then
            doPlayerAddBlessing(cid, 1)
            doPlayerAddBlessing(cid, 2)
            doPlayerAddBlessing(cid, 3)
            doPlayerAddBlessing(cid, 4)
            doPlayerAddBlessing(cid, 5)
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
        else
            doPlayerSendCancel(cid, "You need five crystal coin to get blessed!")
        end
    end    
    return 1
end

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

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

This npc sells the djinn items, but not the rings and amulets, because I made some other npcs for that ;).
Djinn.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Djinn" script="data/npc/scripts/Djinn.lua" walkinterval="0" floorchange="0">
	<health now="100" max="100"/>
	<look type=80" head="20" body="30" legs="40" feet="50"/>
	<parameters>
	<parameter key="module_shop" value="3" />
	<parameter key="message_greet" value="Hello|PLAYERNAME]! I sell the djinn items. Just ask me for a {trade}." />
        <parameter key="message_farewell" value="Goodbye. Thanks for trading with me |PLAYERNAME|." />
	<parameter key="message_walkaway" value="Goodbye." />
	</parameters>
</npc>

Djinn.lua
Code:
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

shopModule:addBuyableItem({'beholder shield'}, 2518, 7000, 1, 'beholder shield')
shopModule:addBuyableItem({'noble armor'}, 2486, 8000, 1, 'noble armor')
shopModule:addBuyableItem({'spike sword'}, 2383, 8000, 1, 'spike sword')
shopModule:addBuyableItem({'war hammer'}, 2391, 10000, 1, 'war hammer')

shopModule:addSellableItem({'beholder shield'}, 2518, 1200, 1, 'beholder shield')
shopModule:addSellableItem({'crown shield'}, 2519, 8000, 1, 'crown shield')
shopModule:addSellableItem({'dragon shield'}, 2516, 4000, 1, 'dragon shield')
shopModule:addSellableItem({'guardian shield'}, 2515, 2000, 1, 'guardian shield')
shopModule:addSellableItem({'phoenix shield'}, 2539, 16000, 1, 'phoenix shield')

shopModule:addSellableItem({'blue robe'}, 2656, 10000, 1, 'blue rope')
shopModule:addSellableItem({'crown armor'}, 2487, 12000, 1, 'crown armor')
shopModule:addSellableItem({'noble armor'}, 2486, 900, 1, 'noble armor')

shopModule:addSellableItem({'boots of haste'}, 2195, 30000, 1, 'boots of haste')

shopModule:addSellableItem({'broad sword'}, 2413, 500, 1, 'broad sword')
shopModule:addSellableItem({'dragon lance'}, 2414, 9000, 1, 'dragon lance')
shopModule:addSellableItem({'fire axe'}, 2432, 8000, 1, 'fire axe')
shopModule:addSellableItem({'fire sword'}, 2392, 4000, 1, 'fire sword')
shopModule:addSellableItem({'ice rapier'}, 2396, 1000, 1, 'ice rapier')
shopModule:addSellableItem({'obsidian lance'}, 2425, 500, 1, 'obsidian lance')
shopModule:addSellableItem({'spike sword'}, 2383, 1000, 1, 'spike sword')
shopModule:addSellableItem({'war hammer'}, 2391, 1200, 1, 'war hammer')

shopModule:addSellableItem({'crown helmet'}, 2491, 2500, 1, 'crown helmet')
shopModule:addSellableItem({'crusader helmet'}, 2497, 6000, 1, 'crusader helmet')
shopModule:addSellableItem({'royal helmet'}, 2498, 30000, 1, 'royal helmet')

shopModule:addSellableItem({'crown legs'}, 2488, 12000, 1, 'crown legs')

shopModule:addSellableItem({'earth spike sword'}, 7854, 1000, 1, 'spike sword')
shopModule:addSellableItem({'energy spike sword'}, 7869, 1000, 1, 'spike sword')
shopModule:addSellableItem({'fiery spike sword'}, 7744, 1000, 1, 'spike sword')
shopModule:addSellableItem({'icy spike sword'}, 7763, 1000, 1, 'spike sword')
shopModule:addSellableItem({'earth war hammer'}, 7868, 1200, 1, 'war hammer')
shopModule:addSellableItem({'energy war hammer'}, 7883, 1200, 1, 'war hammer')
shopModule:addSellableItem({'fiery war hammer'}, 7758, 1200, 1, 'war hammer')
shopModule:addSellableItem({'icy war hammer'}, 7777, 1200, 1, 'war hammer')

shopModule:addSellableItem({'wand of vortex'}, 2190, 100, 1, 'wand of vortex')
shopModule:addSellableItem({'wand of dragonbreath'}, 2191, 200, 1, 'wand of dragonbreath')
shopModule:addSellableItem({'wand of decay'}, 2188, 1000, 1, 'wand of decay')
shopModule:addSellableItem({'wand of draconia'}, 8921, 1500, 1, 'wand of draconia')
shopModule:addSellableItem({'wand of cosmic energy'}, 2189, 2000, 1, 'wand of casmic energy')
shopModule:addSellableItem({'wand of inferno'}, 2187, 3000, 1, 'wand of inferno')
shopModule:addSellableItem({'wand of starstorm'}, 8920, 3600, 1, 'wand of starstorm')
shopModule:addSellableItem({'wand of voodoo'}, 8922, 4400, 1, 'wand of voodoo')

shopModule:addSellableItem({'life crystal'}, 2177, 50, 1, 'life crystal')
shopModule:addSellableItem({'magic light wand'}, 2162, 35, 1, 'magic light wand')
shopModule:addSellableItem({'mind stone'}, 2178, 100, 1, 'mind stone')
shopModule:addSellableItem({'orb'}, 2176, 750, 1, 'orb')

shopModule:addBuyableItem({'magic light wand'}, 2162, 120, 1, 'magic light wand')

shopModule:addSellableItem({'dragon hammer'}, 2434, 2000, 1, 'dragon hammer')
shopModule:addSellableItem({'giant sword'}, 2393, 17000, 1, 'giant sword')
shopModule:addSellableItem({'knight axe'}, 2430, 2000, 1, 'knight axe')
shopModule:addSellableItem({'poison dagger'}, 2411, 50, 1, 'poison dagger')
shopModule:addSellableItem({'scimitar'}, 2419, 150, 1, 'scimitar')
shopModule:addSellableItem({'serpent sword'}, 2409, 900, 1, 'serpent sword')
shopModule:addSellableItem({'skull staff'}, 2436, 6000, 1, 'skull staff')

shopModule:addSellableItem({'dark armor'}, 2489, 400, 1, 'dark armor')
shopModule:addSellableItem({'knight armor'}, 2476, 5000, 1, 'knight armor')
shopModule:addSellableItem({'dark helmet'}, 2490, 250, 1, 'dark helmet')
shopModule:addSellableItem({'mystic turban'}, 2663, 150, 1, 'mystic turban')
shopModule:addSellableItem({'strange helmet'}, 2479, 500, 1, 'strange helmet')
shopModule:addSellableItem({'warrior helmet'}, 2475, 5000, 1, 'warrior helmet')

shopModule:addSellableItem({'knight legs'}, 2477, 5000, 1, 'knight legs')

shopModule:addSellableItem({'ancient shield'}, 2532, 900, 1, 'ancient shield')
shopModule:addSellableItem({'black shield'}, 2529, 800, 1, 'black shield')
shopModule:addSellableItem({'tower shield'}, 2528, 8000, 1, 'tower shield')
shopModule:addSellableItem({'vampire shield'}, 2534, 15000, 1, 'vamire shield')

shopModule:addBuyableItem({'ice rapier'}, 2396, 5000, 1, 'ice rapier')
shopModule:addBuyableItem({'serpent sword'}, 2409, 6000, 1, 'serpent sword')
shopModule:addBuyableItem({'dark armor'}, 2489, 1500, 1, 'dark armor')
shopModule:addBuyableItem({'dark helmet'}, 2490, 1000, 1, 'dark helmet')
shopModule:addBuyableItem({'ancient shield'}, 2532, 5000, 1, 'ancient shield')

shopModule:addSellableItem({'snakebite rod'}, 2182, 100, 1, 'snakebite rod')
shopModule:addSellableItem({'moonlight rod'}, 2186, 200, 1, 'moonlight rod')
shopModule:addSellableItem({'necrotic rod'}, 2185, 1000, 1, 'necrotic rod')
shopModule:addSellableItem({'northwind rod'}, 8911, 1500, 1, 'northwind rod')
shopModule:addSellableItem({'terra rod'}, 2181, 2000, 1, 'terra rod')
shopModule:addSellableItem({'hailstorm rod'}, 2183, 3000, 1, 'hailstorm rod')
shopModule:addSellableItem({'springsprout rod'}, 8912, 3600, 1, 'springsprout rod')
shopModule:addSellableItem({'underworld rod'}, 8910, 4400, 1, 'underworld rod')

shopModule:addSellableItem({'ankh'}, 2193, 100, 1, 'ankh')
shopModule:addSellableItem({'mysterious fetish'}, 2194, 50, 1, 'mysterious fetish')

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

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

It sells/buys equipments, which npcs like Sam sells in reallife.
Equip.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Equip" script="data/npc/scripts/equipment.lua" walkinterval="0" floorchange="0">
	<health now="100" max="100"/>
	<look type="131" head="57" body="113" legs="86" feet="95" addons="0"/>
	<parameters>
	<parameter key="module_shop" value="3" />
	<parameter key="message_greet" value="Welcome |PLAYERNAME]! My name is Equip and I sell and buy equipments, just ask me for a {trade} if your are interested." />
        <parameter key="message_farewell" value="Goodbye, I will see you around sometimes |PLAYERNAME|." />
	<parameter key="message_walkaway" value="Aren't we saying goodbye anymore?" />
	</parameters>
</npc>

Equipment.lua
Code:
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({'steel helmet'}, 2457, 580, 1, 'steel helmet')
shopModule:addBuyableItem({'chain helmet'}, 2458, 52, 1, 'chain helmet')
shopModule:addBuyableItem({'iron helmet'}, 2459, 390, 1, 'iron helmet')
shopModule:addBuyableItem({'brass helmet'}, 2460, 120, 1, 'brass helmet')
shopModule:addBuyableItem({'leather helmet'}, 2461, 12, 1, 'leather helmet')
shopModule:addBuyableItem({'viking helmet'}, 2473, 265, 1, 'viking helmet')
shopModule:addBuyableItem({'soldier helmet'}, 2481, 110, 1, 'soldier helmet')
shopModule:addBuyableItem({'studded helmet'}, 2482, 63, 1, 'studded helmet')

shopModule:addBuyableItem({'chain armor'}, 2464, 200, 1, 'chain armor')
shopModule:addBuyableItem({'brass armor'}, 2465, 450, 1, 'brass armor')
shopModule:addBuyableItem({'leather armor'}, 2467, 35, 1, 'leather armor')

shopModule:addBuyableItem({'brass legs'}, 2478, 195, 1, 'brass legs')
shopModule:addBuyableItem({'chain legs'}, 2648, 80, 1, 'chain legs')
shopModule:addBuyableItem({'leather legs'}, 2649, 10, 1, 'leather legs')

shopModule:addBuyableItem({'steel shield'}, 2509, 240, 1, 'steel shield')
shopModule:addBuyableItem({'plate shield'}, 2510, 125, 1, 'plate shield')
shopModule:addBuyableItem({'brass shield'}, 2511, 16, 1, 'brass shield')
shopModule:addBuyableItem({'wooden shield'}, 2512, 15, 1, 'wooden shield')
shopModule:addBuyableItem({'dwarven shield'}, 2525, 500, 1, 'dwarven shield')

shopModule:addBuyableItem({'sword'}, 2376, 85, 1, 'sword')
shopModule:addBuyableItem({'two handed sword'}, 2377, 950, 1, 'two handed sword')
shopModule:addBuyableItem({'dagger'}, 2379, 5, 1, 'dagger')
shopModule:addBuyableItem({'rapier'}, 2384, 15, 1, 'rapier')
shopModule:addBuyableItem({'sabre'}, 2385, 35, 1, 'sabre')
shopModule:addBuyableItem({'carlin sword'}, 2395, 473, 1, 'carlin sword')

shopModule:addBuyableItem({'club'}, 2382, 5, 1, 'club')
shopModule:addBuyableItem({'morning star'}, 2394, 430, 1, 'morning star')
shopModule:addBuyableItem({'mace'}, 2398, 90, 1, 'mace')
shopModule:addBuyableItem({'battle hammer'}, 2417, 350, 1, 'battle hammer')
shopModule:addBuyableItem({'clerical mace'}, 2423, 540, 1, 'clerical mace')

shopModule:addBuyableItem({'battle axe'}, 2378, 235, 1, 'battle axe')
shopModule:addBuyableItem({'hand axe'}, 2380, 8, 1, 'hand axe')
shopModule:addBuyableItem({'axe'}, 2386, 20, 1, 'axe')
shopModule:addBuyableItem({'barbarian axe'}, 2429, 590, 1, 'barbarian axe')

shopModule:addSellableItem({'battle axe'}, 2378, 80, 1, 'battle axe')
shopModule:addSellableItem({'hand axe'}, 2380, 4, 1, 'hand axe')
shopModule:addSellableItem({'halberd'}, 2381, 400, 1, 'halberd')
shopModule:addSellableItem({'axe'}, 2386, 8, 1, 'axe')
shopModule:addSellableItem({'double axe'}, 2387, 260, 1, 'double axe')
shopModule:addSellableItem({'barbarian axe'}, 2429, 185, 1, 'barbarian axe')

shopModule:addSellableItem({'steel helmet'}, 2457, 190, 1, 'steel helmet')
shopModule:addSellableItem({'chain helmet'}, 2458, 17, 1, 'chain helmet')
shopModule:addSellableItem({'iron helmet'}, 2459, 145, 1, 'iron helmet')
shopModule:addSellableItem({'brass helmet'}, 2460, 30, 1, 'brass helmet')
shopModule:addSellableItem({'leather helmet'}, 2461, 4, 1, 'leather helmet')
shopModule:addSellableItem({'viking helmet'}, 2473, 66, 1, 'viking helmet')
shopModule:addSellableItem({'legion helmet'}, 2480, 22, 1, 'legion helmet')
shopModule:addSellableItem({'soldier helmet'}, 2481, 16, 1, 'soldier helmet')

shopModule:addSellableItem({'plate armor'}, 2463, 400, 1, 'plate armor')
shopModule:addSellableItem({'chain armor'}, 2464, 70, 1, 'chain armor')
shopModule:addSellableItem({'brass armor'}, 2465, 150, 1, 'brass armor')
shopModule:addSellableItem({'leather armor'}, 2467, 12, 1, 'leather armor')
shopModule:addSellableItem({'scale armor'}, 2483, 75, 1, 'scale armor')
shopModule:addSellableItem({'studded armor'}, 2484, 70, 1, 'studded armor')

shopModule:addSellableItem({'brass legs'}, 2478, 49, 1, 'brass legs')
shopModule:addSellableItem({'plate legs'}, 2647 115, 1, 'plate legs')
shopModule:addSellableItem({'chain legs'}, 2648, 25, 1, 'chain legs')
shopModule:addSellableItem({'leather legs'}, 2649, 2, 1, 'leather legs')

shopModule:addSellableItem({'steel shield'}, 2509, 80, 1, 'steel shield')
shopModule:addSellableItem({'plate shield'}, 2510, 45, 1, 'plate shield')
shopModule:addSellableItem({'brass shield'}, 2511, 16, 1, 'brass shield')
shopModule:addSellableItem({'wooden shield'}, 2512, 5, 1, 'wooden shield')
shopModule:addSellableItem({'battle shield'}, 2513, 95, 1, 'battle shield')
shopModule:addSellableItem({'dwarven shield'}, 2525, 100, 1, 'dwarven shield')
shopModule:addSellableItem({'sentinel shield'}, 3974, 120, 1, 'sentinel shield')
shopModule:addSellableItem({'salamander shield'}, 3975, 280, 1, 'salamander shield')
shopModule:addSellableItem({'tusk shield'}, 3973, 850, 1, 'tusk shield')

shopModule:addSellableItem({'sword'}, 2376, 25, 1, 'sword')
shopModule:addSellableItem({'two handed sword'}, 2377, 450, 1, 'two handed sword')
shopModule:addSellableItem({'dagger'}, 2379, 2, 1, 'dagger')
shopModule:addSellableItem({'rapier'}, 2384, 5, 1, 'rapier')
shopModule:addSellableItem({'sabre'}, 2385, 12, 1, 'sabre')
shopModule:addSellableItem({'carlin sword'}, 2395, 118, 1, 'carlin sword')
shopModule:addSellableItem({'short sword'}, 2406, 10, 1, 'short sword')

shopModule:addSellableItem({'club'}, 2382, 1, 1, 'club')
shopModule:addSellableItem({'morning star'}, 2394, 90, 1, 'morning star')
shopModule:addSellableItem({'mace'}, 2398, 30, 1, 'mace')
shopModule:addSellableItem({'battle hammer'}, 2417, 120, 1, 'battle hammer')
shopModule:addSellableItem({'giant smithhammer'}, 2321, 250, 1, 'giant smithhammer')
shopModule:addSellableItem({'clerical mace'}, 2423, 170, 1, 'clerical mace')

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Sells and buys differnt kinds of food.
Fooda.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Fooda" script="data/npc/scripts/food.lua" walkinterval="0" floorchange="0">
	<health now="100" max="100"/>
	<look type="251" head="78" body="79" legs="82" feet="101" addons="3"/>
	<parameters>
	<parameter key="module_shop" value="3" />
	<parameter key="message_greet" value="Hi |PLAYERNAME]. Ask me for a {trade} if you want to buy some food." />
        <parameter key="message_farewell" value="Goodbye and bon a petit! |PLAYERNAME|." />
	<parameter key="message_walkaway" value="Bye... Don't you like my food?" />
	</parameters>
</npc>

Food.lua
Code:
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({'meat'}, 2666, 5, 1, 'meat')
shopModule:addBuyableItem({'fish'}, 2667, 5, 1, 'fish')
shopModule:addBuyableItem({'salmon'}, 2668, 5, 1, 'salmon')
shopModule:addBuyableItem({'ham'}, 2671, 8, 1, 'ham')
shopModule:addBuyableItem({'dragon ham'}, 2672, 25, 1, 'dragon ham')
shopModule:addBuyableItem({'pear'}, 2673, 4, 1, 'pear')
shopModule:addBuyableItem({'red apple'}, 2674, 3, 1, 'red apple')
shopModule:addBuyableItem({'orange'}, 2675, 10, 1, 'orange')
shopModule:addBuyableItem({'banana'}, 2676, 3, 1, 'banana')
shopModule:addBuyableItem({'blueberry'}, 2677, 1, 1, 'blueberry')
shopModule:addBuyableItem({'cherry'}, 2679, 1, 1, 'cherry')
shopModule:addBuyableItem({'strawberry'}, 2680, 1, 1, 'strawberry')
shopModule:addBuyableItem({'grape'}, 2680, 3, 1, 'grape')
shopModule:addBuyableItem({'melon'}, 2682, 8, 1, 'melon')
shopModule:addBuyableItem({'pumpkin'}, 2683, 10, 1, 'pumpkin')
shopModule:addBuyableItem({'carrot'}, 2684, 3, 1, 'carrot')
shopModule:addBuyableItem({'tomato'}, 2685, 5, 1, 'tomato')
shopModule:addBuyableItem({'corncob'}, 2686, 3, 1, 'corncob')
shopModule:addBuyableItem({'cookie'}, 2687, 2, 1, 'cookie')
shopModule:addBuyableItem({'bread'}, 2689, 4, 1, 'bread')
shopModule:addBuyableItem({'roll'}, 2690, 2, 1, 'roll')
shopModule:addBuyableItem({'brown bread'}, 2691, 3, 1, 'brown bread')
shopModule:addBuyableItem({'egg'}, 2695, 2, 1, 'egg)
shopModule:addBuyableItem({'cheese'}, 2696, 2, 1, 'cheese')
shopModule:addBuyableItem({'white mushroom'}, 2787, 6, 1, 'white mushroom')
shopModule:addBuyableItem({'red mushroom'}, 2788, 12, 1, 'red mushroom')
shopModule:addBuyableItem({'brown mushroom'}, 2789, 10, 1, 'brown mushroom')
shopModule:addBuyableItem({'valentine cake'}, 6393, 6, 1, 'valentine cake')
shopModule:addBuyableItem({'cookbook'}, 2347, 150, 1, 'cookbook')

shopModule:addSellableItem({'meat'}, 2666, 2, 1, 'meat')
shopModule:addSellableItem({'salmon'}, 2668, 2, 1, 'salmon')
shopModule:addSellableItem({'bread'}, 2689, 2, 1, 'bread')
shopModule:addSellableItem({'ham'}, 2671, 4, 1, 'ham')
shopModule:addBuyableItem({'blueberry'}, 2677, 1, 5, 'blueberry')

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Sells and buys jewelry
Jewel
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Jewel" script="data/npc/scripts/jewelry.lua" walkinterval="0" floorchange="0">
	<health now="100" max="100"/>
	<look type="140" head="79" body="15" legs="55" feet="110" addons="3"/>
	<parameters>
	<parameter key="module_shop" value="3" />
	<parameter key="message_greet" value="Hi my name is Jewel, |PLAYERNAME]! I could offer you jewelry, just ask me to {trade}." />
        <parameter key="message_farewell" value="Goodbye, do you also love jewelry? |PLAYERNAME|." />
	<parameter key="message_walkaway" value="See you around with my jewelry I hope." />
	</parameters>
</npc>

Jewelry.lua
Code:
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

shopModule:addSellableItem({'white pearl'}, 2143, 160, 1, 'white pearl')
shopModule:addSellableItem({'black pearl'}, 2144, 280, 1, 'black pearl')
shopModule:addSellableItem({'small diamond'}, 2145, 300, 1, 'small diamond')
shopModule:addSellableItem({'small sapphire'}, 2146, 250, 1, 'small sapphire')
shopModule:addSellableItem({'small ruby'}, 2147, 250, 1, 'small ruby')
shopModule:addSellableItem({'small emerald'}, 2149, 250, 1, 'small emerald')
shopModule:addSellableItem({'small amethyst'}, 2150, 200, 1, 'small amethyst')
shopModule:addSellableItem({'talon'}, 2151, 320, 1, 'talon')

shopModule:addBuyableItem({'white pearl'}, 2143, 320, 1, 'white pearl')
shopModule:addBuyableItem({'black pearl'}, 2144, 560, 1, 'black pearl')
shopModule:addBuyableItem({'small diamond'}, 2145, 600, 1, 'small diamond')
shopModule:addBuyableItem({'small sapphire'}, 2146, 500, 1, 'small sapphire')
shopModule:addBuyableItem({'small ruby'}, 2147, 500, 1, 'small ruby')
shopModule:addBuyableItem({'small emerald'}, 2149, 500, 1, 'small emerald')
shopModule:addBuyableItem({'small amethyst'}, 2150, 400, 1, 'small amethyst')

shopModule:addBuyableItem({'bronze goblet'}, 5807, 2000, 1, 'bronze goblet')
shopModule:addBuyableItem({'silver goblet'}, 5806, 3000, 1, 'silver goblet')
shopModule:addBuyableItem({'golden goblet'}, 5805, 5000, 1, 'golden goblet')

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

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Rune, potions and wands/rod selling npc
Manah.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Mana" script="data/npc/scripts/runes.lua" walkinterval="0" floorchange="0">
	<health now="100" max="100"/>
	<look type="130" head="95" body="94" legs="95" feet="76" addons="0"/>
	<parameters>
	<parameter key="module_shop" value="3" />
	<parameter key="message_greet" value="Hiah |PLAYERNAME]! My name is Manah, Ask me for a {trade} if you want to buy some runes, wands or fluids." />
        <parameter key="message_farewell" value="Thanks for doing business |PLAYERNAME|." />
	<parameter key="message_walkaway" value="Biah!" />
	</parameters>
</npc>

Runes.lua
Code:
---------holy missile------------

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

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

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:addSellableItem({'normal flask'}, 7636, 5, 'empty small potion flask')
shopModule:addSellableItem({'strong flask'}, 7634, 10, 'empty strong potion flask')
shopModule:addSellableItem({'great flask'}, 7635, 15, 'empty great potion flask')

shopModule:addBuyableItem({'blank rune'}, 		2260, 10, 1		'blank rune')

shopModule:addBuyableItem({'animate dead'}, 		2316, 375, 1,		'animate dead rune')
shopModule:addBuyableItem({'antidote'}, 		2266, 65, 1, 		'antidote rune')
shopModule:addBuyableItem({'avalanche'}, 		2274, 180, 4,		'avalanche rune')
shopModule:addBuyableItem({'chameleon'}, 		2291, 210, 1, 		'chameleon rune')
shopModule:addBuyableItem({'convince creature'}, 	2290, 80, 1,		'convince creature rune')
shopModule:addBuyableItem({'desintegrate'}, 		2310, 80, 3,		'desintegrate rune')
shopModule:addBuyableItem({'destroy field'}, 		2261, 45,  3, 		'destroy field')
shopModule:addBuyableItem({'energy bomb'}, 		2262, 325, 2,		'energy bomb rune')
shopModule:addBuyableItem({'energy field'}, 		2277, 115, 3, 		'energy field')
shopModule:addBuyableItem({'energy wall'}, 		2279, 340, 4,		'energy wall rune')
shopModule:addBuyableItem({'explosion'}, 		2313, 190, 6, 		'explosion rune')
shopModule:addBuyableItem({'fire bomb'}, 		2305, 235, 2,		'fire bomb rune')
shopModule:addBuyableItem({'fire field'}, 		2301, 85,  3,		'fire field rune')
shopModule:addBuyableItem({'fire wall'}, 		2303, 245, 4,		'fire wall rune')
shopModule:addBuyableItem({'fireball'}, 		2302, 150,  5,		'fire ball')
shopModule:addBuyableItem({'great fireball'}, 		2304, 180, 4, 		'great fireball rune')
shopModule:addBuyableItem({'heavy magic missile'}, 	2311, 120, 10,		'heavy magic missile rune')
shopModule:addBuyableItem({'icicle'}, 			2271, 150, 5,		'icicle rune')
shopModule:addBuyableItem({'intense healing'}, 		2265, 95, 1,		'intense healing rune')
shopModule:addBuyableItem({'light magic missile'}, 	2287, 40, 10,		'light magic missile rune')
shopModule:addBuyableItem({'magic wall'}, 		2293, 350, 3,		'magic wall rune')
shopModule:addBuyableItem({'paralyze'}, 		2278, 700, 1, 		'paralyze rune')
shopModule:addBuyableItem({'poison bomb'}, 		2286, 170, 2,		'poison bomb rune')
shopModule:addBuyableItem({'poison field'}, 		2285, 65,  3,		'poison field')
shopModule:addBuyableItem({'poison wall'}, 		2289, 210, 4,		'poison wall rune')
shopModule:addBuyableItem({'soulfire'}, 		2308, 140, 3, 		'soulfire rune')
shopModule:addBuyableItem({'stalagmite'}, 		2292, 120, 10, 		'stalagmite rune')
shopModule:addBuyableItem({'stone shower'}, 		2288, 150, 4, 		'stoneshower rune')
shopModule:addBuyableItem({'sudden death'}, 		2268, 325, 3, 		'sudden death rune')
shopModule:addBuyableItem({'thunderstorm'}, 		2268, 150, 4, 		'thunderstorm rune')
shopModule:addBuyableItem({'ultimate healing'}, 	2273, 175, 1, 		'ultimate healing rune')
shopModule:addBuyableItem({'wild growth'}, 		2269, 320, 2,		'wild growth rune')

shopModule:addBuyableItemContainer({'bp blank rune'}, 		1988, 2260, 220, 1		'bp blank rune')

shopModule:addBuyableItemContainer({'bp animate dead'}, 	1998, 2316, 7520, 1,		'bp animate dead rune')
shopModule:addBuyableItemContainer({'bp antidote'}, 		2003, 2266, 1320, 1, 		'bp antidote rune')
shopModule:addBuyableItemContainer({'bp avalanche'}, 		2002, 2274, 3620, 4,		'bp avalanche rune')
shopModule:addBuyableItemContainer({'bp chameleon'}, 		1998, 2291, 4220, 1, 		'bp chameleon rune')
shopModule:addBuyableItemContainer({'bp convince creature'}, 	1998, 2290, 1620, 1,		'bp convince creature rune')
shopModule:addBuyableItemContainer({'bp desintegrate'}, 	2001, 2310, 1620, 3,		'bp desintegrate rune')
shopModule:addBuyableItemContainer({'bp destroy field'}, 	2003, 2261, 920,  3, 		'bp destroy field')
shopModule:addBuyableItemContainer({'bp energy bomb'}, 		2003, 2262, 6520, 2,		'bp energy bomb rune')
shopModule:addBuyableItemContainer({'bp energy field'}, 	1998, 2277, 2320, 3, 		'bp energy field')
shopModule:addBuyableItemContainer({'bp energy wall'}, 		2002, 2279, 6820, 4,		'bp energy wall rune')
shopModule:addBuyableItemContainer({'bp explosion'}, 		2001, 2313, 3820, 6, 		'bp explosion rune')
shopModule:addBuyableItemContainer({'bp fire bomb'}, 		2000, 2305, 4720, 2,		'bp fire bomb rune')
shopModule:addBuyableItemContainer({'bp fire field'}, 		2000, 2301, 1720,  3,		'bp fire field rune')
shopModule:addBuyableItemContainer({'bp fire wall'}, 		2000, 2303, 4920, 4,		'bp fire wall rune')
shopModule:addBuyableItemContainer({'bp fireball'}, 		2000, 2302, 3020,  5,		'bp fire ball')
shopModule:addBuyableItemContainer({'bp great fireball'}, 	2000, 2304, 3620, 4, 		'bp great fireball rune')
shopModule:addBuyableItemContainer({'bp heavy magic missile'}, 	2001, 2311, 2420, 10,		'bp heavy magic missile rune')
shopModule:addBuyableItemContainer({'bp icicle'}, 		2002, 2271, 3020, 5,		'bp icicle rune')
shopModule:addBuyableItemContainer({'bp intense healing'}, 	2003, 2265, 1920, 1,		'bp intense healing rune')
shopModule:addBuyableItemContainer({'bp light magic missile'}, 	1998, 2287, 820, 10,		'bp light magic missile rune')
shopModule:addBuyableItemContainer({'bp magic wall'}, 		1999, 2293, 7020, 3,		'bp magic wall rune')
shopModule:addBuyableItemContainer({'bp paralyze'}, 		2002, 2278, 1420, 1, 		'bp paralyze rune')
shopModule:addBuyableItemContainer({'bp poison bomb'}, 		1998, 2286, 3420, 2,		'bp poison bomb rune')
shopModule:addBuyableItemContainer({'bp poison field'}, 	1998, 2285, 1320,  3,		'bp poison field')
shopModule:addBuyableItemContainer({'bp poison wall'}, 		1998, 2289, 4220, 4,		'bp poison wall rune')
shopModule:addBuyableItemContainer({'bp soulfire'}, 		2000, 2308, 2820, 3, 		'bp soulfire rune')
shopModule:addBuyableItemContainer({'bp stalagmite'}, 		1998, 2292, 2400, 10, 		'bp stalagmite rune')
shopModule:addBuyableItemContainer({'bp stone shower'}, 	1999, 2288, 3020, 4, 		'bp stoneshower rune')
shopModule:addBuyableItemContainer({'bp sudden death'}, 	2003, 2268, 6520, 3, 		'bp sudden death rune')
shopModule:addBuyableItemContainer({'bp thunderstorm'}, 	1999, 2268, 3020, 4, 		'bp thunderstorm rune')
shopModule:addBuyableItemContainer({'bp ultimate healing'}, 	2002, 2273, 3520, 1, 		'bp ultimate healing rune')
shopModule:addBuyableItemContainer({'bp wild growth'}, 		2002, 2269, 6420, 2,		'bp wild growth rune')

shopModule:addBuyableItemContainer({'bp health potion'}, 	2000, 7618, 45, 1, 		'bp health potion')
shopModule:addBuyableItemContainer({'bp mana potion'}, 		2001, 7620, 50, 1, 		'bp mana potion')
shopModule:addBuyableItemContainer({'bp strong health'}, 	2000, 7588, 100, 1, 		'bp strong health potion')
shopModule:addBuyableItemContainer({'bp strong mana'}, 		2001, 7589, 80, 1, 		'bp strong mana potion')
shopModule:addBuyableItemContainer({'bp great health'}, 	2000, 7591, 190, 1, 		'bp great health potion')
shopModule:addBuyableItemContainer({'bp great mana'}, 		2001, 7590, 120, 1, 		'bp great mana potion')
shopModule:addBuyableItemContainer({'bp great spirit'}, 	1988, 8472, 190, 1, 		'bp great spirit potion')
shopModule:addBuyableItemContainer({'bp ultimate health'}, 	2000, 8473, 310, 1, 		'bp ultimate health potion')

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

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

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

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


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 items = {[1] = 2190, [2] = 2182, [5] = 2190, [6] = 2182}
	if(msgcontains(msg, 'first rod') or msgcontains(msg, 'first wand')) then
		if(isSorcerer(cid) or isDruid(cid)) then
			if(getPlayerStorageValue(cid, 30002) == -1) 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]) == TRUE) then
		selfSay('Ok then.', cid)
		talkState[talkUser] = 0
	end

	return true
end

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

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Npc which sells necklaces
Necklace.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Necklace" script="data/npc/scripts/necklaces.lua" walkinterval="0" floorchange="0">
	<health now="100" max="100"/>
	<look type="138" head="115" body="0" legs="19" feet="94" addons="3"/>
	<parameters>
	<parameter key="module_shop" value="3" />
	<parameter key="message_greet" value="Welcome |PLAYERNAME]! My name is Necklace. May I help you with a {trade}?" />
        <parameter key="message_farewell" value="Goodbye and good luck with your necklaces, |PLAYERNAME|." />
	<parameter key="message_walkaway" value="Goodbye and good luck with your necklaces." />
	</parameters>
</npc>

Necklaces.lua
Code:
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

shopModule:addBuyableItem({'amulet of loss'}, 2173, 50000, 1, 'amulet of loss')
shopModule:addBuyableItem({'protection amulet'}, 2200, 700, 1, 'protection amulet')
shopModule:addBuyableItem({'ruby necklace'}, 2133, 3560, 1, 'ruby necklace')
shopModule:addBuyableItem({'dragon necklace'}, 2201, 1000, 1, 'dragon necklace')
shopModule:addBuyableItem({'garlic necklace'}, 2199, 100, 1, 'garlic necklace')
shopModule:addBuyableItem({'golden amulet'}, 2130, 6600, 1, 'golden amulet')
shopModule:addBuyableItem({'scarf'}, 2661, 15, 1, 'scarf')
shopModule:addBuyableItem({'bronze amulet'}, 2172, 100, 1, 'bronze amulet')
shopModule:addBuyableItem({'elven amulet'}, 2198, 500, 1, 'elven amulet')
shopModule:addBuyableItem({'protection amulet'}, 2200, 700, 1, 'protection amulet')
shopModule:addBuyableItem({'silver amulet'}, 2198, 100, 1, 'silver amulet')
shopModule:addBuyableItem({'strange talisman'}, 2161, 100, 1, 'strange talisman')

shopModule:addSellableItem({'crystal necklace'}, 2123, 400, 1, 'crystal necklace')
shopModule:addSellableItem({'ruby necklace'}, 2133, 2000, 1, 'ruby necklace')
shopModule:addSellableItem({'dragon necklace'}, 2201, 100, 1, 'dragon necklace')
shopModule:addSellableItem({'garlic necklace'}, 2199, 50, 1, 'garlic necklace')
shopModule:addSellableItem({'ancient amulet'}, 2142, 200, 1, 'ancient amulet')
shopModule:addSellableItem({'demonbone amulet'}, 2136, 32000, 1, 'demonbone amulet')
shopModule:addSellableItem({'scarab amulet'}, 2135, 200, 1, 'scarab amulet')
shopModule:addSellableItem({'bronze amulet'}, 2172, 50, 1, 'bronze amulet')
shopModule:addSellableItem({'elven amulet'}, 2198, 100, 1, 'elven amulet')
shopModule:addSellableItem({'glacier amulet'}, 7888, 1500, 1, 'glacier amulet')
shopModule:addSellableItem({'protection amulet'}, 2200, 100, 1, 'protection amulet')
shopModule:addSellableItem({'silver amulet'}, 2170, 50, 1, 'silver amulet')
shopModule:addSellableItem({'strange talisman'}, 2161, 30, 1, 'strange talisman')

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

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Last edited:
Addon seller
Varkhall.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Varkhall" script="data/npc/scripts/addon.lua" walkinterval="0" floorchange="0">
	<health now="100" max="100"/>
	<look type="134" head="57" body="29" legs="95" feet="98" addons="3"/>
	<parameters>
	<parameter key="module_shop" value="3" />
	<parameter key="message_greet" value="Welcome |PLAYERNAME]! I am Verkhall and I sell all {addons}." />
        <parameter key="message_farewell" value="Goodbye |PLAYERNAME|. I hope I improved your outfit." />
	<parameter key="message_walkaway" value="Goodbye." />
	</parameters>
</npc>

addon.lua
Code:
keywordHandler = KeywordHandler:new()
 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

-- Storage IDs --
citizen     = 22001
hunter        = 22003
mage        = 22005
knight        = 22007
nobleman    = 22009
summoner    = 22011
warrior        = 22013
barbarian    = 22015
druid        = 22017
wizard        = 22019
oriental    = 22021
pirate        = 22023
assassin    = 22025
beggar        = 22027
shaman        = 22029
norseman    = 22031
nightmare    = 22033
jester        = 22035
brotherhood    = 22037
yalaharian    = 22039


newaddon    = 'Here you are, enjoy your brand new addon!'
noitems        = 'You do not have all the required items.'
noitems2    = 'You do not have all the required items or you do not have the first addon, which by the way, is a requirement for this addon.'
already        = 'It seems you already have this addon, don\'t you try to mock me son!'

-- CITIZEN START --
function CitizenFirst(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,citizen)
    if addon == -1 then
        if getPlayerItemCount(cid,5878) >= 100 then
        if doPlayerRemoveItem(cid,5878,100) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 128, 1)
            doPlayerAddOutfit(cid, 136, 1)
            setPlayerStorageValue(cid,citizen,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end

function CitizenSecond(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,citizen+1)
    if addon == -1 then
        if getPlayerItemCount(cid,5890) >= 100 and getPlayerItemCount(cid,5902) >= 50 and getPlayerItemCount(cid,2480) >= 1 then
        if doPlayerRemoveItem(cid,5890,100) and doPlayerRemoveItem(cid,5902,50) and doPlayerRemoveItem(cid,2480,1) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 128, 2)
            doPlayerAddOutfit(cid, 136, 2)
            setPlayerStorageValue(cid,citizen+1,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end
-- CITIZEN END --

-- HUNTER START --
function HunterFirst(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,hunter)
    if addon == -1 then
        if getPlayerItemCount(cid,5947) >= 1 and getPlayerItemCount(cid,5876) >= 100 and getPlayerItemCount(cid,5948) >= 100 and getPlayerItemCount(cid,5891) >= 5 and getPlayerItemCount(cid,5887) >= 1 and getPlayerItemCount(cid,5888) >= 1 and getPlayerItemCount(cid,5889) >= 1 then
        if doPlayerRemoveItem(cid,5947,1) and doPlayerRemoveItem(cid,5876,100) and doPlayerRemoveItem(cid,5948,100) and doPlayerRemoveItem(cid,5891,5) and doPlayerRemoveItem(cid,5887,1) and doPlayerRemoveItem(cid,5888,1) and doPlayerRemoveItem(cid,5889,1) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 129, 1)
            doPlayerAddOutfit(cid, 137, 2)
            setPlayerStorageValue(cid,hunter,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end

function HunterSecond(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,hunter+1)
    if addon == -1 then
        if getPlayerItemCount(cid,5875) >= 1 then
        if doPlayerRemoveItem(cid,5875,1) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 129, 2)
            doPlayerAddOutfit(cid, 137, 1)
            setPlayerStorageValue(cid,hunter+1,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end
-- HUNTER END --

-- MAGE START --
function MageFirst(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,mage)
    if addon == -1 then
        if getPlayerSex(cid) == 0 then
        if getPlayerItemCount(cid,5958) >= 1 then
        if doPlayerRemoveItem(cid,5958,1) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 141, 1)
            doPlayerAddOutfit(cid, 130, 1)
            setPlayerStorageValue(cid,mage,1)
        end
        else
            selfSay(noitems)
        end
        elseif getPlayerSex(cid) == 1 then
        if getPlayerItemCount(cid,2181) >= 1 and getPlayerItemCount(cid,2182) >= 1 and getPlayerItemCount(cid,2183) >= 1 and getPlayerItemCount(cid,2185) >= 1 and getPlayerItemCount(cid,2186) >= 1 and getPlayerItemCount(cid,2187) >= 1 and getPlayerItemCount(cid,2188) >= 1 and getPlayerItemCount(cid,2189) >= 1 and getPlayerItemCount(cid,2190) >= 1 and getPlayerItemCount(cid,2191) >= 1 and getPlayerItemCount(cid,5904) >= 10 and getPlayerItemCount(cid,2193) >= 20 and getPlayerItemCount(cid,5809) >= 1 then
        if doPlayerRemoveItem(cid,2181,1) and doPlayerRemoveItem(cid,2182,1) and doPlayerRemoveItem(cid,2183,1) and doPlayerRemoveItem(cid,2185,1) and doPlayerRemoveItem(cid,2186,1) and doPlayerRemoveItem(cid,2187,1) and doPlayerRemoveItem(cid,2188,1) and doPlayerRemoveItem(cid,2189,1) and doPlayerRemoveItem(cid,2190,1) and doPlayerRemoveItem(cid,2191,1) and doPlayerRemoveItem(cid,5904,10) and doPlayerRemoveItem(cid,2193,20) and doPlayerRemoveItem(cid,5809,1) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 130, 1)
            doPlayerAddOutfit(cid, 141, 1)
            setPlayerStorageValue(cid,mage,1)
        end
        else
            selfSay(noitems)
        end
        end
    else
        selfSay(already)
    end
    end

end

function MageSecond(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,mage+1)
    if addon == -1 then
        if getPlayerSex(cid) == 0 then
        if getPlayerItemCount(cid,5894) >= 70 and getPlayerItemCount(cid,5911) >= 20 and getPlayerItemCount(cid,5883) >= 40 and getPlayerItemCount(cid,5922) >= 35 and getPlayerItemCount(cid,5886) >= 10 and getPlayerItemCount(cid,5881) >= 60 and getPlayerItemCount(cid,5882) >= 40 and getPlayerItemCount(cid,5904) >= 15 and getPlayerItemCount(cid,5905) >= 30 then
        if doPlayerRemoveItem(cid,5894,70) and doPlayerRemoveItem(cid,5911,20) and doPlayerRemoveItem(cid,5883,40) and doPlayerRemoveItem(cid,5922,35) and doPlayerRemoveItem(cid,5886,10) and doPlayerRemoveItem(cid,5881,60) and doPlayerRemoveItem(cid,5882,40) and doPlayerRemoveItem(cid,5904,15) and doPlayerRemoveItem(cid,5905,30) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 141, 2)
            doPlayerAddOutfit(cid, 130, 2)
            setPlayerStorageValue(cid,mage+1,1)
        end
        else
            selfSay(noitems)
        end
        elseif getPlayerSex(cid) == 1 then
        if getPlayerItemCount(cid,5903) >= 1 then
        if doPlayerRemoveItem(cid,5903,1) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 130, 2)
            doPlayerAddOutfit(cid, 141, 2)
            setPlayerStorageValue(cid,mage+1,1)
        end
        else
            selfSay(noitems)
        end
        end
    else
        selfSay(already)
    end
    end

end
-- MAGE END --

-- KNIGHT START --
function KnightFirst(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,knight)
    if addon == -1 then
        if getPlayerItemCount(cid,5892) >= 1 and getPlayerItemCount(cid,5880) >= 100 then
        if doPlayerRemoveItem(cid,5892,1) and doPlayerRemoveItem(cid,5880,100) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 131, 1)
            doPlayerAddOutfit(cid, 139, 1)
            setPlayerStorageValue(cid,knight,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end

function KnightSecond(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,knight+1)
    if addon == -1 then
        if getPlayerItemCount(cid,5893) >= 100 and getPlayerItemCount(cid,5924) >= 1 and getPlayerItemCount(cid,5885) >= 1 and getPlayerItemCount(cid,5887) >= 1 then
        if doPlayerRemoveItem(cid,5893,100) and doPlayerRemoveItem(cid,5924,1) and doPlayerRemoveItem(cid,5885,1) and doPlayerRemoveItem(cid,5887,1) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 131, 2)
            doPlayerAddOutfit(cid, 139, 2)
            setPlayerStorageValue(cid,knight+1,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end
-- KNIGHT END --

-- NOBLEMAN START --
function NoblemanFirst(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    local player_gold     = getPlayerItemCount(cid,2148)
    local player_plat     = getPlayerItemCount(cid,2152)*100
    local player_crys     = getPlayerItemCount(cid,2160)*10000
    local player_money     = player_gold + player_plat + player_crys

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,nobleman)
    if addon == -1 then
        if player_money >= 150000 then
        if doPlayerRemoveMoney(cid,150000) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 132, 1)
            doPlayerAddOutfit(cid, 140, 1)
            setPlayerStorageValue(cid,nobleman,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end

function NoblemanSecond(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    local player_gold     = getPlayerItemCount(cid,2148)
    local player_plat     = getPlayerItemCount(cid,2152)*100
    local player_crys     = getPlayerItemCount(cid,2160)*10000
    local player_money     = player_gold + player_plat + player_crys

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,nobleman+1)
    if addon == -1 then
        if player_money >= 150000 then
        if doPlayerRemoveMoney(cid,150000) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 132, 2)
            doPlayerAddOutfit(cid, 140, 2)
            setPlayerStorageValue(cid,nobleman+1,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end
-- NOBLEMAN END --


-- YALAHARIAN START --
function YalaharianFirst(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    local player_gold     = getPlayerItemCount(cid,2148)
    local player_plat     = getPlayerItemCount(cid,2152)*100
    local player_crys     = getPlayerItemCount(cid,2160)*10000
    local player_money     = player_gold + player_plat + player_crys

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,yalaharian)
    if addon == -1 then
        if player_money >= 150000 then
        if doPlayerRemoveMoney(cid,150000) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 325, 1)
            doPlayerAddOutfit(cid, 324, 1)
            setPlayerStorageValue(cid,yalaharian,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end

function YalaharianSecond(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    local player_gold     = getPlayerItemCount(cid,2148)
    local player_plat     = getPlayerItemCount(cid,2152)*100
    local player_crys     = getPlayerItemCount(cid,2160)*10000
    local player_money     = player_gold + player_plat + player_crys

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,yalaharian+1)
    if addon == -1 then
        if player_money >= 150000 then
        if doPlayerRemoveMoney(cid,150000) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 325, 2)
            doPlayerAddOutfit(cid, 324, 2)
            setPlayerStorageValue(cid,yalaharian+1,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end
-- YALAHARIAN end --


-- SUMMONER START --
function SummonerFirst(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,summoner)
    if addon == -1 then
        if getPlayerSex(cid) == 1 then
        if getPlayerItemCount(cid,5958) >= 1 then
        if doPlayerRemoveItem(cid,5958,1) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 133, 1)
            doPlayerAddOutfit(cid, 138, 1)
            setPlayerStorageValue(cid,summoner,1)
        end
        else
            selfSay(noitems)
        end
        elseif getPlayerSex(cid) == 0 then
        if getPlayerItemCount(cid,2181) >= 1 and getPlayerItemCount(cid,2182) >= 1 and getPlayerItemCount(cid,2183) >= 1 and getPlayerItemCount(cid,2185) >= 1 and getPlayerItemCount(cid,2186) >= 1 and getPlayerItemCount(cid,2187) >= 1 and getPlayerItemCount(cid,2188) >= 1 and getPlayerItemCount(cid,2189) >= 1 and getPlayerItemCount(cid,2190) >= 1 and getPlayerItemCount(cid,2191) >= 1 and getPlayerItemCount(cid,5904) >= 10 and getPlayerItemCount(cid,2193) >= 20 and getPlayerItemCount(cid,5809) >= 1 then
        if doPlayerRemoveItem(cid,2181,1) and doPlayerRemoveItem(cid,2182,1) and doPlayerRemoveItem(cid,2183,1) and doPlayerRemoveItem(cid,2185,1) and doPlayerRemoveItem(cid,2186,1) and doPlayerRemoveItem(cid,2187,1) and doPlayerRemoveItem(cid,2188,1) and doPlayerRemoveItem(cid,2189,1) and doPlayerRemoveItem(cid,2190,1) and doPlayerRemoveItem(cid,2191,1) and doPlayerRemoveItem(cid,5904,10) and doPlayerRemoveItem(cid,2193,20) and doPlayerRemoveItem(cid,5809,1) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 133, 1)
            doPlayerAddOutfit(cid, 138, 1)
            setPlayerStorageValue(cid,summoner,1)
        end
        else
            selfSay(noitems)
        end
        end
    else
        selfSay(already)
    end
    end

end

function SummonerSecond(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,summoner+1)
    if addon == -1 then
        if getPlayerSex(cid) == 1 then
        if getPlayerItemCount(cid,5894) >= 70 and getPlayerItemCount(cid,5911) >= 20 and getPlayerItemCount(cid,5883) >= 40 and getPlayerItemCount(cid,5922) >= 35 and getPlayerItemCount(cid,5886) >= 10 and getPlayerItemCount(cid,5881) >= 60 and getPlayerItemCount(cid,5882) >= 40 and getPlayerItemCount(cid,5904) >= 15 and getPlayerItemCount(cid,5905) >= 30 then
        if doPlayerRemoveItem(cid,5894,70) and doPlayerRemoveItem(cid,5911,20) and doPlayerRemoveItem(cid,5883,40) and doPlayerRemoveItem(cid,5922,35) and doPlayerRemoveItem(cid,5886,10) and doPlayerRemoveItem(cid,5881,60) and doPlayerRemoveItem(cid,5882,40) and doPlayerRemoveItem(cid,5904,15) and doPlayerRemoveItem(cid,5905,30) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 133, 2)
            doPlayerAddOutfit(cid, 138, 2)
            setPlayerStorageValue(cid,summoner+1,1)
        end
        else
            selfSay(noitems)
        end
        elseif getPlayerSex(cid) == 0 then
        if getPlayerItemCount(cid,5903) >= 1 then
        if doPlayerRemoveItem(cid,5903,1) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 133, 2)
            doPlayerAddOutfit(cid, 138, 2)
            setPlayerStorageValue(cid,summoner+1,1)
        end
        else
            selfSay(noitems)
        end
        end
    else
        selfSay(already)
    end
    end

end
-- SUMMONER END --

-- WARRIOR START --
function WarriorFirst(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,warrior)
    if addon == -1 then
        if getPlayerItemCount(cid,5925) >= 100 and getPlayerItemCount(cid,5899) >= 100 and getPlayerItemCount(cid,5884) >= 1 and getPlayerItemCount(cid,5919) >= 1 then
        if doPlayerRemoveItem(cid,5925,100) and doPlayerRemoveItem(cid,5899,100) and doPlayerRemoveItem(cid,5884,1) and doPlayerRemoveItem(cid,5919,1) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 134, 1)
            doPlayerAddOutfit(cid, 142, 1)
            setPlayerStorageValue(cid,warrior,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end

function WarriorSecond(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,warrior+1)
    if addon == -1 then
        if getPlayerItemCount(cid,5887) >= 1 and getPlayerItemCount(cid,5880) >= 100 then
        if doPlayerRemoveItem(cid,5887,1) and doPlayerRemoveItem(cid,5880,100) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 134, 2)
            doPlayerAddOutfit(cid, 142, 2)
            setPlayerStorageValue(cid,warrior+1,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end
-- WARRIOR END --

-- BARBARIAN START --
function BarbarianFirst(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,barbarian)
    if addon == -1 then
        if getPlayerItemCount(cid,5884) >= 1 and getPlayerItemCount(cid,5885) >= 1 and getPlayerItemCount(cid,5911) >= 50 and getPlayerItemCount(cid,5910) >= 50 and getPlayerItemCount(cid,5886) >= 10 then
        if doPlayerRemoveItem(cid,5884,1) and doPlayerRemoveItem(cid,5885,1) and doPlayerRemoveItem(cid,5911,50) and doPlayerRemoveItem(cid,5910,50) and doPlayerRemoveItem(cid,5886,10) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 143, 2)
            doPlayerAddOutfit(cid, 147, 2)
            setPlayerStorageValue(cid,barbarian,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end

function BarbarianSecond(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,barbarian+1)
    if addon == -1 then
        if getPlayerItemCount(cid,5880) >= 100 and getPlayerItemCount(cid,5892) >= 1 and getPlayerItemCount(cid,5893) >= 50 and getPlayerItemCount(cid,5876) >= 50 and getPlayerStorageValue(cid,barbarian) then
        if doPlayerRemoveItem(cid,5880,100) and doPlayerRemoveItem(cid,5892,1) and doPlayerRemoveItem(cid,5893,50) and doPlayerRemoveItem(cid,5876,50) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 143, 1)
            doPlayerAddOutfit(cid, 147, 1)
            setPlayerStorageValue(cid,barbarian+1,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end
-- BARBARIAN END --

-- DRUID START --
function DruidFirst(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,druid)
    if addon == -1 then
        if getPlayerItemCount(cid,5897) >= 50 and getPlayerItemCount(cid,5896) >= 50 then
        if doPlayerRemoveItem(cid,5897,50) and doPlayerRemoveItem(cid,5896,50) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 144, 1)
            doPlayerAddOutfit(cid, 148, 1)
            setPlayerStorageValue(cid,druid,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end

function DruidSecond(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,druid+1)
    if addon == -1 then
        if getPlayerItemCount(cid,5937) >= 1 and getPlayerItemCount(cid,5938) >= 1 and getPlayerItemCount(cid,5906) >= 100 and getPlayerItemCount(cid,5942) >= 1 and getPlayerItemCount(cid,5940) >= 1 then
        if doPlayerRemoveItem(cid,5937,1) and doPlayerRemoveItem(cid,5938,1) and doPlayerRemoveItem(cid,5906,100) and doPlayerRemoveItem(cid,5942,1) and doPlayerRemoveItem(cid,5940,1) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 144, 2)
            doPlayerAddOutfit(cid, 148, 2)
            setPlayerStorageValue(cid,druid+1,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end
-- DRUID END --

-- WIZARD START --
function WizardFirst(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,wizard)
    if addon == -1 then
        if getPlayerItemCount(cid,2488) >= 1 and getPlayerItemCount(cid,2123) >= 1 and getPlayerItemCount(cid,2492) >= 1 and getPlayerItemCount(cid,2536) >= 1 then
        if doPlayerRemoveItem(cid,2488,1) and doPlayerRemoveItem(cid,2123,1) and doPlayerRemoveItem(cid,2492,1) and doPlayerRemoveItem(cid,2536,1) then
            selfSay(newaddon)
            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 145, 2)
            doPlayerAddOutfit(cid, 149, 2)
            setPlayerStorageValue(cid,wizard,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end

function WizardSecond(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,wizard+1)
    if addon == -1 then
        if getPlayerItemCount(cid,5922) >= 50 and getPlayerStorageValue(cid,wizard) then
        if doPlayerRemoveItem(cid,5922,50) and getPlayerStorageValue(cid,wizard) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 145, 1)
            doPlayerAddOutfit(cid, 149, 1)
            setPlayerStorageValue(cid,wizard+1,1)
        end
        else
            selfSay(noitems2)
        end
    else
        selfSay(already)
    end
    end

end
-- WIZARD END --

-- ORIENTAL START --
function OrientalFirst(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,oriental)
    if addon == -1 then
        if getPlayerItemCount(cid,5945) >= 1 then
        if doPlayerRemoveItem(cid,5945,1) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 146, 1)
            doPlayerAddOutfit(cid, 150, 1)
            setPlayerStorageValue(cid,oriental,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end

function OrientalSecond(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,oriental+1)
    if addon == -1 then
        if getPlayerItemCount(cid,5883) >= 100 and getPlayerItemCount(cid,5895) >= 100 and getPlayerItemCount(cid,5891) >= 2 and getPlayerItemCount(cid,5912) >= 100 then
        if doPlayerRemoveItem(cid,5883,100) and doPlayerRemoveItem(cid,5895,100) and doPlayerRemoveItem(cid,5891,2) and doPlayerRemoveItem(cid,5912,100) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 146, 2)
            doPlayerAddOutfit(cid, 150, 2)
            setPlayerStorageValue(cid,oriental+1,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end
-- ORIENTAL END --

-- PIRATE START --
function PirateFirst(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,pirate)
    if addon == -1 then
        if getPlayerItemCount(cid,6126) >= 100 and getPlayerItemCount(cid,6097) >= 100 and getPlayerItemCount(cid,6098) >= 100 then
        if doPlayerRemoveItem(cid,6126,100) and doPlayerRemoveItem(cid,6097,100) and doPlayerRemoveItem(cid,6098,100) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 151, 1)
            doPlayerAddOutfit(cid, 155, 1)
            setPlayerStorageValue(cid,pirate,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end

function PirateSecond(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,pirate+1)
    if addon == -1 then
        if getPlayerItemCount(cid,2385) >= 1 and getPlayerItemCount(cid,6098) >= 1 and getPlayerItemCount(cid,6095) >= 1 and getPlayerItemCount(cid,6096) >= 1 then
        if doPlayerRemoveItem(cid,6099,1) and doPlayerRemoveItem(cid,6100,1) and doPlayerRemoveItem(cid,6101,1) and doPlayerRemoveItem(cid,6102,1) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 151, 2)
            doPlayerAddOutfit(cid, 155, 2)
            setPlayerStorageValue(cid,pirate+1,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end
-- PIRATE END --

-- ASSASSIN START --
function AssassinFirst(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,assassin)
    if addon == -1 then
        if getPlayerItemCount(cid,5898) >= 30 and getPlayerItemCount(cid,5882) >= 10 and getPlayerItemCount(cid,5881) >= 30 and getPlayerItemCount(cid,5895) >= 20 and getPlayerItemCount(cid,5905) >= 20 and getPlayerItemCount(cid,5906) >= 10 and getPlayerItemCount(cid,5885) >= 1 then
        if doPlayerRemoveItem(cid,5898,30) and doPlayerRemoveItem(cid,5882,10) and doPlayerRemoveItem(cid,5881,30) and doPlayerRemoveItem(cid,5895,20) and doPlayerRemoveItem(cid,5905,20) and doPlayerRemoveItem(cid,5906,10) and doPlayerRemoveItem(cid,5885,1) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 152, 1)
            doPlayerAddOutfit(cid, 156, 1)
            setPlayerStorageValue(cid,assassin,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end

function AssassinSecond(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,assassin+1)
    if addon == -1 then
        if getPlayerItemCount(cid,5909) >= 50 and getPlayerItemCount(cid,5910) >= 50 and getPlayerItemCount(cid,5911) >= 50 and getPlayerItemCount(cid,5912) >= 50 and getPlayerItemCount(cid,5913) >= 50 and getPlayerItemCount(cid,5914) >= 50 and getPlayerItemCount(cid,5886) >= 10 then
        if doPlayerRemoveItem(cid,5909,50) and doPlayerRemoveItem(cid,5910,50) and doPlayerRemoveItem(cid,5911,50) and doPlayerRemoveItem(cid,5912,50) and doPlayerRemoveItem(cid,5913,50) and doPlayerRemoveItem(cid,5914,50) and doPlayerRemoveItem(cid,5886,10) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 152, 2)
            doPlayerAddOutfit(cid, 156, 2)
            setPlayerStorageValue(cid,assassin+1,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end
-- ASSASSIN END --

-- BEGGAR START --
function BeggarFirst(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    local player_gold     = getPlayerItemCount(cid,2148)
    local player_plat     = getPlayerItemCount(cid,2152)*100
    local player_crys     = getPlayerItemCount(cid,2160)*10000
    local player_money     = player_gold + player_plat + player_crys

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,beggar)
    if addon == -1 then
        if getPlayerItemCount(cid,5883) >= 100 and player_money >= 20000 then
        if doPlayerRemoveItem(cid,5883,100) and doPlayerRemoveMoney(cid,20000) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 153, 1)
            doPlayerAddOutfit(cid, 157, 1)
            setPlayerStorageValue(cid,beggar,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end

function BeggarSecond(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,beggar+1)
    if addon == -1 then
        if getPlayerItemCount(cid,6107) >= 1 then
        if doPlayerRemoveItem(cid,6107,1) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 153, 2)
            doPlayerAddOutfit(cid, 157, 2)
            setPlayerStorageValue(cid,beggar+1,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end
-- BEGGAR END --

-- SHAMAN START --
function ShamanFirst(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,shaman)
    if addon == -1 then
        if getPlayerItemCount(cid,3955) >= 5 and getPlayerItemCount(cid,5015) >= 1 then
        if doPlayerRemoveItem(cid,3955,5) and doPlayerRemoveItem(cid,5015,1) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 154, 2)
            doPlayerAddOutfit(cid, 158, 2)
            setPlayerStorageValue(cid,shaman,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end

function ShamanSecond(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,shaman+1)
    if addon == -1 then
        if getPlayerItemCount(cid,3966) >= 5 and getPlayerItemCount(cid,3967) >= 5 then
        if doPlayerRemoveItem(cid,3966,5) and doPlayerRemoveItem(cid,3967,5) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 154, 1)
            doPlayerAddOutfit(cid, 158, 1)
            setPlayerStorageValue(cid,shaman+1,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end
-- SHAMAN END --

-- NORSEMAN START --
function NorsemanFirst(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,norseman)
    if addon == -1 then
        if getPlayerItemCount(cid,7290) >= 5 then
        if doPlayerRemoveItem(cid,7290,5) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 251, 1)
            doPlayerAddOutfit(cid, 252, 1)
            setPlayerStorageValue(cid,norseman,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end

function NorsemanSecond(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,norseman+1)
    if addon == -1 then
        if getPlayerItemCount(cid,7290) >= 10 then
        if doPlayerRemoveItem(cid,7290,10) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 251, 2)
            doPlayerAddOutfit(cid, 252, 2)
            setPlayerStorageValue(cid,norseman+1,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end
-- NORSEMAN END --

-- NIGHTMARE START --
function NightmareFirst(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,nightmare)
    if addon == -1 then
        if getPlayerItemCount(cid,6500) >= 500 then
        if doPlayerRemoveItem(cid,6500,500) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 268, 1)
            doPlayerAddOutfit(cid, 269, 1)
            setPlayerStorageValue(cid,nightmare,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end

function NightmareSecond(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,nightmare+1)
    if addon == -1 then
        if getPlayerItemCount(cid,6500) >= 1500 then
        if doPlayerRemoveItem(cid,6500,1500) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 268, 2)
            doPlayerAddOutfit(cid, 269, 2)
            setPlayerStorageValue(cid,nightmare+1,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end
-- NIGHTMARE END --

-- JESTER START --
function JesterFirst(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,jester)
    if addon == -1 then
        if getPlayerItemCount(cid,5879) >= 1 and getPlayerItemCount(cid,5878) >= 4 then
        if doPlayerRemoveItem(cid,5879,1) and doPlayerRemoveItem(cid,5878,4) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 273, 1)
            doPlayerAddOutfit(cid, 270, 1)
            setPlayerStorageValue(cid,jester,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end

function JesterSecond(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,jester+1)
    if addon == -1 then
        if getPlayerItemCount(cid,5909) >= 5 then
        if doPlayerRemoveItem(cid,5909,5) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 273, 2)
            doPlayerAddOutfit(cid, 270, 2)
            setPlayerStorageValue(cid,jester+1,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end
-- JESTER END --

-- BROTHERHOOD START --
function BrotherhoodFirst(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,brotherhood)
    if addon == -1 then
        if getPlayerItemCount(cid,6500) >= 500 then
        if doPlayerRemoveItem(cid,6500,500) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 278, 1)
            doPlayerAddOutfit(cid, 279, 1)
            setPlayerStorageValue(cid,brotherhood,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end

function BrotherhoodSecond(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,brotherhood+1)
    if addon == -1 then
        if getPlayerItemCount(cid,6500) >= 1500 then
        if doPlayerRemoveItem(cid,6500,1500) then
            selfSay(newaddon)

            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 278, 2)
            doPlayerAddOutfit(cid, 279, 2)
            setPlayerStorageValue(cid,brotherhood+1,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end
-- BROTHERHOOD END --


keywordHandler:addKeyword({'addons'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you first & second addons of the following outfits: Citizen, Hunter, Mage, Knight, Nobleman, Summoner, Warrior, Barbarian, Druid, Wizard, Oriental, Pirate, Assassin, Beggar, Shaman, Norseman, Nightmare, Jester, Brotherhood & Yalaharian."})
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "What you do is that you type 'first hunter addon' or 'second hunter addon' where you replace 'hunter' with whatever outfit you'd like to achieve the addons for. Assuming that you already collected all the required pieces, say 'yes' and voíla - you got yourself an addon!"})

 node1 = keywordHandler:addKeyword({'first citizen addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first citizen addon you need to give me 100 minotaur leathers. Do you have them with you?'})
    node1:addChildKeyword({'yes'}, CitizenFirst, {})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node2 = keywordHandler:addKeyword({'second citizen addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first hunter addon you need to give me 100 chicken feathers, 50 honeycombs and a legion helmet. Do you have them with you?'})
    node2:addChildKeyword({'yes'}, CitizenSecond, {})
    node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node3 = keywordHandler:addKeyword({'first hunter addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first hunter addon you need to give me an engraved crossbow, 100 lizard leathers, 100 red dragon leather, 5 enchanted chicken wings, royal steel, hell steel and draconian steel. Do you have them with you?'})
    node3:addChildKeyword({'yes'}, HunterFirst, {})
    node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node4 = keywordHandler:addKeyword({'second hunter addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the second hunter addon you need to give me a pair of sniper gloves. Do you have them with you?'})
    node4:addChildKeyword({'yes'}, HunterSecond, {})
    node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node5 = keywordHandler:addKeyword({'first mage addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first mage addon you need to give me a winning lottery ticket if you are a female. Otherwise, you need to give me all kind of wands and rods, 10 magic sulphurs, 20 ankhs and a soul stone. Do you have it with you?'})
    node5:addChildKeyword({'yes'}, MageFirst, {})
    node5:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node6 = keywordHandler:addKeyword({'second mage addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the second mage addon you need to give me 70 bat wings, 20 red pieces of cloth, 40 ape fur, 35 holy orchid, 10 spools of spider silk yarn, 60 lizard scales, 40 red dragon scales, 15 magic sulphurs and 30 vampire dusts if you are a female. Otherwise, you need to give me a ferumbras\' hat. Do you have them with you?'})
    node6:addChildKeyword({'yes'}, MageSecond, {})
    node6:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node7 = keywordHandler:addKeyword({'first knight addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first knight addon you need to give me a chunk of crude iron and 100 iron ores. Do you have it with you?'})
    node7:addChildKeyword({'yes'}, KnightFirst, {})
    node7:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node8 = keywordHandler:addKeyword({'second knight addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the second knight addon you need to give me 100 perfect behemoth fangs, a damaged steel helmet, warrior\'s sweat and a royal steel. Do you have them with you?'})
    node8:addChildKeyword({'yes'}, KnightSecond, {})
    node8:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node9 = keywordHandler:addKeyword({'first nobleman addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first nobleman addon you need to give me 150,000 gold pieces. Do you have it with you?'})
    node9:addChildKeyword({'yes'}, NoblemanFirst, {})
    node9:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node10 = keywordHandler:addKeyword({'second nobleman addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the second nobleman addon you need to give me 150,000 gold pieces. Do you have them with you?'})
    node10:addChildKeyword({'yes'}, NoblemanSecond, {})
    node10:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node11 = keywordHandler:addKeyword({'first summoner addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first summoner addon you need to give me a winning lottery ticket if you are a male. Otherwise, you need to give me all kind of wands and rods, 10 magic sulphurs, 20 ankhs and a soul stone. Do you have it with you?'})
    node11:addChildKeyword({'yes'}, SummonerFirst, {})
    node11:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node12 = keywordHandler:addKeyword({'second summoner addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the second summoner addon you need to give me 70 bat wings, 20 red pieces of cloth, 40 ape fur, 35 holy orchid, 10 spools of spider silk yarn, 60 lizard scales, 40 red dragon scales, 15 magic sulphurs and 30 vampire dusts if you are a male. Otherwise, you need to give me a ferumbras\' hat. Do you have them with you?'})
    node12:addChildKeyword({'yes'}, SummonerSecond, {})
    node12:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node13 = keywordHandler:addKeyword({'first warrior addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first warrior addon you need to give me 100 hardened bones, 100 turtle shells, a fighting spirit and a dragon claw. Do you have it with you?'})
    node13:addChildKeyword({'yes'}, WarriorFirst, {})
    node13:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node14 = keywordHandler:addKeyword({'second warrior addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the second warrior addon you need to give me 100 iron ores and a piece of royal steel. Do you have them with you?'})
    node14:addChildKeyword({'yes'}, WarriorSecond, {})
    node14:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node15 = keywordHandler:addKeyword({'first barbarian addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first barbarian addon you need to give me a fighting spirit, the warrior\'s sweat, 50 red pieces of cloth, 50 green pieces of cloth and 10 spider silk yarns. Do you have them with you?'})
    node15:addChildKeyword({'yes'}, BarbarianFirst, {})
    node15:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node16 = keywordHandler:addKeyword({'second barbarian addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the second barbarian addon you need to give me 100 iron ore, a chunk of crude iron, 50 behemoth fangs and 50 lizard leathers. Do you have them with you?'})
    node16:addChildKeyword({'yes'}, BarbarianSecond, {})
    node16:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node17 = keywordHandler:addKeyword({'first druid addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first druid addon you need to give me 50 wolf paws and 50 bear paws. Do you have them with you?'})
    node17:addChildKeyword({'yes'}, DruidFirst, {})
    node17:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node18 = keywordHandler:addKeyword({'second druid addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the second druid addon you need to give me Griffinclaw flower sample, water from the hydra cave, 100 demon dusts, a blessed wooden stake and Ceirons wolf tooth chain. Do you have them with you?'})
    node18:addChildKeyword({'yes'}, DruidSecond, {})
    node18:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node19 = keywordHandler:addKeyword({'first wizard addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first wizard addon you need to give me a dragon scale mail, a pair of crown legs, a medusa shield and a ring of the sky. Do you have them with you?'})
    node19:addChildKeyword({'yes'}, WizardFirst, {})
    node19:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node20 = keywordHandler:addKeyword({'second wizard addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the second wizard addon you need to give me 50 holy orchids. Do you have them with you?'})
    node20:addChildKeyword({'yes'}, WizardSecond, {})
    node20:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node21 = keywordHandler:addKeyword({'first oriental addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first oriental addon you need to give me a mermaid comb. Do you have it with you?'})
    node21:addChildKeyword({'yes'}, OrientalFirst, {})
    node21:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node22 = keywordHandler:addKeyword({'second oriental addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the second oriental addon you need to give me 100 ape furs, 100 fish fins, 2 enchanted chicken wings and 100 blue pieces of cloth. Do you have them with you?'})
    node22:addChildKeyword({'yes'}, OrientalSecond, {})
    node22:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node23 = keywordHandler:addKeyword({'first pirate addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first pirate addon you need to give me 100 hooks, 100 peg legs and 100 eye patches. Do you have them with you?'})
    node23:addChildKeyword({'yes'}, PirateFirst, {})
    node23:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node24 = keywordHandler:addKeyword({'second pirate addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the second pirate addon you need to give me brutus bloodbeard\'s hat, lethal lissy\'s shirt, ron the ripper\'s sabre and deadeye devious\' eye patch. Do you have them with you?'})
    node24:addChildKeyword({'yes'}, PirateSecond, {})
    node24:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node25 = keywordHandler:addKeyword({'first assassin addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first assassin addon you need to give me 30 beholder eyes, 10 red dragon scales, 30 lizard scales, 20 fish fins, 20 vampire dusts, 10 demon dusts and Warrior\'s sweat. Do you have them with you?'})
    node25:addChildKeyword({'yes'}, AssassinFirst, {})
    node25:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node26 = keywordHandler:addKeyword({'second assassin addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the second assassin addon you need to give me 50 blue piece of cloth, 50 green piece of cloth, 50 red piece of cloth, 50 brown piece of cloth, 50 yellow piece of cloth, 50 white piece of cloth and 10 spider silk yarns. Do you have them with you?'})
    node26:addChildKeyword({'yes'}, AssassinSecond, {})
    node26:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node27 = keywordHandler:addKeyword({'first beggar addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first beggar addon you need to give me 100 ape furs and 20,000 gold pieces. Do you have them with you?'})
    node27:addChildKeyword({'yes'}, BeggarFirst, {})
    node27:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node28 = keywordHandler:addKeyword({'second beggar addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the second beggar addon you need to give me simon the beggar\'s staff. Do you have it with you?'})
    node28:addChildKeyword({'yes'}, BeggarSecond, {})
    node28:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node29 = keywordHandler:addKeyword({'first shaman addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first shaman addon you need to give me 5 dworf voodoo dolls and a mandrake. Do you have them with you?'})
    node29:addChildKeyword({'yes'}, ShamanFirst, {})
    node29:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node30 = keywordHandler:addKeyword({'second shaman addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the second shaman addon you need to give me 5 banana staffs and 5 tribal masks. Do you have them with you?'})
    node30:addChildKeyword({'yes'}, ShamanSecond, {})
    node30:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node31 = keywordHandler:addKeyword({'first norseman addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first norseman addon you need to give me 5 shards. Do you have them with you?'})
    node31:addChildKeyword({'yes'}, NorsemanFirst, {})
    node31:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node32 = keywordHandler:addKeyword({'second norseman addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the second norseman addon you need to give me 10 shards. Do you have them with you?'})
    node32:addChildKeyword({'yes'}, NorsemanSecond, {})
    node32:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node33 = keywordHandler:addKeyword({'first nightmare addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first nightmare addon you need to give me 500 demonic essences. Do you have them with you?'})
    node33:addChildKeyword({'yes'}, NightmareFirst, {})
    node33:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node34 = keywordHandler:addKeyword({'second nightmare addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the second nightmare addon you need to give me 1500 demonic essences. Do you have them with you?'})
    node34:addChildKeyword({'yes'}, NightmareSecond, {})
    node34:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node35 = keywordHandler:addKeyword({'first jester addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first jester addon you need to give me a giant spider silk and 4 minotaur leathers. Do you have them with you?'})
    node35:addChildKeyword({'yes'}, JesterFirst, {})
    node35:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node36 = keywordHandler:addKeyword({'second jester addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the second jester addon you need to give me 5 white piece of cloth. Do you have them with you?'})
    node36:addChildKeyword({'yes'}, JesterSecond, {})
    node36:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node37 = keywordHandler:addKeyword({'first brotherhood addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first brotherhood addon you need to give me 500 demonic essences. Do you have them with you?'})
    node37:addChildKeyword({'yes'}, BrotherhoodFirst, {})
    node37:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node38 = keywordHandler:addKeyword({'second brotherhood addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the second brotherhood addon you need to give me 1500 demonic essences. Do you have them with you?'})
    node38:addChildKeyword({'yes'}, BrotherhoodSecond, {})
    node38:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node39 = keywordHandler:addKeyword({'first yalaharian addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first yalaharian addon you need to give me 150000 gold coins. do you have them with you?'})
    node39:addChildKeyword({'yes'}, YalaharianFirst, {})
    node39:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

 node40 = keywordHandler:addKeyword({'second yalaharian addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the second yalaharian addon you need to give me 300000 gold coins. do you have them with you?'})
    node40:addChildKeyword({'yes'}, YalaharianSecond, {})
    node40:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})


npcHandler:addModule(FocusModule:new())

Sells backpack, bags and tools like ropes, shovel, etc.
Tool.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Tool" script="data/npc/scripts/tools.lua" walkinterval="0" floorchange="0">
	<health now="100" max="100"/>
	<look type="128" head="77" body="43" legs="38" feet="76" addons="3"/>
	<parameters>
	<parameter key="module_shop" value="3" />
	<parameter key="message_greet" value="Hello, are you looking for adventure |PLAYERNAME]! I sell things you probably need to get in deep dungeons, just ask me for a {trade}." />
        <parameter key="message_farewell" value="Goodbye, good luck on your adventure |PLAYERNAME|." />
	<parameter key="message_walkaway" value="Kidd, please watch out for the deeper dungeons!" />
	</parameters>
</npc>

Tools.lua
Code:
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({'brown bag'}, 1987, 20, 1, 'brown bag')
shopModule:addBuyableItem({'brown backpack'}, 1988, 20, 1, 'brown backpack')
shopModule:addBuyableItem({'basket'}, 1989, 6, 1, 'basket')
shopModule:addBuyableItem({'present box'}, 1990, 20, 1, 'present box')
shopModule:addBuyableItem({'green bag'}, 1991, 5, 1, 'green bag')
shopModule:addBuyableItem({'yellow bag'}, 1992, 5, 1, 'yellow bag')
shopModule:addBuyableItem({'red bag'}, 1993, 5, 1, 'red bag')
shopModule:addBuyableItem({'purple bag'}, 1994, 5, 1, 'purple bag')
shopModule:addBuyableItem({'blue bag'}, 1995, 5, 1, 'blue bag')
shopModule:addBuyableItem({'grey bag'}, 1996, 5, 1, 'grey bag')
shopModule:addBuyableItem({'golden bag'}, 1997, 5, 1, 'golden bag')
shopModule:addBuyableItem({'green backpack'}, 1998, 20, 1, 'green backpack')
shopModule:addBuyableItem({'yellow backpack'}, 1999, 20, 1, 'yellow backpack')
shopModule:addBuyableItem({'red backpack'}, 2000, 20, 1, 'red backpack')
shopModule:addBuyableItem({'purple backpack'}, 2001, 20, 1, 'purple backpack')
shopModule:addBuyableItem({'blue backpack'}, 2002, 20, 1, 'blue backpack')
shopModule:addBuyableItem({'grey backpack'}, 2003, 20, 1, 'grey backpack')
shopModule:addBuyableItem({'golden backpack'}, 2004, 20, 1, 'golden backpack')
shopModule:addBuyableItem({'beach backpack'}, 5949, 20, 1, 'beach backpack')
shopModule:addBuyableItem({'beach bag'}, 5950, 20, 1, 'beach bag')
shopModule:addBuyableItem({'camouflage bag'}, 3939, 20, 1, 'camouflage bag')
shopModule:addBuyableItem({'camouflage backpack'}, 3940, 20, 1, 'camouflage backpack')
shopModule:addBuyableItem({'pirate backpack'}, 5926, 20, 1, 'pirate backpack')
shopModule:addBuyableItem({'pirate bag'}, 5927, 5, 1, 'pirate bag')
shopModule:addBuyableItem({'fur backpack'}, 7342, 20, 1, 'fur backpack')
shopModule:addBuyableItem({'fur bag'}, 7343, 20, 1, 'fur bag')

shopModule:addBuyableItem({'rope'}, 2120, 50, 1, 'rope')
shopModule:addBuyableItem({'scythe'}, 2550, 50, 1, 'scythe')
shopModule:addBuyableItem({'pick'}, 2553, 50, 1, 'pick')
shopModule:addBuyableItem({'shovel'}, 2554, 50, 1, 'shovel')
shopModule:addBuyableItem({'fishing rod'}, 2580, 150, 1, 'fishing rod')
shopModule:addBuyableItem({'worms'}, 3976, 1, 1, 'worms')
shopModule:addBuyableItem({'torch'}, 2150, 2, 1, 'torch')
shopModule:addBuyableItem({'football'}, 2190, 111, 1, 'football')
shopModule:addBuyableItem({'watch'}, 2036, 20, 1, 'watch')

shopModule:addSellableItem({'rope'}, 2120, 8, 1, 'rope')
shopModule:addSellableItem({'shovel'}, 2554, 8, 1, 'shovel')
shopModule:addSellableItem({'scythe'}, 2550, 10, 1, 'scythe')
shopModule:addSellableItem({'pick'}, 2553, 15, 1, 'pick')
shopModule:addSellableItem({'fishing rod'}, 2580, 40, 1, 'fishing rod')
shopModule:addSellableItem({'watch'}, 2036, 6, 1, 'watch')

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Last edited:
Exchanger npc.
Sweaty Cyclops.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Sweaty Cyclops" script="data/npc/scripts/exchanger.lua" walkinterval="0" floorchange="0">
	<health now="100" max="100"/>
	<look type="22" head="0" body="0" legs="0" feet="0" />
	<parameters>
	<parameter key="module_shop" value="3" />
	<parameter key="message_greet" value="Hi little one. I am an exchanger npc. Need some {help} to know exactly what I am exchanging?" />
        <parameter key="message_farewell" value="Goodbye. Have fun on your adventure little one." />
	<parameter key="message_walkaway" value="You are just so little..." />
	</parameters>
</npc>

Exchanger.lua
Code:
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)

function creatureSayCallback(cid, type, msg)
	if(not npcHandler:isFocused(cid)) then
		return false
	end
		if msgcontains(msg, 'help') then
		selfSay('You can here change some items for "spider silk yarn", "chunk of crude iron", "draconian steel", "warrior sweat", "magic sulpher", "enchanted chicken wing", "royal steel", "hell steel", "engraved crossbow", "fighting spirit", "infernal bolt", "blue, green and red piece of clothes", "obsidian knife" and "lottery ticket".')

			elseif msgcontains(msg, 'spider silk yarn') then
			if getPlayerItemCount(cid,5879) >= 10 then
				selfSay('Did you bring me the 10 Giant Silks ?')
				talk_state = 1
			else
				selfSay('I need a 10 Giant Spider Silks, to give you the spider silk yarn. Come back when you have them.')
				talk_state = 0
			end

			elseif msgcontains(msg, 'yes') and talk_state == 1 then
			talk_state = 0
			if getPlayerItemCount(cid,5879) >= 10 then
			if doPlayerRemoveItem(cid,5879, 10) == TRUE then
			doPlayerAddItem(cid, 5886, 1)
                        selfSay('Here u are.')
			end
			else
				selfSay(havent_item)
			end

elseif msgcontains(msg, 'chunk of crude iron') then
if getPlayerItemCount(cid,2393) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 then
selfSay('Did you bring me the 3 Bast Skirts and Giant Sword ?')
talk_state = 2
else
selfSay('I need a 3 Bast Skirts and Giant Sword, to give you the chunk of crude iron. Come back when you have them.')
talk_state = 0
end
elseif msgcontains(msg, 'yes') and talk_state == 2 then
talk_state = 0
if getPlayerItemCount(cid,2393) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 then
if doPlayerRemoveItem(cid,2393,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 then
selfSay(addon_give)
doPlayerAddItem(cid,5892,1)
end
else
selfSay(havent_item)
end



elseif msgcontains(msg, 'ticket') or msgcontains(msg, 'lottery') or msgcontains(msg, 'lottery ticket') or msgcontains(msg, 'lotery ticket') then
if getPlayerItemCount(cid,2006) >= 100 then
selfSay('Did you bring me 100 empty vials?')
talk_state = 9
else
selfSay('I need 100 empty vials, to give you a lottery ticket. Come back when you have them.')
talk_state = 0
end
elseif msgcontains(msg, 'yes') and talk_state == 9 then
talk_state = 0
if getPlayerItemCount(cid,2006) >= 100 then
if doPlayerRemoveItem(cid,2006,100) == 1 then
selfSay(addon_give)
if(math.random(1,10) == 1) then
	doPlayerAddItem(cid,5958,1)
	else
doPlayerAddItem(cid,5956,1)6
end

else
selfSay(havent_item)
end



elseif msgcontains(msg, 'yes') and talk_state == 6 then
        if getPlayerItemCount(cid,2006) >= 100 then
            if doPlayerTakeItem(cid,2006,100) == 0 then
                selfSay('Here you are.')
                if(math.random(1,10) == 1) then
                    doPlayerAddItem(cid,5958,1)
                else
                    doPlayerAddItem(cid,5956,1)
                end
            else
                selfSay(hasNoMsg)
            end
        else
            selfSay(hasNoMsg)
        end

















elseif msgcontains(msg, 'draconian steel') then
if getPlayerItemCount(cid,2516) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 then
selfSay('Did you bring me 3 Bast Skirts and Dragon Shield ?')
talk_state = 3
else
selfSay('I need 3 Bast Skirts and Dragon Shield, to give you the draconian steel. Come back when you have them.')
talk_state = 0
end
elseif msgcontains(msg, 'yes') and talk_state == 3 then
talk_state = 0
if getPlayerItemCount(cid,2516) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 then
if doPlayerRemoveItem(cid,2516,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 then
doPlayerAddItem(cid,5889,1)
selfSay('Here u are.')
end
else
selfSay(havent_item)
end

		elseif msgcontains(msg, 'warrior sweat') then
				if getPlayerItemCount(cid,2475) >= 1 and getPlayerItemCount(cid,2475) >= 1 and getPlayerItemCount(cid,2475) >= 1 and getPlayerItemCount(cid,2475) >= 1 then
					selfSay('Did you bring me 4 warrior helmets?')
					talk_state = 4
				else
					selfSay('I need 4 warrior helmets, to give you the warrior sweat. Come back when you have them.')
					talk_state = 0
				end
		elseif msgcontains(msg, 'yes') and talk_state == 4 then
			talk_state = 0
			if getPlayerItemCount(cid,2475) >= 1 and getPlayerItemCount(cid,2475) >= 1 and getPlayerItemCount(cid,2475) >= 1 and getPlayerItemCount(cid,2475) >= 1 then
					if doPlayerRemoveItem(cid,2475,1) == 1 and doPlayerRemoveItem(cid,2475,1) == 1 and doPlayerRemoveItem(cid,2475,1) == 1 and doPlayerRemoveItem(cid,2475,1) == 1 then
						doPlayerAddItem(cid,5885,1)
						selfSay(addon_give)
					end
				else
				selfSay(havent_item)
				end

elseif msgcontains(msg, 'magic sulpher') then
if getPlayerItemCount(cid,2392) >= 1 and getPlayerItemCount(cid,2392) >= 1 and getPlayerItemCount(cid,2392) >= 1 then
selfSay('Did you bring me 3 fire swords?')
talk_state = 5
else
selfSay('I need 3 fire swords, to give you the magic sulpher. Come back when you have them.')
talk_state = 0
end

		elseif msgcontains(msg, 'yes') and talk_state == 5 then
			talk_state = 0
			if getPlayerItemCount(cid,2392) >= 1 and getPlayerItemCount(cid,2392) >= 1 and getPlayerItemCount(cid,2392) >= 1 then
					if doPlayerRemoveItem(cid,2392,1) == 1 and doPlayerRemoveItem(cid,2392,1) == 1 and doPlayerRemoveItem(cid,2392,1) == 1 then
						doPlayerAddItem(cid,5904,1)
						selfSay(addon_give)
				end
			else
				selfSay(havent_item)
			end

		elseif msgcontains(msg, 'enchanted chicken wing') then
			if getPlayerItemCount(cid,2195) >= 1 then
				selfSay('Did you bring me boots of haste?')
				talk_state = 6
			else
				selfSay('I need boots of haste, to give you the enchanted chicken wing. Come back when you have them.')
				talk_state = 0
			end

		elseif msgcontains(msg, 'yes') and talk_state == 6 then
			talk_state = 0
			if getPlayerItemCount(cid,2195) >= 1 then
					if doPlayerRemoveItem(cid,2195,1) == 1 then
						doPlayerAddItem(cid,5891,1)
						selfSay(addon_give)
					end
			else
				selfSay(havent_item)
			end



		elseif msgcontains(msg, 'royal steel') then
			if getPlayerItemCount(cid,2487) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 then
				selfSay('Did you bring me the 3 Bast Skirts and Crown Armor ?')
				talk_state = 7
			else
				selfSay('I need 3 Bast Skirts and Crown Armor, to give you the royal steel. Come back when you have them.')
				talk_state = 0
			end
		elseif msgcontains(msg, 'yes') and talk_state == 7 then
			talk_state = 0
			if getPlayerItemCount(cid,2487) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 then
					if doPlayerRemoveItem(cid,2487,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 then
						selfSay(addon_give)
						doPlayerAddItem(cid,5887,1)
					end
			else
				selfSay(havent_item)
			end


		elseif msgcontains(msg, 'hell steel') then
			if getPlayerItemCount(cid,2462) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 then
				selfSay('Did you bring me the 3 Bast Skirts and Devil Helmet ?')
				talk_state = 8
			else
				selfSay('I need a 3 Bast Skirts and Devil Helmet, to give you the hell steel. Come back when you have them.')
				talk_state = 0
			end

		elseif msgcontains(msg, 'yes') and talk_state == 8 then
			talk_state = 0
			if getPlayerItemCount(cid,2462) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 then

					if doPlayerRemoveItem(cid,2462,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 then
						selfSay(addon_give)
						doPlayerAddItem(cid,5888,1)
					end
			else
				selfSay(havent_item)
			end

		elseif msgcontains(msg, 'engraved crossbow') then
			if getPlayerItemCount(cid,5954) >= 15 then
				selfSay('Did you bring me the 15 demon horns?')
				talk_state = 9
			else
				selfSay('I need a 15 demon horns, to give you the engraved crossbow. Come back when you have them.')
				talk_state = 0
			end
		elseif msgcontains(msg, 'yes') and talk_state == 9 then
			talk_state = 0
			if getPlayerItemCount(cid,5954) >= 15 then
					if doPlayerRemoveItem(cid,5954,15) == 1 then
						selfSay(addon_give)
						doPlayerAddItem(cid,5947,1)
					end

			else
				selfSay(havent_item)
			end

		elseif msgcontains(msg, 'fighting spirit') then
			if getPlayerItemCount(cid,2498) >= 1 and getPlayerItemCount(cid,2498) >= 1 then
				selfSay('Did you bring me the 2 Royal Helmets?')
				talk_state = 10
			else
				selfSay('I need a 2 Royal Helmets, to give you the Fighting Spirit. Come back when you have them.')
				talk_state = 0
			end
		elseif msgcontains(msg, 'yes') and talk_state == 10 then
			talk_state = 0
			if getPlayerItemCount(cid,2498) >= 1 and getPlayerItemCount(cid,2498) >= 1 then
					if doPlayerRemoveItem(cid,2498,1) == 1 and doPlayerRemoveItem(cid,2498,1) == 1 then
						selfSay(addon_give)
						doPlayerAddItem(cid,5884,1)
					end

			else
				selfSay(havent_item)
			end


		elseif msgcontains(msg, 'infernal bolt') then
			if getPlayerItemCount(cid,5944) >= 1 then
				selfSay('Did you bring me the Soul Orb?')
				talk_state = 11
			else
				selfSay('I need a Soul Orb, to give you the 2 Infernal Bolts. Come back when you have them.')
				talk_state = 0
			end
		elseif msgcontains(msg, 'yes') and talk_state == 11 then
			talk_state = 0
			if getPlayerItemCount(cid,5944) >= 1 then
					if doPlayerRemoveItem(cid,5944,1) == 1 then
						selfSay(addon_give)
						doPlayerAddItem(cid,6529,2)
					end

			else
				selfSay(havent_item)
			end

		elseif msgcontains(msg, 'blue piece of cloth') then
			if getPlayerItemCount(cid,2663) >= 1 then
				selfSay('Did you bring me the Mystic Turban ?')
				talk_state = 12
			else
				selfSay('I need a Mystic Turban, to give you the Blue Piece of Cloth. Come back when you have them.')
				talk_state = 0
			end
		elseif msgcontains(msg, 'yes') and talk_state == 12 then
			talk_state = 0
			if getPlayerItemCount(cid,2663) >= 1 then
					if doPlayerRemoveItem(cid,2663,1) == 1 then
						selfSay(addon_give)
						doPlayerAddItem(cid,5912,1)
					end

			else
				selfSay(havent_item)
			end

		elseif msgcontains(msg, 'green piece of cloth') then
			if getPlayerItemCount(cid,2652) >= 1 then
				selfSay('Did you bring me the Green Tunic ?')
				talk_state = 13
			else
				selfSay('I need a Green Tunic, to give you the Green Piece of Cloth. Come back when you have them.')
				talk_state = 0
			end
		elseif msgcontains(msg, 'yes') and talk_state == 13 then
			talk_state = 0
			if getPlayerItemCount(cid,2652) >= 1 then
					if doPlayerRemoveItem(cid,2652,1) == 1 then
						selfSay(addon_give)
						doPlayerAddItem(cid,5910,1)
					end

			else
				selfSay(havent_item)
			end

		elseif msgcontains(msg, 'red piece of cloth') then
			if getPlayerItemCount(cid,2655) >= 1 then
				selfSay('Did you bring me the Red Robe ?')
				talk_state = 14
			else
				selfSay('I need a Red Robe, to give you the Red Piece of Cloth. Come back when you have them.')
				talk_state = 0
			end
		elseif msgcontains(msg, 'yes') and talk_state == 14 then
			talk_state = 0
			if getPlayerItemCount(cid,2655) >= 1 then
					if doPlayerRemoveItem(cid,2655,1) == 1 then
						selfSay(addon_give)
						doPlayerAddItem(cid,5911,1)
					end

			else
				selfSay(havent_item)
			end


		elseif msgcontains(msg, 'obsidian knife') then
			if getPlayerItemCount(cid,3983) >= 3 and getPlayerItemCount(cid,2516) >= 1 and getPlayerItemCount(cid,2425) >= 1 then
				selfSay('Did you bring me the 3 bast skirts, a dragon shield and a obsidian lance?')
				talk_state = 15
			else
				selfSay('I need 3 bast skirts, a dragon shield and a obsidian lance to give you the obsidian knife. Come back when you have them.')
				talk_state = 0
			end
		elseif msgcontains(msg, 'yes') and talk_state == 15 then
			talk_state = 0
			if getPlayerItemCount(cid,3983) >= 3 and getPlayerItemCount(cid,2516) >= 1 and getPlayerItemCount(cid,2425) >= 1  then
					if doPlayerRemoveItem(cid,3983,1) == 3 and doPlayerRemoveItem(cid,2516,1) == 1 and doPlayerRemoveItem(cid,2425,1) == 1 then
						selfSay(addon_give)
						doPlayerAddItem(cid,5908,1)
					end

			else
				selfSay(havent_item)
			end


        elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 5) then
            selfSay('Ok than.')
            talk_state = 0
        end
    -- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
    return true
end


npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Last edited:
@ up
Thanks!

NEWS!
Added yesterday two npcs and today also two! Buzy with equipment npc now.

NEWS!
Added a npc which buys and sells equipment.
Also added a npc which sells distance ammunition.
Also added a blessing + promote npc (not made by myself).


I've got some question to anybody which is able to answer it :eek:.
Might this script (below) also work with the new shopmodule?
Code:
<?xml version="1.0"?>

<npc name="Furnitura" script="data/npc/scripts/none.lua" access="3" lookdir="1" autowalk="0">
	<health now="1" max="1"/>
	<look type="133" head="98" body="116" legs="43" feet="95" addons="3"/>
	<parameters>
		<parameter key="module_shop" value="2" />
		<parameter key="message_greet" value="Welcome to my Furniture shop,|PLAYERNAME|!" />
                <parameter key="message_farewell" value="Good bye, hope you might come back anytime to my furniture shop." />
		<parameter key="message_walkaway" value="Uhm... Hope you liked my furniture shop..." />

	<parameter key="shop_buyable" value="knight statue,1442,50;minotaur statue,1446,50;goblin statue,1447,50;small table,3903,20;round table,3902,25;square table,3901,25;big table,3938,30;wooden chair,3904,15;rocking chair,3908,25;red cushioned chair,3906,40;green cushioned chair,3907,40;sofa chair,3905,55;indoor plant,3925,8;flower bowl,2102,6;god flower,2100,5;honey flower,2103,5;potted flower,2104,5;small purple pillow,1678,20;small green pillow,1679,20;small red pillow,1680,20;small blue pillow,1681,20;small orange pillow,1683,20;small turquiose pillow,1684,20;small white pillow,1684,20;heart pillow,1685,30;purple pillow,1678,25;green pillow,1679,25;red pillow,1680,25;blue pillow,1681,orange pillow,1682,25;turqoise pillow,25;white pillow,1684,25;round blue pillow,1690,25;round red pillow,1691,25;round purple pillow,1692,25;round turquiose pillow,1693,25;vase,2008,3;coal basin,1485,25;amphora,2023,4;large amphora,2034,50;piano,2080,200;harp,2084,50;water pipe,2093,40;pendulum clock,3911,75;telescope,3918,70;table lamp,2065,35;rocking horse,2116,30;globe,3924,50;birdcage,3923,50;round mirror,1845,40;oval mirror,1851,40;edged mirror,1848,40;landscape picture,1852,50;portrait picture,1854,50;stillife picture,1853,50;cuckoo clock,1873,40;blue tapestry,1872,25;green tapestry,1860,25;orange tapestry,1866,25;pink tapestry,1857,25;red tapestry,1869,25;white tapestry,1880,25;yellow tapestry,1863,25;drawer,1714,18;dresser,1724,25;locker,3912,30;crate,1739,10;chest,1749,10;box,1741,10;barrel,1770,12;trunk,1750,10;trough,1775,7;armour rack,5860,90;weapon rack,5852,90" />
	</parameters>
</npc>


Thanks in advance,
Sentielo
 
Last edited by a moderator:
NEWS!
Added rune npcs, with the buy bp full with runes function. It contains all runes of tibia 8.4 accept the holy rune and it got the rods and wands

NEWS!
Added rashid. He sells the same items as he do in the cipsoft map!

NEWS!
Added Djinn. He sells all the equipment which the 4 djinns of real tibia sells, except rings and amulets ;). I will make 2 others for those ;).
 
Last edited by a moderator:
I got an notification and a question for you.

Notification: Do not double/triple post in a row within 24 hours, if you want to repost, and you have recently posted, just edit your already made post and modify it.

Question: Does theese NPC's have the new NPC window system? Or just the trade window.?
 
shopModule:addBuyableItem({'brown bag'}, 1987, 20, 1, 'brown backpack')

shopModule:addBuyableItem({'basket'}, 1989, 6, 1, 'brown backpack')
Shall it be brown backpack there or bag? (Line 12) , (Line 14)
 
@krille
The brown bag, thanks for reporting it.
And the other line should be the basket.
I will change it.

@znote
Yeah I already noticed that I had to put everything in one line :p.
And I will make (got them almost all) a XML file, which fixes that the npcs got the newest shopmodule if you mean that.
 
shopModule:addSellableItem({'terra hood'}, 7903, , 1, 'terra hood')
error in this tag in rashid

Change for this:
shopModule:addSellableItem({'terra hood'}, 7903, 2500, 1, 'terra hood')

In runes.lua
shopModule:addBuyableItem({'energy field''}, %2
 
Last edited:
And the rashid? Why you remove he?

[28/12/2008 02:02:59] Lua Script Error: [Npc interface]
[28/12/2008 02:02:59] data/npc/scripts/necklaces.lua

[28/12/2008 02:02:59] data/npc/scripts/necklaces.lua:11: attempt to index global 'shopModule' (a nil value)
[28/12/2008 02:02:59] [Warning - NpcScript::NpcScript] Can not load script: data/npc/scripts/necklaces.lua
[28/12/2008 02:02:59] data/npc/scripts/Runes.lua:113: ')' expected near ''wand of voodoo''

[28/12/2008 02:03:34] Lua Script Error: [Npc interface]
[28/12/2008 02:03:34] data/npc/scripts/Jewelry.lua

[28/12/2008 02:03:34] data/npc/scripts/Jewelry.lua:11: attempt to index global 'shopModule' (a nil value)
[28/12/2008 02:03:34] [Warning - NpcScript::NpcScript] Can not load script: data/npc/scripts/Jewelry.lua
[28/12/2008 02:03:34] data/npc/scripts/Runes.lua:113: ')' expected near ''wand of voodoo''
[28/12/2008 02:03:37] Saving server...

[28/12/2008 02:03:37] Lua Script Error: [Npc interface]
[28/12/2008 02:03:37] data/npc/scripts/Jewelry.lua

[28/12/2008 02:03:37] data/npc/scripts/Jewelry.lua:11: attempt to index global 'shopModule' (a nil value)
[28/12/2008 02:03:37] [Warning - NpcScript::NpcScript] Can not load script: data/npc/scripts/Jewelry.lua
[28/12/2008 02:03:37] data/npc/scripts/Runes.lua:113: ')' expected near ''wand of voodoo''

Man what server support this module?
 
Last edited:
Aew a few bugs, not so hard to fix I guess... :p
I removed him because I made the xml files and I want to put the xml file and the lua file under each other ;).
The Forgotten server should support the npcs... What server do you use?
Fixed the rune bug, copy it again.
 
Last edited:
Aew a few bugs, not so hard to fix I guess... :p
I removed him because I made the xml files and I want to put the xml file and the lua file under each other ;).
The Forgotten server should support the npcs... What server do you use?
Fixed the rune bug, copy it again.

I use TFS Mystic Spirit Rev.22!!!
Good luck... :D

Edit: More reports...
Runes.lua
shopModule:addBuyableItem({'blank rune'}, 2260, 10, 1 'blank rune')
change for:
shopModule:addBuyableItem({'blank rune'}, 2260, 10, 1, 'blank rune')

shopModule:addBuyableItemContainer({'bp blank rune'}, 1988, 2260, 220, 1 'bp blank rune')
Change for:
shopModule:addBuyableItemContainer({'bp blank rune'}, 1988, 2260, 220, 1, 'bp blank rune')


EDIT²
Man please post your base library "Lib" why the "shopModule" no work in TFS Mystic Spirit Rev.22 ou in
TFS Version: 0.3 (beta 2)!
 
Last edited:
@ up
I am testing the npcs at the moment and I realised that I had to delete every "1," for an example:
shopModule:addBuyableItem({'blank rune'}, 2260, 10, 1, 'blank rune')
should be:
shopModule:addBuyableItem({'blank rune'}, 2260, 10, 'blank rune')

Wait before you take them over before I change them all is my advice
 
@ up
I am testing the npcs at the moment and I realised that I had to delete every "1," for an example:
shopModule:addBuyableItem({'blank rune'}, 2260, 10, 1, 'blank rune')
should be:
shopModule:addBuyableItem({'blank rune'}, 2260, 10, 'blank rune')

Wait before you take them over before I change them all is my advice

Ohhh Thanks!!! I delete all 1, and the all scripts work now and you need move this:
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

for later of script and no in finish ;]
 
Last edited:
Back
Top