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
perenico
Beginner


Joined: 07 Jun 2005
Posts: 23
Location: France

PostPosted: Mon Jan 16, 2006 12:50 pm   

hit rate for astaria
 
here's something which tells you how hard and often you hit.
haven't tested it all, it seems to work, this is just well, obviously useless.

Code:
#CLASS {hit}
#ALIAS rate {
  #IF (%numparam( ) == 0) {
    #MATH rate {(%arrget( hit, 9)*100)/(%arrget( hit, 9)+%arrget( hit, 10))}
    #SAY total accuracy : @rate%
    #MATH rate {(%arrget( hit, 0)*100)/%arrget( hit, 9)}
    #SAY %arrget( hit, 0) weak hits : @rate%
    #MATH rate {(%arrget( hit, 1)*100)/%arrget( hit, 9)}
    #SAY %arrget( hit, 1) light hits : @rate%
    #MATH rate {(%arrget( hit, 2)*100)/%arrget( hit, 9)}
    #SAY %arrget( hit, 2) clean/hard hits : @rate%
    #MATH rate {(%arrget( hit, 3)*100)/%arrget( hit, 9)}
    #SAY %arrget( hit, 3) deft/solid hits : @rate%
    #MATH rate {(%arrget( hit, 4)*100)/%arrget( hit, 9)}
    #SAY %arrget( hit, 4) expert/heavy hits : @rate%
    #MATH rate {(%arrget( hit, 5)*100)/%arrget( hit, 9)}
    #SAY %arrget( hit, 5) violent/harsh hits : @rate%
    #MATH rate {(%arrget( hit, 6)*100)/%arrget( hit, 9)}
    #SAY %arrget( hit, 6) savage/massive hits : @rate%
    #MATH rate {(%arrget( hit, 7)*100)/%arrget( hit, 9)}
    #SAY %arrget( hit, 7) critic hits : @rate%
    #MATH rate {(%arrget( hit, 8)*100)/%arrget( hit, 9)}
    #SAY %arrget( hit, 8) chance hits : @rate%
    } {
    #MATH rate {(%arrget( hit, 9)*100)/(%arrget( hit, 9)+%arrget( hit, 10))}
    %1 total accuracy : @rate%
    #MATH rate {(%arrget( hit, 0)*100)/%arrget( hit, 9)}
    %1 %arrget( hit, 0) weak hits : @rate%
    #MATH rate {(%arrget( hit, 1)*100)/%arrget( hit, 9)}
    %1 %arrget( hit, 1) light hits : @rate%
    #MATH rate {(%arrget( hit, 2)*100)/%arrget( hit, 9)}
    %1 %arrget( hit, 2) clean/hard hits : @rate%
    #MATH rate {(%arrget( hit, 3)*100)/%arrget( hit, 9)}
    %1 %arrget( hit, 3) deft/solid hits : @rate%
    #MATH rate {(%arrget( hit, 4)*100)/%arrget( hit, 9)}
    %1 %arrget( hit, 4) expert/heavy hits : @rate%
    #MATH rate {(%arrget( hit, 5)*100)/%arrget( hit, 9)}
    %1 %arrget( hit, 5) violent/harsh hits : @rate%
    #MATH rate {(%arrget( hit, 6)*100)/%arrget( hit, 9)}
    %1 %arrget( hit, 6) savage/massive hits : @rate%
    #MATH rate {(%arrget( hit, 7)*100)/%arrget( hit, 9)}
    %1 %arrget( hit, 7) critic hits : @rate%
    #MATH rate {(%arrget( hit, 8)*100)/%arrget( hit, 9)}
    %1 %arrget( hit, 8) chance hits : @rate%
    }
  }
#ALIAS rate_zero {#VA hit %array( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)}
#VAR hit {<Array>|334|902|1113|1082|1134|873|254|78|122|5770|713}
#VAR temp_hit {1134}
#VAR rate {2}
#TRIGGER {but you miss.} {
  #VA temp_hit %arrget( hit, 10)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 10, @temp_hit)
  }
