Help - Search - Members - Calendar
Full Version: Sphere 1.0 Rc7: Custom Spells : Flagging Help
SphereServer Forums > Archived Discussions > Sphere 1.0 > Script Help 1.0
Admin Sayter
I've custom built about 400 spells subdivided into roughly 8 different groups of mage spells. However, I have one really annoying error which makes them overly unbalanced.

When I cast the spell on an NPC (ie: Player attacks a headless with Fireball), they are hit by the spell as expected. Damage is dealt. Saving throws applied as needed etc...but they do NOT aggro the attacking player.

What is an easy method to achieve this goal? Here is an example of a simple spell to ease giving me a heads up. Most of my spells use a similar structure.


[itemdef 01f32]
defname=i_scroll_magic_arrow
resources=i_scroll_blank, i_reag_sulfur_ash
skillmake=inscription 10.0, magery 5.0
type=t_eq_script
weight=1
//circle=1
category=provisions - alchemy & magic
subsection=scrolls - 1st circle
description=magic arrow scroll

on=@create
attr_magic=1
//morex=s_magic_arrow
//morey={10 50}

ON=@userdclick
VAR MAINCAST=(<?src.magery?>+(<?src.magicklore?>/10))
VAR CHANCEFAIL=RAND(55)
src.consume 10 i_arrow_fx
IF (<?src.tag.gifted?>==1)
IF (<?src.mana?> >=6)
IF (<?src.magery?> >=6.0)
IF (<?CHANCEFAIL?> <= <?MAINCAST?>)
src.say "Vrel Kath"
src.anim 16
target "Select the target to cast this spell on."
src.f_raiseexp
return 1
else
src.sysmessage "You fail to cast the spell."
return 1
endif
return 1
else
src.sysmessage "You are not skilled enough to cast this spell."
return 1
endif
return 1
else
src.sysmessage "You lack the mana to cast this spell."
return 1
endif
return 1
else
src.sysmessage "You are not gifted, and cannot cast magick."
return 1
endif

ON=@targon_char
src.flags=<?src.flags?>&&statf_war //war mode
src.targ.attack
src.newitem=i_arrow_fx
src.act.more1=(<?src.magery?>/12)+(<?src.magicklore?>/20)+(<?src.evaluatingintel?>/20)+{1 4}
src.act.equip
return 1



[ITEMDEF i_arrow_fx]
name="magicarrow"
id=i_memory
type=t_eq_script
layer=layer_special

on=@create
attr=attr_newbie|attr_move_never
timer=0
tag.times=1

on=@timer
var randres=RAND(100)
if (<tag.times>==1)
tag.times=<tag.times>+1
timer=0
return 0
elseif (<tag.times>==2)
if (<cont.targ.magicresistance> <=<randres>)
cont.targ.effect=0,i_fx_fireball_small,5,16,1
cont.targ.sound=snd_SPELL_MAGIC_ARROW
cont.targ.hits=<cont.targ.hits>+-<more1>

cont.mana=<cont.mana>+-6
return 0
else
cont.targ.sysmessage "You resist the spell."
//src.targ.effect=3,i_fx_glow2,0,16,0
cont.targ.sound=snd_SPELL_MAGIC_ARROW
cont.targ.effect=0,i_fx_fireball_small,5,16,1

cont.mana=<cont.mana>+-6
return 0
endif

timer=1
tag.times=0
remove
return 0
endif
Apo
Use hit(<dam>,<type>,<src-uid>) or damage(<dam>,<type>,<src-uid>) when dealing damage instead of just decreasing the hitpoints.

This way you'll also get some damage animations.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.