Ravauvial
Member
All you have to do is this:
Go into data/global.lua
Near the bottom you will see this
Now after the crystal coin add this
Now in data/actions/action.xml
find this:
and add this
Now in data/actions/scripts/other/changegold.lua
you will see this:
Change it to this:
That is it should work great.
Go into data/global.lua
Near the bottom you will see this
Code:
ITEM_GOLD_COIN = 2148
ITEM_PLATINUM_COIN = 2152
ITEM_CRYSTAL_COIN = 2160
Now after the crystal coin add this
Code:
ITEM_GOLD_NUGGET = 2157
ITEM_GOLD_INGOT = 9971
Now in data/actions/action.xml
find this:
Code:
<!-- 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"/>
and add this
Code:
<action itemid="2157" script="other/changegold.lua"/> <!-- Gold Nugget -->
<action itemid="9971" script="other/changegold.lua"/> <!-- 1 Gold Ingot -->
Now in data/actions/scripts/other/changegold.lua
you will see this:
Code:
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
Change it to this:
Code:
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, "$$$", TEXTCOLOR_LIGHTBLUE)
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, "$$$", TEXTCOLOR_TEAL)
elseif item.itemid == ITEM_CRYSTAL_COIN and item.type == ITEMCOUNT_MAX then
doChangeTypeItem(item.uid, item.type - item.type)
doPlayerAddItem(cid, ITEM_GOLD_NUGGET, 1)
doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_GREEN)
elseif item.itemid == ITEM_GOLD_NUGGET and item.type == ITEMCOUNT_MAX then
doChangeTypeItem(item.uid, item.type - item.type)
doPlayerAddItem(cid, ITEM_GOLD_INGOT, 1)
doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_GREEN)
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, "$$$", TEXTCOLOR_YELLOW)
elseif item.itemid == ITEM_CRYSTAL_COIN then
doChangeTypeItem(item.uid, item.type - 1)
doPlayerAddItem(cid, ITEM_PLATINUM_COIN, ITEMCOUNT_MAX)
doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_LIGHTBLUE)
elseif item.itemid == ITEM_GOLD_NUGGET then
doChangeTypeItem(item.uid, item.type - 1)
doPlayerAddItem(cid, ITEM_CRYSTAL_COIN, ITEMCOUNT_MAX)
doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_GREEN)
elseif item.itemid == ITEM_GOLD_INGOT then
doChangeTypeItem(item.uid, item.type - 1)
doPlayerAddItem(cid, ITEM_GOLD_NUGGET, ITEMCOUNT_MAX)
doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_GREEN)
else
return FALSE
end
return TRUE
end
That is it should work great.