Postado Junho 2, 2012 12 anos 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 Junho 2, 2012 12 anos por MatheusVidaLoka (veja o histórico de edições)
Postado Junho 3, 2012 12 anos D+ em gostei,ja ouvi falar desse script e ja procurei não achei em nenhum lugar REP +!
Postado Junho 3, 2012 12 anos Autor D+ em gostei,ja ouvi falar desse script e ja procurei não achei em nenhum lugar REP +! Obrigado, espero ter lhe ajudado.
Postado Junho 4, 2012 12 anos Autor Muito bom, gostei muito, eu tmbm estava a procura, rep+ Obrigado, fico feliz de ter lhe ajudado.
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.