Ir para conteúdo

Featured Replies

Postado
  • Este é um post popular.

Fala galera do Tibia King, hoje venho trazer um actions a vocês, queria dizer que essa action já é velha, mas dei uma olhada no TK e não vi nada a respeito da action, então decidi postar para vocês.

Qual a função da Action?

É um novo tipo de gold que cada um vale 1kk, funcionando normal nas compras e vendas de itens em npcs, e nas trocas de crystal coin para o golda nugget (novo gold).

Bom vamos ao script.

Vá em data/actions/scripts e abra o arquivo crystal.lua, apague tudo o que está dentro, logo em seguida cole o script abaixo:

--By MatheusVidaLoka

function onUse(cid, item, frompos, item2, topos)

if item.itemid == 2160 and item.type == 100 then

doRemoveItem(item.uid,item.type)

doPlayerAddItem(cid,2157,1)

doPlayerSendTextMessage(cid,22,"Voce trocou 100 crystal por 1 Gold Nuggets")

elseif item.itemid == 2152 and item.type < 100 then

doRemoveItem(item.uid,1)

doPlayerAddItem(cid,2152,100)

doPlayerSendTextMessage(cid,22,"Voce trocou 1 crystal por 100 platinum coins")

end

end

Traduzindo:

Vermelho: É o id da crystal coin, e a quantidade a ser trocada por 1 gold nugget (Novo Gold).

Azul: É o id da gold nugget, e a quantidade de gold nugget.

Logo em seguida, vá novamente em data/actions/scripts copie qualquer arquivo.lua e cole, em seguida renomeie-o para "goldnuggets" sem aspas, abra-o, apague tudo, e cole o script abaixo.

--By MatheusVidaLoka

function onUse(cid, item, frompos, item2, topos)

if doRemoveItem(item.uid,1) then

doPlayerSendTextMessage(cid,22,"Voce trocou 1 gold nugget por 100 crystal coins")

doPlayerAddItem(cid,2160,100)

end

end

Traduzindo:

Laranja: É o que vai dizer quando o player trocar 1 gold nugget por 100 crystal coins.

Verde: É o id da crystal coin, e a quantidade equivalente a 1 gold nugget.

Logo em seguida, abra data/actions/actions.xml e adicione a tag abaixo.

<action itemid="2157" script="goldnuggets.lua" />

Traduzindo:

Rosa: É o id do gold nuggets.

Azul: O nome do arquivo.lua que você salvou.

Depois disso abra data/items/items.xml, aperte CTRL + F, e digite 2157, ai você vai achar o item Gold Nugget que vai estar assim:

<item id="2157" article="a" name="gold nugget" plural="gold nuggets">

<attribute key="weight" value="10"/>

Substitua tudo por isso:

<item id="2157" article="a" name="gold nugget" plural="gold nuggets">

<attribute key="weight" value="10"/>

<attribute key="worth" value="1000000" />

Traduzindo:

Vermelho: Peso do gold nugget.

Azul: Valor do item (como 1 crystal coin = 10k , 1 gold nugget = 1kk)

Logo depois vá data/actions/scripts/other e abra o arquivo changegold.lua, susbistitua tudo oque está la dentro por esse script a seguir, e salve:

-- By MatheusVidaLoka

local coins = {

[iTEM_GOLD_COIN] = {

to = ITEM_PLATINUM_COIN, effect = TEXTCOLOR_YELLOW

},

[iTEM_PLATINUM_COIN] = {

from = ITEM_GOLD_COIN, to = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_LIGHTBLUE

},

[iTEM_CRYSTAL_COIN] = {

from = ITEM_PLATINUM_COIN, to = 2157, effect = TEXTCOLOR_LIGHTBLUE

},

[2157] = {

from = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_TEAL

}

}

function onUse(cid, item, fromPosition, itemEx, toPosition)

if(getPlayerFlagValue(cid, PLAYERFLAG_CANNOTPICKUPITEM)) then

return false

end

local coin = coins[item.itemid]

if(not coin) then

return false

end

if(coin.to ~= nil and item.type == ITEMCOUNT_MAX) then

doChangeTypeItem(item.uid, item.type - item.type)

doPlayerAddItem(cid, coin.to, 1)

doSendAnimatedText(fromPosition, "$$$", coins[coin.to].effect)

elseif(coin.from ~= nil) then

doChangeTypeItem(item.uid, item.type - 1)

doPlayerAddItem(cid, coin.from, ITEMCOUNT_MAX)

doSendAnimatedText(fromPosition, "$$$", coins[coin.from].effect)

end

return true

end

Traduzindo:

Vermelho: É o id do Gold Nugget.

Por fim vá em data/actions/actions.xml, pule uma linha qualquer e cole isso, e salve:

<action itemid="2157" event="script" value="other/changegold.lua"/>

Traduzindo:

Azul: É o id do gold nugget.

Verde: O nome do arquivo que você salvou.

Server testado em Ot 8.60 e funcionou corretamente.

Creditos:

MatheusVidaLoka

JFLNT

Se enfringi alguma regra do TK por favor me reporte.

Desculpe-me pelos mal usos das ferramentas do TK (quotes,spoiler,CODES,etc) pois estou com certos problemas.

Editado por MatheusVidaLoka (veja o histórico de edições)

  • Respostas 21
  • Visualizações 18.2k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • BetterWar ATS
    BetterWar ATS

    --Buy Jeff local coins = { [2148] = { to = 2152, effect = 210 }, [2152] = { from = 2148, to = 2160, effect = 130 }, [2160] = { from = 2152, to = 9971, effec

  • MatheusVidaLoka
    MatheusVidaLoka

    Obrigado, espero ter lhe ajudado.

  • primeiro crie um arquivo com o nome gold nugget.lua na pasta action, ou você escolhe dai cole isso dentro   --By MatheusVidaLoka function onUse(cid, item, frompos, item2, topos) if doRem

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo