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-nmm7 (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-nmm7 (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-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 786 - File: showthread.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/showthread.php 786 errorHandler->error






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change spell properties individually
Author Message
Coruja
Sphere Developer
*****

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

Dimension Shard

Post: #1
Change spell properties individually
Code:
[SPELL 1]
DEFNAME=s_clumsy
...
EFFECT=10
DURATION=120.0
I need to preserve the current spell hardcoded action (items, memories, etc) without using SPELLFLAG_SCRIPTED to prevent many headaches but just use a custom formula to make EFFECT and DURATION a variable based on magery skill

it's something like this:
Code:
[SPELL 1]
DEFNAME=s_clumsy
...

ON=@Effect
EFFECT=<eval (<SRC.MAGERY>*10)/100>
DURATION=<eval (<SRC.MAGERY>*120)/100>
is there any way to do this using -legal- sphere functions/variables like this example?

I'm asking this because the only way I found to do this is use a horrible workaround to change these variables globally like this:
Code:
[SPELL 1]
DEFNAME=s_clumsy
...

ON=@Effect
//change effect and duration to be applied when hit the spell
SERV.SPELL.s_clumsy.EFFECT=<eval (<MAGERY>*10)/100>
SERV.SPELL.s_clumsy.DURATION=<eval (<MAGERY>*120)/100>

//now I must use another second horrible workaround to store the value
//(on the item that doesnt exists but will be created when the spell hit lol)
//to make it apply the same EFFECT when DURATION is over:
TIMERF 1,FINDID.i_rune_clumsy.MORE = <SERV.SPELL.s_clumsy.EFFECT>
TIMERF 1,FINDID.i_rune_clumsy.EVENTS = +t_horrible_workaround

[TYPEDEF t_horrible_workaround]
ON=@Unequip
SERV.SPELL.<MOREX>.EFFECT=<MORE>
If there's no way to do this, it could be a great feature to some dev implement Smile

EDIT: lol I posted this topic on wrong forum section, someone move it to "Sphere .56b > Script Help" plz
(This post was last modified: 07-11-2013 09:17 AM by Coruja.)
07-11-2013 09:07 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Change spell properties individually - Coruja - 07-11-2013 09:07 AM

Forum Jump:


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