Ir para conteúdo

Featured Replies

Postado

No ot que eu to criando, como todo ot, faz conversao de golds, para platium, e de platium para cristal coins, dai eu queria que quando o player estivesse com 100Cristal coins, no caso, 100 pratinhas azuis, converter para uma barra de ouro, aquela que Ferumbras da... Podem me ajudar?

  • Respostas 16
  • Visualizações 3.4k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Jamison Collins
    Jamison Collins

    Tente esse script : local coins = { [ITEM_GOLD_COIN] = { to = ITEM_PLATINUM_COIN, effect = TEXTCOLOR_YELLOW }, [ITEM_PLATINUM_COIN] = { from = ITEM_GOLD_COIN, to = ITEM_CRYSTAL_COIN, effect = TEXTCO

Postado

actions\scripts\changegold.lua

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

actions.xml

<!-- Change gold -->
<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"/>

créditos: beddy

Postado
  • Autor

N deu certo, eu quero fazer 100 crystal coins em 1 scarab coins, o ID dos 2:

scarab coins = 2159

crystal coins = 2160

 

 

Resumindo, eu quero que quando o player estiver com 100 crystal coins, possa converter para 1 scarab coins...

^^

Postado

1 Passo: Transformar o scarab coin em um item de money.
Procure o scarab coin em "items/items.xml", e logo abaixo da tag:

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

insira a seguinte tag:

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

2 Passo: Configurar a action para transformar 100 crystal coins em 1 scarab coin.
Vá até "actions/actions.xml" e adicione a seguinte tag:

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

vá até o arquivo changegold.lua pelo caminho "actions/scripts/other/changegold.lua" e substitua seu conteúdo por este:

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 = ITEM_GOLD_NUGGET, effect = TEXTCOLOR_TEAL
},
[ITEM_SCARAB_COIN] = {
from = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_YELLOW
}
}
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

Créditos: Sofft

 

teste ai

Postado
  • Autor

Não entendi a parte do Scarab coin, como eu faço? Eu substituo o que tem, pelo o que vc mando ai?

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