Difference between revisions of "Zmud Damage Counter"

From AvatarWiki
Jump to navigation Jump to search
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This trigger and alias set will track damage dealt and received for all on a member list. For each line of combat the hit is stored by damage verb if the person attacking was on the list, and a running damage total is kept. Damage values were taken from [[ Damage |Damage]], missing values were extrapolated. Valid damage ranges from weak to ***ANNIH. Report options include a display of {damage done/ average hit/ damage taken} or a breakdown of all hits by verb. You may display these for yourself, everyone or a partial selection. Efforts have been made to make sure that all damage is counted, currently I am under the impression that melee damage as well as spell damage that includes your name and throwing damage is accounted for. The damage done by shield charges is not.
+
Tested for zmud 7.21
  
If you have made any helpful upgrades to this code I'd appreciate it if you'd share and post it in the discussion area, though I'm presenting this as is and don't intend to consistently maintain it :)
+
This trigger and alias set will track damage dealt and received for all on a member list. For each line of combat the hit is stored by damage verb if the person attacking was on the list, and a running damage total is kept. Damage values were taken from [[ Damage |Damage]]. Report options include a display of {damage done/ average hit/ damage taken} or a breakdown of all hits by verb. You may display these for yourself, everyone or a partial selection. Latest triggers should catch anything with a name and a damage verb.
  
 
== Code ==
 
== Code ==
''Copy this section and paste it into a *.txt file. Then, in zMUD, go to "Settings -> File -> Import Text" and select the file you saved to:''
+
''For quick input copy this section and paste it into a *.txt file. Then, in zMUD, go to "Settings -> File -> Import  
  #CLASS {Damagecounter}
+
 
  #ALIAS dcadd {#additem DClist %1;#var %1 0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0;#echo %1 added to the damage counting list.}
+
  #CLASS {dcounter}
 +
  #ALIAS dcadd {#additem DCtrack %1;#additem DCnames %1;#echo %1 added to the damage counting list.}
 
  #ALIAS dcrep {#YESNO "What report would you like to show?" {Short report (total damage done and taken) :dcrep1} {Breakdown of damage verbs:dcrep2}}
 
  #ALIAS dcrep {#YESNO "What report would you like to show?" {Short report (total damage done and taken) :dcrep1} {Breakdown of damage verbs:dcrep2}}
  #ALIAS dcclear {#FO @DClist {#UNVAR %i};#VAR DClist "";#VAR DCterm 0;dcadd your;#ECHO Damagecounter reset. Please re-add groupies.}
+
  #ALIAS dcclear {#FO @DCtrack {#UNVAR %i};#VAR DCtrack "you";#VAR DCnames "";dcadd your;#ECHO Damagecounter reset. Please re-add groupies.}
  #ALIAS dcrep2 {#if (!@DCreport) {dcrepto};#YESNO "Who would you like to report for?" {Yourself:#VAR DCreportfor "your"} {Everyone:#VAR DCreportfor @DClist} {Partial:#VAR DCreportfor %pick( p:Who would you like to display reports for?:, @DClist)};#FO @DCreportfor {@DCreport Breakdown for %if( %i="your", Myself, %upper( %left( %i, 1))%right( %i, 1)):%if( %item( @{%i}, 1), %char( 32)Tickling~(~|c~|%item( @{%i}, 1)~|n~|~))%if( %item( @{%i}, 2), %char( 32)Mauling~(~|c~|%item( @{%i}, 2)~|n~|~))%if( %item( @{%i}, 3), %char( 32)Decimating~(~|c~|%item( @{%i}, 3)~|n~|~))%if( %item( @{%i}, 4), %char( 32)Devasting~(~|c~|%item( @{%i}, 4)~|n~|~))%if( %item( @{%i}, 5), %char( 32)Pulverizing~(~|c~|%item( @{%i}, 5)~|n~|~))%if( %item( @{%i}, 6), %char( 32)Maiming~(~|c~|%item( @{%i}, 6)~|n~|~))%if( %item( @{%i}, 7), %char( 32)Eviscerating~(~|c~|%item( @{%i}, 7)~|n~|~))%if( %item( @{%i}, 8), %char( 32)Mutilating~(~|c~|%item( @{%i}, 8)~|n~|~))%if( %item( @{%i}, 9), %char( 32)Disemboweling~(~|c~|%item( @{%i}, 9)~|n~|~))%if( %item( @{%i}, 10), %char( 32)Dismembering~(~|c~|%item( @{%i}, 10)~|n~|~))%if( %item( @{%i}, 11), %char( 32)Massacring~(~|c~|%item( @{%i}, 11)~|n~|~))%if( %item( @{%i}, 12), %char( 32)Mangling~(~|c~|%item( @{%i}, 12)~|n~|~))%if( %item( @{%i}, 13), %char( 32)Demolishing~(~|c~|%item( @{%i}, 13)~|n~|~))%if( %item( @{%i}, 14), %char( 32)Obliterating~(~|c~|%item( @{%i}, 14)~|n~|~))%if( %item( @{%i}, 15), %char( 32)Annihilating~(~|c~|%item( @{%i}, 15)~|n~|~))%if( %item( @{%i}, 16), %char( 32)Terminal~(~|c~|%item( @{%i}, 16)~|n~|~))}}
+
  #ALIAS dcrep2 {#if (!@DC.repto) {dcrepto};#YESNO "Who would you like to report for?" {Yourself:#VAR DC.reportfor "your"} {Everyone:#VAR DC.reportfor @DCnames} {Partial:#VAR DC.reportfor %pick( p:Who would you like to display reports for?:, @DCnames)};#LOOPDB @you {#var your.%key %eval( %db( @your, %key) + %val)};#var you "";#FO @DC.reportfor {#var %i.out "";#FO @dverbshort {#if (%db( @{%i}, %I)) {#var %i.out %concat( %db( @{%i}, out), " ", %I, ~(, ~|c~|, %db( @{%i}, %I), ~|n~|, ~))}};@DC.repto Breakdown for %if( %i="your", Myself, %upper( %left( %i, 1))%right( %i, 1)):%db( @{%i}, out)}}
