[Action] Adicione Novas Moedas No Seu Otserv! (8.5)

caramelosoares
em Actions e Talkactions

caramelosoares

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 21/11/09Posts: 3

Olá pessoal, esse é o meu primeiro tutorial aqui no fórum, vou ensinar como trocar moedas, exemplo, quando se tem 100 golds e vc usa ele, ele vira 1 platinum, de 100 platinum vai pra 1 crystal.... o que vou ensinar eh como transformar 100 crystal em 1 scarab e 100 scarab em 1 gold ingot...

 

Primeiro abra o arquivo data/actions/actions.xml e procure pelo id 2148, após encontrar vc verá as seguintes linhas depois dele:

 

    <action itemid="2148" event="script" value="other/changegold.lua"/>
    <action itemid="2152" event="script" value="other/changegold.lua"/>
    <action itemid="2160" event="script" value="other/changegold.lua"/>

 

altere isso para:

 

    <action itemid="2148" event="script" value="other/changegold.lua"/>
    <action itemid="2152" event="script" value="other/changegold.lua"/>
    <action itemid="2159" event="script" value="other/changegold.lua"/>
    <action itemid="2160" event="script" value="other/changegold.lua"/>
    <action itemid="9971" event="script" value="other/changegold.lua"/>

 

sendo o itemid 2159 o scarab coin e o 9971 o gold ingot.

 

agora faça um backup do arquivo /data/actions/scripts/other/changegold.lua e depois abra-o, apague tudo dentro dele e cole isso:

 

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == ITEM_GOLD_COIN and item.type == ITEMCOUNT_MAX then
        doChangeTypeItem(item.uid, item.type - item.type)
        doPlayerAddItem(cid, ITEM_PLATINUM_COIN, 1)
        doSendAnimatedText(fromPosition, "R$", TEXTCOLOR_PLATINUMBLUE)
    elseif item.itemid == ITEM_PLATINUM_COIN and item.type == ITEMCOUNT_MAX then
        doChangeTypeItem(item.uid, item.type - item.type)
        doPlayerAddItem(cid, ITEM_CRYSTAL_COIN, 1)
        doSendAnimatedText(fromPosition, "R$", TEXTCOLOR_TEAL)
    elseif item.itemid == ITEM_PLATINUM_COIN and item.type < ITEMCOUNT_MAX then
        doChangeTypeItem(item.uid, item.type - 1)
        doPlayerAddItem(cid, ITEM_GOLD_COIN, ITEMCOUNT_MAX)
        doSendAnimatedText(fromPosition, "R$", TEXTCOLOR_YELLOW)
    elseif item.itemid == ITEM_CRYSTAL_COIN and item.type == ITEMCOUNT_MAX then
        doChangeTypeItem(item.uid, item.type - item.type)
        doPlayerAddItem(cid, 2159, 1)
        doSendAnimatedText(fromPosition, "R$", TEXTCOLOR_TEAL)
    elseif item.itemid == ITEM_CRYSTAL_COIN and item.type < ITEMCOUNT_MAX then
        doChangeTypeItem(item.uid, item.type - 1)
        doPlayerAddItem(cid, ITEM_PLATINUM_COIN, ITEMCOUNT_MAX)
        doSendAnimatedText(fromPosition, "R$", TEXTCOLOR_YELLOW)
    elseif item.itemid == 2159 and item.type == ITEMCOUNT_MAX then
        doChangeTypeItem(item.uid, item.type - item.type)
        doPlayerAddItem(cid, 9971, 1)
        doSendAnimatedText(fromPosition, "R$", TEXTCOLOR_TEAL)
    elseif item.itemid == 2159 and item.type < ITEMCOUNT_MAX then
        doChangeTypeItem(item.uid, item.type - 1)
        doPlayerAddItem(cid, ITEM_CRYSTAL_COIN, ITEMCOUNT_MAX)
        doSendAnimatedText(fromPosition, "R$", TEXTCOLOR_RED)
    elseif item.itemid == 9971 and item.type < ITEMCOUNT_MAX then
        doChangeTypeItem(item.uid, item.type - 1)
        doPlayerAddItem(cid, 2159, ITEMCOUNT_MAX)
        doSendAnimatedText(fromPosition, "R$", TEXTCOLOR_GREEN)
    else
        return FALSE
    end
    return TRUE
end

 

agora vc recarrega as actions ou reinicia seu servidor.....

seja feliz...

 

Abraços!

GOD Psico master

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 11/04/09Posts: 1Char no Tibia: Kadullyn

UP UP UP UP UP UP UP UP UP UP GOOD GOOD GOOD FUNFOU LEGAL!!!

 

 

RULEZZZ!!

APROVADO :great:

 

 

mundotibia.servergame.com .::8.52::50x::24hrs::.

rod_doidim

Rodi
avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 02/05/07Posts: 145

rsrsrsrs!

legal legal !!!

isso é velho pakas .. mais é legal ^^.

Parabens só esqueceu de formatar para ficar mais visivel o post.

 

Bom. Obrigado

celebration.png

logo.png.com

gkaonicx72

avatar
Marquês
Marquês

INFOS

Grupo: MarquêsRegistrado: 16/07/08Posts: 1130Char no Tibia: -

Opa obrigado. Por enquanto esta funcionando vou ver se achar bugs aviso. Obrigado por trazer novo conteúdo ao Xtibia, continue assim.

Até mais.

Atenciosamente, Kaonic

Trabalhando para um futuro melhor do Xtibia - By Kaonic, não use sem colocar os créditos.

Email (não uso como msn): kaonic@xtibia.com

MSN: Envie MP

Mapping Teacher: Koddy

 

Copa XTibia Design - Participante #2 do Grupo A



1277160188-U5886.jpg

 

 

Gifts:



Moskitinho ** -Reji * -Dj Sky * -ShadowDemon** -NightAdams **