SphereCommunity

Full Version: Damage in AREA on SPELLSUCCESS
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have this if that runs on @spellsuccess, it is working, automatically dispelling the person, but I need it to damage the next players, how should I do?

Code:
IF (<ARGN1>==5)&&(<ACT.DEFNAME>==i_potion_explosionless)
SRV.arearadius=3
ACT.REMOVE
FINDID.i_rune_paralyze.REMOVE
FINDID.i_rune_PARALYZE_FIELD.REMOVE

Damage <eval {1 2}>,dam_magic
SOUND=snd_SPELL_EXPLOSION
Effect 3 i_fx_explode 16 10 0
ENDIF
Probably there's a conflict between you code and internal code, because you're using the trigger to do some custom actions but you're not using "return 1" at the end, so sphere will run your custom code and later will also run the default hardcoded actions for this spell

So you must choose add the "return 1" line and fully do all actions on the custom script (eg: cause damage, test skillgain, etc)
Code:
ACT.REMOVE
FINDID.i_rune_paralyze.REMOVE
FINDID.i_rune_paralyze_field.REMOVE
FORCHARS 3
  DAMAGE <R1,2>,dam_magic
ENDFOR
SOUND snd_spell_explosion
EFFECT 3 i_fx_explode 16 10 0
//also check skillgain, etc
return 1

or don't use "return 1" but only deal with actions that can safely override hardcoded actions (eg: use hardcoded LOCAL's instead manually call DAMAGE, SOUND, EFFECT, etc)
Code:
LOCAL.DAMAGETYPE=dam_magic
LOCAL.EFFECT=<R1,2> //this is the same of "damage"
LOCAL.AREARADIUS=3

PS: @SpellSuccess is always called when you succeed any spell cast, and since your code is probably only used on spell 5, you can optimize this script moving @SpellSuccess (char trigger) to @Success (spell trigger) on spell 5 (sphere_spells.scp)
Reference URL's