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
Tyraelxv2
Newbie


Joined: 27 May 2011
Posts: 7

PostPosted: Fri May 27, 2011 6:48 pm   

Help with trigger!
 
I need help making a trigger to heal myself. I want to heal myself at 60%, but my prompt doesnt specify a max. Looks like:

hp: 906 sp: 960 mp: 1056 left foot: 19% Cutting

Thats the display after taking a hit. How do I do this without a max on the prompt?
the healing command would be: apply salve

Sorry for being a complete noob =D
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Fri May 27, 2011 6:54 pm   
 
you would need to have you max value predetermined and stored in a variable such as @maxHp


Code:
#TR {hp: (%d) sp: (%d) mp: (%d)} {
hp=%1
#IF (@hp<%eval(@maxHp*0.6)) {apply salve}
}

something like that should work
_________________
Discord: Shalimarwildcat
Reply with quote
Tyraelxv2
Newbie


Joined: 27 May 2011
Posts: 7

PostPosted: Fri May 27, 2011 6:56 pm   
 
I forgot to mention that in battle you sometimes get multiple prompts as you get hit multiple times. Would the eval prevent over healing?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Fri May 27, 2011 7:06 pm   
 
the eval just figures out what 60% of max is

if you want to make it so this only fires so often... you could turn it off for a timed interval before it turns back on and is able to fire again... that required naming the setting as well.


Code:
#TR "healingPrompt" {hp: (%d) sp: (%d) mp: (%d)} {
hp=%1
#IF (@hp<%eval(@maxHp*0.6)) {
apply salve
#T- healingPrompt
#ALARM "keephealing" +30 {#T+ healingPrompt}
}
}


That alarm will keep the trigger from firing but once every 30 seconds
_________________
Discord: Shalimarwildcat
Reply with quote
Tyraelxv2
Newbie


Joined: 27 May 2011
Posts: 7

PostPosted: Fri May 27, 2011 7:07 pm   
 
Wow ...... thanks for the help~
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