|
Valheru Newbie
Joined: 26 Jul 2003 Posts: 2 Location: Malaysia
|
Posted: Sat Jul 26, 2003 10:54 pm
Damage Calculation |
I would like to know if there's a way to calculate damage based on the following formula.
damage = exp gained per hit/2
The mud could be set to display exp total after each hit but I can't figure out how to set the trigger to keep both old and new exp. |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sat Jul 26, 2003 11:02 pm |
Assuming that the experience is displayed in the prompt, you need to capture the experience displayed in the prompt and save it in a variable. Then, subtract the value of this variable from the current amount of experience the prompt displays. Example:
#TRIGGER {(%d)exp~>} {#SH Damage was: %eval((%1 - @exp) / 2);#VAR exp %1} "" {prompt|nocr} |
|
|
|
Valheru Newbie
Joined: 26 Jul 2003 Posts: 2 Location: Malaysia
|
Posted: Sun Jul 27, 2003 5:51 am |
The show works but if I want it to display on status ?
|
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sun Jul 27, 2003 5:34 pm |
Define the status bar as follows:
#STATUS {Damage was: @damage}
and then replace the whole #SH command with:
#VAR damage %eval((%1 - @exp) / 2) |
|
|
|
|
|