• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[TFS 1.0] Another currency after 100cc

Its the same, add a constant function in your global.lua to define the itemid, item.xml add the "currency - worth" amount and lastly add the new lines in your changegold.lua file.
 
Its the same, add a constant function in your global.lua to define the itemid, item.xml add the "currency - worth" amount and lastly add the new lines in your changegold.lua file.

Added to global.lua:
Code:
ITEM_GOLD_COIN = 2148
ITEM_PLATINUM_COIN = 2152
ITEM_CRYSTAL_COIN = 2160
ITEM_GOLD_NUGGET = 2157
ITEM_BAR_GOLD = 15515

changegold.lua: (WORKS)
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)
   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)
   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)
   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)
   elseif item.itemid == ITEM_CRYSTAL_COIN and item.type < ITEMCOUNT_MAX then
     doChangeTypeItem(item.uid, item.type - 1)
     doPlayerAddItem(cid, ITEM_PLATINUM_COIN, ITEMCOUNT_MAX)
   elseif item.itemid == ITEM_GOLD_NUGGET and item.type == ITEMCOUNT_MAX then
     doChangeTypeItem(item.uid, item.type - item.type)
     doPlayerAddItem(cid, ITEM_BAR_GOLD, 1)
   elseif item.itemid == ITEM_GOLD_NUGGET and item.type < ITEMCOUNT_MAX then
     doChangeTypeItem(item.uid, item.type - 1)
     doPlayerAddItem(cid, ITEM_CRYSTAL_COIN, ITEMCOUNT_MAX)
   elseif item.itemid == ITEM_BAR_GOLD and item.type < ITEMCOUNT_MAX then
     doChangeTypeItem(item.uid, item.type - 1)
     doPlayerAddItem(cid, ITEM_GOLD_NUGGET, ITEMCOUNT_MAX)
   else
     return FALSE
   end
   return TRUE
end

When I add the attribute "worth" to my item (2157 & 15515 in this case) it says "[WARNING - Items::parseItemNode] Unknown key: worth"
I tried the old ones already...
 
Okay serach for crystal coin and see if it has some other parameter like currency or smth like that.
 
In const.h just search for
Code:
ITEM_CRYSTAL_COIN
then add your customs under.

In item.cpp
search for
Code:
 int32_t Item::getWorth() const

And add your worths there.

And last thing to edit is, in game.cpp and search for:
Code:
void Game::addMoney(Cylinder* cylinder, uint64_t money, uint32_t flags /*= 0*/)
 
Back
Top