Postado Janeiro 26, 2015 10 anos Alguém adapta pra min esse change gold, quando tiver 1kk clicar e virar 1 gold ingot, e 1 gold ingot se clicar vira 1kk, eu vi isso em um ot, não sei como funciona, depois que vira gold ingot funciona como dnheiro normal 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, 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 (1º) | [8.60] - Galaxy Server - Download (2º) | [8.60] - Glorious Server - Download (3º) | [8.60] - Epic Server - Download
Postado Janeiro 26, 2015 10 anos Solução Ta diamante: 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 = 2145, effect = TEXTCOLOR_TEAL}, [2145] = {from = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_WHITE} } function onUse(cid, item, fromPosition, itemEx, toPosition) 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 vou editando: 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 = 9971, effect = TEXTCOLOR_TEAL}, [9971] = {from = ITEM_CRYSTAL_COIN, effect = 205} } function onUse(cid, item, fromPosition, itemEx, toPosition) 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 Pronto, 205 é a cor, amarelozin... Não se esqueça de por valor no gold ingot de 1kk ... no items.xml. Editado Janeiro 26, 2015 10 anos por Caronte (veja o histórico de edições) Se quiser sua dúvida tirada, mande PM com os links, e não com a dúvida (outros podem ter a mesma dúvida, e o fórum serve para ser usado). Tópicos: [FAQ] BBCODE [LIB] Constant [RME] Administrando bordas. [TALK] Broadcast Editável. [TALK] Sugest. [TALK] Checkpoint. [MOVE] Pântano pegajoso. [ACTION] Piggy Bank. (Cassino). [GLOBAL] Uptime Ad. [C0DE] Consertando 'Invalid Password' [PROGRAM] Quest Maker
Postado Janeiro 26, 2015 10 anos 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 = 9971, effect = TEXTCOLOR_TEAL } [9971] = { 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 No items.xml vc coloca essa tag dentro da tag do gold ingot: <attribute key="worth" value="100000000" /> No caso, a tag do gold ingot ficará assim: <item id="9971" article="a" name="gold ingot" plural="gold ingots"> <attribute key="weight" value="1800" /> <attribute key="worth" value="100000000" /> </item> Te ajudei?? REP + e ficamos quites... http://www.tibiaking.com/forum/uploads/emoticons/default_happyy.png' alt=';D'> Atenciosamente, Daniel. Abraços! Meus tutoriais: Programação: Resolvendo QUALQUER erro na data base. Scripts (system's, creaturescripts, mod's, NPC's, etc): (Sistema) GOD Ambient Light Full. Adicionando novas mounts ao servidor [NPC] Papai Noel que dá presente todo ano. Web-site: Resolvendo problema de caracteres especiais em PHP Formatando textos em PHP! Mudando a cor, tamanho, fonte, etc. Criando e configurando tabelas para paginas PHP
Postado Janeiro 26, 2015 10 anos Jno, independente do qual você usar, use o último effect, como 205, pois é a cor do gold ingot... Se quiser sua dúvida tirada, mande PM com os links, e não com a dúvida (outros podem ter a mesma dúvida, e o fórum serve para ser usado). Tópicos: [FAQ] BBCODE [LIB] Constant [RME] Administrando bordas. [TALK] Broadcast Editável. [TALK] Sugest. [TALK] Checkpoint. [MOVE] Pântano pegajoso. [ACTION] Piggy Bank. (Cassino). [GLOBAL] Uptime Ad. [C0DE] Consertando 'Invalid Password' [PROGRAM] Quest Maker
Postado Maio 20, 2021 4 anos Em 25/01/2015 em 22:15, Danihcv disse: 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 = 9971, effect = TEXTCOLOR_TEAL } [9971] = { 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 No items.xml vc coloca essa tag dentro da tag do gold ingot: <attribute key="worth" value="100000000" /> No caso, a tag do gold ingot ficará assim: <item id="9971" article="a" name="gold ingot" plural="gold ingots"> <attribute key="weight" value="1800" /> <attribute key="worth" value="100000000" /> </item> Eu to com um problema parecido só que ao invés do gold ignot eu queria que fosse a bar of gold (id 15515) Só que no meu servidor é ravscripts e n consegui converter =\ meu scrip atual dos meus coins é: local config = { [ITEM_GOLD_COIN] = {changeTo = ITEM_PLATINUM_COIN}, [ITEM_PLATINUM_COIN] = {changeBack = ITEM_GOLD_COIN, changeTo = ITEM_CRYSTAL_COIN}, [ITEM_CRYSTAL_COIN] = {changeBack = ITEM_PLATINUM_COIN} } local goldConverter = Action() function goldConverter.onUse(player, item, fromPosition, target, toPosition, isHotkey) local coin = config[target.itemid] if not coin then return false end local charges = item:getCharges() if coin.changeTo and target.type == 100 then target:remove() player:addItem(coin.changeTo, 1) item:transform(item:getId(), charges -1) elseif coin.changeBack then target:transform(target.itemid, target.type - 1) player:addItem(coin.changeBack, 100) item:transform(item:getId(), charges -1) else return false end if charges == 0 then item:remove() end return true end goldConverter:id(26378, 29020) goldConverter:register()
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.