LucasFerraz
Systems Analyst
Script part
Me: first mage addon
NPC: Do you want first mage addon for 1 ferumbras' hat?
Me: Yes
-- NOTHING HAPPENS --
LUA:
function creatureSayCallback(cid, type, msg)
if not npcHandler:isFocused(cid) then
return false
elseif msgcontains(msg, "first mage addon") and getPlayerSex(cid) == 1 then
selfSay('Do you want {first mage addon} for 1 ferumbras\' hat?', cid)
Topic[cid] = 1
if Topic[cid] == 1 and msgcontains(msg, "yes") then
if (getPlayerItemCount(cid,5809) >= 1) and (getPlayerItemCount(cid,2193) >= 20) and (getPlayerItemCount(cid,5904) >= 10) and (getPlayerItemCount(cid,2182) >= 1) and (getPlayerItemCount(cid,2186) >= 1) and (getPlayerItemCount(cid,2185) >= 1) and (getPlayerItemCount(cid,2181) >= 1) and (getPlayerItemCount(cid,2183) >= 1) and (getPlayerItemCount(cid,2190) >= 1) and (getPlayerItemCount(cid,2191) >= 1) and (getPlayerItemCount(cid,2188) >= 1) and (getPlayerItemCount(cid,2189) >= 1) and (getPlayerItemCount(cid,2187) >= 1) then
if getPlayerStorageValue(cid, 10006) <= 0 then
doPlayerRemoveItem(cid, 5809, 1)
doPlayerRemoveItem(cid, 2193, 20)
doPlayerRemoveItem(cid, 5904, 10)
doPlayerRemoveItem(cid, 2182, 1)
doPlayerRemoveItem(cid, 2186, 1)
doPlayerRemoveItem(cid, 2185, 1)
doPlayerRemoveItem(cid, 2181, 1)
doPlayerRemoveItem(cid, 2183, 1)
doPlayerRemoveItem(cid, 2190, 1)
doPlayerRemoveItem(cid, 2191, 1)
doPlayerRemoveItem(cid, 2188, 1)
doPlayerRemoveItem(cid, 2189, 1)
doPlayerRemoveItem(cid, 2187, 1)
doPlayerAddOutfit(cid, 130, 1)
local pos = getCreaturePosition(cid)
doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE)
else
selfSay('You already have this addon', cid)
end
else
selfSay('You do not have the required item', cid)
end
end
elseif msgcontains(msg, "first mage addon") and getPlayerSex(cid) == 0 then
selfSay('Do you want {first mage addon} for 1 ferumbras\' hat?', cid)
Topic[cid] = 1
if Topic[cid] == 1 and msgcontains(msg, "yes") then
if (getPlayerItemCount(cid,5958) >= 1) then
if getPlayerStorageValue(cid, 10006) <= 0 then
doPlayerRemoveItem(cid, 5958, 1)
doPlayerAddOutfit(cid, 138, 1)
local pos = getCreaturePosition(cid)
doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE)
else
selfSay('You already have this addon', cid)
end
else
selfSay('You do not have the required itens', cid)
end
elseif msgcontains(msg, "no") then
selfSay('Alright then. Come back when you got the neccessary items.', cid)
end
end
end
Me: first mage addon
NPC: Do you want first mage addon for 1 ferumbras' hat?
Me: Yes
-- NOTHING HAPPENS --