MadMOOK
Hoo
- Joined
- Apr 20, 2011
- Messages
- 802
- Reaction score
- 44
Well in your mods folder if you dont have change-gold.xml make one and add this!!
Change them xxxx's to your new item id for new currency
After you do this go into data/lib/constant.lua.... mine is 000-constant.lua,yours might be too
Find this!
Then add this beneath other coins! you name it what you want and use item id of your choosing
Go into data/items/items.xml and find your new currency item and add
and BOOM your ready to rumble!!
If you change ITEM_MILLION_COIN to anything else in contant.lua then make sure you change it in change-gold.xml mod aswell!! Cheers!
Change them xxxx's to your new item id for new currency
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="change-gold" version="1.0" author="The Forgotten Server" contact="otland.net" enabled="yes">
<action itemid="2148;2152;2160;xxxxx" event="script" override="yes"><![CDATA[
local coins = {
[ITEM_GOLD_COIN] = {
to = ITEM_PLATINUM_COIN, effect = COLOR_YELLOW
},
[ITEM_PLATINUM_COIN] = {
from = ITEM_GOLD_COIN, to = ITEM_CRYSTAL_COIN, effect = COLOR_LIGHTBLUE
},
[ITEM_CRYSTAL_COIN] = {
from = ITEM_PLATINUM_COIN, to = ITEM_MILLION_COIN, effect = COLOR_TEAL
},
[ITEM_MILLION_COIN] = {
from = ITEM_CRYSTAL_COIN, effect = COLOR_RED
}
}
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)
doPlayerSendTextMessage(cid, MESSAGE_EXPERIENCE, "$$$", ITEMCOUNT_MAX, coins[coin.to].effect, getCreaturePosition(cid))
elseif(coin.from ~= nil) then
doChangeTypeItem(item.uid, item.type - 1)
doPlayerAddItem(cid, coin.from, ITEMCOUNT_MAX)
doPlayerSendTextMessage(cid, MESSAGE_EXPERIENCE, "$$$", ITEMCOUNT_MAX, coins[coin.from].effect, getCreaturePosition(cid))
end
return true
end
]]></action>
</mod>
After you do this go into data/lib/constant.lua.... mine is 000-constant.lua,yours might be too
Find this!
Code:
ITEM_GOLD_COIN = 2148
ITEM_PLATINUM_COIN = 2152
ITEM_CRYSTAL_COIN = 2160
Code:
ITEM_MILLION_COIN = xxxxx
Go into data/items/items.xml and find your new currency item and add
Code:
<attribute key="worth" value="1000000"/>
and BOOM your ready to rumble!!
If you change ITEM_MILLION_COIN to anything else in contant.lua then make sure you change it in change-gold.xml mod aswell!! Cheers!
Last edited: