Postado Outubro 15, 2013 11 anos Bom dia, Estou com um problema no meu OTserv, sempre que os players tentam comprar uma Wand of Voodoo no npc de loja mágica (Eryn), nada acontece e a distro mostra o seguinte erro: attempt to buy an item thats only sellable ESTOU USANDO TFS 0.3.6 SVN (9.6/9.7) - PERCEBI QUE O ERRO NÃO ACONTECE APENAS COM O ERYN, E SIM COM TODOS OS NPCS DE RUNAS! Aqui o XML do Eryn: <?xml version="1.0" encoding="UTF-8"?> <npc name="Eryn" nameDescription="Eryn, the rune vendor" script="data/npc/scripts/runas.lua" walkinterval="2000" floorchange="0" skull="green"> <health now="100" max="100"/> <look type="130" head="39" body="122" legs="125" feet="57" addons="0"/> <parameters> <parameter key="message_greet" value="Hello |PLAYERNAME|. I sell runes, potions, wands and rods."/> <parameter key="message_decline" value="Is |TOTALCOST| gold coins too much for you? Get out of here!"/> </parameters> </npc> Aqui o LUA do Eryn: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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 local shopModule = ShopModule:new() npcHandler:addModule(shopModule) shopModule:addBuyableItem({'small health'}, 8704, 20, 1, 'small health potion') shopModule:addBuyableItem({'health potion'}, 7618, 45, 1, 'health potion') shopModule:addBuyableItem({'mana potion'}, 7620, 50, 1, 'mana potion') shopModule:addBuyableItem({'strong health'}, 7588, 100, 1, 'strong health potion') shopModule:addBuyableItem({'strong mana'}, 7589, 80, 1, 'strong mana potion') shopModule:addBuyableItem({'great health'}, 7591, 190, 1, 'great health potion') shopModule:addBuyableItem({'great mana'}, 7590, 120, 1, 'great mana potion') shopModule:addBuyableItem({'great spirit'}, 8472, 190, 1, 'great spirit potion') shopModule:addBuyableItem({'ultimate health'}, 8473, 310, 1, 'ultimate health potion') shopModule:addBuyableItem({'antidote potion'}, 8474, 50, 1, 'antidote potion') shopModule:addBuyableItem({'mastermind potion'}, 7440, 100000, 1, 'mastermind potion') shopModule:addBuyableItem({'berserk potion'}, 7439, 100000, 1, 'berserk potion') shopModule:addBuyableItem({'bullseye potion'}, 7443, 100000, 1, 'bullseye potion') shopModule:addBuyableItem({'instense healing'}, 2265, 8, 1, 'intense healing rune') shopModule:addBuyableItem({'blank rune'}, 2260, 10, 3, 'blank rune') shopModule:addBuyableItem({'ultimate healing'}, 2273, 50, 3, 'ultimate healing rune') shopModule:addBuyableItem({'magic wall'}, 2293, 50, 3, 'magic wall rune') shopModule:addBuyableItem({'destroy field'}, 2261, 4, 3, 'destroy field rune') shopModule:addBuyableItem({'light magic missile'}, 2287, 4, 3, 'light magic missile rune') shopModule:addBuyableItem({'heavy magic missile'}, 2311, 12, 3, 'heavy magic missile rune') shopModule:addBuyableItem({'great fireball'}, 2304, 10, 3, 'great fireball rune') shopModule:addBuyableItem({'explosion'}, 2313, 35, 3, 'explosion rune') shopModule:addBuyableItem({'sudden death'}, 2268, 100, 3, 'sudden death rune') shopModule:addBuyableItem({'Heavy Holy Missile'}, 2295, 200, 3, 'Heavy Holy Missile') shopModule:addBuyableItem({'paralyze'}, 2278, 350, 3, 'paralyze rune') shopModule:addBuyableItem({'animate dead'}, 2316, 25, 3, 'animate dead rune') shopModule:addBuyableItem({'wild growth'}, 2269, 60, 3, 'wild growth rune') shopModule:addBuyableItem({'convince creature'}, 2290, 8, 3, 'convince creature rune') shopModule:addBuyableItem({'chameleon'}, 2291, 21, 3, 'chameleon rune') shopModule:addBuyableItem({'desintegrate'}, 2310, 8, 3, 'desintegreate rune') shopModule:addBuyableItem({'snakebite rod', 'snakebite'}, 2182, 500, 1, 'snakebite rod') shopModule:addBuyableItem({'moonlight rod', 'moonlight'}, 2186, 1000, 1, 'moonlight rod') shopModule:addBuyableItem({'necrotic rod', 'necrotic'}, 2185, 5000, 1, 'necrotic rod') shopModule:addBuyableItem({'northwind rod', 'northwind'}, 8911, 7500, 1, 'northwind rod') shopModule:addBuyableItem({'terra rod', 'terra'}, 2181, 10000, 1, 'terra rod') shopModule:addBuyableItem({'hailstorm rod', 'hailstorm'}, 2183, 15000, 1, 'hailstorm rod') shopModule:addBuyableItem({'springsprout rod', 'springsprout'}, 8912, 18000, 1, 'springsprout rod') shopModule:addBuyableItem({'underworld rod', 'underworld'}, 8910, 22000, 1, 'underworld rod') shopModule:addBuyableItem({'wand of vortex', 'vortex'}, 2190, 500, 1, 'wand of vortex') shopModule:addBuyableItem({'wand of dragonbreath', 'dragonbreath'}, 2191, 1000, 1, 'wand of dragonbreath') shopModule:addBuyableItem({'wand of decay', 'decay'}, 2188, 5000, 1, 'wand of decay') shopModule:addBuyableItem({'wand of draconia', 'draconia'}, 8921, 7500, 1, 'wand of draconia') shopModule:addBuyableItem({'wand of cosmic energy', 'cosmic energy'}, 2189, 10000, 1, 'wand of cosmic energy') shopModule:addBuyableItem({'wand of inferno', 'inferno'},2187, 15000, 1, 'wand of inferno') shopModule:addBuyableItem({'wand of starstorm', 'starstorm'}, 8920, 18000, 1, 'wand of starstorm') shopModule:addBuyableItem({'wand of voodoo', 'voodoo'}, 8922, 22000, 1, 'wand of voodoo') shopModule:addSellableItem({'wand of vortex', 'vortex'}, 2190, 250, 'wand of vortex') shopModule:addSellableItem({'wand of dragonbreath', 'dragonbreath'}, 2191, 500, 'wand of dragonbreath') shopModule:addSellableItem({'wand of decay', 'decay'}, 2188, 2500, 'wand of decay') shopModule:addSellableItem({'wand of draconia', 'draconia'}, 8921, 3750, 'wand of draconia') shopModule:addSellableItem({'wand of cosmic energy', 'cosmic energy'}, 2189, 5000, 'wand of cosmic energy') shopModule:addSellableItem({'wand of inferno', 'inferno'},2187, 7500, 'wand of inferno') shopModule:addSellableItem({'wand of starstorm', 'starstorm'}, 8920, 9000, 'wand of starstorm') shopModule:addSellableItem({'wand of voodoo', 'voodoo'}, 8922, 11000, 'wand of voodoo') shopModule:addSellableItem({'snakebite rod', 'snakebite'}, 2182, 250, 'snakebite rod') shopModule:addSellableItem({'moonlight rod', 'moonlight'}, 2186, 500, 'moonlight rod') shopModule:addSellableItem({'necrotic rod', 'necrotic'}, 2185, 2500, 'necrotic rod') shopModule:addSellableItem({'northwind rod', 'northwind'}, 8911, 3750, 'northwind rod') shopModule:addSellableItem({'terra rod', 'terra'}, 2181, 5000, 'terra rod') shopModule:addSellableItem({'hailstorm rod', 'hailstorm'}, 2183, 7500, 'hailstorm rod') shopModule:addSellableItem({'springsprout rod', 'springsprout'}, 8912, 9000, 'springsprout rod') shopModule:addSellableItem({'underworld rod', 'underworld'}, 8910, 11000, 'underworld rod') shopModule:addSellableItem({'normal potion flask', 'normal flask'}, 7636, 5, 'empty small potion flask') shopModule:addSellableItem({'strong potion flask', 'strong flask'}, 7634, 10, 'empty strong potion flask') shopModule:addSellableItem({'great potion flask', 'great flask'}, 7635, 15, 'empty great potion flask') shopModule:addSellableItem({'spellbook of enlightenment'}, 8900, 3000, 'spellbook of enlightenment') shopModule:addSellableItem({'spellbook of warding'}, 8901, 5000, 'spellbook of warding') shopModule:addSellableItem({'spellbook of mind control'}, 8902, 10000, 'spellbook of mind control') shopModule:addSellableItem({'spellbook of lost souls'}, 8903, 50000, 'spellbook of lost souls') shopModule:addSellableItem({'spellbook of prophercies'}, 8904, 140000, 'spellbook of prophercies') shopModule:addSellableItem({'spellbook of dark mysteries'}, 8918, 180000, 'spellbook of dark mysteries') function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local items = {[1] = 2190, [2] = 2182, [5] = 2190, [6] = 2182} if(msgcontains(msg, 'first rod') or msgcontains(msg, 'first wand')) then if(isSorcerer(cid) or isDruid(cid)) then if(getPlayerStorageValue(cid, 30002) == -1) then selfSay('So you ask me for a {' .. getItemNameById(items[getPlayerVocation(cid)]) .. '} to begin your advanture?', cid) talkState[talkUser] = 1 else selfSay('What? I have already gave you one {' .. getItemNameById(items[getPlayerVocation(cid)]) .. '}!', cid) end else selfSay('Sorry, you aren\'t a druid either a sorcerer.', cid) end elseif(msgcontains(msg, 'yes')) then if(talkState[talkUser] == 1) then doPlayerAddItem(cid, items[getPlayerVocation(cid)], 1) selfSay('Here you are young adept, take care yourself.', cid) setPlayerStorageValue(cid, 30002, 1) end talkState[talkUser] = 0 elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then selfSay('Ok then.', cid) talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Rep++ pra quem conseguir resolver. Espero que alguém consiga me ajudar, preciso muito que isto funcione. Obrigado.
Postado Outubro 15, 2013 11 anos Creio que descobrir o problema, teste e me diz o que deu. troque shopModule:addBuyableItem({'wand of voodoo', 'voodoo'}, 8922, 22000, 1, 'wand of voodoo') por este aqui shopModule:addBuyableItem({'wand of voodoo', 'voodoo'}, 8922, 22000, 'wand of voodoo') Te ajudei? Se você achar que eu mereço, me dê uma "rep+" e selecione meu post como "melhor resposta" Skype: JoadsonAion
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.