|
Curtis Novice
Joined: 25 Nov 2002 Posts: 39 Location: USA
|
Posted: Sat Mar 15, 2003 11:40 pm
Healing Trigger |
I am trying to create a trigger that checks my hp when I am able to take another healing potion.
@maxhp = maximum health
@hp = current health status
The trigger phrase is this:
{You could take another health or mana potion.}
What I would like to do is if my current health is 66% of @maxhp than quaff potion and if my current health is %33 of max health than quaff potion and eat herb. |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sun Mar 16, 2003 12:51 am |
#TRIGGER {You could take another health or mana potion.} {#IF (!@waitforheal) {#IF ((@hp * 100) / @maxhp < 66) {quaff potion};#IF ((@hp * 100) / @maxhp < 33) {quaff potion};#VAR waitforheal 1}}
#TRIGGER {You have healed yourself.} {#VAR waitforheal 0}
The variable @waitforheal is used so that the trigger doesn't try to heal you twice in case you get the message that you may heal again before you actually heal. I doubt that this will happen, but it is an important to check this, especially if the heal is done by a trigger that fires off the prompt.
Kjata |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Mar 16, 2003 2:58 am |
I think the second #IF is supposed to be "eat herb".
LightBulb
Advanced Member |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sun Mar 16, 2003 11:52 am |
Yup, you're right. Thanks for catching that LightBulb.
Kjata |
|
|
|
|
|