Npc Não Vende

phefoo
Por phefoo
em Scripts

phefoo

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 17/09/10Posts: 1

Bom pessoal estou com mais um problema no meu ot, este aqui ja tem muito tempo porem nunca procurei ajuda pra arrumar, mas ja procurei soluções na internet e nunca achei.

 

O erro se da quando eu tento comprar no npc uma wand ou rod, apenas nesses dois itens.

 

erro:

 

 

 

 

 

[shopModule.onSell]

Attempt to purchase an item which only sellable

por causa desse erro fiz uma venda de wands e rods por alavancas, mas gostaria muito de resolver esse meu problema.

 

E se alguem souber tambem sobre um bless system 100% pois ja usei varios e muitas vezes quando o player é morto com bless, dropa todos os itens, mesmo não estando red ou black skull.

obrigado pela ajuda desde ja!

VictorTasquin

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 29/01/12Posts: 72Gênero: MasculinoChar no Tibia: Ann Seehy

NPC das Wands.

Você está usando esta tag ?:

 

<parameter key="shop_buyable" value="WAND,ID,PREÇO"/>

 

 

Bless:

Abra seu config.lua e configure a parte das blesses desta forma:

 

-- Blessings

blessings = true

blessingOnlyPremium = false

blessingReductionBase = 30

blessingReductionDecrement = 5

eachBlessReduction = 8

 

Agora colocarei 2 modos, NPC ou TALKACTIONS.

 

Talkactions:

Abra a pasta data/talkactions/scripts, copie qualquer arquivo renomeie para bless, abra e apague tudo dentro e cole isto:

 

 

local bless = {1, 2, 3, 4, 5} --Quais blesses ira receber /no caso todas\

local cost = 80000 --Dinheiro que será retirado do player

function onSay(cid, words, param)

for i = 1, table.maxn(bless) do

if(getPlayerBlessing(cid, bless)) then

doPlayerSendCancel(cid,"Voce ja tem todas as bless.") --Mensagem caso o player ja tenha as blesses

return TRUE

end

end

 

if(doPlayerRemoveMoney(cid, cost) == TRUE) then

for i = 1, table.maxn(bless) do

doPlayerAddBlessing(cid, bless)

end

doCreatureSay(cid, "You are now blessed by the NOMEDOSERVER" ,19) --Mensagem ao receber as blesses

doSendMagicEffect(getPlayerPosition(cid), 49)

else

doPlayerSendCancel(cid,"Voce precisa de 80k para a bless.") --Mensagem caso nao tenha diheiro suficiente

end

return TRUE

end

 

 

Em Talkactions.XML, nas talks de players:

 

<talkaction words="!bless" event="script" value="bless.lua"/>

 

Configure a seu gosto.

 

Script NPC:

Abra a pasta data/npc/scripts, copie qualquer arquivo renomeie para bless, abra e apague tudo dentro e cole isto:

 

 

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

 

local node1 = keywordHandler:addKeyword({'primeira bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the first blessing for 2000 (plus level depending amount) gold?'})

node1:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 1, premium = true, baseCost = 2000, levelCost = 200, startLevel = 30, endLevel = 120})

node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})

 

local node2 = keywordHandler:addKeyword({'segunda bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the second blessing for 2000 (plus level depending amount) gold?'})

node2:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 2, premium = true, baseCost = 2000, levelCost = 200, startLevel = 30, endLevel = 120})

node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})

 

local node3 = keywordHandler:addKeyword({'terceira bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the third blessing for 2000 (plus level depending amount) gold?'})

node3:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 3, premium = true, baseCost = 2000, levelCost = 200, startLevel = 30, endLevel = 120})

node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})

 

local node4 = keywordHandler:addKeyword({'quarta bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the fourth blessing for 2000 (plus level depending amount) gold?'})

node4:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 4, premium = true, baseCost = 2000, levelCost = 200, startLevel = 30, endLevel = 120})

node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})

 

local node5 = keywordHandler:addKeyword({'quinta bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the fifth blessing for 2000 (plus level depending amount) gold?'})

node5:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 5, premium = true, baseCost = 2000, levelCost = 200, startLevel = 30, endLevel = 120})

node5:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})

 

npcHandler:addModule(FocusModule:new())

 

Configure a seu gosto.

 

Ajudei ? REP+

Ajudei ? REP+