#ALIAS dctermcheck {#FO @DClist {#VAR DCtemp1 0;#VAR DCtemp2 %i;#LOOP 2,15 {#VAR DCtemp1 %eval( @DCtemp1+%item( @{@DCtemp2}, %I))};#VAR DCtemp1 %eval( %item( @{@DCtemp2}, 17)/@DCtemp1);#VAR DCtemp1 %eval( @DCtemp1 * %item( @{@DCtemp2}, 16));#VAR DCtemp1 %eval( @DCtemp1 + %item( @{@DCtemp2}, 17));#VAR @DCtemp2 %replaceitem( @DCtemp1, 19, @{@DCtemp2})};#ECHO Terminal hits have been processed.}
+
#ALIAS dcrep1 {#if (!@DC.repto) {dcrepto};#YESNO "Who would you like to report for?" {Yourself:#VAR DC.reportfor "your"} {Everyone:#VAR DC.reportfor @DCnames} {Partial:#VAR DC.reportfor %pick( p:Who would you like to display reports for?:, @DCnames)};#LOOPDB @you {#var your.%key %eval( %db( @your, %key) + %val)};#var you "";#var DC.total 0;#var DC.taken 0;#var DC.totalcount 0;#var DC.takencount 0;#FO @DCnames {#if ( %db( @{%i}, terminal)) {#var %i.total %eval( %db( @{%i}, dealt) + %db( @{%i}, dealt)/(%db( @{%i}, attacks) - %db( @{%i}, terminal))* %db( @{%i}, terminal))} {#var %i.total %db( @{%i}, dealt)};#if (@DC.total < %db( @{%i}, total)) {#var DC.total %db( @{%i}, total)};#if (@DC.taken < %db( @{%i}, taken)) {#var DC.taken %db( @{%i}, taken)};#var DC.totalcount %eval( @DC.totalcount + %db( @{%i}, total));#var DC.takencount %eval( @DC.takencount + %db( @{%i}, taken))};#FO @DC.reportfor {#if ( %db( @{%i}, terminal)) {#var %i.verb %item( @dverbs, %eval( @verbBinary(1,139,%eval(%db(@{%i},dealt)/(%db(@{%i},attacks)- %db( @{%i}, terminal)))) -1))} {#var %i.verb %item( @dverbs, %eval( @verbBinary(1,139,%eval(%db(@{%i},dealt)/%db(@{%i},attacks))) -1))};@DC.repto %if( %i="your", I, %upper( %left( %i, 1))%right( %i, 1)): Dealt->%if( %db( @{%i}, total) = @DC.total, ~|bc~|, ~|c~|)%db( @{%i}, total)|n|~(%eval( %db( @{%i}, total)*100/@DC.totalcount)%~) Averaged~[|bk|%replace( %db( @{%i}, verb), "=", "-")|n|~] Took->%if( %db( @{%i}, taken) = @DC.taken, ~|br~|, ~|r~|)%db( @{%i}, taken)|n|~(%eval( %db( @{%i}, taken)*100/@DC.takencount)%~)}}
#ALIAS dcrep1 {#if (!@DCreport) {dcrepto};#YESNO "Who would you like to report for?" {Yourself:#VAR DCreportfor "your"} {Everyone:#VAR DCreportfor @DClist} {Partial:#VAR DCreportfor %pick( p:Who would you like to display reports for?:, @DClist)};dctermcheck;dcavecheck;#VAR DCtemp1 0;#VAR DCtemp2 0;#VAR DCtemp3 0;#VAR DCtemp4 0;#FO @DClist {#IF {%eval( %item( @{%i}, 19) > @DCtemp1)} {#VAR DCtemp1 %item( @{%i}, 19)};#IF {%eval( %item( @{%i}, 18) > @DCtemp2)} {#VAR DCtemp2 %item( @{%i}, 18)};#ADD DCtemp3 %item( @{%i}, 19);#ADD DCtemp4 %item( @{%i}, 18)};#FO @DCreportfor {@DCreport ~|w~|Stats for %if( %i="your", Myself, %upper( %left( %i, 1))%right( %i, 1)): Dealt->%if( %item( @{%i}, 19) = @DCtemp1, ~|BC~|, ~|C~|)%item( @{%i}, 19)~|w~|~(%eval( %item( @{%i}, 19)*100/@DCtemp3)%~) Average~[~|bk~|%item( @damageverbs, %item( @{%i}, 20))~|w~|~] Taken->%if( %item( @{%i}, 18) = @DCtemp2, ~|BR~|, ~|R~|)%item( @{%i}, 18)~|w~|~(%eval( %item( @{%i}, 18)*100/@DCtemp4)%~)}}
+
#ALIAS dcs {dcclear;#if (!@DCreport) {@DCreport = gt} {};#t+ "%w is leading (%d) player[ s]with";groupstat}
#ALIAS dcavecheck {#FO @DClist {#var DCtemp1 %i;#var DCtemp2 0;#LOOP 1,15 {#VAR DCtemp2 %eval( @DCtemp2+%item( @{@DCtemp1}, %I))};#var DCtemp2 %eval( %item( @{%i}, 17)/@DCtemp2);#var DCtemp3 %item( @damagevalues, 75);#var DCtemp4 75;#WHILE (@DCtemp2 < @DCtemp3) {#add DCtemp4 -1;#var DCtemp3 %item( @damagevalues, @DCtemp4)};#VAR %i %replaceitem( @DCtemp4, 20, @{%i})}}
+
#ALIAS dcrepto {#prompt DC.repto "Enter the channel to output to, eg gt, say ect."}
#ALIAS dcstart {dcclear;#if (!@DCreport) {@DCreport = gt} {};#if {%1} {@DCtemp1 = %1} {@DCtemp1 = 2;#prompt DCtemp1 "How many people are in the group?"};#if (@DCtemp < 10) {#loop @DCtemp1 {#temp {^ %i|??? ???? (&%wDCtemp1)} {#if (%lower( @DCtemp1) != @dcCurChar) {dcadd %lower( @DCtemp1)}}}} {#loop 1,9 {#temp {^ %i|??? ???? (&%wDCtemp1)} {#if (%lower( @DCtemp1) != @dcCurChar) {dcadd %lower( @DCtemp1)}}};#loop 10,@DCtemp {#temp {^%i|??? ???? (&%wDCtemp1)} {#if (%lower( @DCtemp1) != @dcCurChar) {dcadd %lower( @DCtemp1)}}}};group}
+
#VAR dverbshort {nil|pathetic|weak|punishing|surprising|amazing|astonishing|mauling|decimating|devastating|pulverizing|maiming|eviscerating|mutilating|disemboweling|dismembering|massacring|mangling|demolishing|obliterating|annihilating|eradicating|vaporizing|destructive|extreme|porcine|divine|daunting|terminal}
#ALIAS dcrepto {#prompt DCreport "Enter the channel to output to, eg gt, say ect."}
+
#VAR dvalues {0|2|4|8|10|14|18|22|26|30|34|38|42|46|49|55|60|65|70|75|80|85|90|95|100|110|120|130|140|150|160|170|180|190|200|225|250|275|300|325|350|375|400|425|450|475|500|540|574|606|675|730|769|810|884|915|1000|1100|1200|1300|1400|1500|1600|1700|1800|1900|2000|2200|2400|2600|2800|3000|3200|3400|3600|3800|4100|4500|5007|5901|5902|6200|6500|7000|7500|7800|8200|8500|9000|9500|10000|11000|12000|13000|14000|15000|16500|18000|19000|20000|21000|22000|23000|24000|25000|26000|27000|28000|29000|30000|31000|32000|33000|34000|35000|36000|37000|38000|39000|40000|41000|42000|43000|44500|47000|48000|50000|51000|53000|55000|57000|59000|61000|65000|70000|75000|80000|100000|0}
#VAR damageverbs {weak|punishing|surprising|amazing|astonishing|mauling|MAULING|MAULING*|MAULING**|MAULING***|decimating|DECIMATING|DECIMATING*|DECIMATING**|DECIMATING***|devastating|DEVASTATING|DEVASTATING*|DEVASTATING**|DEVASTATING***|pulverizing|PULVERIZING|PULVERIZING*|PULVERIZING**|PULVERIZING***|maiming|MAIMING|MAIMING*|MAIMING**|MAIMING***|eviscerating|EVISCERATING|EVISCERATING*|EVISCERATING**|EVISCERATING***|mutilating|MUTILATING|MUTILATING*|MUTILATING**|MUTILATING***|disemboweling|DISEMBOWELING|DISEMBOWELING*|DISEMBOWELING**|DISEMBOWELING***|dismembering|DISMEMBERING|DISMEMBERING*|DISMEMBERING**|DISMEMBERING***|massacring|MASSACRING|MASSACRING*|MASSACRING**|MASSACRING***|mangling|MANGLING|MANGLING*|MANGLING**|MANGLING***|demolishing|DEMOLISHING|DEMOLISHING*|DEMOLISHING**|DEMOLISHING***|obliterating|OBLITERATING|OBLITERATING*|OBLITERATING**|OBLITERATING***|annihilating|ANNIHILATING|ANNIHILATING*|ANNIHILATING**|ANNIHILATING***|terminal}
+
#VAR dverbs {nil|pathetic|weak|punishing|surprising|amazing|astonishing|mauling|MAULING|MAULING*|MAULING**|MAULING***|decimating|DECIMATING|DECIMATING*|DECIMATING**|DECIMATING***|devastating|DEVASTATING|DEVASTATING*|DEVASTATING**|DEVASTATING***|pulverizing|PULVERIZING|PULVERIZING*|PULVERIZING**|PULVERIZING***|maiming|MAIMING|MAIMING*|MAIMING**|MAIMING***|eviscerating|EVISCERATING|EVISCERATING*|EVISCERATING**|EVISCERATING***|mutilating|MUTILATING|MUTILATING*|MUTILATING**|MUTILATING***|disemboweling|DISEMBOWELING|DISEMBOWELING*|DISEMBOWELING**|DISEMBOWELING***|dismembering|DISMEMBERING|DISMEMBERING*|DISMEMBERING**|DISMEMBERING***|massacring|MASSACRING|MASSACRING*|MASSACRING**|MASSACRING***|mangling|MANGLING|MANGLING*|MANGLING**|MANGLING***|demolishing|DEMOLISHING|DEMOLISHING*|DEMOLISHING**|DEMOLISHING***|obliterating|OBLITERATING|OBLITERATING*|OBLITERATING**|OBLITERATING***|annihilating|ANNIHILATING|ANNIHILATING*|ANNIHILATING**|ANNIHILATING***|ANNIHILATING***<|ANNIHILATING***<<|ANNIHILATING***<<<|ANNIHILATING***<<<<|eradicating|ERADICATING|ERADICATING*|ERADICATING**|ERADICATING***|ERADICATING***<|ERADICATING***<<|ERADICATING***<<<|ERADICATING***<<<<|vaporizing|VAPORIZING|VAPORIZING*|VAPORIZING**|VAPORIZING***|VAPORIZING***<|VAPORIZING***<<|VAPORIZING***<<<|VAPORIZING***<<<<|destructive|DESTRUCTIVE|DESTRUCTIVE*|DESTRUCTIVE**|DESTRUCTIVE***|DESTRUCTIVE****|DESTRUCTIVE****<|DESTRUCTIVE****<<|DESTRUCTIVE****<<<|DESTRUCTIVE****<<<<|DESTRUCTIVE***<<<<=|DESTRUCTIVE**<<<<==|DESTRUCTIVE*<<<<===|DESTRUCTIVE<<<<====|extreme|EXTREME|EXTREME*|EXTREME**|EXTREME***|EXTREME****|EXTREME****<|EXTREME****<<|EXTREME****<<<|EXTREME****<<<<|EXTREME***<<<<=|EXTREME**<<<<==|EXTREME*<<<<===|EXTREME<<<<====|porcine|PORCINE|PORCINE*|PORCINE**|PORCINE***|PORCINE***<|PORCINE***<<|PORCINE***<<<|PORCINE***<<<<|divine|daunting|terminal}
#VAR damagevalues {4|8|10|12|16|19|24|28|32|36|40|43|49|54|58|62|67|73|78|81|88|95|97|101|120|130|140|143|152|161|174|185|195|202|239|266|292|316|330|353|378|410|437|469|492|539|580|616|652|714|774|824|872|900|1000|1075|1150|1250|1350|1445|1516|1609|1750|1850|1945|2090|2340|2500|2700|2900|3000|3250|3500|3750|4000|0}
+
#VAR verbBinary {%if( %1 = %2, %1, %if( %eval( %item( @dvalues, %eval( (%1+%2)/2.0)) > %3), @verbBinary(%1, %eval( (%1+%2)/2.0),%3), @verbBinary( %eval( (%1+%2)/2.0),%2,%3)))}
#VAR damageverbshort {mauling|decimating|devastating|pulverizing|maiming|eviscerating|mutilating|disemboweling|dismembering|massacring|mangling|demolishing|obliterating|annihilating|terminal}
 
