The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






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)