local config = {
payment = 5952, -- ID of Item which you need to get one addon.
amount = 1, -- Amount of Item which you need to get one addon.
addons = { -- Addon Name, Addon ID, Addon ID, Addon Type, Storage
["first citizen"] = { 136, 128, 1, 10001 },
["second citizen"] = { 136, 128, 2, 10002 },
["first hunter"] = { 137, 129, 1, 20001 },
["second hunter"] = { 137, 129, 2, 20002 },
["first knight"] = { 139, 131, 1, 300001 },
["second knight"] = { 139, 131, 2, 300002 },
["first mage"] = { 138, 130, 1, 40001 },
["second mage"] = { 138, 130, 2, 40002 },
["first summoner"] = { 141, 133, 1, 50001 },
["second summoner"] = { 141, 133, 2, 50002 },
["first barbarian"] = { 147, 143, 1, 60001 },
["second barbarian"] = { 147, 143, 2, 60002 },
["first druid"] = { 148, 144, 1, 70001 },
["second druid"] = { 148, 144, 2, 70002 },
["first nobleman"] = { 140, 132, 1, 80001 },
["second nobleman"] = { 140, 132, 2, 80002 },
["first oriental"] = { 150, 146, 1, 99001 },
["second oriental"] = { 150, 146, 2, 90002 },
["first warrior"] = { 142, 134, 1, 100001 },
["second warrior"] = { 142, 134, 2, 100002 },
["first wizard"] = { 145, 149, 1, 110001 },
["second wizard"] = { 145, 149, 2, 110002 },
["first assassin"] = { 156, 152, 1, 120001 },
["second assassin"] = { 156, 152, 2, 120002 },
["first beggar"] = { 157, 153, 1, 130001 },
["second beggar"] = { 157, 153, 2, 130002 },
["first pirate"] = { 155, 151, 1, 140001 },
["second pirate"] = { 155, 151, 2, 140002 },
["first shaman"] = { 158, 154, 1, 150001 },
["second shaman"] = { 158, 154, 2, 150002 },
["first norseman"] = { 251, 252, 1, 160001 },
["second norseman"] = { 251, 252, 2, 160002 },
["first brotherhood"] = { 278, 279, 1, 170001 },
["second brotherhood"] = { 278, 279, 2, 170002 },
["first nightmare"] = { 268, 269, 1, 180001 },
["second nightmare"] = { 268, 269, 2, 180002 },
["first jester"] = { 273, 270, 1, 190001 },
["second jester"] = { 273, 270, 2, 190002 },
["first demonhunter"] = { 289, 288, 1, 200001 },
["second demonhunter"] = { 289, 288, 2, 200002 },
["first yalaharian"] = { 325, 324, 1, 210001 },
["second yalaharian"] = { 325, 324, 2, 210002 },
}
}
function onSay(cid, words, param)
for name, pos in pairs(config.addons) do
if param == name then
if getPlayerItemCount(cid,config.payment) >= config.amount then
addon = getPlayerStorageValue(cid,pos[4])
if addon == -1 then
doPlayerAddOutfit(cid, pos[1], pos[3])
doPlayerAddOutfit(cid, pos[2], pos[3])
doPlayerRemoveItem(cid,config.payment,config.amount)
setPlayerStorageValue(cid,pos[4],1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought the " .. param .. " addon.")
else
doPlayerSendCancel(cid, "You already have this addon.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
else
doPlayerSendCancel(cid, "You don't have a addon scroll to buy this addon.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
end
end
return TRUE
end