SphereCommunity
Change spell properties individually - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Change spell properties individually (/Thread-Change-spell-properties-individually)



Change spell properties individually - Coruja - 07-11-2013 09:07 AM

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


RE: Change spell properties individually - Staff_Stanic - 07-11-2013 12:23 PM

I think that you can use 'ARGN2' and 'ARGN3' to do what you want...
Code:
@Effect
ARGN1 = The number of the spell that has hit the object.
ARGN2 = The strength of the spell.
ARGN3 = A multiplier for the spell's duration or effect.

Also you can use the 'ARGN3' to change the "length of time it will take to cast the spell" on @Start
Code:
@Start
ARGN1 = The spell number being cast.
ARGN2 = The difficulty of the spell.
ARGN3 = The length of time it will take to cast the spell, in tenths of a second.


Font:
http://wiki.sphere.torfo.org/index.php/@Effect
http://wiki.sphere.torfo.org/index.php/@Start_(Spell_Trigger)


RE: Change spell properties individually - Coruja - 07-12-2013 12:44 PM

ARGN2 on both trigger just change the spell power value that seems a random value based on magery, to later use this value on the unknown EFFECT formula to return the unknow value which I doesnt want to use

and ARGN3 on @Start changes only the spell cast time not the spell effect duration


RE: Change spell properties individually - admin phoenix - 07-12-2013 03:21 PM

why not using
ON=@Effect
argn2=<eval (<SRC.MAGERY>*10)/100>

or some other formular?
I am using this for my whole spells.
But my formular is a little bit complexer. I am using a function because I am also using resistance and some other effects Smile


RE: Change spell properties individually - Coruja - 07-13-2013 02:32 AM

already tried some days ago but it doesnt work too
with magery 100.0% the ARGN2 return strange values like 700~900, to use this random value on another formula to define the real spell effect (how much dex the clumsy will decrease). But in this case the ARGN2 is completely useless since EFFECT on [spell 1] always override it

Code:
[SPELL 1]
...
EFFECT=10,15

ON=@Success //or @Effect
ARGN2=<R1000>
just try it and even changing the ARNG2 to 0 or 1000, the dex decreased is always a random value between 10~15


RE: Change spell properties individually - darksun84 - 07-13-2013 02:40 AM

According to my "tests"the "spell power" thing in argn2 just increase the chance to get the maximum value of the EFFECT field Tongue

Or better, more your magery is high, more chance you'll get the maximum effect value