• 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 Reflection ♥

Snake Royal

Snake Hunter ♥
Joined
Sep 9, 2011
Messages
25
Reaction score
3
Location
Poland
Reflection ♥
When the player activates the spell a reflection will apply, 50% of the incoming damage will bounce back to the attacker. Duration is 5 seconds.

_______________________________________________
[video=youtube;SxvZ3bhaAD4]http://www.youtube.com/watch?v=SxvZ3bhaAD4[/video]


_______________________________________________
XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Reflection" version="1.0" author="Snake Royal" contact="otland.net" enabled="yes">
	<instant name="Reflection" words="exori ion" lvl="50" mana="140" prem="1" aggressive="0" selftarget="1" exhaustion="7000" needlearn="0" event="script">
		<vocation id="4"/>
		<vocation id="8"/>
		<![CDATA[
			function onCastSpell(cid, var)
				registerCreatureEvent(cid, "Reflection/statschange001")
				doCreatureSetStorage(cid, 2000, os.time() + 5)
				doSendMagicEffect(getThingPosition(cid), CONST_ME_HOLYDAMAGE)
				return true
			end

		]]>
	</instant>
	
	<event type="statschange" name="Reflection/statschange001" event="script"><![CDATA[
		function onStatsChange(cid, attacker, type, combat, value)
			if (getCreatureStorage(cid, 2000) > os.time() and type == STATSCHANGE_HEALTHLOSS) then
				local absorb = math.ceil(value * 0.5)
				doSendMagicEffect(getThingPosition(attacker), CONST_ME_HOLYDAMAGE)
				doSendAnimatedText(getThingPosition(attacker), absorb, COLOR_RED)
				doCreatureAddHealth(attacker, -absorb)
				doCreatureAddHealth(cid, absorb)
			end
			return true
		end
	]]></event>
</mod>
mods/yourname.xml
 
if i'm not wrong this spell
will remove player health not mana ;)
 
lets say you are attacked by a mage and you used that spell
it will remove his health not mana
 
Lua:
doTargetCombatHealth(attacker, cid, type, - absorb, - absorb, CONST_ME_HOLYDAMAGE)
Maybe this would work insted.
 
It don't work if the player/creatures hits you from distance or using magic from distance.
Please fix it.
 
Back
Top