Brutal Pkers 2012
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Brutal Pkers 2012

Brutal Pkers - All round skilling, staking and PKing RSC Private Server
 
HomeLatest imagesRegisterLog in

 

 PK Menu Toggle

Go down 
AuthorMessage
Yong Min
Administrator



Gender : Male
Posts : 144
Points : 409
Reputation : 27
Join date : 2011-11-11

PK Menu Toggle Empty
PostSubject: PK Menu Toggle   PK Menu Toggle I_icon_minitimeMon Jan 16, 2012 12:07 pm

This is a little feature I threw together for PKers. You can toggle this information by using the F2 button.

Firstly go into your Client folder, and then go into the following dir:
Quote :

src - org - rscdaemon - client
Now open your mudclient class, and find:
Code:

    private boolean recording = false;
Under that, add:
Code:

   private boolean showPkMenu = false;
   private boolean displayHitsWarning  = false;
   private boolean displayPrayerWarning = false;
Now find:
Code:

                case 1005: // Down Arrow
                gameMenu.updateText(chatHandle, "");
                break;
Under that, add:
Code:

         case 1009: // F2
            /**
             * PK Menu Toggle
             * @author Yong Min
             */
            showPkMenu = !showPkMenu;
            if(showPkMenu) {
               handleServerMessage("@whi@[@red@RSCKingdom@whi@] PK Menu is now:@gre@ Active");
            } else if(displayHitsWarning = true) {
               handleServerMessage("@whi@[@red@RSCKingdom@whi@] PK Menu is now:@red@ Inactive");
               displayHitsWarning = false;
               displayPrayerWarning = false;
            } else {
               handleServerMessage("@whi@[@red@RSCKingdom@whi@] PK Menu is now:@red@ Inactive");
            }
            break;
Now find:
Code:

if (!notInWilderness) {
Above that, add:
Code:

      /**
       * PK Menu Toggle
       * @author Yong Min
       */
      if(showPkMenu) {
         int i9 = 140;
         gameGraphics.drawString("#i27# @whi@PK MENU#i27#", 10, i9, 1, 16777215);
         i9 += 12;
         gameGraphics.drawString("@gre@Attack: @whi@" + playerStatCurrent[0] + "/" + playerStatBase[0], 25, i9, 2, 0xffffff);
         i9 += 12;
         gameGraphics.drawString("@gre@Defense: @whi@" +   playerStatCurrent[1] + "/" + playerStatBase[1], 25, i9, 2, 0xffffff);
         i9 += 12;
         gameGraphics.drawString("@gre@Strength: @whi@" + playerStatCurrent[2] + "/" + playerStatBase[2], 25, i9, 2, 0xffffff);
         i9 += 12;
         if(playerStatCurrent[3] <= (playerStatBase[3]) / 2) {
            gameGraphics.drawString("@gre@Hits: @red@" + playerStatCurrent[3] + "/" + playerStatBase[3], 25, i9, 2, 0xffffff);
            displayHitsWarning = true;
         } else {
            gameGraphics.drawString("@gre@Hits: @whi@" + playerStatCurrent[3] + "/" + playerStatBase[3], 25, i9, 2, 0xffffff);
            displayHitsWarning = false;
         }
         i9 += 12;
         if(playerStatCurrent[5] <= (playerStatBase[5]) / 2) {
            gameGraphics.drawString("@gre@Prayer: @red@" +   playerStatCurrent[5] + "/" + playerStatBase[5], 25, i9, 2, 0xffffff);
            displayPrayerWarning = true;
         } else {
            gameGraphics.drawString("@gre@Prayer: @whi@" +   playerStatCurrent[5] + "/" + playerStatBase[5], 25, i9, 2, 0xffffff);
            displayPrayerWarning = false;
         }
      }
      if(displayHitsWarning) {
         int i10 = 313;
         gameGraphics.drawString("@red@WARNING: LOW HITS!", 202, i10, 1, 16777215);
      }
      if(displayPrayerWarning) {
         int i10 = 325;
         gameGraphics.drawString("@red@WARNING: LOW PRAYER!", 193, i10, 1, 16777215);
      }
Now open your GameImage class from the following dir:
Quote :

src - org - rscdaemon - client
Now find:
Code:

                if (string.charAt(offset) == '#' && offset + 4 < string.length() && string.charAt(offset + 4) == '#' && string.substring(offset + 1, offset + 4).equalsIgnoreCase("adm")) {
Above that, add:
Code:

            if (string.charAt(offset) == '#' && offset + 4 < string.length() && string.charAt(offset + 4) == '#' && string.substring(offset + 1, offset + 2).equalsIgnoreCase("i")) {
               String str = string.substring(offset + 2, offset + 4);
               int heh = -1;
               try {
                  heh = Integer.parseInt(str);
               } catch(Exception e) {
            } finally {
               if(heh < 1290) {
                  if(str != null && str.length() == 2) {
                     spriteClip4(x + 1, y - 15, 19, 19, mudclient.SPRITE_ITEM_START + EntityHandler.getItemDef(heh).getSprite(), EntityHandler.getItemDef(heh).getPictureMask(), 0, 0, false);
                     x += 21;
                     offset += 4;
                     }
                  }
               }
            }
            else
            if (string.charAt(offset) == '#' && offset + 5 < string.length() && string.charAt(offset + 5) == '#' && string.substring(offset + 1, offset + 2).equalsIgnoreCase("i")) {
               String str = string.substring(offset + 2, offset + 5);
               int heh = -1;
               try {
                  heh = Integer.parseInt(str);
                  } catch(Exception e) {
               } finally {
                  if(heh < 1290) {
                     if(str != null && str.length() == 3) {
                        spriteClip4(x + 1, y - 15, 19, 19, mudclient.SPRITE_ITEM_START + EntityHandler.getItemDef(heh).getSprite(), EntityHandler.getItemDef(heh).getPictureMask(), 0, 0, false);
                        x += 21;
                        offset += 5;
                     }
                  }
               }
            }
            else
            if (string.charAt(offset) == '#' && offset + 6 < string.length() && string.charAt(offset + 6) == '#' && string.substring(offset + 1, offset + 2).equalsIgnoreCase("i")) {
               String str = string.substring(offset + 2, offset + 6);
               int heh = -1;
               try {
                  heh = Integer.parseInt(str);
                  } catch(Exception e) {
               } finally {
                  if(heh < 1290) {
                     if(str != null && str.length() == 4) {
                        spriteClip4(x + 1, y - 15, 19, 19, mudclient.SPRITE_ITEM_START + EntityHandler.getItemDef(heh).getSprite(), EntityHandler.getItemDef(heh).getPictureMask(), 0, 0, false);
                        x += 21;
                        offset += 6;
                     }
                  }
               }
            }
            else
Now find:
Code:

import org.rscdaemon.client.util.DataConversions;
Below that, add:
Code:

import org.rscdaemon.client.entityhandling.EntityHandler;
import org.rscdaemon.client.entityhandling.defs.ItemDef;
Here's how it will look in game if you have done it successfully.

PK Menu Toggle Dpb6s0

If you lose more than 50% of your prayer or hits level, you will get a warning and it will display red in your pk menu.

PK Menu Toggle 2h58nwz

PK Menu Toggle 2yxm3vm

PK Menu Toggle 260d4xw
Back to top Go down
https://brutalpkers.forumotion.co.uk
 
PK Menu Toggle
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Brutal Pkers 2012 :: RSC Development :: Releases-
Jump to: