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

voc ring

Beef Jerky

New Member
Joined
Sep 19, 2008
Messages
68
Reaction score
0
idk if this will work but attempted at making exp ring ( took from differant person no credits to me)


to make it so it does differant exp for each voc,


Code:
function onEquip(cid, item, slot)
getPlayerVoc

else if
getPlayerVoc ='1'
doTransformItem(item.uid, 10612, 1)
doPlayerSendTextMessage(cid, 22, 'More Power ?')
doPlayerSetExperienceRate(cid, 2)
else
getPlayerVoc ='2'
doTransformItem(item.uid, 10612, 1)
doPlayerSendTextMessage(cid, 22, 'More Power?')
doPlayerSetExperienceRate(cid, 2)
else 
getPlayerVoc ='3'
doTransformItem(item.uid, 10612, 1)
doPlayerSendTextMessage(cid, 22, 'More Power?')
doPlayerSetExperienceRate(cid, 2)
else 
getPlayerVoc ='4'
doTransformItem(item.uid, 10612, 1)
doPlayerSendTextMessage(cid, 22, 'More Power?')
doPlayerSetExperienceRate(cid, 2)else 
getPlayerVoc ='5'
doTransformItem(item.uid, 10612, 1)
doPlayerSendTextMessage(cid, 22, 'More Power?')
doPlayerSetExperienceRate(cid, 4)
else if
getPlayerVoc ='6'
doTransformItem(item.uid, 10612, 1)
doPlayerSendTextMessage(cid, 22, 'More Power?')
doPlayerSetExperienceRate(cid, 4)
else if
getPlayerVoc ='7'
doTransformItem(item.uid, 10612, 1)
doPlayerSendTextMessage(cid, 22, 'More Power?')
doPlayerSetExperienceRate(cid, 4)
else if
getPlayerVoc ='8'
doTransformItem(item.uid, 10612, 1)
doPlayerSendTextMessage(cid, 22, 'More Power?')
doPlayerSetExperienceRate(cid, 4)
else if
getPlayerVoc= '9'
doTransformItem(item.uid, 10612, 1)
doPlayerSendTextMessage(cid, 22, 'More Power?')
doPlayerSetExperienceRate(cid, 4)
elsegetPlayerVoc ='10'
doTransformItem(item.uid, 10612, 1)
doPlayerSendTextMessage(cid, 22, 'More Power?')
doPlayerSetExperienceRate(cid, 2)




return TRUE
end

function onDeEquip(cid, item, slot)
doTransformItem(item.uid, 10613, 1)
doPlayerSendTextMessage(cid, 22, 'Awh mengz')
doPlayerSetExperienceRate(cid, 1)


return TRUE
end


Idk a more advanced person in Lua.. can look it over and edit it better? that would be awesome :thumbup:
 
Code:
function onEquip(cid, item, slot)
getPlayerVoc

else if
getPlayerVoc ='1'
doTransformItem(item.uid, 10612, 1)
doPlayerSendTextMessage(cid, 22, 'More Power ?')
doPlayerSetExperienceRate(cid, 2)
else
getPlayerVoc ='2'
doTransformItem(item.uid, 10612, 1)
doPlayerSendTextMessage(cid, 22, 'More Power?')
doPlayerSetExperienceRate(cid, 2)
else 
getPlayerVoc ='3'
doTransformItem(item.uid, 10612, 1)
doPlayerSendTextMessage(cid, 22, 'More Power?')
doPlayerSetExperienceRate(cid, 2)
else 
getPlayerVoc ='4'
doTransformItem(item.uid, 10612, 1)
doPlayerSendTextMessage(cid, 22, 'More Power?')
doPlayerSetExperienceRate(cid, 2)else 
getPlayerVoc ='5'
doTransformItem(item.uid, 10612, 1)
doPlayerSendTextMessage(cid, 22, 'More Power?')
doPlayerSetExperienceRate(cid, 4)
else if
getPlayerVoc ='6'
doTransformItem(item.uid, 10612, 1)
doPlayerSendTextMessage(cid, 22, 'More Power?')
doPlayerSetExperienceRate(cid, 4)
else if
getPlayerVoc ='7'
doTransformItem(item.uid, 10612, 1)
doPlayerSendTextMessage(cid, 22, 'More Power?')
doPlayerSetExperienceRate(cid, 4)
else if
getPlayerVoc ='8'
doTransformItem(item.uid, 10612, 1)
doPlayerSendTextMessage(cid, 22, 'More Power?')
doPlayerSetExperienceRate(cid, 4)
else if
getPlayerVoc= '9'
doTransformItem(item.uid, 10612, 1)
doPlayerSendTextMessage(cid, 22, 'More Power?')
doPlayerSetExperienceRate(cid, 4)
elsegetPlayerVoc ='10'
doTransformItem(item.uid, 10612, 1)
doPlayerSendTextMessage(cid, 22, 'More Power?')
doPlayerSetExperienceRate(cid, 2)




