gergecoelho
Apprentice
Posts: 31
Likes Given: 7
Likes Received: 3 in 3 posts
Joined: Jul 2015
Reputation: 0
|
Heal "command"
Hey guys, me again.
I've been trying to make a Racial Healing Spell accessed via command ( .celheal in this case).
Here's what I got so far:
Quote:[FUNCTION celheal]
IF (<SRC.TAG.RACE>==03)
TARGET Who do you want to heal?
ELSE
I.SYSMESSAGE=You are not a Celestial.
ENDIF
ON=@TargOn_Char
IF (<TARG.DIST>=1)
ARGO.CAST 7 //Possible Heal effect and sound? Or maybe weird target on target?
SRC.SYSMESSAGE=Drawing on your divine blood, your touch heals.
ARGO.SYSMESSAGE=You were healed.
ARGO.HITS += ({8,12}+(SRC.Healing/100))
IF <ARGO.HITS> > TARG.MAXHITS
ARGO.HITS=ARGO.MAXHITS
ENDIF
ELSE
SRC.SYSMESSAGE=You must close to touch the target.
ENDIF
So, I checked the Wiki and sadly found out that @TargOn_Char fires off items, and that might explain the error message I'm getting "Targetted item gone?".
Any other way to solve this?
Plus: I'm aiming for the visual and sound effects like the Heal spell (the .cast 7) but I'm not sure if it is gonna work like it should as is, or it would make a target appear on the person who was healed.
Thanks in advance, guys!
|
|
07-27-2015 04:47 AM |
|
|
XuN
Sphere Developer
Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30
|
RE: Heal "command"
http://wiki.sphere.torfo.org/index.php/Targetf
Something like this will do the job:
Code:
[FUNCTION celheal]
IF (<SRC.TAG.RACE>==03)
sysmessage Who do you want to heal?
TARGETf _celheal
ELSE
SYSMESSAGE=You are not a Celestial.
ENDIF
Code:
[FUNCTION _celheal]
ref1=<argo>
IF (<ref1.dist> == 1) // ? Is this right? one tile away? you used IF (<TARG.DIST>=1) which makes no sense, you are not comparing anything but trying to SET the value returned from <targ.dist> to 1 ... this will cause a mess on your code.
//ARGO.CAST 7 //Possible Heal effect and sound? Or maybe weird target on target? this should be replaced with the effect you want, the spell heal should have the effectid you should use:
ref1.effect=3,effect_id_here,20,30,1
sysmessage=Drawing on your divine blood, your touch heals.
ref1.sysmessage=You were healed.
ref1.hits +=({8,12}+(Healing/100)) // Note that you are not using brackets outside Healing, it should be (<Healing>/100).
if (<ref1.hits> > <ref1.maxhits>) //IF <ARGO.HITS> > TARG.MAXHITS. you are comaring <argo.hits> against 'targ.maxhits', shouldn't it be <targ.maxhits>? However, and also important, you should be comparing or both <argo.hits> and <argo.maxhits> or <targ.hits> and <targ.maxhits> but not a mix of them, since one may target to a different character at certain situations.
ref1.hits=<ref1.maxhits>
endif
else
sysmessage=You must close to touch the target.
endif
|
|
07-27-2015 07:38 AM |
|
|
gergecoelho
Apprentice
Posts: 31
Likes Given: 7
Likes Received: 3 in 3 posts
Joined: Jul 2015
Reputation: 0
|
RE: Heal "command"
Oh thanks on that one!
Added the effect and the sound effect from the heal spell and it's looking good and healing.
But the distance thing seems messed up, it's healing regardless of distance, sphere says: Can't resolve <ref1.dist>
Quote:[FUNCTION _celheal]
ref1=<argo>
IF (<ref1.dist> >= 2)
sysmessage=You must be close to touch the target.
else
sysmessage=Drawing on your divine blood, your touch heals.
ref1.effect=3,i_fx_heal_effect,20,30,1
ref1.sound=snd_spell_heal
ref1.sysmessage=You were healed.
ref1.hits +=({8,12}+(<Healing>/100))
if (<ref1.hits> > <ref1.maxhits>)
ref1.hits=<ref1.maxhits>
endif
endif
P.S.: Dist 1 = At the target's side, right? Dist 0 = Sharing the same tile?
And it's healing even trees and statics, how could I check if it's a living thing before applying the heal?
Thanks for the attention.
(This post was last modified: 07-27-2015 11:47 AM by gergecoelho.)
|
|
07-27-2015 11:46 AM |
|
|