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

Advanced Mana rune

Rhumor

Dutch & Proud
Joined
Jul 7, 2007
Messages
451
Reaction score
2
I need a mana rune that works like this:
-How higher the players level is, how higher he heals.
-An animation on the user with howmuch he heals.

I found one before but it gave an exhaust error.
I need it for TFS 0.2.5 (8.22)

Thanks!
 
manarune.lua:
Code:
local manaPercent = 0.30 -- It give you 30% of your mana.

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local target = getThingfromPos(toPosition)
	if target.itemid == 2 and target.uid > 0 then
	local mana = getPlayerMana(target.uid)
	local maxmana = getPlayerMaxMana(target.uid)
	local gainMana = maxmana * manaPercent
		doPlayerAddMana(target.uid, gainMana)
		doSendMagicEffect(toPosition, CONST_ME_MAGIC_GREEN)
		doSendAnimatedText(toPosition, gainMana, 83)
		doPlayerRemoveItem(cid, item.itemid, 1)
	else
		doPlayerSendCancel(cid, 'You need to target a player.')
	end
return TRUE
end

spells.xml :
Code:
<rune name="Manarune" id="2312" allowfaruse="1" charges="1" lvl="20" maglv="1" exhaustion="2000" range="5" aggressive="0" needtarget="1" blocktype="solid" script="support/manarune.lua"/>

item.xml:
Code:
<item id="2312" article="a" name="mana rune">
		<attribute key="weight" value="120"/>
		<attribute key="charges" value="1"/>
	</item>

Here it is ! Have fun !!!
 
Cause this
local manaPercent = 0.30 -- It give you 30% of your mana.

function onUse(cid, item, fromPosition, itemEx, toPosition)
local target = getThingfromPos(toPosition)
if target.itemid == 2 and target.uid > 0 then
local mana = getPlayerMana(target.uid)
local maxmana = getPlayerMaxMana(target.uid)
local gainMana = maxmana * manaPercent
doPlayerAddMana(target.uid, gainMana)
doSendMagicEffect(toPosition, CONST_ME_MAGIC_GREEN)
doSendAnimatedText(toPosition, gainMana, 83)
doPlayerRemoveItem(cid, item.itemid, 1)
else
doPlayerSendCancel(cid, 'You need to target a player.')
end
return TRUE
end
is action script. So JUST add it to actions :) (and ofc actions.xml)
 
Back
Top