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


Joined: 27 Feb 2004
Posts: 2

PostPosted: Fri Feb 27, 2004 9:47 am   

Damage Counter, Please help!?
 
This sounds a bit dumb, but how could I make it via a trigger,
where each time I'm hit, it will #echo the amount of damage taken? -- per hit.
or if I regened it... it would say by how much... the basic layout on the mud is..

450/450H 600/607M 180/180FP
after being hit..
400/450H 600/607M 180/180FP
then it'll echo :
You've been hit for '50 dmg'..
or... if I casted armor...
400/450H 580/607M 180/180FP
You spent 20 mana.

pretty much, im needing any change in any of those variables, but... I'm new to scripting, please help!
Reply with quote
Serentus
Apprentice


Joined: 28 Sep 2001
Posts: 103
Location: USA

PostPosted: Fri Feb 27, 2004 10:26 am   
 
This should get you started.

#TRIGGER {You've Been Hit} {#VAR BeenHit 1}

#TRIGGER {You cast a spell} {#VAR Casted 1}

#TRIGGER {(%d)/(%d)H (%d)/(%d)M (%d)/(%d)FP} {#VAR PrevHealth @Health;#VAR PrevMana @Mana;#VAR PrevFP @FP;#VAR Health %1;#VAR Mana %3;#VAR FP %5;#IF (@BeenHit=1) {#SAY You've been hit for %eval(@PrevHealth-@Health) dmg;#VAR BeenHit 0};#IF (@Casted=1) {#SAY You spent %eval(@PrevMana-@Mana) mana};#VAR Casted 0} {nocr|prompt}

You could get rid of the first two triggers and change the (@BeenHit=1) and (@Casted=1) in the 3rd trigger's #IFs to (@Health<@PrevHealth) and (@Mana<@PrevMana) if you wanted to Echo everytime one drops.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Fri Feb 27, 2004 6:56 pm   
 
Going along those same lines something like this would work too

#TRIGGER {(%d)/(%d)H (%d)/(%d)M (%d)/(%d)FP} {#if (%1<prompt.hp) {prompt.damfor=%eval(@prompt.hp-%1)} {prompt.damfor=0};prompt.hp=%1;prompt.maxhp=%2;#if (%3<prompt.ma) {prompt.mafor=%eval(@prompt.ma-%1)} {prompt.mafor=0};prompt.ma=%3;prompt.maxma=%4;prompt.fp=%5;prompt.maxfp=%6;#if (@prompt.hpfor>0 OR prompt.ma>0) {#sayp hit for @prompt.damfor used @prompt.mafor mana}}

Edit: Fixed some typos
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