User:Rehevkor/Scripts/HP Monitor

From Discworld MUD Wiki
< User:Rehevkor‎ | Scripts
Revision as of 15:28, 8 August 2009 by Rehevkor (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

To install copy and paste the text in the box below to zMUD.

#CLASS {Lexx's HP Monitor}
#VAR MaxHp {0}
#VAR MaxGp {0}
#VAR XpVar {0}
#VAR Damage {0}
#VAR HpRegen {3}
#VAR HpVar {0}
#VAR GpVar {0}
#VAR HpPerc {100}
#VAR GpPerc {100}
#VAR HpCol {green}
#TRIGGER {^Hp: %1~(&MaxHp~)[ ]Gp: %2~(&MaxGp~)[ ]Xp: &XpVar$} {
  #MATH Damage (%1 - @HpVar)
  #VAR HpVar %1
  #VAR GpVar %3
  #MATH HpPerc ((%float( 100)/@MaxHp)*@HpVar)
  #MATH GpPerc ((%float( 100)/@MaxGp)*@GpVar)
  #IF ((%float( 100)/@MaxHp)*@HpVar)<=25) {#VAR HpCol red} {#IF (((%float( 100)/@MaxHp)*@HpVar)<=50) {#VAR HpCol bold,yellow} {#VAR HpCol green}}
  #SUB {%ansi(@HpCol)Hp: @HpVar %if(@Damage!=@HpRegen,%if(@Damage<0,%ansi(bold,red)~{@Damage~}%ansi(@HpCol),%if(@Damage>0,%ansi(bold,cyan)~{+@Damage~}%ansi(@HpCol) )))(@MaxHp) Gp: @GpVar (@MaxGp) Xp: @XpVar}
  }
#CLASS 0