Ir para conteúdo

trocar um item por outro


Fuscante

Posts Recomendados

1° va em seuot/data/talkaction e crie um script com o nome de goldn_shop feito isso vc vai colocar dentro dele

 

 

function onSay(cid, words, param)

local items = {
["lunar"] = {qnt = 20, ch = 7424},
["carrow"] = {qnt = 30, ch = 2352},
["gbow"] = {qnt = 50, ch = 7438},
["wsword"] = {qnt = 80, ch = 2408},
}
if not param or param == "" or not items[param] then
doPlayerSendTextMessage(cid, 20, "Não encontramos este item no estoque, os items disponíveis são:")
for a, b in pairs(items) do
doPlayerSendTextMessage(cid, 20, ""..getItemNameById(b.ch).." - "..b.qnt.." gold nuggets.")
end
return true
end
if getPlayerItemCount(cid, 2157) < items[param].qnt then
doPlayerSendTextMessage(cid, 20, "Para comprar um "..getItemNameById(items[param].ch).." você precisa de "..items[param].qnt.." gold nuggets.")
return true
end
doSendMagicEffect(getThingPos(cid), 14)
doPlayerAddItem(cid, items[param].ch)
doPlayerRemoveItem(cid, 2157, items[param].qnt)
doPlayerSendTextMessage(cid, 20, "Você comprou um "..getItemNameById(items[param].ch).." por "..items[param].qnt.." gold nuggets.")
return true
end

feito isso vc vai adicionar a seguinte tag em talkaction.xml

<talkaction words="!gshop;/gshop" event="script" value="goldn_shop.lua"/>

o script funciona assim !gshop para vc ver os items que podera comprar .
para comprar !gshop lunar,!gshop wsword, !gshopcarrow ,!gshop gbow, obrigado gente foi esses os items que eu coloquei
creditos:
Roksas : 99%
Eu: 1 % por postar no xtibia
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...