Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » Finished MUD Scripts
fadedparadox
Beginner


Joined: 11 Jan 2007
Posts: 10

PostPosted: Thu Mar 15, 2007 10:47 am   

Achaea: Critical Hit Counter
 
Trevize from Achaea here. I maintain and update a website with scripts for Achaea that I wrote.

I figured I might as well post some of my scripts here. As always, the newest versions of my scripts are at achaea.fadedparadox.com.

Quoted from my website:

Quote:
This script tracks your critical hits overall and in individual sessions. Use CRITS SHOW to see your crits, CRITS ON/OFF to turn the crit tracking on and off, CRITS SESSION to reset the current session, and CRITS RESET to reset the whole script. The critcounter script installs into the Shadow|CritCounter directory.

To make this script work properly, do two things. One, create triggers that match your attacks, make them do CRITHIT, and place them inside the Shadow|CritCounter|crittrigs directory. Be certain you do this! It will not track hits without the triggers, and it will not turn off properly without the triggers in the proper directory. And two, be sure to turn the CritCounter off when fighting, and on when bashing, to ensure it tracks hits and criticals properly.

Code:
#CLASS {Shadow}
#CLASS 0
#DELC {Shadow|CritCounter}
#CLASS {Shadow|CritCounter}
#VAR critcounterversion {1.0}
#CLASS 0
#CLASS {Shadow|CritCounter|critscript}
#ALIAS crits {#if ("%1" == "off") {#T- crittrigs;#say " ";#say " ";#say %ansi( 7)CritCounter disabled.;#send " "} {#if ("%1" == "on") {#T+ crittrigs;#say " ";#say " ";#say %ansi( 7)CritCounter enabled.;#send " "} {#if ("%1" == "show") {critshow} {#if ("%-1" == "reset") {critreset;#say " ";#say " ";#say %ansi( 7)CritCounter reset.;#send " "} {#if ("%-1" == "session") {critsession;#say " ";#say " ";#say %ansi( 7)CritCounter session reset.;#send " "} {crithelp}}}}}}
#ALIAS critshow {#pri {#say " ";#say " ";#say %ansi( 7)CritCounter Status: %if(%class(crittrigs),%ansi( 3)enabled,%ansi( 4)disabled)%ansi( 7).;#say " ";#say %ansi( 6)Critical hits:;#say %ansi( 8)"                            Overall                 Current Session";#say %ansi( 8)" Type of hit         Number    %hit   %crit      Number    %hit   %crit";#say " ";#sayp %ansi( 7)" Total Hits";#sayp %ansi( 7)%repeat(" ", 16-%len(@critcount.hits))@critcount.hits;#say %ansi( 7)%repeat(" ", 28-%len(@critsession.hits))@critsession.hits;#sayp %ansi( 7)" Total Criticals";#sayp %ansi( 7)%repeat(" ", 11-%len(@critcount.crits))@critcount.crits;#sayp %ansi( 7)%repeat(" ", 7-%len(@critpercent(@critcount.crits)))@critpercent(@critcount.crits)"%";#sayp %ansi( 7)%repeat(" ", 20-%len(@critsession.crits))@critsession.crits;#say %ansi( 7)%repeat(" ", 7-%len(@scritpercent(@critsession.crits)))@scritpercent(@critsession.crits)"%";#say " ";critdisplay c Criticals;critdisplay cc Crushing;critdisplay oc Obliterating;critdisplay apc Annihilating;critdisplay wsc World-Shattering;#send " "}}
#ALIAS crithelp {#say " ";#say " ";#say {%ansi( 7)CRITS SHOW - display your critical hits};#say {%ansi( 7)CRITS ON/OFF - turn the crit counter on or off};#say {%ansi( 7)CRITS SESSION - reset your crit session};#say {%ansi( 7)CRITS RESET - reset your crit counter};#send " "}
#ALIAS critsession {#pri {#addkey critsession {hits|c|cc|oc|apc|wsc|crits} {0}}}
#ALIAS critreset {#pri {#addkey critcount {hits|c|cc|oc|apc|wsc|crits} {0};#addkey critsession {hits|c|cc|oc|apc|wsc|crits} {0}}}
#ALIAS crithit {#addkey critcount hits {%eval(%db(@critcount,hits)+1)};#addkey critsession hits {%eval(%db(@critsession,hits)+1)}}
#ALIAS critadd {#addkey critcount %1 {%eval(%db(@critcount,%1)+1)};#addkey critcount crits {%eval(%db(@critcount,crits)+1)};#addkey critsession %1 {%eval(%db(@critsession,%1)+1)};#addkey critsession crits {%eval(%db(@critsession,crits)+1)}}
#ALIAS critdisplay {#sayp %ansi( 7)" "%-2;#sayp %ansi( 7)%repeat(" ", 26-%len(%-2)-%len(%db(@critcount,%1)))%db(@critcount,%1);#sayp %ansi( 7)%repeat(" ", 7-%len(@critpercent(%db(@critcount,%1))))@critpercent(%db(@critcount,%1))"%";#sayp %ansi( 7)%repeat(" ", 7-%len(@critpercent2(%db(@critcount,%1))))@critpercent2(%db(@critcount,%1))"%";#sayp %ansi( 7)%repeat(" ", 12-%len(%db(@critsession,%1)))%db(@critsession,%1);#sayp %ansi( 7)%repeat(" ", 7-%len(@scritpercent(%db(@critsession,%1))))@scritpercent(%db(@critsession,%1))"%";#say %ansi( 7)%repeat(" ", 7-%len(@scritpercent2(%db(@critsession,%1))))@scritpercent2(%db(@critsession,%1))"%"}
#VAR critcount {}
#ADDKEY critcount {hits|crits|c|cc|oc|apc|wsc} {0}
#VAR critsession {}
#ADDKEY critsession {hits|crits|c|cc|oc|apc|wsc} {0}
#FUNC critpercent {%if(@critcount.hits,%format(2,%eval(%float(%1)/%float(@critcount.hits)*100)),0.00)}
#FUNC critpercent2 {%if(@critcount.crits,%format(2,%eval(%float(%1)/%float(@critcount.crits)*100)),0.00)}
#FUNC scritpercent {%if(@critsession.hits,%format(2,%eval(%float(%1)/%float(@critsession.hits)*100)),0.00)}
#FUNC scritpercent2 {%if(@critsession.crits,%format(2,%eval(%float(%1)/%float(@critsession.crits)*100)),0.00)}
#CLASS 0
#CLASS {Shadow|CritCounter|crittrigs}
#REGEX {^You have scored a CRITICAL hit\!$} {critadd c}
#REGEX {^You have scored a CRUSHING CRITICAL hit\!$} {critadd cc}
#REGEX {^You have scored an OBLITERATING CRITICAL hit\!$} {critadd oc}
#REGEX {^You have scored an ANNIHILATINGLY POWERFUL CRITICAL hit\!$} {critadd apc}
#REGEX {^You have scored a WORLD-SHATTERING CRITICAL HIT\!\!\!$} {critadd wsc}
#REGEX {^You slip behind .* and garrote .*} {crithit}
#CLASS 0
#SAY [Shadow] CritCounter script 1.0 installed.
Reply with quote
fadedparadox
Beginner


Joined: 11 Jan 2007
Posts: 10

PostPosted: Thu Mar 15, 2007 10:50 am   
 
Sample output:

Code:

CritCounter Status: enabled.
 
Critical hits:
                            Overall                 Current Session
 Type of hit         Number    %hit   %crit      Number    %hit   %crit
 
 Total Hits            3390                        1161
 Total Criticals        635  18.73%                 222  19.12%
 
 Criticals              501  14.78%  78.90%         179  15.42%  80.63%
 Crushing               105   3.10%  16.54%          35   3.01%  15.77%
 Obliterating            24   0.71%   3.78%           8   0.69%   3.60%
 Annihilating             5   0.15%   0.79%           0   0.00%   0.00%
 World-Shattering         0   0.00%   0.00%           0   0.00%   0.00%
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » Finished MUD Scripts 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