Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Heal "command"
Author Message
gergecoelho
Apprentice
*

Posts: 31
Likes Given: 7
Likes Received: 3 in 3 posts
Joined: Jul 2015
Reputation: 0



Post: #1
Heal "command"
Hey guys, me again. Big Grin

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! Tongue
07-27-2015 04:47 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #2
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
Find all posts by this user Like Post Quote this message in a reply
gergecoelho
Apprentice
*

Posts: 31
Likes Given: 7
Likes Received: 3 in 3 posts
Joined: Jul 2015
Reputation: 0



Post: #3
RE: Heal "command"
Oh thanks on that one! Big Grin

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. Smile
(This post was last modified: 07-27-2015 11:47 AM by gergecoelho.)
07-27-2015 11:46 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #4
RE: Heal "command"
I'm pretty sure you are receiving this error when targeting tress, etc.

Code:
ref1=<argo>//place next check after this line
if !(<ref1.IsChar>)
sysmessage=You can only heal living beings.
elseif (<ref1.dist> >= 2) // the rest of the code, note the 'elseif' here.
07-27-2015 06:36 PM
Find all posts by this user Like Post Quote this message in a reply
gergecoelho
Apprentice
*

Posts: 31
Likes Given: 7
Likes Received: 3 in 3 posts
Joined: Jul 2015
Reputation: 0



Post: #5
RE: Heal "command"
Switched "<ref1.dist>" to "<ref1.DISTANCE>" and it's workind fine now. Big Grin

Thanks again!!
07-28-2015 01:30 AM
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)