Help with Healing Skill coding?

by Unknown

Back to Mechanic's Corner.

Unknown2008-12-26 02:31:59
Okay, so, when you succor someone, it shows the following:

Person is:
Person currently has (# health) out of (# maxhealth) health.

I'd like to make it a list of allies and enemies, so that the following occurs...

If Person is an ally and their current health is below 66% their max health, and their current health is less than your current health, you farheal them.

So like, let's say my current health is 3000.


CODE
succor shuyin

Shuyin is:
Shuyin currently has 2000 health out of toomuchdamn health.


succor urazial

Urazial is:
Urazial currently has 2000 health out of 3000 health.

You raise your hand in the air and attempt to heal Urazial from afar.



Is it possible?

I already have a succor coding so that when I succor someone, I don't try to mass-heal myself for their afflictions.

So, would I just need to change it?


Name: suc
Pattern:
succor %1
#if (%1 = me) {@succor = 1} {@succor = 0}

This is what my current setting is for it. I know my question is rather jambled, but I hope someone can decode it and help me out. Thanks!
Unknown2008-12-26 03:22:53
I could give you the Psuedocode for it, but that's about it.
Unknown2008-12-26 04:00:45
QUOTE (Kialkarkea @ Dec 25 2008, 10:22 PM) <{POST_SNAPBACK}>
I could give you the Psuedocode for it, but that's about it.


I'll take quasi-code. Shoot.
Gwylifar2008-12-26 05:20:14
...for what client?
Unknown2008-12-26 05:57:06
ZMUD
Isuka2008-12-26 07:58:05
create a string list variable to store your allies (@allies), then populate it. you can create aliases to ally and unally that modify this variable.

CODE
     Trigger pattern (regex):
     ^(\\a+) currently has (\\d+) health out of (\\d+) health.$
    
     Trigger value:
     #IF ((%float(%2)/%float(%3)*100 < 66 && > %2 && %ismember(%1,@allies)) {
       ... do your farheal stuff ...
     }
     #T-


Then, alter your succor alias to enable that trigger before sending the command.

Is that basically what you're looking for?
Gwylifar2008-12-26 16:00:00
CODE
#VAR lAllies {Urazial|Astraea|other|names|here}
#TR {^(%w) currently has (%d) health out of (%d) health.$} {#if (%ismember(%1,@lAllies) and %2 < %eval(%3 * 2 / 3) and %2 < @iHealthCur) {farheal %1}}


I'm assuming your current health is in @iHealthCur, replace that with the name of the variable you use.
Isuka2008-12-26 17:06:52
QUOTE (Gwylifar @ Dec 26 2008, 08:00 AM) <{POST_SNAPBACK}>
CODE
#VAR lAllies {Urazial|Astraea|other|names|here}
#TR {^(%w) currently has (%d) health out of (%d) health.$} {#if (%ismember(%1,@lAllies) and %2 < %eval(%3 * 2 / 3) and %2 < @iHealthCur) {farheal %1}}


I'm assuming your current health is in @iHealthCur, replace that with the name of the variable you use.


I always like to turn off groups of triggers that aren't going to be used for general play. Why spend the time parsing if you're -only- going to use it directly after invoking the succor spell?
Gwylifar2008-12-26 20:00:48
Often, a single-line simple trigger will incur less overhead than the same trigger disabled plus the trigger(s) needed to enable and disable it at the appropriate times. In this case, disabling is more a matter of not triggering on the wrong circumstances than on avoiding processing overhead.

That said... by all means, wrap the above in enable/disable stuff. I wasn't intending it to be the ultimate system, just the advice requested.