[Spell 18]
DEFNAME=s_fireball
NAME=Fireball
SOUND=snd_SPELL_FIREBALL
RUNES=VF
CAST_TIME=1.6
RESOURCES=i_reag_black_pearl
RUNE_ITEM=i_rune_FIREBALL
SCROLL_ITEM=i_scroll_FIREBALL
FLAGS=SPELLFLAG_DIR_ANIM | SPELLFLAG_HARM | SPELLFLAG_TARG_CHAR | SPELLFLAG_FX_TARG
EFFECT_ID=i_fx_fireball
EFFECT=8,16
DURATION=0.0
MANAUSE=9
SKILLREQ=MAGERY 30.0
INTERRUPT=100.0,100.0
ON=@Effect
custom_fire_effect <argo>
return 1
[function custom_fire_effect]
if (<uid> = <src>) //check is damage spell targeted to self
return 1
elif <custom_spell_check <argn1>>
local.refd = <reflection_check>
local.firemagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.skillrand=(<magery> + <inscription> + <evaluatingintel>)/150
local.firemagic=<EVAL <local.firemagic> + rand(<eval <local.skillrand>/2> ,<eval <local.skillrand>>)>
local.firemagic=<EVAL <local.firemagic> - <resfire>>
if <local.refd> = 0
damage <eval < local.firemagic>> dam_fire <src>
elif <local.refd> = 1
src.damage <eval < local.firemagic>> dam_fire <src>
endif
endif
[function custom_spell_check] //check the source because if source is item formulas can return odd results
ref1 = <argn1>
if (<ref1>)
if (<ref1.type> = t_scroll) || (<ref1.type> = t_wand)
return 1
else
return 0
endif
elif (<isitem>)
return 0
else
return 1
endif
[function reflection_check]
if ((<findid.i_rune_magic_reflection>) && !(<src.uid> = <uid>))
if <src.findid.i_rune_magic_reflection>
findid.i_rune_magic_reflection.remove
src.findid.i_rune_magic_reflection.remove
SRC.EFFECT=3,037b9,6,15,1
EFFECT=3,037b9,6,15,1
return 2
else
findid.i_rune_magic_reflection.remove
EFFECT=3,037b9,6,15,1
return 1
endif
else
return 0
endif