Hello everyone.
My problem is that I have made a NPC'er, and you can change soul orbs for stone skins, but when I change soul orbs for stone skin, I am getting ssa so it works good, but it has got only 1 charge, and I have setted already in items.xml charge 5 for stone skin amulet. Same problem for might rings.
Does anyone know how to fix it?
My code, not all of the script but the part where you change soul orbs for ss'a etc.
co_trzeba_mowic = what_to_say
co_sie_dostaje = what_you_get
Thanks in advance
My problem is that I have made a NPC'er, and you can change soul orbs for stone skins, but when I change soul orbs for stone skin, I am getting ssa so it works good, but it has got only 1 charge, and I have setted already in items.xml charge 5 for stone skin amulet. Same problem for might rings.
Does anyone know how to fix it?
My code, not all of the script but the part where you change soul orbs for ss'a etc.
Code:
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
local config = {
[1] = {co_trzeba_mowic = "Stone Skin Amulet", ile_soul_orbow = 20, co_sie_dostaje = 2197, talkstate = 1},
[2] = {co_trzeba_mowic = "Time Ring", ile_soul_orbow = 10, co_sie_dostaje = 2169, talkstate = 2},
[3] = {co_trzeba_mowic = "Might Ring", ile_soul_orbow = 25, co_sie_dostaje = 2164, talkstate = 3},
[4] = {co_trzeba_mowic = "Blue Robe", ile_soul_orbow = 11, co_sie_dostaje = 2656, talkstate = 4}
}
for i=1, #config do
if msgcontains(msg, config[i].co_trzeba_mowic) then
selfSay("So, you want to buy from me 1 "..getItemNameById(config[i].co_sie_dostaje).." for "..config[i].ile_soul_orbow.." soul orbs?", cid)
talkState[talkUser] = config[i].talkstate
elseif msgcontains(msg, "yes") and talkState[talkUser] == config[i].talkstate then
if getPlayerItemCount(cid, 5944) >= config[i].ile_soul_orbow then
selfSay("Here you are.", cid)
doPlayerRemoveItem(cid, 5944, config[i].ile_soul_orbow)
doPlayerAddItem(cid, config[i].co_sie_dostaje, 1)
else
selfSay("You don't have enough soul orbs.", cid)
end
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
co_trzeba_mowic = what_to_say
co_sie_dostaje = what_you_get
Thanks in advance