• 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:
Code:
local NUGET_ID = 1234 -- enter nuget's id ;P

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_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 and item.type == ITEMCOUNT_MAX then
		doChangeTypeItem(item.uid, item.type - item.type)
		doPlayerAddItem(cid, NUGET_ID, 1)
		doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_WHITE)
	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)
		doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_LIGHTBLUE)
	elseif item.itemid == NUGET_ID then
		doChangeTypeItem(item.uid, item.type - 1)
		doPlayerAddItem(cid, ITEM_CRYSTAL_COIN, ITEMCOUNT_MAX)
		doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_LIGHTBLUE)
	end

	doSendMagicEffect(fromPosition, CONST_ME_FIREWORK_RED)

	return TRUE
end

Rep me up! ;P
 
Go to ./data/actions/actions.xml and add:
Code:
<action itemid="2157" event="script" value="other/changegold.lua"/>

Go to ./data/actions/scripts/other/goldchange.lua and replace code with my.
 
BUMP!

Could some1 help me please :(

PLEASE!

PHP:
The only one thing what I want to do is to make a script,
which is usefull to change 100cc with an effect (29) to 1 gold nugget
 
Yeah, I couldn't help you with the addon NPC but here you go :)
Tested it, should work!

Code:
--Configurations
local ITEM_NUGGET = 2157 -- Nugget ID
--End of Configs

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == ITEM_GOLD_COIN and item.type == ITEMCOUNT_MAX then --Gold Coin to Platinum Coin
		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 --Platinum Coin to Crystal Coin
		doChangeTypeItem(item.uid, item.type - item.type)
		doPlayerAddItem(cid, ITEM_CRYSTAL_COIN, 1)
		doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_TEAL)
	elseif item.itemid == ITEM_PLATINUM_COIN and item.type < ITEMCOUNT_MAX then --Platinum Coin to Gold Coin
		doChangeTypeItem(item.uid, item.type - 1)
		doPlayerAddItem(cid, ITEM_GOLD_COIN, ITEMCOUNT_MAX)
		doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_YELLOW)
	elseif item.itemid == ITEM_CRYSTAL_COIN and item.type < ITEMCOUNT_MAX then --Crystal Coin to Platinum Coin
		doChangeTypeItem(item.uid, item.type - 1)
		doPlayerAddItem(cid, ITEM_PLATINUM_COIN, ITEMCOUNT_MAX)
		doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_LIGHTBLUE)
	elseif item.itemid == ITEM_CRYSTAL_COIN and item.type == ITEMCOUNT_MAX then --Crystal Coin to Nugget
		doChangeTypeItem(item.uid, item.type - item.type)
        doPlayerAddItem(cid, ITEM_NUGGET,1)
        doSendAnimatedText(fromPosition, "Nugget!", TEXTCOLOR_YELLOW)
		end
	if item.itemid == ITEM_NUGGET and item.type < ITEMCOUNT_MAX then --Nugget to Crystal Coin
	doChangeTypeItem(item.uid, item.type - item.type)
		doPlayerAddItem(cid, ITEM_CRYSTAL_COIN, ITEMCOUNT_MAX)
	  else
		return FALSE
	end
	return TRUE
end

So, just overwrite the old "Changegold.lua".
 
Oh, that didnt work: Heres a fix!


Okay, so heres is the fix:

First, we have to edit the "Changegold.lua" to this:

Code:
--Configurations
local ITEM_NUGGET = 2157 -- Nugget ID
--End of Configs

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == ITEM_GOLD_COIN and item.type == ITEMCOUNT_MAX then --Gold Coin to Platinum Coin
		doChangeTypeItem(item.uid, item.type - item.type)
		doPlayerAddItem(cid, ITEM_PLATINUM_COIN, 1)
		doSendAnimatedText(fromPosition, "Platinum", TEXTCOLOR_LIGHTBLUE)
	elseif item.itemid == ITEM_PLATINUM_COIN and item.type == ITEMCOUNT_MAX then --Platinum Coin to Crystal Coin
		doChangeTypeItem(item.uid, item.type - item.type)
		doPlayerAddItem(cid, ITEM_CRYSTAL_COIN, 1)
		doSendAnimatedText(fromPosition, "Crystal!", TEXTCOLOR_TEAL)
	elseif item.itemid == ITEM_PLATINUM_COIN and item.type < ITEMCOUNT_MAX then --Platinum Coin to Gold Coin
		doChangeTypeItem(item.uid, item.type - 1)
		doPlayerAddItem(cid, ITEM_GOLD_COIN, ITEMCOUNT_MAX)
		doSendAnimatedText(fromPosition, "Gold", TEXTCOLOR_YELLOW)
	elseif item.itemid == ITEM_CRYSTAL_COIN and item.type < ITEMCOUNT_MAX then --Crystal Coin to Platinum Coin
		doChangeTypeItem(item.uid, item.type - 1)
		doPlayerAddItem(cid, ITEM_PLATINUM_COIN, ITEMCOUNT_MAX)
		doSendAnimatedText(fromPosition, "Platinum", TEXTCOLOR_LIGHTBLUE)
	elseif item.itemid == ITEM_CRYSTAL_COIN and item.type == ITEMCOUNT_MAX then --Crystal Coin to Nugget
		doChangeTypeItem(item.uid, item.type - item.type)
        doPlayerAddItem(cid, ITEM_NUGGET,1)
        doSendAnimatedText(fromPosition, "Nugget", TEXTCOLOR_YELLOW)
	  else
		return FALSE
	end
	return TRUE
end

Then, make a new Lua file called "changenugget.lua" inside "actions/scripts/other"
This should be inside of it:

Code:
--Configurations
local ITEM_NUGGET = 2157 -- Nugget ID
--End of Configs

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == ITEM_NUGGET then --Nugget to Crystal Coin
	doChangeTypeItem(item.uid, item.type - 1)
		doPlayerAddItem(cid, ITEM_CRYSTAL_COIN, ITEMCOUNT_MAX)
		doSendAnimatedText(fromPosition, "Crystal", TEXTCOLOR_TEAL)
	  else
		return FALSE
	end
	return TRUE
end

And last: In Actions.xml you should add this line only:

Code:
<action itemid="2157" script="other/changenugget.lua"/>

So that should fix it.
 
Hey Bagasen, you helped me very much with this as you said you couldn't helped me with the addon npc but you can try it couse this script took so much time of Cykotitan and I think he quitted it. Well just try to help me out with this *Addon NPC Script* ;)

P.S. Thank you for this Nugget script man! Gonna Rep ya :)

Keep it up!

Regards,
Martii~ :w00t:
 
Back
Top