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

Addon and Promotion Npc

Otfan125

Well-Known Member
Joined
Mar 1, 2008
Messages
169
Solutions
1
Reaction score
55
Location
Thais
Hello guys, well since i cannot enter ******.net, i'll be on this one more. So what i need is, that if someone could see how to make the Addon npc only give the first and second addon. The npc that i have right now is like real tibia. You need items for the addon. I only want the 5k first addon and 10k second addon. Here is the npc script.
--------------------------------------------------------------------------------------------
------------------------------------ Advanced Addon NPC ------------------------------------
--------------------- Script made by teh_pwnage and bugfixes by Sentielo -------------------
--------------- Special thanks to: mokerhamer, Xidaozu and Jiddo, deaths'life --------------
------------------------------- Thanks also to everyone else -------------------------------
------------------------------ NPC based on TFS 0.2.4 --------------------------------------
--------------------------------------------------------------------------------------------
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

-- OTServ event handling functions start
function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() end
-- OTServ event handling functions end

function creatureSayCallback(cid, type, msg)
-- 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.
if(npcHandler.focus ~= cid) then
return false
end

addon_need_premium = 'Sorry, you need a premium account to get addons.'
addon_have_already = 'Sorry, you already have this addon.'
addon_have_not_items = 'Sorry, you don\'t have these items.'
addon_give = 'Here you are.'
player_gold = getPlayerItemCount(cid,2148)
player_plat = getPlayerItemCount(cid,2152)*100
player_crys = getPlayerItemCount(cid,2160)*10000
player_money = player_gold + player_plat + player_crys

