- Forums
- OTServ
- Recursos
- Scripting
- Actions e Talkactions
- Vender potion vazio por comando
LA
action
Vender potion vazio por comando
By larissaots, 30 de mai. de 2015 in Actions e Talkactions
otserv
tibia
script
1
1.1k
By larissaots, 30 de mai. de 2015 in Actions e Talkactions
info
Group: Banidos
Joined: 07/04/13
Posts: 648
Reputation: +163
Créditos à Renato.
Objetivo
Simples, o player fala !sellvial e ele venderá todos os potions vazios que ele tem por X gps cada um.
Testado em: 8.60
Tutorial
talkactions.xml:
talkactions/scripts, crie arquivo com nome sellvial.lua e bote isso dentro:
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