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

Spell erac tnodi- A support mana refill for Sorcs/Druids

Joe Rod

Discord: joerod1
Joined
Mar 16, 2011
Messages
499
Solutions
2
Reaction score
172
GitHub
joerod1
Hi all, this is a support spell for sorc/druids that it gives a certain percent of total mana if it's sacrificed a certain percent of your total hp, the player who cast this spell can get max 50% of his/her total mana and sometimes can die because it removes 50~100% of total hp. As you can see is a double-edged sword, it could save the life or finish it.

b_zuy4.png


Lua:
function onCastSpell(cid, var)

	local num = math.random(50)
	local pos = getThingPos(cid)
	local health = math.floor(getCreatureMaxHealth(cid)*((num*2)/100))
	local mana = math.floor(getCreatureMaxMana(cid)*((num)/100))
	if (health >= getCreatureHealth(cid)) then
		doSendAnimatedText(pos, "FAIL!", 215)
	else
		doSendAnimatedText(pos, "+"..num .."%", COLOR_LIGHTGREEN)
		doPlayerSendTextMessage(cid, 27, "You have won "..mana.." mana points, by sacrifice of "..health.." points." )
	end
	doSendMagicEffect(pos, 12)
	doCreatureAddHealth(cid, -health)
	doCreatureAddMana(cid, mana)
	
	return true 
end

XML:
<instant name="Intense Mana Recover" words="erac tnodi" lvl="20" mana="70" aggressive="1" selftarget="1" exhaustion="10000"  needlearn="0" event="script" value="support/idontcare.lua">
		<vocation id="1;5"/>
		<vocation id="2;6"/>	
	</instant>

I hope you like it, it was a random idea :p
Regards
 
Replace:
Code:
	local health = math.floor(getCreatureMaxHealth(cid)*((num*2)/100))
	local mana = math.floor(getCreatureMaxMana(cid)*((num)/100))
With:
Code:
	local health = math.floor(getCreatureHealth(cid)*((num*2)/100))
	local mana = math.floor(getCreatureMana(cid)*((num)/100))
To make it only steal from currently available health, not max health.
 
Back
Top