if msgcontains(msg, 'addons') then
selfSay('I can give you Citizen, Hunter, Knight, Mage, Nobleman, Summoner, Warrior, Barbarian, Druid, Wizard, Oriental, Pirate, Assassin, Beggar, Shaman and Norseman addons.')
elseif msgcontains(msg, 'help') then
selfSay('To buy the first addon say \'first NAME addon\', for the second addon say \'second NAME addon\'.')
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'first citizen addon') then
if isPremium(cid) then
if getPlayerItemCount(cid,5878) >= 100 then
selfSay('Did you bring me 100 minotaur leathers?')
talk_state = 1
else
selfSay('I need 100 minotaur leather, to give you the first citizen addon. Come back when you have them.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 1 then
talk_state = 0
if getPlayerItemCount(cid,5878) >= 100 then
addon = getPlayerStorageValue(cid,10001)
if addon == -1 then
if doPlayerTakeItem(cid,5878,100) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 128, 1)
doPlayerAddOutfit(cid, 136, 1)
setPlayerStorageValue(cid,10001,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'second citizen addon') then
if isPremium(cid) then
if getPlayerItemCount(cid,5890) >= 100 and getPlayerItemCount(cid,5902) >= 50 and getPlayerItemCount(cid,2480) >= 1 then
selfSay('Did you bring me 100 chicken feathers, 50 honeycombs and the legion helmet?')
talk_state = 2
else
selfSay('I need 100 chicken feathers, 50 honeycombs and a legion helmet, to give you the second citizen addon. Come back when you have them.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 2 then
talk_state = 0
if getPlayerItemCount(cid,5890) >= 100 and getPlayerItemCount(cid,5902) >= 50 and getPlayerItemCount(cid,2480) >= 1 then
addon = getPlayerStorageValue(cid,10002)
if addon == -1 then
if doPlayerTakeItem(cid,5890,100) == 0 and doPlayerTakeItem(cid,5902,50) == 0 and doPlayerTakeItem(cid,2480,1) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 128, 2)
doPlayerAddOutfit(cid, 136, 2)
setPlayerStorageValue(cid,10002,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'first hunter addon') then
if isPremium(cid) 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
selfSay('Did you bring me the engraved crossbow, 100 lizard leathers, 100 red dragon leather, 5 enchanted chicken wings, royal steel, hell steel and draconian steel?')
talk_state = 3
else
selfSay('I need a engraved crossbow, 100 lizard leathers, 100 red dragon leather, 5 enchanted chicken wings, royal steel, hell steel and draconian steel, to give you the first hunter addon. Come back when you have them.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 3 then
talk_state = 0
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
addon = getPlayerStorageValue(cid,20002)
if addon == -1 then
if doPlayerTakeItem(cid,5947,1) == 0 and doPlayerTakeItem(cid,5876,100) == 0 and doPlayerTakeItem(cid,5948,100) == 0 and doPlayerTakeItem(cid,5891,5) == 0 and doPlayerTakeItem(cid,5887,1) == 0 and doPlayerTakeItem(cid,5888,1) == 0 and doPlayerTakeItem(cid,5889,1) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 129, 1)
doPlayerAddOutfit(cid, 137, 1)
setPlayerStorageValue(cid,20002,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'second hunter addon') then
if isPremium(cid) then
if getPlayerItemCount(cid,5875) >= 1 then
selfSay('Did you bring me the sniper gloves?')
talk_state = 4
else
selfSay('I need sniper gloves, to give you the second hunter addon. Come back when you have them.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 4 then
talk_state = 0
if getPlayerItemCount(cid,5875) >= 1 then
addon = getPlayerStorageValue(cid,20001)
if addon == -1 then
if doPlayerTakeItem(cid,5875,1) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 129, 2)
doPlayerAddOutfit(cid, 137, 2)
setPlayerStorageValue(cid,20001,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'first knight addon') then
if isPremium(cid) then
if getPlayerItemCount(cid,5892) >= 1 and getPlayerItemCount(cid,5880) >= 100 then
selfSay('Did you bring me the chunk of crude iron and 100 iron ores?')
talk_state = 5
else
selfSay('I need a chunk of crude iron and 100 iron ores, to give you the first knight addon. Come back when you have them.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 5 then
talk_state = 0
if getPlayerItemCount(cid,5892) >= 1 and getPlayerItemCount(cid,5880) >= 100 then
addon = getPlayerStorageValue(cid,30001)
if addon == -1 then
if doPlayerTakeItem(cid,5892,1) == 0 and doPlayerTakeItem(cid,5880,100) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 131, 1)
doPlayerAddOutfit(cid, 139, 1)
setPlayerStorageValue(cid,30001,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'second knight addon') then
if isPremium(cid) then
if getPlayerItemCount(cid,5893) >= 100 and getPlayerItemCount(cid,5924) >= 1 and getPlayerItemCount(cid,5885) >= 1 and getPlayerItemCount(cid,5887) >= 1 then
selfSay('Did you bring me 100 behemoth fangs, the damaged steel helmet, warrior\'s sweat, and royal steel?')
talk_state = 6
else
selfSay('I need 100 behemoth fangs, a damaged steel helmet, warrior\'s sweat and royal steel, to give you the second knight addon. Come back when you have them.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 6 then
talk_state = 0
if getPlayerItemCount(cid,5893) >= 100 and getPlayerItemCount(cid,5924) >= 1 and getPlayerItemCount(cid,5885) >= 1 and getPlayerItemCount(cid,5887) >= 1 then
addon = getPlayerStorageValue(cid,30002)
if addon == -1 then
if doPlayerTakeItem(cid,5893,100) == 0 and doPlayerTakeItem(cid,5924,1) == 0 and doPlayerTakeItem(cid,5885,1) == 0 and doPlayerTakeItem(cid,5887,1) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 131, 2)
doPlayerAddOutfit(cid, 139, 2)
setPlayerStorageValue(cid,30002,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'first mage addon') then
if isPremium(cid) then
if getPlayerSex(cid) == 0 then
if getPlayerItemCount(cid,5958) >= 1 then
selfSay('Did you bring me a winning lotery ticket?')
talk_state = 7
else
selfSay('I need a winning lotery ticket, to give you the first mage addon. Come back when you have it.')
talk_state = 0
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
selfSay('Did you bring me all the wands and rods, 10 magic sulphors, 20 ankhs and a soul stone?')
talk_state = 7
else
selfSay('I need all kind of wands and rods, 10 magic sulphurs, 20 ankhs and a soul stone, to give you the first mage addon. Come back when you have it.')
talk_state = 0
end
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 7 then
talk_state = 0
if getPlayerSex(cid) == 0 then
if getPlayerItemCount(cid,5958) >= 1 then
addon = getPlayerStorageValue(cid,40001)
if addon == -1 then
if doPlayerTakeItem(cid,5958,1) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 141, 1)
setPlayerStorageValue(cid,40001,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
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
addon = getPlayerStorageValue(cid,40001)
if addon == -1 then
if doPlayerTakeItem(cid,2181,1) == 0 and doPlayerTakeItem(cid,2182,1) == 0 and doPlayerTakeItem(cid,2183,1) == 0 and doPlayerTakeItem(cid,2185,1) == 0 and doPlayerTakeItem(cid,2186,1) == 0 and doPlayerTakeItem(cid,2187,1) == 0 and doPlayerTakeItem(cid,2188,1) == 0 and doPlayerTakeItem(cid,2189,1) == 0 and doPlayerTakeItem(cid,2190,1) == 0 and doPlayerTakeItem(cid,2191,1) == 0 and doPlayerTakeItem(cid,5904,10) == 0 and doPlayerTakeItem(cid,2193,20) == 0 and doPlayerTakeItem(cid,5809,1) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 130, 1)
setPlayerStorageValue(cid,40001,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'second mage addon') then
if isPremium(cid) 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
selfSay('Did you bring 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?')
talk_state = 8
else
selfSay('I need 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, to give you the second mage addon. Come back when you have it.')
talk_state = 0
end
elseif getPlayerSex(cid) == 1 then
if getPlayerItemCount(cid,5903) >= 1 then
selfSay('Did you bring me the ferumbras hat?')
talk_state = 8
else
selfSay('I need a ferumbras hat to give you the second mage addon. Come back when you have it.')
talk_state = 0
end
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 8 then
talk_state = 0
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
addon = getPlayerStorageValue(cid,40002)
if addon == -1 then
if doPlayerTakeItem(cid,5894,70) and doPlayerTakeItem(cid,5911,20) and doPlayerTakeItem(cid,5883,40) and doPlayerTakeItem(cid,5922,35) and doPlayerTakeItem(cid,5886,10) and doPlayerTakeItem(cid,5881,60) and doPlayerTakeItem(cid,5882,40) and doPlayerTakeItem(cid,5904,15) and doPlayerTakeItem(cid,5905,30) then
selfSay(addon_give)
doPlayerAddOutfit(cid, 141, 2)
setPlayerStorageValue(cid,40002,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
elseif getPlayerSex(cid) == 1 then
if getPlayerItemCount(cid,5903) >= 1 then
addon = getPlayerStorageValue(cid,40002)
if addon == -1 then
if doPlayerTakeItem(cid,5903,1) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 130, 2)
setPlayerStorageValue(cid,40002,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'first summoner addon') then
if isPremium(cid) then
if getPlayerSex(cid) == 1 then
if getPlayerItemCount(cid,5958) >= 1 then
selfSay('Did you bring me a winning lotery ticket?')
talk_state = 9
else
selfSay('I need a winning lotery ticket, to give you the first summoner addon. Come back when you have it.')
talk_state = 0
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
selfSay('Did you bring me all the wands and rods, 10 magic sulphors, 20 ankhs and a soul stone?')
talk_state = 9
else
selfSay('I need all kind of wands and rods, 10 magic sulphurs, 20 ankhs and a soul stone, to give you the first summoner addon. Come back when you have it.')
talk_state = 0
end
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 9 then
talk_state = 0
if getPlayerSex(cid) == 1 then
if getPlayerItemCount(cid,5958) >= 1 then
addon = getPlayerStorageValue(cid,50001)
if addon == -1 then
if doPlayerTakeItem(cid,5958,1) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 133, 1)
setPlayerStorageValue(cid,50001,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
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
addon = getPlayerStorageValue(cid,50001)
if addon == -1 then
if doPlayerTakeItem(cid,2181,1) == 0 and doPlayerTakeItem(cid,2182,1) == 0 and doPlayerTakeItem(cid,2183,1) == 0 and doPlayerTakeItem(cid,2185,1) == 0 and doPlayerTakeItem(cid,2186,1) == 0 and doPlayerTakeItem(cid,2187,1) == 0 and doPlayerTakeItem(cid,2188,1) == 0 and doPlayerTakeItem(cid,2189,1) == 0 and doPlayerTakeItem(cid,2190,1) == 0 and doPlayerTakeItem(cid,2191,1) == 0 and doPlayerTakeItem(cid,5904,10) == 0 and doPlayerTakeItem(cid,2193,20) == 0 and doPlayerTakeItem(cid,5809,1) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 138, 1)
setPlayerStorageValue(cid,50001,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'second summoner addon') then
if isPremium(cid) 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
selfSay('Did you bring 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?')
talk_state = 10
else
selfSay('I need 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, to give you the second summoner addon. Come back when you have it.')
talk_state = 0
end
elseif getPlayerSex(cid) == 0 then
if getPlayerItemCount(cid,5903) >= 1 then
selfSay('Did you bring me the Ferumbrass\' hat?')
talk_state = 10
else
selfSay('I need the famous Ferumbrass\' hat, to give you the second summoner addon. Come back when you have it.')
talk_state = 0
end
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 10 then
talk_state = 0
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
addon = getPlayerStorageValue(cid,50002)
if addon == -1 then
if doPlayerTakeItem(cid,5894,70) and doPlayerTakeItem(cid,5911,20) and doPlayerTakeItem(cid,5883,40) and doPlayerTakeItem(cid,5922,35) and doPlayerTakeItem(cid,5886,10) and doPlayerTakeItem(cid,5881,60) and doPlayerTakeItem(cid,5882,40) and doPlayerTakeItem(cid,5904,15) and doPlayerTakeItem(cid,5905,30) then
selfSay(addon_give)
doPlayerAddOutfit(cid, 133, 2)
setPlayerStorageValue(cid,50002,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
elseif getPlayerSex(cid) == 0 then
if getPlayerItemCount(cid,5903) >= 1 then
addon = getPlayerStorageValue(cid,50002)
if addon == -1 then
if doPlayerTakeItem(cid,5903,1) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 138, 2)
setPlayerStorageValue(cid,50002,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'first barbarian addon') then
if isPremium(cid) 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
selfSay('Did you bring me the fighting spirit, the warrior\'s sweat, 50 red pieces of cloth, 50 green pieces of cloth and 10 spider silk yarns?')
talk_state = 11
else
selfSay('I need fighting spirit, warrior\'s sweat, 50 red pieces of cloth, 50 green pieces of cloth and 10 spider silk yarns, to give you the first barbarian addon. Come back when you have them.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 11 then
talk_state = 0
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
addon = getPlayerStorageValue(cid,60001)
if addon == -1 then
if doPlayerTakeItem(cid,5884,1) == 0 and doPlayerTakeItem(cid,5885,1) == 0 and doPlayerTakeItem(cid,5911,50) == 0 and doPlayerTakeItem(cid,5910,50) == 0 and doPlayerTakeItem(cid,5886,10) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 143, 2)
doPlayerAddOutfit(cid, 147, 2)
setPlayerStorageValue(cid,60001,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'second barbarian addon') then
if isPremium(cid) then
if getPlayerItemCount(cid,5880) >= 100 and getPlayerItemCount(cid,5892) >= 1 and getPlayerItemCount(cid,5893) >= 50 and getPlayerItemCount(cid,5876) >= 50 then
selfSay('Did you bring me 100 iron ore, 1 chunk of crude iron, 50 behemoth fangs and 50 lizard leathers?')
talk_state = 12
else
selfSay('I need 100 iron ore, 1 chunk of crude iron, 50 behemoth fangs and 50 lizard leathers, to give you the second barbarian addon. Come back when you have them.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 12 then
talk_state = 0
if getPlayerItemCount(cid,5880) >= 100 and getPlayerItemCount(cid,5892) >= 1 and getPlayerItemCount(cid,5893) >= 50 and getPlayerItemCount(cid,5876) >= 50 then
addon = getPlayerStorageValue(cid,60002)
if addon == -1 then
if doPlayerTakeItem(cid,5880,100) == 0 and doPlayerTakeItem(cid,5892,1) == 0 and doPlayerTakeItem(cid,5893,50) == 0 and doPlayerTakeItem(cid,5876,50) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 143, 1)
doPlayerAddOutfit(cid, 147, 1)
setPlayerStorageValue(cid,60002,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'first druid addon') then
if isPremium(cid) then
if getPlayerItemCount(cid,5897) >= 50 and getPlayerItemCount(cid,5896) >= 50 then
selfSay('Did you bring me 50 wolf paws and 50 bear paws?')
talk_state = 13
else
selfSay('I need 50 wolf paws and 50 bear paws, to give you the first druid addon. Come back when you have them.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 13 then
talk_state = 0
if getPlayerItemCount(cid,5897) >= 50 and getPlayerItemCount(cid,5896) >= 50 then
addon = getPlayerStorageValue(cid,70001)
if addon == -1 then
if doPlayerTakeItem(cid,5897,50) == 0 and doPlayerTakeItem(cid,5896,50) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 144, 1)
doPlayerAddOutfit(cid, 148, 1)
setPlayerStorageValue(cid,70001,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'second druid addon') then
if isPremium(cid) then
if getPlayerItemCount(cid,5937) >= 1 and getPlayerItemCount(cid,5938) >= 1 and getPlayerItemCount(cid,5906) >= 100 and getPlayerItemCount(cid,5940) >= 1 then
selfSay('Did you bring me 100 demon dusts, ceiron his wolf tooth chain, the water from the hydra cave and the botanist container?')
talk_state = 14
else
selfSay('I need 100 demon dusts, ceiron his wolf tooth chain, the water from the hydra cave and the botanist container to give you the second druid addon. Come back when you have them.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 14 then
talk_state = 0
if getPlayerItemCount(cid,5906) >= 100 then
addon = getPlayerStorageValue(cid,70002)
if addon == -1 then
if doPlayerTakeItem(cid,5906,100) == 0 and doPlayerTakeItem(cid,5938,1) >=1 and doPlayerTakeItem(cid,5906,100) >=100 and doPlayerTakeItem(cid,5940,1) >=1 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 144, 2)
doPlayerAddOutfit(cid, 148, 2)
setPlayerStorageValue(cid,70002,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'first nobleman addon') then
if isPremium(cid) then
if player_money >= 150000 then
selfSay('Did you bring me 150000 gold coins?')
talk_state = 15
else
selfSay('I need 150000 gold coins, to give you the first nobleman addon. Come back when you have them.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 15 then
talk_state = 0
if player_money >= 150000 then
addon = getPlayerStorageValue(cid,80001)
if addon == -1 then
if doPlayerRemoveMoney(cid,150000) then
selfSay(addon_give)
doPlayerAddOutfit(cid, 132, 1)
doPlayerAddOutfit(cid, 140, 1)
setPlayerStorageValue(cid,80001,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'second nobleman addon') then
if isPremium(cid) then
if player_money >= 150000 then
selfSay('Did you bring me 150000 gold coins?')
talk_state = 16
else
selfSay('I need 150000 gold coins, to give you the second nobleman addon. Come back when you have them.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 16 then
talk_state = 0
if player_money >= 150000 then
addon = getPlayerStorageValue(cid,80002)
if addon == -1 then
if doPlayerRemoveMoney(cid,150000) then
selfSay(addon_give)
doPlayerAddOutfit(cid, 132, 2)
doPlayerAddOutfit(cid, 140, 2)
setPlayerStorageValue(cid,80002,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'first oriental addon') then
if isPremium(cid) then
if getPlayerItemCount(cid,5945) >= 1 then
selfSay('Did you bring me the mermaid comb?')
talk_state = 17
else
selfSay('I need a mermaid comb, to give you the first oriental addon. Come back when you have it.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 17 then
talk_state = 0
if getPlayerItemCount(cid,5945) >= 1 then
addon = getPlayerStorageValue(cid,90001)
if addon == -1 then
if doPlayerTakeItem(cid,5945,1) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 146, 1)
doPlayerAddOutfit(cid, 150, 1)
setPlayerStorageValue(cid,90001,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'second oriental addon') then
if isPremium(cid) then
if getPlayerItemCount(cid,5883) >= 100 and getPlayerItemCount(cid,5895) >= 100 and getPlayerItemCount(cid,5891) >= 2 and getPlayerItemCount(cid,5912) >= 100 then
selfSay('Did you bring me 100 ape furs, 100 fish fins, 2 enchanted chicken wings and 100 blue pieces of cloth?')
talk_state = 18
else
selfSay('I need 100 ape furs, 100 fish fins, 2 enchanted chicken wings and 100 blue pieces of cloth, to give you the second oriental addon. Come back when you have them.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 18 then
talk_state = 0
if getPlayerItemCount(cid,5883) >= 100 and getPlayerItemCount(cid,5895) >= 100 and getPlayerItemCount(cid,5891) >= 2 and getPlayerItemCount(cid,5912) >= 100 then
addon = getPlayerStorageValue(cid,90002)
if addon == -1 then
if doPlayerTakeItem(cid,5883,100) == 0 and doPlayerTakeItem(cid,5895,100) == 0 and doPlayerTakeItem(cid,5891,2) == 0 and doPlayerTakeItem(cid,5912,100) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 146, 2)
doPlayerAddOutfit(cid, 150, 2)
setPlayerStorageValue(cid,90002,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'first warrior addon') then
if isPremium(cid) then
if getPlayerItemCount(cid,5925) >= 100 and getPlayerItemCount(cid,5899) >= 100 and getPlayerItemCount(cid,5884) >= 1 and getPlayerItemCount(cid,5919) >= 1 then
selfSay('Did you bring me 100 hardened bones, 100 turtle shells, fighting spirit and a dragon claw?')
talk_state = 19
else
selfSay('I need 100 hardened bones, 100 turtle shells, fighting spirit and a dragon claw, to give you the first warrior addon. Come back when you have it.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 19 then
talk_state = 0
if getPlayerItemCount(cid,5925) >= 100 and getPlayerItemCount(cid,5899) >= 100 and getPlayerItemCount(cid,5884) >= 1 and getPlayerItemCount(cid,5919) >= 1 then
addon = getPlayerStorageValue(cid,100001)
if addon == -1 then
if doPlayerTakeItem(cid,5925,100) == 0 and doPlayerTakeItem(cid,5899,100) == 0 and doPlayerTakeItem(cid,5884,1) == 0 and doPlayerTakeItem(cid,5919,1) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 134, 1)
doPlayerAddOutfit(cid, 142, 1)
setPlayerStorageValue(cid,100001,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'second warrior addon') then
if isPremium(cid) then
if getPlayerItemCount(cid,5887) >= 1 and getPlayerItemCount(cid,5880) >= 100 then
selfSay('Did you bring me 100 iron ores and royal steel?')
talk_state = 20
else
selfSay('I need 100 iron ores and royal steel, to give you the second warrior addon. Come back when you have them.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 20 then
talk_state = 0
if getPlayerItemCount(cid,5887) >= 1 and getPlayerItemCount(cid,5880) >= 100 then
addon = getPlayerStorageValue(cid,100002)
if addon == -1 then
if doPlayerTakeItem(cid,5887,1) == 0 and doPlayerTakeItem(cid,5880,100) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 134, 2)
doPlayerAddOutfit(cid, 142, 2)
setPlayerStorageValue(cid,100002,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'first wizard addon') then
if isPremium(cid) then
if getPlayerItemCount(cid,2488) >= 1 and getPlayerItemCount(cid,2123) >= 1 and getPlayerItemCount(cid,2492) >= 1 and getPlayerItemCount(cid,2536) >= 1 then
selfSay('Did you bring me a medusa shield, a dragon scale mail, a ring of the sky and crown legs?')
talk_state = 21
else
selfSay('I need a medusa shield, a dragon scale mail, a ring od the sky and crown legs, to give you the first wizard addon. Come back when you have it.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 21 then
talk_state = 0
if getPlayerItemCount(cid,2488) >= 1 and getPlayerItemCount(cid,2123) >= 1 and getPlayerItemCount(cid,2492) >= 1 and getPlayerItemCount(cid,2536) >= 1 then
addon = getPlayerStorageValue(cid,110001)
if addon == -1 then
if doPlayerTakeItem(cid,2488,1) == 0 and doPlayerTakeItem(cid,2123,1) == 0 and doPlayerTakeItem(cid,2492,1) == 0 and doPlayerTakeItem(cid,2536,1) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 145, 2)
doPlayerAddOutfit(cid, 149, 2)
setPlayerStorageValue(cid,110001,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'second wizard addon') then
if isPremium(cid) then
if getPlayerItemCount(cid,5922) >= 50 and getPlayerStorageValue(cid,110001) then
selfSay('Did you bring me 50 holy orchids?')
talk_state = 22
else
selfSay('I need 50 holy orchids and you must have a skull mask or a snake tiara, to give you the second wizard addon. Come back when you have them.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 22 then
talk_state = 0
if getPlayerItemCount(cid,5922) >= 50 then
addon = getPlayerStorageValue(cid,110002)
if addon == -1 then
if doPlayerTakeItem(cid,5922,50) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 145, 1)
doPlayerAddOutfit(cid, 149, 1)
setPlayerStorageValue(cid,110002,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'first assassin addon') then
if isPremium(cid) 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
selfSay('Did you bring me 30 beholder eyes, 10 red dragon scales, 30 lizard scales, 20 fish fins, 20 vampire dusts, 10 demon dusts and Warrior\'s sweat?')
talk_state = 23
else
selfSay('I need 30 beholder eyes, 10 red dragon scales, 30 lizard scales, 20 fish fins, 20 vampire dusts, 10 demon dusts and Warrior\'s sweat, to give you the first assassin addon. Come back when you have it.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 23 then
talk_state = 0
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
addon = getPlayerStorageValue(cid,120001)
if addon == -1 then
if doPlayerTakeItem(cid,5898,30) == 0 and doPlayerTakeItem(cid,5882,10) == 0 and doPlayerTakeItem(cid,5881,30) == 0 and doPlayerTakeItem(cid,5895,20) == 0 and doPlayerTakeItem(cid,5905,20) == 0 and doPlayerTakeItem(cid,5906,10) == 0 and doPlayerTakeItem(cid,5885,1) then
selfSay(addon_give)
doPlayerAddOutfit(cid, 152, 1)
doPlayerAddOutfit(cid, 156, 1)
setPlayerStorageValue(cid,120001,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'second assassin addon') then
if isPremium(cid) 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
selfSay('Did you bring 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?')
talk_state = 24
else
selfSay('I need 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, to give you the second assassin addon. Come back when you have them.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 24 then
talk_state = 0
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
addon = getPlayerStorageValue(cid,120002)
if addon == -1 then
if doPlayerTakeItem(cid,5909,50) == 0 and doPlayerTakeItem(cid,5910,50) == 0 and doPlayerTakeItem(cid,5911,50) == 0 and doPlayerTakeItem(cid,5912,50) == 0 and doPlayerTakeItem(cid,5913,50) == 0 and doPlayerTakeItem(cid,5914,50) == 0 and doPlayerTakeItem(cid,5886,10) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 152, 2)
doPlayerAddOutfit(cid, 156, 2)
setPlayerStorageValue(cid,120002,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'first beggar addon') then
if isPremium(cid) then
if getPlayerItemCount(cid,5883) >= 100 and player_money >= 20000 then
selfSay('Did you bring me 100 ape furs and 20000 gold coins?')
talk_state = 25
else
selfSay('I need 100 ape furs and 20000 gold coins, to give you the first beggar addon. Come back when you have it.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 25 then
talk_state = 0
if getPlayerItemCount(cid,5883) >= 100 and player_money >= 20000 then
addon = getPlayerStorageValue(cid,130001)
if addon == -1 then
if doPlayerTakeItem(cid,5883,100) == 0 and doPlayerRemoveMoney(cid,20000) then
selfSay(addon_give)
doPlayerAddOutfit(cid, 153, 1)
doPlayerAddOutfit(cid, 157, 1)
setPlayerStorageValue(cid,130001,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'second beggar addon') then
if isPremium(cid) then
if getPlayerItemCount(cid,6107) >= 1 then
selfSay('Did you bring me Simon\'s favourite staff?')
talk_state = 26
else
selfSay('I need Simon\'s favourite staff, to give you the second beggar addon. Come back when you have them.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 26 then
talk_state = 0
if getPlayerItemCount(cid,6107) >= 1 then
addon = getPlayerStorageValue(cid,130002)
if addon == -1 then
if doPlayerTakeItem(cid,6107,1) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 153, 2)
doPlayerAddOutfit(cid, 157, 2)
setPlayerStorageValue(cid,130002,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'first pirate addon') then
if isPremium(cid) then
if getPlayerItemCount(cid,6126) >= 100 and getPlayerItemCount(cid,6097) >= 100 and getPlayerItemCount(cid,6098) >= 100 then
selfSay('Did you bring me 100 eye patches, 100 peg legs and 100 hooks?')
talk_state = 27
else
selfSay('I need 100 eye patches, 100 peg legs and 100 hooks, to give you the first pirate addon. Come back when you have it.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 27 then
talk_state = 0
if getPlayerItemCount(cid,6126) >= 100 and getPlayerItemCount(cid,6097) >= 100 and getPlayerItemCount(cid,6098) >= 100 then
addon = getPlayerStorageValue(cid,140001)
if addon == -1 then
if doPlayerTakeItem(cid,6126,100) == 0 and doPlayerTakeItem(cid,6097,100) == 0 and doPlayerTakeItem(cid,6098,100) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 151, 1)
doPlayerAddOutfit(cid, 155, 1)
setPlayerStorageValue(cid,140001,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'second pirate addon') then
if isPremium(cid) then
if getPlayerItemCount(cid,6101) >= 1 and getPlayerItemCount(cid,6102) >= 1 and getPlayerItemCount(cid,6099) >= 1 and getPlayerItemCount(cid,6100) >= 1 then
selfSay('Did you bring me Ron the Ripper\'s Sabre, the Deadeye Devious\' Eye Patch, the Brutus Bloodbeard\'s hat and the Lethal Lissy\'s Shirt?')
talk_state = 28
else
selfSay('I need Ron the Ripper\'s Sabre, the Deadeye Devious\' Eye Patch, the Brutus Bloodbeard\'s hat and the Lethal Lissy\'s Shirt to give you the second pirate addon. Come back when you have them.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 28 then
talk_state = 0
if getPlayerItemCount(cid,6101) >= 1 and getPlayerItemCount(cid,6102) >= 1 and getPlayerItemCount(cid,6099) >= 1 and getPlayerItemCount(cid,6100) >= 1 then
addon = getPlayerStorageValue(cid,140002)
if addon == -1 then
if doPlayerTakeItem(cid,6101,1) == 0 and doPlayerTakeItem(cid,6102,1) == 0 and doPlayerTakeItem(cid,6099,1) == 0 and doPlayerTakeItem(cid,6100,1) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 151, 2)
doPlayerAddOutfit(cid, 155, 2)
setPlayerStorageValue(cid,140002,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'first shaman addon') then
if isPremium(cid) then
if getPlayerItemCount(cid,3955) >= 5 and getPlayerItemCount(cid,5015) >= 1 then
selfSay('Did you bring me 5 dworc vodoo dolls and a mandrake?')
talk_state = 29
else
selfSay('I need 5 dworc vodoo dolls and a mandrake, to give you the first shaman addon. Come back when you have it.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 29 then
talk_state = 0
if getPlayerItemCount(cid,3955) >= 5 and getPlayerItemCount(cid,5015) >= 1 then
addon = getPlayerStorageValue(cid,150001)
if addon == -1 then
if doPlayerTakeItem(cid,3955,5) == 0 and doPlayerTakeItem(cid,5015,1) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 154, 1)
doPlayerAddOutfit(cid, 158, 1)
setPlayerStorageValue(cid,150001,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'second shaman addon') then
if isPremium(cid) then
if getPlayerItemCount(cid,3966) >= 5 and getPlayerItemCount(cid,3967) >= 5 then
selfSay('Did you bring me 5 banana staffs and 5 tribal masks?')
talk_state = 30
else
selfSay('I need 5 banana staffs and 5 tribal masks, to give you the second shaman addon. Come back when you have them.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 30 then
talk_state = 0
if getPlayerItemCount(cid,3966) >= 5 and getPlayerItemCount(cid,3967) >= 5 then
addon = getPlayerStorageValue(cid,150002)
if addon == -1 then
if doPlayerTakeItem(cid,3966,5) == 0 and doPlayerTakeItem(cid,3967,5) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 154, 2)
doPlayerAddOutfit(cid, 158, 2)
setPlayerStorageValue(cid,150002,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'first norseman addon') then
if isPremium(cid) then
if getPlayerItemCount(cid,7290) >= 5 then
selfSay('Excellent, Did you bring me 5 shard?')
talk_state = 31
else
selfSay('I need 5 shard, to give you the first norseman addon. Come back when you have them.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 31 then
talk_state = 0
if getPlayerItemCount(cid,7290) >= 5 then
addon = getPlayerStorageValue(cid,150003)
if addon == -1 then
if doPlayerTakeItem(cid,7290,5) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 251, 1)
doPlayerAddOutfit(cid, 252, 1)
setPlayerStorageValue(cid,150003,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'second norseman addon') then
if isPremium(cid) then
if getPlayerItemCount(cid,7290) >= 10 then
selfSay('Did you bring me 10 shard?')
talk_state = 32
else
selfSay('I need 10 shard, to give you the second norseman addon. Come back when you have them.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 32 then
talk_state = 0
if getPlayerItemCount(cid,7290) >= 10 then
addon = getPlayerStorageValue(cid,150004)
if addon == -1 then
if doPlayerTakeItem(cid,7290,10) == 0 then
selfSay(addon_give)
doPlayerAddOutfit(cid, 251, 2)
doPlayerAddOutfit(cid, 252, 2)
setPlayerStorageValue(cid,150004,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ confirm no ------------------------------------------------
elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 34) 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())

So, i dont know how to change all of that for just 5k first addon and 10k second addon. Who can help me ?


Also, the Promotion npc. I need one ! and i cannot find one in here ! does someone know a link to it ?


Also, here is my global.lua, if i need to make any changes.

--dofile(getDataDir() .. 'functions.lua')

-- Storages consts
STORAGE_RUM_MACHINE = 100000

-- Booleans consts
TRUE = 1
FALSE = 0

-- Error consts
LUA_ERROR = -1
LUA_NO_ERROR = 0

CONTAINER_POSITION = 65535

-- Directions consts
NORTH = 0
EAST = 1
SOUTH = 2
WEST = 3
SOUTHWEST = 4
SOUTHEAST = 5
NORTHWEST = 6
NORTHEAST = 7

-- World Types consts
WORLD_TYPE_NO_PVP = 1
WORLD_TYPE_PVP = 2
WORLD_TYPE_PVP_ENFORCED = 3

COMBAT_FORMULA_UNDEFINED = 0
COMBAT_FORMULA_LEVELMAGIC = 1
COMBAT_FORMULA_SKILL = 2
COMBAT_FORMULA_DAMAGE = 3

CONDITION_PARAM_OWNER = 1
CONDITION_PARAM_TICKS = 2
CONDITION_PARAM_OUTFIT = 3
CONDITION_PARAM_HEALTHGAIN = 4
CONDITION_PARAM_HEALTHTICKS = 5
CONDITION_PARAM_MANAGAIN = 6
CONDITION_PARAM_MANATICKS = 7
CONDITION_PARAM_DELAYED = 8
CONDITION_PARAM_SPEED = 9
CONDITION_PARAM_LIGHT_LEVEL = 10
CONDITION_PARAM_LIGHT_COLOR = 11
CONDITION_PARAM_SOULGAIN = 12
CONDITION_PARAM_SOULTICKS = 13
CONDITION_PARAM_MINVALUE = 14
CONDITION_PARAM_MAXVALUE = 15
CONDITION_PARAM_STARTVALUE = 16
CONDITION_PARAM_TICKINTERVAL = 17
CONDITION_PARAM_FORCEUPDATE = 18
CONDITION_PARAM_SKILL_MELEE = 19
CONDITION_PARAM_SKILL_FIST = 20
CONDITION_PARAM_SKILL_CLUB = 21
CONDITION_PARAM_SKILL_SWORD = 22
CONDITION_PARAM_SKILL_AXE = 23
CONDITION_PARAM_SKILL_DISTANCE = 24
CONDITION_PARAM_SKILL_SHIELD = 25
CONDITION_PARAM_SKILL_FISHING = 26
CONDITION_PARAM_STAT_MAXHITPOINTS = 27
CONDITION_PARAM_STAT_MAXMANAPOINTS = 28
CONDITION_PARAM_STAT_SOULPOINTS = 29
CONDITION_PARAM_STAT_MAGICPOINTS = 30
CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT = 31
CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT = 32
CONDITION_PARAM_STAT_SOULPOINTSPERCENT = 33
CONDITION_PARAM_STAT_MAGICPOINTSPERCENT = 34

COMBAT_PARAM_TYPE = 1
COMBAT_PARAM_EFFECT = 2
COMBAT_PARAM_DISTANCEEFFECT = 3
COMBAT_PARAM_BLOCKSHIELD = 4
COMBAT_PARAM_BLOCKARMOR = 5
COMBAT_PARAM_TARGETCASTERORTOPMOST = 6
COMBAT_PARAM_CREATEITEM = 7
COMBAT_PARAM_AGGRESSIVE = 8
COMBAT_PARAM_DISPEL = 9

CALLBACK_PARAM_LEVELMAGICVALUE = 1
CALLBACK_PARAM_SKILLVALUE = 2
CALLBACK_PARAM_TARGETTILE = 3
CALLBACK_PARAM_TARGETCREATURE = 4

COMBAT_NONE = 0
COMBAT_PHYSICALDAMAGE = 1
COMBAT_ENERGYDAMAGE = 2
COMBAT_POISONDAMAGE = 4 --Deprecated
COMBAT_EARTHDAMAGE = 4
COMBAT_FIREDAMAGE = 8
COMBAT_UNDEFINEDDAMAGE = 16
COMBAT_LIFEDRAIN = 32
COMBAT_MANADRAIN = 64
COMBAT_HEALING = 128
COMBAT_DROWNDAMAGE = 256
COMBAT_ICEDAMAGE = 512
COMBAT_HOLYDAMAGE = 1024
COMBAT_DEATHDAMAGE = 2048

CONDITION_NONE = 0
CONDITION_POISON = 1
CONDITION_FIRE = 2
CONDITION_ENERGY = 4
CONDITION_LIFEDRAIN = 8
CONDITION_HASTE = 16
CONDITION_PARALYZE = 32
CONDITION_OUTFIT = 64
CONDITION_INVISIBLE = 128
CONDITION_LIGHT = 256
CONDITION_MANASHIELD = 512
CONDITION_INFIGHT = 1024
CONDITION_DRUNK = 2048
CONDITION_EXHAUSTED = 4096
CONDITION_FOOD = 8192
CONDITION_REGENERATION = 8192
CONDITION_SOUL = 16384
CONDITION_DROWN = 32768
CONDITION_MUTED = 65536
CONDITION_ATTRIBUTES = 131072
CONDITION_FREEZING = 262144
CONDITION_DAZZLED = 524288
CONDITION_CURSED = 1048576

PLAYERLOSS_EXPERIENCE = 0
PLAYERLOSS_MANA = 1
PLAYERLOSS_SKILL = 2

CONST_SKILL_FIST = 0
CONST_SKILL_CLUB = 1
CONST_SKILL_SWORD = 2
CONST_SKILL_AXE = 3
CONST_SKILL_DISTANCE = 4
CONST_SKILL_SHIELDING = 5
CONST_SKILL_FISHING = 6

CONST_SLOT_HEAD = 1
CONST_SLOT_NECKLACE = 2
CONST_SLOT_BACKPACK = 3
CONST_SLOT_ARMOR = 4
CONST_SLOT_RIGHT = 5
CONST_SLOT_LEFT = 6
CONST_SLOT_LEGS = 7
CONST_SLOT_FEET = 8
CONST_SLOT_RING = 9
CONST_SLOT_AMMO = 10

CONST_ME_DRAWBLOOD = 0
CONST_ME_LOSEENERGY = 1
CONST_ME_POFF = 2
CONST_ME_BLOCKHIT = 3
CONST_ME_EXPLOSIONAREA = 4
CONST_ME_EXPLOSIONHIT = 5
CONST_ME_FIREAREA = 6
CONST_ME_YELLOW_RINGS = 7
CONST_ME_GREEN_RINGS = 8
CONST_ME_HITAREA = 9
CONST_ME_TELEPORT = 10
CONST_ME_ENERGYHIT = 11
CONST_ME_MAGIC_BLUE = 12
CONST_ME_MAGIC_RED = 13
CONST_ME_MAGIC_GREEN = 14
CONST_ME_HITBYFIRE = 15
CONST_ME_HITBYPOISON = 16
CONST_ME_MORTAREA = 17
CONST_ME_SOUND_BLUE = 18
CONST_ME_SOUND_RED = 19
CONST_ME_POISONAREA = 20
CONST_ME_SOUND_YELLOW = 21
CONST_ME_SOUND_PURPLE = 22
CONST_ME_SOUND_BLUE = 23
CONST_ME_SOUND_WHITE = 24
CONST_ME_BUBBLES = 25
CONST_ME_CRAPS = 26
CONST_ME_GIFT_WRAPS = 27
CONST_ME_FIREWORK_YELLOW = 28
CONST_ME_FIREWORK_RED = 29
CONST_ME_FIREWORK_BLUE = 30
CONST_ME_STUN = 31
CONST_ME_SLEEP = 32
CONST_ME_WATERCREATURE = 33
CONST_ME_GROUNDSHAKER = 34
CONST_ME_HEARTS = 35
CONST_ME_FIREATTACK = 36
CONST_ME_ENERGYAREA = 37
CONST_ME_SMALLCLOUDS = 38
CONST_ME_HOLYDAMAGE = 39
CONST_ME_BIGCLOUDS = 40
CONST_ME_ICEAREA = 41
CONST_ME_ICETORNADO = 42
CONST_ME_ICEATTACK = 43
CONST_ME_STONES = 44
CONST_ME_SMALLPLANTS = 45
CONST_ME_CARNIPHILA = 46
CONST_ME_PURPLEENERGY = 47
CONST_ME_YELLOWENERGY = 48
CONST_ME_HOLYAREA = 49
CONST_ME_BIGPLANTS = 50
CONST_ME_CAKE = 51
CONST_ME_GIANTICE = 52
CONST_ME_WATERSPLASH = 53
CONST_ME_PLANTATTACK = 54
CONST_ME_NONE = 255

CONST_ANI_SPEAR = 0
CONST_ANI_BOLT = 1
CONST_ANI_ARROW = 2
CONST_ANI_FIRE = 3
CONST_ANI_ENERGY = 4
CONST_ANI_POISONARROW = 5
CONST_ANI_BURSTARROW = 6
CONST_ANI_THROWINGSTAR = 7
CONST_ANI_THROWINGKNIFE = 8
CONST_ANI_SMALLSTONE = 9
CONST_ANI_DEATH = 10
CONST_ANI_LARGEROCK = 11
CONST_ANI_SNOWBALL = 12
CONST_ANI_POWERBOLT = 13
CONST_ANI_POISON = 14
CONST_ANI_INFERNALBOLT = 15
CONST_ANI_HUNTINGSPEAR = 16
CONST_ANI_ENCHANTEDSPEAR = 17
CONST_ANI_ASSASSINSTAR = 18
CONST_ANI_GREENSTAR = 19
CONST_ANI_ROYALSPEAR = 20
CONST_ANI_SNIPERARROW = 21
CONST_ANI_ONYXARROW = 22
CONST_ANI_PIERCINGBOLT = 23
CONST_ANI_WHIRLWINDSWORD = 24
CONST_ANI_WHIRLWINDAXE = 25
CONST_ANI_WHIRLWINDCLUB = 26
CONST_ANI_ETHEREALSPEAR = 27
CONST_ANI_ICE = 28
CONST_ANI_EARTH = 29
CONST_ANI_HOLY = 30
CONST_ANI_SUDDENDEATH = 31
CONST_ANI_FLASHARROW = 32
CONST_ANI_FLAMMINGARROW = 33
CONST_ANI_SHIVERARROW = 34
CONST_ANI_ENERGYBALL = 35
CONST_ANI_SMALLICE = 36
CONST_ANI_SMALLHOLY = 37
CONST_ANI_SMALLEARTH = 38
CONST_ANI_EARTHARROW = 39
CONST_ANI_EXPLOSION = 40
CONST_ANI_CAKE = 41
CONST_ANI_WEAPONTYPE = 254
CONST_ANI_NONE = 255

TALKTYPE_SAY = 1
TALKTYPE_WHISPER = 2
TALKTYPE_YELL = 3
TALKTYPE_PRIVATE = 4
TALKTYPE_CHANNEL_Y = 5
TALKTYPE_BROADCAST = 9
TALKTYPE_CHANNEL_R1 = 10
TALKTYPE_PRIVATE_RED = 11
TALKTYPE_CHANNEL_O = 12
TALKTYPE_CHANNEL_R2 = 14
TALKTYPE_ORANGE_1 = 16
TALKTYPE_ORANGE_2 = 17

MESSAGE_STATUS_WARNING = 18
MESSAGE_EVENT_ADVANCE = 19
MESSAGE_EVENT_DEFAULT = 20
MESSAGE_STATUS_DEFAULT = 21
MESSAGE_INFO_DESCR = 22
MESSAGE_STATUS_SMALL = 23
MESSAGE_STATUS_CONSOLE_BLUE = 24
MESSAGE_STATUS_CONSOLE_RED = 25

TEXTCOLOR_BLUE = 5
TEXTCOLOR_LIGHTBLUE = 35
TEXTCOLOR_LIGHTGREEN = 30
TEXTCOLOR_PURPLE = 83
TEXTCOLOR_LIGHTGREY = 129
TEXTCOLOR_DARKRED = 144
TEXTCOLOR_RED = 180
TEXTCOLOR_ORANGE = 198
TEXTCOLOR_YELLOW = 210
TEXTCOLOR_WHITE_EXP = 215
TEXTCOLOR_NONE = 255

STACKPOS_FLOOR = 0
STACKPOS_CREATURE = 253
STACKPOS_FIELD = 254
STACKPOS_MOV_OBJECT = 255

RETURNVALUE_NOERROR = 1
RETURNVALUE_NOTPOSSIBLE = 2
RETURNVALUE_NOTENOUGHROOM = 3
RETURNVALUE_PLAYERISPZLOCKED = 4
RETURNVALUE_PLAYERISNOTINVITED = 5
RETURNVALUE_CANNOTTHROW = 6
RETURNVALUE_THEREISNOWAY = 7
RETURNVALUE_DESTINATIONOUTOFREACH = 8
RETURNVALUE_CREATUREBLOCK = 9
RETURNVALUE_NOTMOVEABLE = 10
RETURNVALUE_DROPTWOHANDEDITEM = 11
RETURNVALUE_BOTHHANDSNEEDTOBEFREE = 12
RETURNVALUE_CANONLYUSEONEWEAPON = 13
RETURNVALUE_NEEDEXCHANGE = 14
RETURNVALUE_CANNOTBEDRESSED = 15
RETURNVALUE_PUTTHISOBJECTINYOURHAND = 16
RETURNVALUE_PUTTHISOBJECTINBOTHHANDS = 17
RETURNVALUE_TOOFARAWAY = 18
RETURNVALUE_FIRSTGODOWNSTAIRS = 19
RETURNVALUE_FIRSTGOUPSTAIRS = 20
RETURNVALUE_CONTAINERNOTENOUGHROOM = 21
RETURNVALUE_NOTENOUGHCAPACITY = 22
RETURNVALUE_CANNOTPICKUP = 23
RETURNVALUE_THISISIMPOSSIBLE = 24
RETURNVALUE_DEPOTISFULL = 25
RETURNVALUE_CREATUREDOESNOTEXIST = 26
RETURNVALUE_CANNOTUSETHISOBJECT = 27
RETURNVALUE_PLAYERWITHTHISNAMEISNOTONLINE = 28
RETURNVALUE_NOTREQUIREDLEVELTOUSERUNE = 29
RETURNVALUE_YOUAREALREADYTRADING = 30
RETURNVALUE_THISPLAYERISALREADYTRADING = 31
RETURNVALUE_YOUMAYNOTLOGOUTDURINGAFIGHT = 32
RETURNVALUE_DIRECTPLAYERSHOOT = 33
RETURNVALUE_NOTENOUGHLEVEL = 34
RETURNVALUE_NOTENOUGHMAGICLEVEL = 35
RETURNVALUE_NOTENOUGHMANA = 36
RETURNVALUE_NOTENOUGHSOUL = 37
RETURNVALUE_YOUAREEXHAUSTED = 38
RETURNVALUE_PLAYERISNOTREACHABLE = 39
RETURNVALUE_CANONLYUSETHISRUNEONCREATURES = 40
RETURNVALUE_ACTIONNOTPERMITTEDINPROTECTIONZONE = 41
RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER = 42
RETURNVALUE_YOUMAYNOTATTACKAPERSONINPROTECTIONZONE = 43
RETURNVALUE_YOUMAYNOTATTACKAPERSONWHILEINPROTECTIONZONE = 44
RETURNVALUE_YOUMAYNOTATTACKTHISCREATURE = 45
RETURNVALUE_YOUCANONLYUSEITONCREATURES = 46
RETURNVALUE_CREATUREISNOTREACHABLE = 47
RETURNVALUE_TURNSECUREMODETOATTACKUNMARKEDPLAYERS = 48
RETURNVALUE_YOUNEEDPREMIUMACCOUNT = 49
RETURNVALUE_YOUNEEDTOLEARNTHISSPELL = 50
RETURNVALUE_YOURVOCATIONCANNOTUSETHISSPELL = 51
RETURNVALUE_YOUNEEDAWEAPONTOUSETHISSPELL = 52

closedDoors = {1209, 1210, 1212, 1213, 1219, 1221, 1231, 1232, 1234, 1235, 1237, 1239, 1249, 1250, 1252, 1253, 1539, 1541, 3535, 3536, 3538, 3544, 3545, 3547, 4913, 4914, 4916, 4917, 5082, 5084, 5098, 5099, 5101, 5107, 5108, 5110, 5116, 5117, 5119, 5125, 5126, 5128, 5134, 5135, 5137, 5138, 5140, 5141, 5143, 5144, 5278, 5279, 5281, 5282, 5284, 5286, 5515, 5517, 5732, 5733, 5735, 5736, 6192, 6193, 6195, 6196, 6198, 6200, 6249, 6250, 6252, 6253, 6255, 6257, 6795, 6797, 6799, 6801, 6891, 6892, 6894, 6900, 6901, 6903, 7033, 7034, 7036, 7042, 7043, 7045, 7054, 7056}
openDoors = {1211, 1211, 1214, 1214, 1220, 1222, 1233, 1233, 1236, 1236, 1238, 1240, 1251, 1251, 1254, 1254, 1540, 1542, 3537, 3537, 3539, 3546, 3546, 3548, 4915, 4915, 4918, 4918, 5083, 5085, 5100, 5100, 5102, 5109, 5109, 5111, 5118, 5118, 5120, 5127, 5127, 5129, 5136, 5136, 5139, 5139, 5142, 5142, 5145, 5145, 5280, 5280, 5283, 5283, 5285, 5287, 5516, 5518, 5734, 5734, 5737, 5737, 6194, 6194, 6197, 6197, 6199, 6201, 6251, 6251, 6254, 6254, 6256, 6258, 6796, 6798, 6800, 6802, 6893, 6893, 6895, 6902, 6902, 6904, 7035, 7035, 7037, 7044, 7044, 7046, 7055, 7057}
verticalOpenDoors = {1211, 1220, 1224, 1228, 1233, 1238, 1242, 1246, 1256, 1260, 1540, 3546, 3548, 3550, 3552, 4915, 5083, 5109, 5111, 5113, 5115, 5127, 5129, 5131, 5133, 5142, 5145, 5283, 5285, 5289, 5293, 5516, 5737, 5749, 6194, 6199, 6203, 6207, 6251, 6256, 6260, 6264, 6798, 6802, 6902, 6904, 6906, 6908, 7044, 7046, 7048, 7050, 7055}
horizontalOpenDoors = {1214, 1222, 1226, 1230, 1236, 1240, 1244, 1248, 1258, 1262, 1542, 3537, 3539, 3541, 3543, 4918, 5085, 5100, 5102, 5104, 5106, 5118, 5120, 5122, 5124, 5136, 5139, 5280, 5287, 5291, 5295, 5518, 5734, 5746, 6197, 6201, 6205, 6209, 6254, 6258, 6262, 6266, 6796, 6800, 6893, 6895, 6897, 6899, 7035, 7037, 7039, 7041, 7057}
questDoors = {1223, 1225, 1241, 1243, 1255, 1257, 3542, 3551, 5105, 5114, 5123, 5132, 5288, 5290, 5745, 5748, 6202, 6204, 6259, 6261, 6898, 6907, 7040, 7049}
levelDoors = {1227, 1229, 1245, 1247, 1259, 1261, 3540, 3549, 5103, 5112, 5121, 5130, 5292, 5294, 6206, 6208, 6263, 6265, 6896, 6905, 7038, 7047}
keys = {2086, 2087, 2088, 2089, 2090, 2091, 2092}

BLUEBERRYBUSH_DECAY_INTERVAL = 300000

ITEMCOUNT_MAX = 100

ITEM_GOLD_COIN = 2148
ITEM_PLATINUM_COIN = 2152
ITEM_CRYSTAL_COIN = 2160
ITEM_FISH = 2667
ITEM_WORM = 3976
ITEM_BLUEBERRY = 2677
ITEM_BLUEBERRYBUSH = 2785
ITEM_BUSH = 2786
ITEM_PARCEL = 2595
ITEM_LABEL = 2599
ITEM_GOLD_COIN = 2148
ITEM_PLATINUM_COIN = 2152
ITEM_CRYSTAL_COIN = 2160


function doPlayerGiveItem(cid, itemid, count, charges)
local hasCharges = (isItemRune(itemid) == TRUE or isItemFluidContainer(itemid) == TRUE)
if(hasCharges and charges == nil) then
charges = 1
end

while count > 0 do
local tempcount = 1

if(hasCharges) then
tempcount = charges
end
if(isItemStackable(itemid) == TRUE) then
tempcount = math.min (100, count)
end

local ret = doPlayerAddItem(cid, itemid, tempcount)
if(ret == LUA_ERROR) then
ret = doCreateItem(itemid, tempcount, getPlayerPosition(cid))
end

if(ret ~= LUA_ERROR) then
if(hasCharges) then
count = count-1
else
count = count-tempcount
end
else
return LUA_ERROR
end
end
return LUA_NO_ERROR
end


function doPlayerTakeItem(cid, itemid, count)
if(getPlayerItemCount(cid,itemid) >= count) then

while count > 0 do
local tempcount = 0
if(isItemStackable(itemid) == TRUE) then
tempcount = math.min (100, count)
else
tempcount = 1
end
local ret = doPlayerRemoveItem(cid, itemid, tempcount)

if(ret ~= LUA_ERROR) then
count = count-tempcount
else
return LUA_ERROR
end
end

if(count == 0) then
return LUA_NO_ERROR
end

else
return LUA_ERROR
end
end


function doPlayerAddMoney(cid, amount)
local crystals = math.floor(amount/10000)
amount = amount - crystals*10000
local platinum = math.floor(amount/100)
amount = amount - platinum*100
local gold = amount
local ret = 0
if(crystals > 0) then
ret = doPlayerGiveItem(cid, ITEM_CRYSTAL_COIN, crystals)
if(ret ~= LUA_NO_ERROR) then
return LUA_ERROR
end
end
if(platinum > 0) then
ret = doPlayerGiveItem(cid, ITEM_PLATINUM_COIN, platinum)
if(ret ~= LUA_NO_ERROR) then
return LUA_ERROR
end
end
if(gold > 0) then
ret = doPlayerGiveItem(cid, ITEM_GOLD_COIN, gold)
if(ret ~= LUA_NO_ERROR) then
return LUA_ERROR
end
end
return LUA_NO_ERROR
end


function doPlayerBuyItem(cid, itemid, count, cost, charges)
if(doPlayerRemoveMoney(cid, cost) == TRUE) then
return doPlayerGiveItem(cid, itemid, count, charges)
else
return LUA_ERROR
end
end


function doPlayerSellItem(cid, itemid, count, cost)

if(doPlayerTakeItem(cid, itemid, count) == LUA_NO_ERROR) then
if(doPlayerAddMoney(cid, cost) ~= LUA_NO_ERROR) then
error('Could not add money to ' .. getPlayerName(cid) .. '(' .. cost .. 'gp)')
end
return LUA_NO_ERROR
else
return LUA_ERROR
end

end

function isInRange(pos, fromPos, toPos)
if pos.x >= fromPos.x and pos.y >= fromPos.y and pos.z >= fromPos.z and pos.x <= toPos.x and pos.y <= toPos.y and pos.z <= toPos.z then
return TRUE
end
return FALSE
end

function isNumber(p)
local m = ""
for i = 1, string.len(p) do
m = string.sub(p, i, i)
if m == "0" or m == "1" or m == "2" or m == "3" or m == "4" or m == "5" or m == "6" or m == "7" or m == "8" or m == "9" then
-- continue
else
return FALSE
end
end
return TRUE
end

function isPremium(cid)
if isPlayer(cid) == TRUE and getPlayerPremiumDays(cid) > 0 then
return TRUE
end
return FALSE
end

function rows(connection, sql_statement)
local cursor = assert(connection:execute(sql_statement))
return function ()
return cursor:fetch()
end
end

function getMonthDayEnding(day)
if day == "01" then
return "st"
elseif day == "02" then
return "nd"
elseif day == "03" then
return "rd"
else
return "th"
end
end

function getMonthString(month)
if month == 1 then
return "January"
elseif month == 2 then
return "February"
elseif month == 3 then
return "March"
elseif month == 4 then
return "April"
elseif month == 5 then
return "May"
elseif month == 6 then
return "June"
elseif month == 7 then
return "July"
elseif month == 8 then
return "August"
elseif month == 9 then
return "September"
elseif month == 10 then
return "October"
elseif month == 11 then
return "November"
elseif month == 12 then
return "December"
end
end

function getArticle(str)
if string.find(str, "[A,a,E,e,I,i,O,o,U,u,Y,y]") == TRUE then
return "an"
end
return "a"
end

function getDistanceBetween(firstPosition, secondPosition)
local xDif = math.abs(firstPosition.x - secondPosition.x)
local yDif = math.abs(firstPosition.y - secondPosition.y)

local posDif = math.max(xDif, yDif)
if(firstPosition.z ~= secondPosition.z) then
posDif = posDif + 9 + 6
end
return posDif
end

PLAYERSLOT_FIRST = 1
PLAYERSLOT_LAST = 10
function removePlayerItemsWithCharges(cid, itemid, charges)
if(isItemRune(itemid) ~= TRUE and isItemFluidContainer(itemid) ~= TRUE) then
error('[Error] removePlayerItemsWithCharges: Item ' .. itemid .. ' is not a rune or fluid container.', 2)
return 0
end

local n = 0

for slot = PLAYERSLOT_FIRST, PLAYERSLOT_LAST, 1 do
local item = getPlayerSlotItem(cid, slot)
if(item.itemid > 0) then
if(item.itemid == itemid and item.type == charges) then
if(doRemoveItem(item.uid, -1) == LUA_NO_ERROR) then
n = n + 1
else
print('[Warning] removePlayerItemsWithCharges: ', 'Could not remove item with uid ' .. item.uid)
end
elseif(isContainer(item.uid) == TRUE) then
n = n + removeContainerItemsWithCharges(item.uid, itemid, charges)
end
end
end

return n

end

function removeContainerItemsWithCharges(uid, itemid, charges)
if(isItemRune(itemid) ~= TRUE and isItemFluidContainer(itemid) ~= TRUE) then
error('[Error] removeContainerItemsWithCharges: Item ' .. itemid .. ' is not a rune or fluid container.', 2)
return 0
end

local n = 0

local slot = 0
local cap = getContainerCap(uid)
while(slot <= cap) do
local item = getContainerItem(uid, slot)
if(item.itemid > 0) then
if(item.itemid == itemid and item.type == charges) then
if(doRemoveItem(item.uid, -1) == LUA_NO_ERROR) then
n = n+1
slot = slot-1
else
print('[Warning] removeContainerItemsWithCharges: ', 'Could not remove item with uid ' .. item.uid)
end
elseif(isContainer(item.uid) == TRUE) then
n = n + removeContainerItemsWithCharges(item.uid, itemid, charges)
end
end
slot = slot+1
end

return n
end

Well, thanks for reading

Sincerely,
Otfan125 :thumbup:
 
PHP:
if msgcontains(msg, 'first addon') then
     if doPlayerRemoveMoney(cid, 5000) == TRUE then
              doPlayerAddOutfit(cid, outfit, 1)
              --continue
     else
     selfSay('Not enough gold. It cost 5000 pieces.')
     end
elseif msgcontains(msg, 'second addon') then
     if doPlayerRemoveMoney(cid, 10000) == TRUE then
              doPlayerAddOutfit(cid, outfit, 2)
     else
     selfSay('Not enough gold. It cost 10000 pieces.')
     end
return TRUE
end
 
I really like this, thank you... But, what do i change in the global.lua ? and, where is the Hi and Bye thing ?
 
PHP:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

-- OTServ event handling functions start
function onCreatureAppear(cid) npcHandlernCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandlernCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandlernCreatureSay(cid, type, msg) end
function onThink() npcHandlernThink() end
-- OTServ event handling functions end

function creatureSayCallback(cid, type, msg)
-- 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.
if(npcHandler.focus ~= cid) then
return false
end

if msgcontains(msg, 'first addon') then
     if doPlayerRemoveMoney(cid, 5000) == TRUE then
              doPlayerAddOutfit(cid, outfit, 1)
              --continue
     else
     selfSay('Not enough gold. It cost 5000 pieces.')
     end
elseif msgcontains(msg, 'second addon') then
     if doPlayerRemoveMoney(cid, 10000) == TRUE then
              doPlayerAddOutfit(cid, outfit, 2)
              --continue
     else
     selfSay('Not enough gold. It cost 10000 pieces.')
     end
end
return true
end

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

Hi/Bye is handled by NPC system.
you have to continue the lines with all of the outfits + filling the numbers where it says --continue.

You do not change anything on global.lua, just paste it in your *.lua NPC file.
 
i get this error.... Lua Script Error: [npc interface] data/npc/scripts/addon.lua:eek:nThink data/npc/scripts/addonlua:9: attemp to call global 'npchandlernThink (a nil value) and i cant say hi, without getting a error... and it does say... attemp to call global... i need to change something there!
 
Back
Top