return TRUE
end

function onDeEquip(cid, item, slot)
doTransformItem(item.uid, 10613, 1)
doPlayerSendTextMessage(cid, 22, 'Awh mengz')
doPlayerSetExperienceRate(cid, 1)


return TRUE
end

What is that :p

Anyways I made you a little more advanced one.

First put this in /data/items/items.xml:
(I used the same ids you have on that script, but you can change them if you want it on another item)

PHP:
<item id="10613" article="an" name="experience ring">
		<attribute key="weight" value="80"/>
		<attribute key="slotType" value="ring"/>
		<attribute key="transformEquipTo" value="10612"/>
		<attribute key="stopduration" value="1"/>
		<attribute key="showduration" value="1"/>
	</item>

PHP:
<item id="10612" article="an" name="experience ring">
		<attribute key="weight" value="80"/>
		<attribute key="slotType" value="ring"/>
		<attribute key="decayTo" value="0"/>
		<attribute key="transformDeEquipTo" value="10613"/>
		<attribute key="duration" value="600"/>		<!-- 600 = 10 minutes -->
		<attribute key="showduration" value="1"/>
	</item>

Now put this in /data/movements/movements.xml:

PHP:
	<movevent type="Equip" itemid="10613" slot="ring" event="script" value="expring.lua"/>
	<movevent type="DeEquip" itemid="10612" slot="ring" event="script" value="expring.lua"/>

Now create the file expring.lua in /data/movements/scripts and add this to it:

Lua:
function onEquip(cid, item, slot)

	local getVoc = getPlayerVocation(cid)
	local getPromo = getPlayerPromotionLevel(cid)
	
	local config =  {

		promotion = 1,		-- PromotionLevel (if you have 2 promotions, put 2 if you want it to boost at that point)
		
		exprate = 1.5,		-- Normal extra Exp Rate given by the ring.
		
		boostexp = 2,		-- Exp Rate BOOST given to promoted players (if they are part of the vocations stated).
		
		vocations = {3,4,7,8}	-- Vocations that get the extra exp rate BOOST after promoted. Put 1,2,3,4,5,6,7,8 if you want them all, or 0 if none.
		
	}

	function NormalBoost()
		doTransformItem(item.uid, 10612, 1)
		doPlayerSendTextMessage(cid, 22, "You will now gain " .. config.exprate .. "x exp boost for the next 10 minutes!")
		doPlayerSetExperienceRate(cid, config.exprate)
	end
	
	function ExtraBoost()
		doTransformItem(item.uid, 10612, 1)
		doPlayerSendTextMessage(cid, 22, "You will now gain " .. config.boostexp .. "x exp boost for the next 10 minutes!")
		doPlayerSetExperienceRate(cid, config.boostexp)
	end
	
	if isInArray(config.vocations, getVoc) and getPromo >= config.promotion then
		ExtraBoost()
	else
		NormalBoost()
	end
	return TRUE
end

function onDeEquip(cid, item, slot)
	doTransformItem(item.uid, 10613, 1)
	doPlayerSendTextMessage(cid, 22, "Exp rate back to 1x.")
	doPlayerSetExperienceRate(cid, 1)
end

In this script you have some extra stuff which you can configure. Read below.

Considering you asked for a voc ring (but in the script you were adding same exp to everyone), I decided to make you a more advanced exp ring that actually works different for certain vocations.

So what it does if you leave the default configuration (which means not modifying anything) of the script is:

· If you are any vocation and not promoted, when you wear the ring you get a 1.5x exp boost.

· If you are sorcerer or druid and you get promotion, when you wear the ring you will still get only 1.5x exp boost.

· But if you are a knight or a paladin and you get promotion, when you wear the ring you will get a 2x exp boost.

Thats what it does, but in the config part of the script you can change the vocations, the exp rate boosts, and the promotion level to whatever you desire.

Cheers.
 
Back
Top