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


Joined: 03 Apr 2006
Posts: 7
Location: Houston, TX

PostPosted: Mon Aug 14, 2006 6:13 am   

trigger for mana percentage
 
Is there a way to make a trigger that can like do the math of someone's mana, and be set to let you know that the person's mana is below half.


Also to use it in conjunction with a skill that lets me see the person's mana.

Like with: X's mana stands at 6792/6252.

X's mana stands at 3396/6252.
(echo @t is below half!)

can that be worked with in regards of using echos and the math?
Reply with quote
Qiz
Novice


Joined: 14 Aug 2006
Posts: 34
Location: Sweden

PostPosted: Mon Aug 14, 2006 7:06 am   
 
An easy way to do this is to create a trigger with the "prompt" option checked. Set the trigger to match your prompt or part of it, just make sure it's enough not to go off elsewhere.

For example:
#TRIG {<(%d)/(%d)hp (%d)/(%d)m} { #IF (%3 < (%4 / 2)) { #ECHO Less than half mana} "" "prompt"

In this case, %1 would be current hp, %2 max hp, while %3 is current mana and %4 max mana. Straight away in the ifcheck, the calculation %4 / 2 (or max mana divided by 2) is done, and after that the conditional check %3 < half of the max mana. The problem however, is that this will keep triggering until you get your mana above half. So, using two complementing triggers like below will do the trick:
#TRIG {<(%d)/(%d)hp (%d)/(%d)m} { #IF (%3 < (%4 / 2)) { #ECHO Less than half Mana!!; #T- BelowHalfMana; #T+ AboveHalfmana}} "BelowHalfMana" "prompt"
#TRIG {<(%d)/(%d)hp (%d)/(%d)m} { #IF (%3 > (%4 / 2)) { #T+ BelowHalfMana; #T- AboveHalfMana}} "AboveHalfMana" "prompt"

With those two triggers you will get one warning each time you drop below half mana. No further warning is issued until you have been above half mana, and then again drop below half.
Reply with quote
Dumas
Enchanter


Joined: 11 Feb 2003
Posts: 511
Location: USA

PostPosted: Mon Aug 14, 2006 11:31 am   
 
And for the part about observing someone else's mana:

#TRIG {(*)'s mana stands at (%d)/(%d).} {#IF (%2<(%3/2)) {#ECHO %1 is below half!}}

No need to have prompt selected for this as you want it to fire immediately.
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