Kill Buffer Tracking: Difference between revisions

From RoDpedia
Jump to navigation Jump to search
Created page with '= Purpose = Repeatedly killing the same mob causes the mob to gain advantages against you in combat and provide less experience. Some believe this also affects pop rates on cer…'
 
mNo edit summary
Line 54: Line 54:
   }
   }
  }
  }
 
  #CLASS 0
  #CLASS 0


[[Category:Triggers]]
[[Category:Triggers]]

Revision as of 17:33, 20 January 2019

Purpose

Repeatedly killing the same mob causes the mob to gain advantages against you in combat and provide less experience. Some believe this also affects pop rates on certain mobs.

From help buffer:

  Mobs remember fighting you if it is within the last twenty-five kills. If they
  have a higher intelligence than you they will learn from it and potentially
  gain an advantage over you in combat, thus lessening the experience gained.

This script keeps track of your kill buffer, allowing you to know when you have cleared out the mob you are concerned about.

Commands

  • setBufferLength - used to set a buffer length other than 25
  • clearBuffer - remove all mob kill history and reset buffer
  • showBuffer - display the current buffer state

Script

cMud 3.34

#CLASS {killBufferTracker} {enable}
#VAR killList ""
#VAR bufferLength 25

#ALIAS setBufferLength {bufferLength=%1;#say Updating killBufferTracker's bufferLength to %1} 
#ALIAS clearBuffer {#VAR killList ""}
#ALIAS showBuffer {
 #if ( %numitems( killList) == 0 ) {
   #say "Your kill buffer is empty, go kill something."
 } {
   #say "The last "%numitems( killList)"/"@bufferLength "mobs kills were:"
   #LOOPDB @killList {#say %key "=" %val}
 }
}

#TRIGGER {(*) is DEAD!!} {
 #local linebefore1 %line2
 #local linebefore2 %line3
 #local fullmobname %1
 
 #if ( %pos( "You", %word(@linebefore1,1) ) > 0 or 
       %pos( "You", %word(@linebefore2,1) ) > 0 ) {
     #if ( %iskey( killList, @fullmobname ) ) {
        killList = %addKey( killList, @fullmobname, (%int(%db( killList, @fullmobname)) + 1) );
        #SHOW %concat(%1," is in the kill buffer ( ",%db( killList, @fullmobname )," times ).")
     } {
        killList = %addkey( @killList, @fullmobname, 1 );
        #SHOW %concat(%1," added to kill buffer.")
     }   
 
     // rumour is that the kill buffer actually tracks 50 despite the help file saying 25
     #if ( %numkeys( killList ) > @bufferLength ) {
        #SHOW %concat( "Removing ",%pop(killList)," from the kill buffer.")
        killList = %delkey( killList, %pop(killList) );
     }
 }
}

#CLASS 0