Créditos no script.
Explicação: simples, o player fala !sellvial e ele venderá todos os potions vazios que ele tem por X gps cada um.
• Crie um arquivo LUA com o nome sellvial.lua em data/talkactions/scripts e ponha:
--[Created by Renato Ribeiro to www.TibiaKing.com and others]--
function onSay (cid, words, param, channel)
local preco = 5 -- gold coins
local count = getPlayerItemCount(cid, 7636) + getPlayerItemCount(cid, 7634) + getPlayerItemCount(cid, 7635)
local result = count*preco
if count == 0 then
doSendMagicEffect(getPlayerPosition(cid), 2)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você não tem potions para vender.")
else
doSendMagicEffect(getPlayerPosition(cid), 12)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você vendeu "..count.." potions por "..result.." gold coins.")
doPlayerAddMoney(cid, result)
return TRUE
end
end[/code]
Altere o valor de cada potion em [i]local preco = 5 (substuindo 5)[/i]
[b]• Depois em [color=#0000FF]data/talkactions/talkactions.xml[/color] ponha a tag em qualquer lugar:[/b]
[code]<talkaction log="yes" words="!sellvial" access="0" event="script" value="sellvial.lua">
E prontinho!
OBS: Script não testado</talkaction>