• 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!

Money-Change (Example: 100cc to 1 Gold Nugget/- 1 Gold Nugget to 100cc)

Martiimeus

●тнυg●ℓιƒє● ρα¢ 4 єνєя
Joined
Feb 3, 2009
Messages
500
Reaction score
1
Location
gєямαηу
Hello Guys,

as the thread already says, Im searching for a script that changes all gold blablablas with an effect like ,29

well and then the 100cc should be able to change to 1 gold nugget and 1 g-nugget to 100cc like 100gp to 1 platinum and 100 platinum to 1cc and every change there, should have an effect like magiceffect,29:thumbup:
 
Last edited:
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, to = ITEM_DOLLAR, effect = TEXTCOLOR_TEAL
	},
	[ITEM_GOLDNUGGET] = {
		from = ITEM_CRYSTAL_COIN, to = ITEM_GOLDINGOT, effect = TEXTCOLOR_GREEN
	},
	[ITEM_GOLDINGOT] = {
		from = ITEM_GOLDNUGGET, effect = TEXTCOLOR_GREEN
	}
}

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

XML:
	<item id="2157" article="a" name="gold nugget" plural="gold nuggets">
		<attribute key="weight" value="10" />
		<attribute key="worth" value="1000000" />
	</item>

	<item id="9971" article="a" name="gold ingot">
		<attribute key="weight" value="1800" />
		<attribute key="worth" value="100000000" />
	</item>
 
Back
Top