Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Curtis
Novice


Joined: 25 Nov 2002
Posts: 39
Location: USA

PostPosted: 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.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: 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
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Mar 16, 2003 2:58 am   
 
I think the second #IF is supposed to be "eat herb".

LightBulb
Advanced Member
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Mar 16, 2003 11:52 am   
 
Yup, you're right. Thanks for catching that LightBulb.

Kjata
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net