#TRIGGER {and {strike|hit} critically!} {
  #VA temp_hit %arrget( hit, 9)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 9, @temp_hit)
  #VA temp_hit %arrget( hit, 7)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 7, @temp_hit)
  }
#TRIGGER {and {strike|hit} lightly.} {
  #VA temp_hit %arrget( hit, 9)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 9, @temp_hit)
  #VA temp_hit %arrget( hit, 1)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 1, @temp_hit)
  }
#TRIGGER {and {strike|hit} weakly.} {
  #VA temp_hit %arrget( hit, 9)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 9, @temp_hit)
  #VA temp_hit %arrget( hit, 0)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 0, @temp_hit)
  }
#TRIGGER {and {strike|hit} {massively!|savagely!}} {
  #VA temp_hit %arrget( hit, 9)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 9, @temp_hit)
  #VA temp_hit %arrget( hit, 6)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 6, @temp_hit)
  }
#TRIGGER {and {strike|hit} {violently.|harshly.}} {
  #VA temp_hit %arrget( hit, 9)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 9, @temp_hit)
  #VA temp_hit %arrget( hit, 5)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 5, @temp_hit)
  }
#TRIGGER {and {strike|hit} {expertly.|heavily.}} {
  #VA temp_hit %arrget( hit, 9)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 9, @temp_hit)
  #VA temp_hit %arrget( hit, 4)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 4, @temp_hit)
  }
#TRIGGER {and {strike|hit} {cleanly.|hard.}} {
  #VA temp_hit %arrget( hit, 9)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 9, @temp_hit)
  #VA temp_hit %arrget( hit, 2)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 2, @temp_hit)
  }
#TRIGGER {and {strike|hit} {deftly.|solidly.}} {
  #VA temp_hit %arrget( hit, 9)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 9, @temp_hit)
  #VA temp_hit %arrget( hit, 3)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 3, @temp_hit)
  }
#TRIGGER {You sense a prime chance to strike, and hit for double effect.} {
  #VA temp_hit %arrget( hit, 8)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 8, @temp_hit)
  }
#CLASS 0


- You can have it echoed on your screen by typing :
rate
- Or you can have it echoed to any channel you like by typing :
rate <channel>
- Of course, you can have it reset by typing :
rate_zero
Reply with quote
perenico
Beginner


Joined: 07 Jun 2005
Posts: 23
Location: France

PostPosted: Thu Mar 23, 2006 1:47 pm   
 
here's the same thing, gives you how often and hard you hit... but using a function, it's much more clear and readable

Code:

#CLASS {hit}
#ALIAS rate {
  #IF (%numparam( ) == 0) {
    #SAY total accuracy : %format( "&.1n", %eval( @rate_comp(9, 10)))%
    #SAY %arrget( hit, 0) weak hits : %format( "&.1n", %eval( @rate_comp(0, 9)))%
    #SAY %arrget( hit, 1) light hits : %format( "&.1n", %eval( @rate_comp(1, 9)))%
    #SAY %arrget( hit, 2) clean/hard hits : %format( "&.1n", %eval( @rate_comp(2, 9)))%
    #SAY %arrget( hit, 3) deft/solid hits : %format( "&.1n", %eval( @rate_comp(3, 9)))%
    #SAY %arrget( hit, 4) expert/heavy hits : %format( "&.1n", %eval( @rate_comp(4, 9)))%
    #SAY %arrget( hit, 5) violent/harsh hits : %format( "&.1n", %eval( @rate_comp(5, 9)))%
    #SAY %arrget( hit, 6) savage/massive hits : %format( "&.1n", %eval( @rate_comp(6, 9)))%
    #SAY %arrget( hit, 7) critic hits : %format( "&.1n", %eval( @rate_comp(7, 9)))%
    #SAY %arrget( hit, 8) chance hits : %format( "&.2n", %eval( @rate_comp(8, 9)))%
    } {
    %1 total accuracy : %format( "&.1n", %eval( @rate_comp(9, 10)))%
    %1 %arrget( hit, 0) weak hits : %format( "&.1n", %eval( @rate_comp(0, 9)))%
    %1 %arrget( hit, 1) light hits : %format( "&.1n", %eval( @rate_comp(1, 9)))%
    %1 %arrget( hit, 2) clean/hard hits : %format( "&.1n", %eval( @rate_comp(2, 9)))%
    %1 %arrget( hit, 3) deft/solid hits : %format( "&.1n", %eval( @rate_comp(3, 9)))%
    %1 %arrget( hit, 4) expert/heavy hits : %format( "&.1n", %eval( @rate_comp(4, 9)))%
    %1 %arrget( hit, 5) violent/harsh hits : %format( "&.1n", %eval( @rate_comp(5, 9)))%
    %1 %arrget( hit, 6) savage/massive hits : %format( "&.1n", %eval( @rate_comp(6, 9)))%
    %1 %arrget( hit, 7) critic hits : %format( "&.1n", %eval( @rate_comp(7, 9)))%
    %1 %arrget( hit, 8) chance hits : %format( "&.2n", %eval( @rate_comp(8, 9)))%
    }
  }