#TRIGGER {^(%w)[^>;]{strike|strikes|hits|blast|blasts} (%w)[^>;]with([* ])(%w)[* ]%w[!.]} {#IF {%ismember( %lower( %1), @DClist)} {#VAR %lower( %1) %replaceitem( %eval( %item( @damagevalues, %ismember( %concat( %4, %3), @damageverbs))+%item( @{%lower( %1)}, 17)), 17, @{%lower( %1)});#VAR %lower( %1) %replaceitem( %eval( %item( @{%lower( %1)}, %eval( %ismember( %lower( %4), @damageverbshort)+1))+1) , %eval( %ismember( %lower( %4), @damageverbshort)+1) , @{%lower( %1)})};#IF {%ismember( %lower( %2), @DClist)} {#VAR %lower( %2) %replaceitem( %eval( %item( @damagevalues, %ismember( %concat( %4, %3), @damageverbs))+%item( @{%lower( %2)}, 18)), 18, @{%lower( %2)})};#IF {%lower( %2) = "you"} {#VAR %lower( your) %replaceitem( %eval( %item( @damagevalues, %ismember( %concat( %4, %3), @damageverbs))+%item( @{%lower( your)}, 18)), 18, @{%lower( your)})}}
 
 
  #TRIGGER {^Welcome back to the AVATAR System, {lord|lady|hero} (%w).} {#var dcCurChar %lower( %1)}
 
  #TRIGGER {^Welcome back to the AVATAR System, {lord|lady|hero} (%w).} {#var dcCurChar %lower( %1)}
 
  #TRIGGER {^Welcome back to the AVATAR System (%w),} {#var dcCurChar %lower( %1)}
 
  #TRIGGER {^Welcome back to the AVATAR System (%w),} {#var dcCurChar %lower( %1)}
 +
#TRIGGER {^({@DCtrack})[^>;] %w[^>;]with[*>= ]({@dverbshort})([*<= ])%w[!.]} {#var %1.%2 %eval( @%1.%2 + 1);#var %1.dealt %eval( @%1.dealt + %item( @dvalues, %ismember( %concat( %2, %3), @dverbs)));#var %1.attacks %eval( @%1.attacks + 1)} "" {notrig}
 +
#TRIGGER {^%w[^>;] ({@DCtrack})[^>;]with[*>= ]({@dverbshort})([*<= ])%w[!.]} {#var %1.taken %eval( @%1.taken + %item( @dvalues, %ismember( %concat( %2, %3), @dverbs)))}
 +
#TRIGGER {%w is leading (%d) player[ s]with} {#if (%1 < 10) {#loop %1 {#temp {^ %i|??? ???? (&%wDCtemp1)} {#if (%lower( @DCtemp1) != @dcCurChar) {dcadd %lower( @DCtemp1)}}}} {#loop 1,9 {#temp {^ %i|??? ???? (&%wDCtemp1)} {#if (%lower( @DCtemp1) != @dcCurChar) {dcadd %lower( @DCtemp1)}}};#loop 10,%1 {#temp {^%i|??? ???? (&%wDCtemp1)} {#if (%lower( @DCtemp1) != @dcCurChar) {dcadd %lower( @DCtemp1)}}}};#t- "%w is leading (%d) player[ s]with";group} "" {disable}
 
  #MENU {DC Add} {dcadd %lower( %selword)} ""
 
  #MENU {DC Add} {dcadd %lower( %selword)} ""
 
  #MENU {DC Clear} {dcclear} ""
 
  #MENU {DC Clear} {dcclear} ""
  #MENU {DC List} {#ec -;#ec --- CHARACTERS ON THE DC LIST ---;#fo @DClist {#ec %i}} ""
+
  #MENU {DC List} {#ec -;#ec --- CHARACTERS ON THE DC LIST ---;#fo @DCnames {#ec %i}} ""
 
  #CLASS 0
 
  #CLASS 0
  
 
== Usage ==
 
== Usage ==
Type dcstart [numberofgroupmembers] to initialize, for example if there are 3 people in the group type dcstart 3. This will create 3 temporary triggers that trigger on the group command, send the group command to the mud, and add the people in the group except yourself because you are always tracked. This command also clears all previous data. Please also note that if you specify more groupies then your current group size you will have to go in and manually delete some of the temporary triggers. (Will be of format ^ #|??? ???? (&%wDCtemp1) )
 
  
If you need to add one member, or would rather add members by hand, you can either right click on their name and select DC Add, or you can type dcadd [name]. If You type dcadd [name] make sure to type the name in lowercase.
+
dcs- Reset all variables and add everyone in your group (including yourself)
  
Two other commands have also been added to the right click menu. DC Clear, which will clear out the tracking variables and DC List which will tell you who you are tracking.
+
dcrep- Brings up a menu with report options
  
Whenever you want to display a report type dcrep and you will be presented with a few options that are self explanatory.
+
dcrepto- Select your output channel (gt, say ect.)
  
I've also included a dcrepto alias, this will set where you report the information to. Please try to keep this off of channels and confined to gt, say or perhaps buddy, as I'm sure it would bother someone.
+
== How It Works ==
  
== Summary ==
+
#ALIAS dcadd {#additem DCtrack %1;#additem DCnames %1;#echo %1 added to the damage counting list.}
 +
Alias to add people to the group variable, dcs will call this automatically when you use it.
  
dcstart # - add your groupies to the tracking, # should be your group size<sup>[1]</sup>
+
#ALIAS dcrep {#YESNO "What report would you like to show?" {Short report (total damage done and taken) :dcrep1} {Breakdown of damage verbs:dcrep2}}
 +
#ALIAS dcrep2 {#if (!@DC.repto) {dcrepto};#YESNO "Who would you like to report for?" {Yourself:#VAR DC.reportfor "your"} {Everyone:#VAR DC.reportfor @DCnames} {Partial:#VAR DC.reportfor %pick( p:Who would you like to display reports for?:, @DCnames)};#LOOPDB @you {#var your.%key %eval( %db( @your, %key) + %val)};#var you "";#FO @DC.reportfor {#var %i.out "";#FO @dverbshort {#if (%db( @{%i}, %I)) {#var %i.out %concat( %db( @{%i}, out), " ", %I, ~(, ~|c~|, %db( @{%i}, %I), ~|n~|, ~))}};@DC.repto Breakdown for %if( %i="your", Myself, %upper( %left( %i, 1))%right( %i, 1)):%db( @{%i}, out)}}
 +
#ALIAS dcrep1 {#if (!@DC.repto) {dcrepto};#YESNO "Who would you like to report for?" {Yourself:#VAR DC.reportfor "your"} {Everyone:#VAR DC.reportfor @DCnames} {Partial:#VAR DC.reportfor %pick( p:Who would you like to display reports for?:, @DCnames)};#LOOPDB @you {#var your.%key %eval( %db( @your, %key) + %val)};#var you "";#var DC.total 0;#var DC.taken 0;#var DC.totalcount 0;#var DC.takencount 0;#FO @DCnames {#if ( %db( @{%i}, terminal)) {#var %i.total %eval( %db( @{%i}, dealt) + %db( @{%i}, dealt)/(%db( @{%i}, attacks) - %db( @{%i}, terminal))* %db( @{%i}, terminal))} {#var %i.total %db( @{%i}, dealt)};#if (@DC.total < %db( @{%i}, total)) {#var DC.total %db( @{%i}, total)};#if (@DC.taken < %db( @{%i}, taken)) {#var DC.taken %db( @{%i}, taken)};#var DC.totalcount %eval( @DC.totalcount + %db( @{%i}, total));#var DC.takencount %eval( @DC.takencount + %db( @{%i}, taken))};#FO @DC.reportfor {#if ( %db( @{%i}, terminal)) {#var %i.verb %item( @dverbs, %eval( @verbBinary(1,139,%eval(%db(@{%i},dealt)/(%db(@{%i},att acks)- %db( @{%i}, terminal)))) -1))} {#var %i.verb %item( @dverbs, %eval( @verbBinary(1,139,%eval(%db(@{%i},dealt)/%db(@{%i},attacks))) -1))};@DC.repto %if( %i="your", I, %upper( %left( %i, 1))%right( %i, 1)): Dealt->%if( %db( @{%i}, total) = @DC.total, ~|bc~|, ~|c~|)%db( @{%i}, total)|n|~(%eval( %db( @{%i}, total)*100/@DC.totalcount)%~) Averaged~[|bk|%replace( %db( @{%i}, verb), "=", "-")|n|~] Took->%if( %db( @{%i}, taken) = @DC.taken, ~|br~|, ~|r~|)%db( @{%i}, taken)|n|~(%eval( %db( @{%i}, taken)*100/@DC.takencount)%~)}}
  
dcrep - report information (ties to dcrep1 and dcrep2)
+
These 3 aliases report all the info. The first one just asks you which of the other two you want to use.
 +
DCrep2 handles the breakdown, looking through each person in your group variable, then looping through their variable concatenating each verb with a count into one string and then outputting it.
 +
DCrep1 first loops through everyone, totals their damage, and stores the highest damage taken and dealt. Next it reports for each person selected, giving their numeric damage total, their equivilent average damage verb and their total damage taken. It also highlights the top damage taken and dealt.
  
dcclear - clear out all information (dcstart will do this also)
+
#ALIAS dcclear {#FO @DCtrack {#UNVAR %i};#VAR DCtrack "you";#VAR DCnames "";dcadd your;#ECHO Damagecounter reset. Please re-add groupies.}
 +
Pretty simple, clears out the variables but automatically re-adds you.
  
dcadd - add a member (dcstart will do this, as will the right click menu)
+
#ALIAS dcs {dcclear;#if (!@DCreport) {@DCreport = gt} {};#t+ "%w is leading (%d) player[ s]with";groupstat}
 +
Has a little check like some of the other aliases have to make sure that you've set a channel to announce the results on for reports and then turns on a trigger to automatically count how many groupies there are and add them, then lastly calls the groupstat command to set off the previous trigger.
  
dcrepto - select a channel to output to (please be considerate)
+
#VAR dverbshort {nil|pathetic|weak|punishing|surprising|amazing|astonishing|mauling|decimating|devastating|pulverizing|maiming|eviscerating|mutilating|disemboweling|dismembering|massacring|mangling|demolishing|obliterating|annihilating|eradicating|vaporizing|destructive|extreme|porcine|divine|daunting|terminal}
 +
#VAR dvalues {0|2|4|8|10|14|18|22|26|30|34|38|42|46|49|55|60|65|70|75|80|85|90|95|100|110|120|130|140|150|160|170|180|190|200|225|250|275|300|325|350|375|400|425|450|475|500|540|574|606|675|730|769|810|884|915|1000|1100|1200|1300|1400|1500|1600|1700|1800|1900|2000|2200|2400|2600|2800|3000|3200|3400|3600|3800|4100|4500|5007|5901|5902|6200|6500|7000|7500|7800|8200|8500|9000|9500|10000|11000|12000|13000|14000|15000|16500|18000|19000|20000|21000|22000|23000|24000|25000|26000|27000|28000|29000|30000|31000|32000|33000|34000|35000|36000|37000|38000|39000|40000|41000|42000|43000|44500|47000|48000|50000|51000|53000|55000|57000|59000|61000|65000|70000|75000|80000|100000|0}
 +
#VAR dverbs {nil|pathetic|weak|punishing|surprising|amazing|astonishing|mauling|MAULING|MAULING*|MAULING**|MAULING***|decimating|DECIMATING|DECIMATING*|DECIMATING**|DECIMATING***|devastating|DEVASTATING|DEVASTATING*|DEVASTATING**|DEVASTATING***|pulverizing|PULVERIZING|PULVERIZING*|PULVERIZING**|PULVERIZING***|maiming|MAIMING|MAIMING*|MAIMING**|MAIMING***|eviscerating|EVISCERATING|EVISCERATING*|EVISCERATING**|EVISCERATING***|mutilating|MUTILATING|MUTILATING*|MUTILATING**|MUTILATING***|disemboweling|DISEMBOWELING|DISEMBOWELING*|DISEMBOWELING**|DISEMBOWELING***|dismembering|DISMEMBERING|DISMEMBERING*|DISMEMBERING**|DISMEMBERING***|massacring|MASSACRING|MASSACRING*|MASSACRING**|MASSACRING***|mangling|MANGLING|MANGLING*|MANGLING**|MANGLING***|demolishing|DEMOLISHING|DEMOLISHING*|DEMOLISHING**|DEMOLISHING***|obliterating|OBLITERATING|OBLITERATING*|OBLITERATING**|OBLITERATING***|annihilating|ANNIHILATING|ANNIHILATING*|ANNIHILATING**|ANNIHILATING***|ANNIHILATING***<|ANNIHILATING***<<|ANNIHILATING***<<<|ANNIHILATING***<<<<|eradicating|ERADICATING|ERADICATING*|ERADICATING**|ERADICATING***|ERADICATING***<|ERADICATING***<<|ERADICATING***<<<|ERADICATING***<<<<|vaporizing|VAPORIZING|VAPORIZING*|VAPORIZING**|VAPORIZING***|VAPORIZING***<|VAPORIZING***<<|VAPORIZING***<<<|VAPORIZING***<<<<|destructive|DESTRUCTIVE|DESTRUCTIVE*|DESTRUCTIVE**|DESTRUCTIVE***|DESTRUCTIVE****|DESTRUCTIVE****<|DESTRUCTIVE****<<|DESTRUCTIVE****<<<|DESTRUCTIVE****<<<<|DESTRUCTIVE***<<<<=|DESTRUCTIVE**<<<<==|DESTRUCTIVE*<<<<===|DESTRUCTIVE<<<<====|extreme|EXTREME|EXTREME*|EXTREME**|EXTREME***|EXTREME****|EXTREME****<|EXTREME****<<|EXTREME****<<<|EXTREME****<<<<|EXTREME***<<<<=|EXTREME**<<<<==|EXTREME*<<<<===|EXTREME<<<<====|porcine|PORCINE|PORCINE*|PORCINE**|PORCINE***|PORCINE***<|PORCINE***<<|PORCINE***<<<|PORCINE***<<<<|divine|daunting|terminal}
  
right click - add, show or clear groupies
+
These 3 variables provide the means to lookup damage. First the damage is looked up in dverbs, then that position is looked up in dvalues. Dverbshort is used for pattern matching and in dcrep2 to loop through each groupies database variable which counts hits per verb.
  
<sup>[1]</sup> If # is larger then group size you will need to manually delete the left over triggers of format ^ #|??? ???? (&%wDCtemp1)
+
#VAR verbBinary {%if( %1 = %2, %1, %if( %eval( %item( @dvalues, %eval( (%1+%2)/2.0)) > %3), @verbBinary(%1, %eval( (%1+%2)/2.0),%3), @verbBinary( %eval( (%1+%2)/2.0),%2,%3)))}
 +
Is a function variable. It uses a binary search to look through dvalues and find the one closest to the damage given (mainly for looking up your average damage). This position is then used with dverbs to give you a word for your numeric damage.
  
== How It Works ==
+
  #TRIGGER {^Welcome back to the AVATAR System, {lord|lady|hero} (%w).} {#var dcCurChar %lower( %1)}
This code's a bit convoluted so my apologies ahead of time.
+
#TRIGGER {^Welcome back to the AVATAR System (%w),} {#var dcCurChar %lower( %1)}
 
+
These two just store what your characters name is so you don't get added when the rest of the group does to the tracking variable. (Its setup to automatically track you)
  #TRIGGER {^(%w)[^>;]{strike|strikes|hits|blast|blasts} (%w)[^>;]with([* ])(%w)[* ]%w[!.]} {#IF {%ismember( %lower( %1), @DClist)} {#VAR %lower( %1) %replaceitem( %eval( %item( @damagevalues, %ismember( %concat( %4, %3), @damageverbs))+%item( @{%lower( %1)}, 17)), 17, @{%lower( %1)});#VAR %lower( %1) %replaceitem( %eval( %item( @{%lower( %1)}, %eval( %ismember( %lower( %4), @damageverbshort)+1))+1) , %eval( %ismember( %lower( %4), @damageverbshort)+1) , @{%lower( %1)})};#IF {%ismember( %lower( %2), @DClist)} {#VAR %lower( %2) %replaceitem( %eval( %item( @damagevalues, %ismember( %concat( %4, %3), @damageverbs))+%item( @{%lower( %2)}, 18)), 18, @{%lower( %2)})};#IF {%lower( %2) = "you"} {#VAR %lower( your) %replaceitem( %eval( %item( @damagevalues, %ismember( %concat( %4, %3), @damageverbs))+%item( @{%lower( your)}, 18)), 18, @{%lower( your)})}}
 
This is where all of the damage tracking takes place. The trigger line should trigger for all damage done by someone to someone, including melee, magic and throwing. There are 3 if statements including within. The first of which checks to see if someone on the tracking list dealt the damage. If they did it updates the array adding the hit and the damage.
 
The Second if statement checks to see if someone on the list was dealt damage. If they were it will add how much damage they took. Since  damage dealt by you is shown as 'your' while damage dealt to you is shown to 'you' there is a third if statement that does the same as the second but just catches damage done to you.
 
 
 
#VAR damageverbs {weak|punishing|surprising|amazing|astonishing|mauling|MAULING|MAULING*|MAULING**|MAULING***|decimating|DECIMATING|DECIMATING*|DECIMATING**|DECIMATING***|devastating|DEVASTATING|DEVASTATING*|DEVASTATING**|DEVASTATING***|pulverizing|PULVERIZING|PULVERIZING*|PULVERIZING**|PULVERIZING***|maiming|MAIMING|MAIMING*|MAIMING**|MAIMING***|eviscerating|EVISCERATING|EVISCERATING*|EVISCERATING**|EVISCERATING***|mutilating|MUTILATING|MUTILATING*|MUTILATING**|MUTILATING***|disemboweling|DISEMBOWELING|DISEMBOWELING*|DISEMBOWELING**|DISEMBOWELING***|dismembering|DISMEMBERING|DISMEMBERING*|DISMEMBERING**|DISMEMBERING***|massacring|MASSACRING|MASSACRING*|MASSACRING**|MASSACRING***|mangling|MANGLING|MANGLING*|MANGLING**|MANGLING***|demolishing|DEMOLISHING|DEMOLISHING*|DEMOLISHING**|DEMOLISHING***|obliterating|OBLITERATING|OBLITERATING*|OBLITERATING**|OBLITERATING***|annihilating|ANNIHILATING|ANNIHILATING*|ANNIHILATING**|ANNIHILATING***|terminal}
 
#VAR damagevalues {4|8|10|12|16|19|24|28|32|36|40|43|49|54|58|62|67|73|78|81|88|95|97|101|120|130|140|143|152|161|174|185|195|202|239|266|292|316|330|353|378|410|437|469|492|539|580|616|652|714|774|824|872|900|1000|1075|1150|1250|1350|1445|1516|1609|1750|1850|1945|2090|2340|2500|2700|2900|3000|3250|3500|3750|4000|0}
 
#VAR damageverbshort {mauling|decimating|devastating|pulverizing|maiming|eviscerating|mutilating|disemboweling|dismembering|massacring|mangling|demolishing|obliterating|annihilating|terminal}
 
These three variables are used to track the damage. A lookup is used on the first one given your damage to find an index to the second giving us the numerical value. The third variable is used to track damage on a per hit basis so you can see a breakdown, this is mapped to a fourth variable that is created per group member where their information is stored.
 
 
 
#ALIAS dcadd {#additem DClist %1;#var %1 0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0;#echo %1 added to the damage counting list.}
 
This alias creates a string list for a given name and adds them to the list of all people you are tracking.
 
 
 
#ALIAS dcclear {#FO @DClist {#UNVAR %i};#VAR DClist "";#VAR DCterm 0;dcadd your;#ECHO Damagecounter reset. Please re-add groupies.}
 
This alias will clear the list of group members and delete the variables storing their info.
 
  
  #ALIAS dcrep {#YESNO "What report would you like to show?" {Short report (total damage done and taken) :dcrep1} {Breakdown of damage verbs:dcrep2}}
+
  #TRIGGER {^({@DCtrack})[^>;] %w[^>;]with[*>= ]({@dverbshort})([*<= ])%w[!.]} {#var %1.%2 %eval( @%1.%2 + 1);#var %1.dealt %eval( @%1.dealt + %item( @dvalues, %ismember( %concat( %2, %3), @dverbs)));#var %1.attacks %eval( @%1.attacks + 1)} "" {notrig}
#ALIAS dcrep1 {#if (!@DCreport) {dcrepto};#YESNO "Who would you like to report for?" {Yourself:#VAR DCreportfor "your"} {Everyone:#VAR DCreportfor @DClist} {Partial:#VAR DCreportfor %pick( p:Who would you like to display reports for?:, @DClist)};dctermcheck;dcavecheck;#VAR DCtemp1 0;#VAR DCtemp2 0;#VAR DCtemp3 0;#VAR DCtemp4 0;#FO @DClist {#IF {%eval( %item( @{%i}, 19) > @DCtemp1)} {#VAR DCtemp1 %item( @{%i}, 19)};#IF {%eval( %item( @{%i}, 18) > @DCtemp2)} {#VAR DCtemp2 %item( @{%i}, 18)};#ADD DCtemp3 %item( @{%i}, 19);#ADD DCtemp4 %item( @{%i}, 18)};#FO @DCreportfor {@DCreport ~|w~|Stats for %if( %i="your", Myself, %upper( %left( %i, 1))%right( %i, 1)): Dealt->%if( %item( @{%i}, 19) = @DCtemp1, ~|BC~|, ~|C~|)%item( @{%i}, 19)~|w~|~(%eval( %item( @{%i}, 19)*100/@DCtemp3)%~) Average~[~|bk~|%item( @damageverbs, %item( @{%i}, 20))~|w~|~] Taken->%if( %item( @{%i}, 18) = @DCtemp2, ~|BR~|, ~|R~|)%item( @{%i}, 18)~|w~|~(%eval( %item( @{%i}, 18)*100/@DCtemp4)%~)}}
+
#TRIGGER {^%w[^>;] ({@DCtrack})[^>;]with[*>= ]({@dverbshort})([*<= ])%w[!.]} {#var %1.taken %eval( @%1.taken + %item( @dvalues, %ismember( %concat( %2, %3), @dverbs)))}
#ALIAS dcrep2 {#if (!@DCreport) {dcrepto};#YESNO "Who would you like to report for?" {Yourself:#VAR DCreportfor "your"} {Everyone:#VAR DCreportfor @DClist} {Partial:#VAR DCreportfor %pick( p:Who would you like to display reports for?:, @DClist)};#FO @DCreportfor {@DCreport Breakdown for %if( %i="your", Myself, %upper( %left( %i, 1))%right( %i, 1)):%if( %item( @{%i}, 1), %char( 32)Tickling~(~|c~|%item( @{%i}, 1)~|n~|~))%if( %item( @{%i}, 2), %char( 32)Mauling~(~|c~|%item( @{%i}, 2)~|n~|~))%if( %item( @{%i}, 3), %char( 32)Decimating~(~|c~|%item( @{%i}, 3)~|n~|~))%if( %item( @{%i}, 4), %char( 32)Devasting~(~|c~|%item( @{%i}, 4)~|n~|~))%if( %item( @{%i}, 5), %char( 32)Pulverizing~(~|c~|%item( @{%i}, 5)~|n~|~))%if( %item( @{%i}, 6), %char( 32)Maiming~(~|c~|%item( @{%i}, 6)~|n~|~))%if( %item( @{%i}, 7), %char( 32)Eviscerating~(~|c~|%item( @{%i}, 7)~|n~|~))%if( %item( @{%i}, 8), %char( 32)Mutilating~(~|c~|%item( @{%i}, 8)~|n~|~))%if( %item( @{%i}, 9), %char( 32)Disemboweling~(~|c~|%item( @{%i}, 9)~|n~|~))%if( %item( @{%i}, 10), %char( 32)Dismembering~(~|c~|%item( @{%i}, 10)~|n~|~))%if( %item( @{%i}, 11), %char( 32)Massacring~(~|c~|%item( @{%i}, 11)~|n~|~))%if( %item( @{%i}, 12), %char( 32)Mangling~(~|c~|%item( @{%i}, 12)~|n~|~))%if( %item( @{%i}, 13), %char( 32)Demolishing~(~|c~|%item( @{%i}, 13)~|n~|~))%if( %item( @{%i}, 14), %char( 32)Obliterating~(~|c~|%item( @{%i}, 14)~|n~|~))%if( %item( @{%i}, 15), %char( 32)Annihilating~(~|c~|%item( @{%i}, 15)~|n~|~))%if( %item( @{%i}, 16), %char( 32)Terminal~(~|c~|%item( @{%i}, 16)~|n~|~))}}
+
The meat and potato triggers. Pretty gnarly looking but they seem to work :) The first one catches all damage anyone in the variable @DCtrack deals, adds an attack to the damage verb that they hit, adds damage to their total damage tracker and adds to their total attacks (just so it doesn't have to add them up later)
These three aliases will display all the information that has been tracked. The first alias will ask you if you would like to just show the total and average damage (dcrep1) or a breakdown of all the hits (dcrep2). Both dcrep1 and 2 check to make sure you have a location you're outputting to.
+
The second catches all damage done to you. It looks up the position in @dverbs, maps it to @dvalues and adds them to your previous total. (Both of these triggers use that same method)
dcrep1 uses 4 temporary variables to calculated who dealt the most damage, who took the most damage and what percentage of the total your damage dealt and received was. Next it goes through each groupie you selected to have a report printed for and prints the information.
 
dcrep2 is a large block of if functions, basically for each group member it checks to see if they had any hits of each verb, if they did it will display the verb and how many hits it was.
 
  
  #ALIAS dctermcheck {#FO @DClist {#VAR DCtemp1 0;#VAR DCtemp2 %i;#LOOP 2,15 {#VAR DCtemp1 %eval( @DCtemp1+%item( @{@DCtemp2}, %I))};#VAR DCtemp1 %eval( %item( @{@DCtemp2}, 17)/@DCtemp1);#VAR DCtemp1 %eval( @DCtemp1 * %item( @{@DCtemp2}, 16));#VAR DCtemp1 %eval( @DCtemp1 + %item( @{@DCtemp2}, 17));#VAR @DCtemp2 %replaceitem( @DCtemp1, 19, @{@DCtemp2})};#ECHO Terminal hits have been processed.}
+
  #TRIGGER {%w is leading (%d) player[ s]with} {#if (%1 < 10) {#loop %1 {#temp {^ %i|??? ???? (&%wDCtemp1)} {#if (%lower( @DCtemp1) != @dcCurChar) {dcadd %lower( @DCtemp1)}}}} {#loop 1,9 {#temp {^ %i|??? ???? (&%wDCtemp1)} {#if (%lower( @DCtemp1) != @dcCurChar) {dcadd %lower( @DCtemp1)}}};#loop 10,%1 {#temp {^%i|??? ???? (&%wDCtemp1)} {#if (%lower( @DCtemp1) != @dcCurChar) {dcadd %lower( @DCtemp1)}}}};#t- "%w is leading (%d) player[ s]with";group} "" {disable}
#ALIAS dcavecheck {#FO @DClist {#var DCtemp1 %i;#var DCtemp2 0;#LOOP 1,15 {#VAR DCtemp2 %eval( @DCtemp2+%item( @{@DCtemp1}, %I))};#var DCtemp2 %eval( %item( @{%i}, 17)/@DCtemp2);#var DCtemp3 %item( @damagevalues, 75);#var DCtemp4 75;#WHILE (@DCtemp2 < @DCtemp3) {#add DCtemp4 -1;#var DCtemp3 %item( @damagevalues, @DCtemp4)};#VAR %i %replaceitem( @DCtemp4, 20, @{%i})}}
+
The trigger that catches group members as mentioned earlier. It creates a trigger for each group slot depending on how many people are in the group and that trigger calls the dcadd alias on them
dctermcheck and dcavecheck are both internal aliases. As their names would suggest dctermcheck handles terminal hits, taking your total damage and dividing it by the number of non terminal hits you have done in a run. It then multiplies this number by the number of terminal hits you have had and comes out with a figure for total damage done.
 
dcavecheck handles finding what your average damage has been. It will take your total damage and divide by the number of hits (should be combined with the previous I suppose) and then loops through each verb value till it finds one that your average damage is higher then. It then takes this index number and stores it in a characters tracking variable to later be displayed as a verb.
 
  
#ALIAS dcstart {dcclear;#if (!@DCreport) {@DCreport = gt} {};#if {%1} {@DCtemp1 = %1} {@DCtemp1 = 2;#prompt DCtemp1 "How many people are in the group?"};#if (@DCtemp < 10) {#loop @DCtemp1 {#temp {^ %i|??? ???? (&%wDCtemp1)} {#if (%lower( @DCtemp1) != @dcCurChar) {dcadd %lower( @DCtemp1)}}}} {#loop 1,9 {#temp {^ %i|??? ???? (&%wDCtemp1)} {#if (%lower( @DCtemp1) != @dcCurChar) {dcadd %lower( @DCtemp1)}}};#loop 10,@DCtemp {#temp {^%i|??? ???? (&%wDCtemp1)} {#if (%lower( @DCtemp1) != @dcCurChar) {dcadd %lower( @DCtemp1)}}}};group}
 
Is the quick start groupie adding alias. It checks to make sure that where your reports go to is defined, then if you've included a group size it will go through and create a temporary trigger for each group slot. Then it calls the group function so the triggers go off and each each person in the group. The temporary triggers are defined not to add whatever character you are on because the triggers are set up to track you automatically. It also checks if you wanted to add more then 9 people, because in that case the trigger for 10-99 is slightly different.
 
 
#TRIGGER {^Welcome back to the AVATAR System, {lord|lady|hero} (%w).} {#var dcCurChar %lower( %1)}
 
#TRIGGER {^Welcome back to the AVATAR System (%w),} {#var dcCurChar %lower( %1)}
 
 
  #MENU {DC Add} {dcadd %lower( %selword)} ""
 
  #MENU {DC Add} {dcadd %lower( %selword)} ""
 
  #MENU {DC Clear} {dcclear} ""
 
  #MENU {DC Clear} {dcclear} ""
  #MENU {DC List} {#ec -;#ec --- CHARACTERS ON THE DC LIST ---;#fo @DClist {#ec %i}} ""
+
  #MENU {DC List} {#ec -;#ec --- CHARACTERS ON THE DC LIST ---;#fo @DCnames {#ec %i}} ""
These last odds and ends store your current character, because damage tracking for yourself is done automatically (and not by your name), and adds 3 menu options for easy access to a few of the aliases.
+
Last but not... well ok they are the least... but just a couple of right click menus that you don't really need but may make it easier to add a groupie that may not of been in the group, clear the list or see who's on the list.
  
 
[[Category: Zmud Scripting]]
 
[[Category: Zmud Scripting]]

Latest revision as of 09:30, 2 November 2010

Tested for zmud 7.21

This trigger and alias set will track damage dealt and received for all on a member list. For each line of combat the hit is stored by damage verb if the person attacking was on the list, and a running damage total is kept. Damage values were taken from Damage. Report options include a display of {damage done/ average hit/ damage taken} or a breakdown of all hits by verb. You may display these for yourself, everyone or a partial selection. Latest triggers should catch anything with a name and a damage verb.

Code

For quick input copy this section and paste it into a *.txt file. Then, in zMUD, go to "Settings -> File -> Import

#CLASS {dcounter}
#ALIAS dcadd {#additem DCtrack %1;#additem DCnames %1;#echo %1 added to the damage counting list.}
#ALIAS dcrep {#YESNO "What report would you like to show?" {Short report (total damage done and taken) :dcrep1} {Breakdown of damage verbs:dcrep2}}
#ALIAS dcclear {#FO @DCtrack {#UNVAR %i};#VAR DCtrack "you";#VAR DCnames "";dcadd your;#ECHO Damagecounter reset. Please re-add groupies.}
#ALIAS dcrep2 {#if (!@DC.repto) {dcrepto};#YESNO "Who would you like to report for?" {Yourself:#VAR DC.reportfor "your"} {Everyone:#VAR DC.reportfor @DCnames} {Partial:#VAR DC.reportfor %pick( p:Who would you like to display reports for?:, @DCnames)};#LOOPDB @you {#var your.%key %eval( %db( @your, %key) + %val)};#var you "";#FO @DC.reportfor {#var %i.out "";#FO @dverbshort {#if (%db( @{%i}, %I)) {#var %i.out %concat( %db( @{%i}, out), " ", %I, ~(, ~|c~|, %db( @{%i}, %I), ~|n~|, ~))}};@DC.repto Breakdown for %if( %i="your", Myself, %upper( %left( %i, 1))%right( %i, 1)):%db( @{%i}, out)}}
#ALIAS dcrep1 {#if (!@DC.repto) {dcrepto};#YESNO "Who would you like to report for?" {Yourself:#VAR DC.reportfor "your"} {Everyone:#VAR DC.reportfor @DCnames} {Partial:#VAR DC.reportfor %pick( p:Who would you like to display reports for?:, @DCnames)};#LOOPDB @you {#var your.%key %eval( %db( @your, %key) + %val)};#var you "";#var DC.total 0;#var DC.taken 0;#var DC.totalcount 0;#var DC.takencount 0;#FO @DCnames {#if ( %db( @{%i}, terminal)) {#var %i.total %eval( %db( @{%i}, dealt) + %db( @{%i}, dealt)/(%db( @{%i}, attacks) - %db( @{%i}, terminal))* %db( @{%i}, terminal))} {#var %i.total %db( @{%i}, dealt)};#if (@DC.total < %db( @{%i}, total)) {#var DC.total %db( @{%i}, total)};#if (@DC.taken < %db( @{%i}, taken)) {#var DC.taken %db( @{%i}, taken)};#var DC.totalcount %eval( @DC.totalcount + %db( @{%i}, total));#var DC.takencount %eval( @DC.takencount + %db( @{%i}, taken))};#FO @DC.reportfor {#if ( %db( @{%i}, terminal)) {#var %i.verb %item( @dverbs, %eval( @verbBinary(1,139,%eval(%db(@{%i},dealt)/(%db(@{%i},attacks)- %db( @{%i}, terminal)))) -1))} {#var %i.verb %item( @dverbs, %eval( @verbBinary(1,139,%eval(%db(@{%i},dealt)/%db(@{%i},attacks))) -1))};@DC.repto %if( %i="your", I, %upper( %left( %i, 1))%right( %i, 1)): Dealt->%if( %db( @{%i}, total) = @DC.total, ~|bc~|, ~|c~|)%db( @{%i}, total)|n|~(%eval( %db( @{%i}, total)*100/@DC.totalcount)%~) Averaged~[|bk|%replace( %db( @{%i}, verb), "=", "-")|n|~] Took->%if( %db( @{%i}, taken) = @DC.taken, ~|br~|, ~|r~|)%db( @{%i}, taken)|n|~(%eval( %db( @{%i}, taken)*100/@DC.takencount)%~)}}
#ALIAS dcs {dcclear;#if (!@DCreport) {@DCreport = gt} {};#t+ "%w is leading (%d) player[ s]with";groupstat}
#ALIAS dcrepto {#prompt DC.repto "Enter the channel to output to, eg gt, say ect."}
#VAR dverbshort {nil|pathetic|weak|punishing|surprising|amazing|astonishing|mauling|decimating|devastating|pulverizing|maiming|eviscerating|mutilating|disemboweling|dismembering|massacring|mangling|demolishing|obliterating|annihilating|eradicating|vaporizing|destructive|extreme|porcine|divine|daunting|terminal}
#VAR dvalues {0|2|4|8|10|14|18|22|26|30|34|38|42|46|49|55|60|65|70|75|80|85|90|95|100|110|120|130|140|150|160|170|180|190|200|225|250|275|300|325|350|375|400|425|450|475|500|540|574|606|675|730|769|810|884|915|1000|1100|1200|1300|1400|1500|1600|1700|1800|1900|2000|2200|2400|2600|2800|3000|3200|3400|3600|3800|4100|4500|5007|5901|5902|6200|6500|7000|7500|7800|8200|8500|9000|9500|10000|11000|12000|13000|14000|15000|16500|18000|19000|20000|21000|22000|23000|24000|25000|26000|27000|28000|29000|30000|31000|32000|33000|34000|35000|36000|37000|38000|39000|40000|41000|42000|43000|44500|47000|48000|50000|51000|53000|55000|57000|59000|61000|65000|70000|75000|80000|100000|0}
#VAR dverbs {nil|pathetic|weak|punishing|surprising|amazing|astonishing|mauling|MAULING|MAULING*|MAULING**|MAULING***|decimating|DECIMATING|DECIMATING*|DECIMATING**|DECIMATING***|devastating|DEVASTATING|DEVASTATING*|DEVASTATING**|DEVASTATING***|pulverizing|PULVERIZING|PULVERIZING*|PULVERIZING**|PULVERIZING***|maiming|MAIMING|MAIMING*|MAIMING**|MAIMING***|eviscerating|EVISCERATING|EVISCERATING*|EVISCERATING**|EVISCERATING***|mutilating|MUTILATING|MUTILATING*|MUTILATING**|MUTILATING***|disemboweling|DISEMBOWELING|DISEMBOWELING*|DISEMBOWELING**|DISEMBOWELING***|dismembering|DISMEMBERING|DISMEMBERING*|DISMEMBERING**|DISMEMBERING***|massacring|MASSACRING|MASSACRING*|MASSACRING**|MASSACRING***|mangling|MANGLING|MANGLING*|MANGLING**|MANGLING***|demolishing|DEMOLISHING|DEMOLISHING*|DEMOLISHING**|DEMOLISHING***|obliterating|OBLITERATING|OBLITERATING*|OBLITERATING**|OBLITERATING***|annihilating|ANNIHILATING|ANNIHILATING*|ANNIHILATING**|ANNIHILATING***|ANNIHILATING***<|ANNIHILATING***<<|ANNIHILATING***<<<|ANNIHILATING***<<<<|eradicating|ERADICATING|ERADICATING*|ERADICATING**|ERADICATING***|ERADICATING***<|ERADICATING***<<|ERADICATING***<<<|ERADICATING***<<<<|vaporizing|VAPORIZING|VAPORIZING*|VAPORIZING**|VAPORIZING***|VAPORIZING***<|VAPORIZING***<<|VAPORIZING***<<<|VAPORIZING***<<<<|destructive|DESTRUCTIVE|DESTRUCTIVE*|DESTRUCTIVE**|DESTRUCTIVE***|DESTRUCTIVE****|DESTRUCTIVE****<|DESTRUCTIVE****<<|DESTRUCTIVE****<<<|DESTRUCTIVE****<<<<|DESTRUCTIVE***<<<<=|DESTRUCTIVE**<<<<==|DESTRUCTIVE*<<<<===|DESTRUCTIVE<<<<====|extreme|EXTREME|EXTREME*|EXTREME**|EXTREME***|EXTREME****|EXTREME****<|EXTREME****<<|EXTREME****<<<|EXTREME****<<<<|EXTREME***<<<<=|EXTREME**<<<<==|EXTREME*<<<<===|EXTREME<<<<====|porcine|PORCINE|PORCINE*|PORCINE**|PORCINE***|PORCINE***<|PORCINE***<<|PORCINE***<<<|PORCINE***<<<<|divine|daunting|terminal}
#VAR verbBinary {%if( %1 = %2, %1, %if( %eval( %item( @dvalues, %eval( (%1+%2)/2.0)) > %3), @verbBinary(%1, %eval( (%1+%2)/2.0),%3), @verbBinary( %eval( (%1+%2)/2.0),%2,%3)))}
#TRIGGER {^Welcome back to the AVATAR System, {lord|lady|hero} (%w).} {#var dcCurChar %lower( %1)}
#TRIGGER {^Welcome back to the AVATAR System (%w),} {#var dcCurChar %lower( %1)}
#TRIGGER {^({@DCtrack})[^>;] %w[^>;]with[*>= ]({@dverbshort})([*<= ])%w[!.]} {#var %1.%2 %eval( @%1.%2 + 1);#var %1.dealt %eval( @%1.dealt + %item( @dvalues, %ismember( %concat( %2, %3), @dverbs)));#var %1.attacks %eval( @%1.attacks + 1)} "" {notrig}
#TRIGGER {^%w[^>;] ({@DCtrack})[^>;]with[*>= ]({@dverbshort})([*<= ])%w[!.]} {#var %1.taken %eval( @%1.taken + %item( @dvalues, %ismember( %concat( %2, %3), @dverbs)))}
#TRIGGER {%w is leading (%d) player[ s]with} {#if (%1 < 10) {#loop %1 {#temp {^ %i|??? ???? (&%wDCtemp1)} {#if (%lower( @DCtemp1) != @dcCurChar) {dcadd %lower( @DCtemp1)}}}} {#loop 1,9 {#temp {^ %i|??? ???? (&%wDCtemp1)} {#if (%lower( @DCtemp1) != @dcCurChar) {dcadd %lower( @DCtemp1)}}};#loop 10,%1 {#temp {^%i|??? ???? (&%wDCtemp1)} {#if (%lower( @DCtemp1) != @dcCurChar) {dcadd %lower( @DCtemp1)}}}};#t- "%w is leading (%d) player[ s]with";group} "" {disable}
#MENU {DC Add} {dcadd %lower( %selword)} ""
#MENU {DC Clear} {dcclear} ""
#MENU {DC List} {#ec -;#ec --- CHARACTERS ON THE DC LIST ---;#fo @DCnames {#ec %i}} ""
#CLASS 0

Usage

dcs- Reset all variables and add everyone in your group (including yourself)

dcrep- Brings up a menu with report options

dcrepto- Select your output channel (gt, say ect.)

How It Works

#ALIAS dcadd {#additem DCtrack %1;#additem DCnames %1;#echo %1 added to the damage counting list.}

Alias to add people to the group variable, dcs will call this automatically when you use it.

#ALIAS dcrep {#YESNO "What report would you like to show?" {Short report (total damage done and taken) :dcrep1} {Breakdown of damage verbs:dcrep2}}
#ALIAS dcrep2 {#if (!@DC.repto) {dcrepto};#YESNO "Who would you like to report for?" {Yourself:#VAR DC.reportfor "your"} {Everyone:#VAR DC.reportfor @DCnames} {Partial:#VAR DC.reportfor %pick( p:Who would you like to display reports for?:, @DCnames)};#LOOPDB @you {#var your.%key %eval( %db( @your, %key) + %val)};#var you "";#FO @DC.reportfor {#var %i.out "";#FO @dverbshort {#if (%db( @{%i}, %I)) {#var %i.out %concat( %db( @{%i}, out), " ", %I, ~(, ~|c~|, %db( @{%i}, %I), ~|n~|, ~))}};@DC.repto Breakdown for %if( %i="your", Myself, %upper( %left( %i, 1))%right( %i, 1)):%db( @{%i}, out)}}
#ALIAS dcrep1 {#if (!@DC.repto) {dcrepto};#YESNO "Who would you like to report for?" {Yourself:#VAR DC.reportfor "your"} {Everyone:#VAR DC.reportfor @DCnames} {Partial:#VAR DC.reportfor %pick( p:Who would you like to display reports for?:, @DCnames)};#LOOPDB @you {#var your.%key %eval( %db( @your, %key) + %val)};#var you "";#var DC.total 0;#var DC.taken 0;#var DC.totalcount 0;#var DC.takencount 0;#FO @DCnames {#if ( %db( @{%i}, terminal)) {#var %i.total %eval( %db( @{%i}, dealt) + %db( @{%i}, dealt)/(%db( @{%i}, attacks) - %db( @{%i}, terminal))* %db( @{%i}, terminal))} {#var %i.total %db( @{%i}, dealt)};#if (@DC.total < %db( @{%i}, total)) {#var DC.total %db( @{%i}, total)};#if (@DC.taken < %db( @{%i}, taken)) {#var DC.taken %db( @{%i}, taken)};#var DC.totalcount %eval( @DC.totalcount + %db( @{%i}, total));#var DC.takencount %eval( @DC.takencount + %db( @{%i}, taken))};#FO @DC.reportfor {#if ( %db( @{%i}, terminal)) {#var %i.verb %item( @dverbs, %eval( @verbBinary(1,139,%eval(%db(@{%i},dealt)/(%db(@{%i},att acks)- %db( @{%i}, terminal)))) -1))} {#var %i.verb %item( @dverbs, %eval( @verbBinary(1,139,%eval(%db(@{%i},dealt)/%db(@{%i},attacks))) -1))};@DC.repto %if( %i="your", I, %upper( %left( %i, 1))%right( %i, 1)): Dealt->%if( %db( @{%i}, total) = @DC.total, ~|bc~|, ~|c~|)%db( @{%i}, total)|n|~(%eval( %db( @{%i}, total)*100/@DC.totalcount)%~) Averaged~[|bk|%replace( %db( @{%i}, verb), "=", "-")|n|~] Took->%if( %db( @{%i}, taken) = @DC.taken, ~|br~|, ~|r~|)%db( @{%i}, taken)|n|~(%eval( %db( @{%i}, taken)*100/@DC.takencount)%~)}}

These 3 aliases report all the info. The first one just asks you which of the other two you want to use. DCrep2 handles the breakdown, looking through each person in your group variable, then looping through their variable concatenating each verb with a count into one string and then outputting it. DCrep1 first loops through everyone, totals their damage, and stores the highest damage taken and dealt. Next it reports for each person selected, giving their numeric damage total, their equivilent average damage verb and their total damage taken. It also highlights the top damage taken and dealt.

#ALIAS dcclear {#FO @DCtrack {#UNVAR %i};#VAR DCtrack "you";#VAR DCnames "";dcadd your;#ECHO Damagecounter reset. Please re-add groupies.}

Pretty simple, clears out the variables but automatically re-adds you.

#ALIAS dcs {dcclear;#if (!@DCreport) {@DCreport = gt} {};#t+ "%w is leading (%d) player[ s]with";groupstat}

Has a little check like some of the other aliases have to make sure that you've set a channel to announce the results on for reports and then turns on a trigger to automatically count how many groupies there are and add them, then lastly calls the groupstat command to set off the previous trigger.

#VAR dverbshort {nil|pathetic|weak|punishing|surprising|amazing|astonishing|mauling|decimating|devastating|pulverizing|maiming|eviscerating|mutilating|disemboweling|dismembering|massacring|mangling|demolishing|obliterating|annihilating|eradicating|vaporizing|destructive|extreme|porcine|divine|daunting|terminal}
#VAR dvalues {0|2|4|8|10|14|18|22|26|30|34|38|42|46|49|55|60|65|70|75|80|85|90|95|100|110|120|130|140|150|160|170|180|190|200|225|250|275|300|325|350|375|400|425|450|475|500|540|574|606|675|730|769|810|884|915|1000|1100|1200|1300|1400|1500|1600|1700|1800|1900|2000|2200|2400|2600|2800|3000|3200|3400|3600|3800|4100|4500|5007|5901|5902|6200|6500|7000|7500|7800|8200|8500|9000|9500|10000|11000|12000|13000|14000|15000|16500|18000|19000|20000|21000|22000|23000|24000|25000|26000|27000|28000|29000|30000|31000|32000|33000|34000|35000|36000|37000|38000|39000|40000|41000|42000|43000|44500|47000|48000|50000|51000|53000|55000|57000|59000|61000|65000|70000|75000|80000|100000|0}
#VAR dverbs {nil|pathetic|weak|punishing|surprising|amazing|astonishing|mauling|MAULING|MAULING*|MAULING**|MAULING***|decimating|DECIMATING|DECIMATING*|DECIMATING**|DECIMATING***|devastating|DEVASTATING|DEVASTATING*|DEVASTATING**|DEVASTATING***|pulverizing|PULVERIZING|PULVERIZING*|PULVERIZING**|PULVERIZING***|maiming|MAIMING|MAIMING*|MAIMING**|MAIMING***|eviscerating|EVISCERATING|EVISCERATING*|EVISCERATING**|EVISCERATING***|mutilating|MUTILATING|MUTILATING*|MUTILATING**|MUTILATING***|disemboweling|DISEMBOWELING|DISEMBOWELING*|DISEMBOWELING**|DISEMBOWELING***|dismembering|DISMEMBERING|DISMEMBERING*|DISMEMBERING**|DISMEMBERING***|massacring|MASSACRING|MASSACRING*|MASSACRING**|MASSACRING***|mangling|MANGLING|MANGLING*|MANGLING**|MANGLING***|demolishing|DEMOLISHING|DEMOLISHING*|DEMOLISHING**|DEMOLISHING***|obliterating|OBLITERATING|OBLITERATING*|OBLITERATING**|OBLITERATING***|annihilating|ANNIHILATING|ANNIHILATING*|ANNIHILATING**|ANNIHILATING***|ANNIHILATING***<|ANNIHILATING***<<|ANNIHILATING***<<<|ANNIHILATING***<<<<|eradicating|ERADICATING|ERADICATING*|ERADICATING**|ERADICATING***|ERADICATING***<|ERADICATING***<<|ERADICATING***<<<|ERADICATING***<<<<|vaporizing|VAPORIZING|VAPORIZING*|VAPORIZING**|VAPORIZING***|VAPORIZING***<|VAPORIZING***<<|VAPORIZING***<<<|VAPORIZING***<<<<|destructive|DESTRUCTIVE|DESTRUCTIVE*|DESTRUCTIVE**|DESTRUCTIVE***|DESTRUCTIVE****|DESTRUCTIVE****<|DESTRUCTIVE****<<|DESTRUCTIVE****<<<|DESTRUCTIVE****<<<<|DESTRUCTIVE***<<<<=|DESTRUCTIVE**<<<<==|DESTRUCTIVE*<<<<===|DESTRUCTIVE<<<<====|extreme|EXTREME|EXTREME*|EXTREME**|EXTREME***|EXTREME****|EXTREME****<|EXTREME****<<|EXTREME****<<<|EXTREME****<<<<|EXTREME***<<<<=|EXTREME**<<<<==|EXTREME*<<<<===|EXTREME<<<<====|porcine|PORCINE|PORCINE*|PORCINE**|PORCINE***|PORCINE***<|PORCINE***<<|PORCINE***<<<|PORCINE***<<<<|divine|daunting|terminal}

These 3 variables provide the means to lookup damage. First the damage is looked up in dverbs, then that position is looked up in dvalues. Dverbshort is used for pattern matching and in dcrep2 to loop through each groupies database variable which counts hits per verb.

#VAR verbBinary {%if( %1 = %2, %1, %if( %eval( %item( @dvalues, %eval( (%1+%2)/2.0)) > %3), @verbBinary(%1, %eval( (%1+%2)/2.0),%3), @verbBinary( %eval( (%1+%2)/2.0),%2,%3)))}

Is a function variable. It uses a binary search to look through dvalues and find the one closest to the damage given (mainly for looking up your average damage). This position is then used with dverbs to give you a word for your numeric damage.

#TRIGGER {^Welcome back to the AVATAR System, {lord|lady|hero} (%w).} {#var dcCurChar %lower( %1)}
#TRIGGER {^Welcome back to the AVATAR System (%w),} {#var dcCurChar %lower( %1)}

These two just store what your characters name is so you don't get added when the rest of the group does to the tracking variable. (Its setup to automatically track you)

#TRIGGER {^({@DCtrack})[^>;] %w[^>;]with[*>= ]({@dverbshort})([*<= ])%w[!.]} {#var %1.%2 %eval( @%1.%2 + 1);#var %1.dealt %eval( @%1.dealt + %item( @dvalues, %ismember( %concat( %2, %3), @dverbs)));#var %1.attacks %eval( @%1.attacks + 1)} "" {notrig}
#TRIGGER {^%w[^>;] ({@DCtrack})[^>;]with[*>= ]({@dverbshort})([*<= ])%w[!.]} {#var %1.taken %eval( @%1.taken + %item( @dvalues, %ismember( %concat( %2, %3), @dverbs)))}

The meat and potato triggers. Pretty gnarly looking but they seem to work :) The first one catches all damage anyone in the variable @DCtrack deals, adds an attack to the damage verb that they hit, adds damage to their total damage tracker and adds to their total attacks (just so it doesn't have to add them up later) The second catches all damage done to you. It looks up the position in @dverbs, maps it to @dvalues and adds them to your previous total. (Both of these triggers use that same method)

#TRIGGER {%w is leading (%d) player[ s]with} {#if (%1 < 10) {#loop %1 {#temp {^ %i|??? ???? (&%wDCtemp1)} {#if (%lower( @DCtemp1) != @dcCurChar) {dcadd %lower( @DCtemp1)}}}} {#loop 1,9 {#temp {^ %i|??? ???? (&%wDCtemp1)} {#if (%lower( @DCtemp1) != @dcCurChar) {dcadd %lower( @DCtemp1)}}};#loop 10,%1 {#temp {^%i|??? ???? (&%wDCtemp1)} {#if (%lower( @DCtemp1) != @dcCurChar) {dcadd %lower( @DCtemp1)}}}};#t- "%w is leading (%d) player[ s]with";group} "" {disable}

The trigger that catches group members as mentioned earlier. It creates a trigger for each group slot depending on how many people are in the group and that trigger calls the dcadd alias on them

#MENU {DC Add} {dcadd %lower( %selword)} ""
#MENU {DC Clear} {dcclear} ""
#MENU {DC List} {#ec -;#ec --- CHARACTERS ON THE DC LIST ---;#fo @DCnames {#ec %i}} ""

Last but not... well ok they are the least... but just a couple of right click menus that you don't really need but may make it easier to add a groupie that may not of been in the group, clear the list or see who's on the list.