local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
-- Storage IDs --
first addons = 22001
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!'
-- ADDONS START --
function AddonsFirst(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
if isPremium(cid) then
addon = player:getStorageValue(cid,first addons)
if addon == -1 then
if player:getItemCount(2160) >= 100 then
if player:removeItem(2160,100) then
selfSay(newaddon, cid)
player:addOutfitAddon(128, 1)
player:addOutfitAddon(136, 1) ------ here make a list of every addon....
player:setStorageValue (first addons,1)
end
else
selfSay(noitems)
end
else
selfSay(already)
end
end
end