• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Special Spell

WiLDTuRTLE

Member
Joined
Feb 26, 2011
Messages
478
Reaction score
5
So I need a spell that include this, 'utito reflec'
Reflect 50% of ALL DMG RECIEVED.
I know this is possible with an item, but i don't know how to make it as spell.

heres the attribut i use on items;
Code:
<attribute key="reflectpercentall" value="100" />

thanks alot to the person who will make this spell for me. <3
 
LUA:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Reflection" version="1.0" author="otland" contact="otland.net" enabled="yes">
	<instant name="Reflection" words="exori reflect" 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>
 
LUA:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Reflection" version="1.0" author="otland" contact="otland.net" enabled="yes">
	<instant name="Reflection" words="exori reflect" lvl="50" mana="140" prem="1" aggressive="0" selftarget="1" exhaustion="7000" needlearn="0" event="script">
		<vocation id="4"/>
		<vocation id="8"/>
		<=!=[=C=D=A=T=A=[
			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"><=!=[=C=D=A=T=A=[
		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>


WAIT!!!!! =OOOO
Where im putting it at? Mods? o.o, never used mod can you tell me how to use it? -> im going to check how to use mod (tut) if there is one thanks for the reply 2 :)
 
save code as script.xml at /mods/

dont understand as the noob i am lol, Ive added this in customspells.xml

Code:
	<instant name="Reflection" words="exori reflect" lvl="50" mana="140" prem="1" aggressive="0" selftarget="1" exhaustion="7000" needlearn="0" event="script/reflect.lua">
		<vocation id="4"/>
		<vocation id="8"/>
	</instant>


And added a LUA script which is the WHOLE thing rury sent/made in it thats it, ive never clicked Mods folder, only data :s
 
Possible to make one similar to that, but gives X % of damage reduction to X and to all?
Like an armor, +5% physical reduction, ~~
for X seconds?

PD; where do i set the time on the spell? I want the reflect effet to be active for 1min, also add a sign to show that the buff is activated? possible?
 
Last edited:
Back
Top