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
Alexiel
Novice


Joined: 05 Mar 2007
Posts: 33
Location: Paulsboro,NJ

PostPosted: Fri Dec 14, 2007 9:34 pm   

Help with gains and losses from casting
 
This is what my status bar looks like:
Code:
< RuRi | 2466h 2451m 402v | fVH >

the fVH are spell ups and vary from chara to chara.
What I would like is when one of my mana or hitpoint draining pieces of eq fires is to be able to group talk that to my group.
Examples of drains:
-You drain energy from %1 with a mystical aura of the seasons.
-An ice spear glows in your hands, filling you with %1's energy.
I would like to see something like +<mana amount> +<hp amount> on my status bar as well.
Thank you in advance
-Alexiel
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sat Dec 15, 2007 5:26 am   
 
I kind of get what you're asking, but could you please show us what the output is supposed to look like? And what do you mean +<mana amount> +<hp amount>? Are you talking about moving your hp/mana info down onto your status bar?

Charneus
Reply with quote
Alexiel
Novice


Joined: 05 Mar 2007
Posts: 33
Location: Paulsboro,NJ

PostPosted: Sat Dec 15, 2007 6:41 pm   
 
it doesn't show how much i drain...the mana from the status bar just changes...so for example:
< RuRi | 2466h 2451m 402v | fVH >
You drain energy from %1 with the mystical aura of seasons would equal something like: < RuRi | 2466h 2551m 402v | fVH >.

I want it to show something like: < RuRi | 2466h 2451m 402v | fVH > (+100m) and then to be able to tell that to my group with:
Drained 100 Mana
Reply with quote
Neo2121
Beginner


Joined: 28 Dec 2006
Posts: 12

PostPosted: Tue Dec 18, 2007 9:45 am   
 
make a trigger with a pattern something like < * | *h *m *v | * > that triggers on the prompt then the script would be something like

Code:
old_health = @health
old_mana = @mana
health = %2
mana = %3
#IF (@health < @old_health) {#echo -%eval( @old_health - @health)h} {#IF (@health > @old_health) {#echo  +%eval( @health - @old_health)h}}
#IF (@mana < @old_mana) {#echo  -%eval( @old_mana - @mana)m} {#IF (@mana > @old_mana) {#echo +%eval( @mana - @old_mana)m}}



the part with %2 and %3 could be different based on the way you set up your pattern, it should grab the values of health and mana from your prompt, there's plenty of tutorials on how to do that, even in the zmud help file, the important part is that you set @old_health before you update the @health variable with the value from the mud.

Then it's just a matter of using %eval to calculate the difference and output it. The reason I used the #IF parts is so it shows +100m if you gain some and -100m if you lose some.

Saying it to your party would be as simple as adding another command after the #echo part like

Code:
#IF (@health < @old_health) {#echo -%eval( @old_health - @health)h} {#IF (@health > @old_health) {
    #echo  +%eval( @health - @old_health)h
    say +%eval( @health - @old_health)h
    }
  }


Only problem with that would be that it's gonna say something everytime your mana gets modified, that's why you might wanna make a class turn on and off based on when you use one of those items.. So it just works after you used one of the items, and not all the time. You need a #T+ <class name> and a #T- <class name> for that.. Just search the help files, shouldn't be complicated.
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