Hello i have a problem; when i wanna change all 4 pieces of Kosheis Ancient Amulet - npc take all but don't give me full amulet. This script works fine with tfs(8.4) but with newest version not working.
Can u help me?
Code:
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
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 "kosheis ancient amulet".')
elseif msgcontains(msg, 'kosheis ancient amulet') or msgcontains(msg, 'amulet') then
if getPlayerItemCount(cid,8262) >= 1 and getPlayerItemCount(cid,8263) >= 1 and getPlayerItemCount(cid,8263) >= 1 and getPlayerItemCount(cid,8264) >= 1 and getPlayerItemCount(cid,2152) >= 50 then
selfSay('Did you bring me all pieces of the Kosheis Ancient Amulet and 5000 gp?')
talk_state = 2
else
selfSay('I need 4 pieces of amulet and 5000 gp. 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,8262) >= 1 and getPlayerItemCount(cid,8263) >= 1 and getPlayerItemCount(cid,8264) >= 1 and getPlayerItemCount(cid,8265) >= 1 and getPlayerItemCount(cid,2152) >= 1 then
if doPlayerRemoveItem(cid,8262,1) == 1 and doPlayerRemoveItem(cid,8263,1) == 1 and doPlayerRemoveItem(cid,8264,1) == 1 and doPlayerRemoveItem(cid,8265,1) == 1 and doPlayerRemoveItem(cid,2152,50) == 1 then
selfSay(addon_give)
doPlayerAddItem(cid,8266,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())
Can u help me?