Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Damage in AREA on SPELLSUCCESS
Author Message
dicataldisky
Apprentice
*

Posts: 9
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Nov 2019
Reputation: 0



Post: #1
Damage in AREA on SPELLSUCCESS
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
11-26-2019 08:13 AM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #2
RE: Damage in AREA on SPELLSUCCESS
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)
11-26-2019 02:09 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)