#ALIAS rate_zero {#VA hit %array( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)}
#TRIGGER {but you miss.} {
  #VA temp_hit %arrget( hit, 10)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 10, @temp_hit)
  }
#TRIGGER {and {strike|hit} critically!} {
  #VA temp_hit %arrget( hit, 9)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 9, @temp_hit)
  #VA temp_hit %arrget( hit, 7)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 7, @temp_hit)
  }
#TRIGGER {and {strike|hit} lightly.} {
  #VA temp_hit %arrget( hit, 9)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 9, @temp_hit)
  #VA temp_hit %arrget( hit, 1)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 1, @temp_hit)
  }
#TRIGGER {and {strike|hit} weakly.} {
  #VA temp_hit %arrget( hit, 9)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 9, @temp_hit)
  #VA temp_hit %arrget( hit, 0)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 0, @temp_hit)
  }
#TRIGGER {and {strike|hit} {massively!|savagely!}} {
  #VA temp_hit %arrget( hit, 9)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 9, @temp_hit)
  #VA temp_hit %arrget( hit, 6)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 6, @temp_hit)
  }
#TRIGGER {and {strike|hit} {violently.|harshly.}} {
  #VA temp_hit %arrget( hit, 9)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 9, @temp_hit)
  #VA temp_hit %arrget( hit, 5)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 5, @temp_hit)
  }
#TRIGGER {and {strike|hit} {expertly.|heavily.}} {
  #VA temp_hit %arrget( hit, 9)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 9, @temp_hit)
  #VA temp_hit %arrget( hit, 4)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 4, @temp_hit)
  }
#TRIGGER {and {strike|hit} {cleanly.|hard.}} {
  #VA temp_hit %arrget( hit, 9)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 9, @temp_hit)
  #VA temp_hit %arrget( hit, 2)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 2, @temp_hit)
  }
#TRIGGER {and {strike|hit} {deftly.|solidly.}} {
  #VA temp_hit %arrget( hit, 9)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 9, @temp_hit)
  #VA temp_hit %arrget( hit, 3)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 3, @temp_hit)
  }
#TRIGGER {You sense a prime chance to strike, and hit for double effect.} {
  #VA temp_hit %arrget( hit, 8)
  #ADD temp_hit 1
  #NOOP %arrset( hit, 8, @temp_hit)
  }
#VAR hit {<Array>|2|2|4|2|0|0|0|0|0|10|0}
#VAR temp_hit {2}
#FU rate_comp {%eval( %eval( %arrget( hit, %1)*100.0) / %format( "&.1n", %eval( %arrget( hit, %1)+%arrget( hit, %2))))}
#CLASS 0
_________________
-=-=-=-=-=-=-=-=-=-=-=-=
astaria3.com : 5000
character name : Vandemar
-=-=-=-=-=-=-=-=-=-=-=-=
Zmud : 7.21
-=-=-=-=-=-=-=-=-=-=-=-=
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