MegaMediaLife
Welcome to MegaMediaLife. Register to post Have fun!!!!


MegaMediaLife
 
HomeHomeCalendarFAQSearchMemberlistUsergroupsRegisterLog in

Share | 
 

 The new runescape HP bars!

Go down 
AuthorMessage
clayd
Moderator


Posts : 8
Reputation : 0
Join date : 2009-11-15

PostSubject: The new runescape HP bars!   Sun Nov 15, 2009 10:47 pm

This was not made by me! we dont have this here so i leeched it from Rune-s3rver, 100% credits to Badreligion

The Sprites
sendspace.com hnir4j ----------------Sprites
http://uppit.com/v/AFWLSM80 ------------Backup link
Download and extract the sprites, put them in your cache directory in a folder named Sprites
----------------------------------------------


Adding the new HP bar:

Client.java

First off declare this.
Code:

public boolean HPBarToggle = true;

============ Non-Renamed ============

Search for
Code:

if(((Class30_Sub2_Sub4_Sub1) (obj)).anInt1532 > anInt1161)
You should see this:
Code:

            if(((Class30_Sub2_Sub4_Sub1) (obj)).anInt1532 > anInt1161)
            {
                method127(true, ((Class30_Sub2_Sub4_Sub1) (obj)), ((Class30_Sub2_Sub4_Sub1) (obj)).anInt1507 + 15);
                if(anInt963 > -1)
                {
                    int i1 = (((Class30_Sub2_Sub4_Sub1) (obj)).anInt1533 * 30) / ((Class30_Sub2_Sub4_Sub1) (obj)).anInt1534;
                    if(i1 > 30)
                        i1 = 30;
                    Class30_Sub2_Sub1.method336(5, anInt964 - 3, anInt963 - 15, 65280, i1, 0);
                    Class30_Sub2_Sub1.method336(5, anInt964 - 3, (anInt963 - 15) + i1, 0xff0000, 30 - i1, 0);
                }
            }
Replace all of that with this
Code:

            if(((Class30_Sub2_Sub4_Sub1) (obj)).anInt1532 > anInt1161)
            {
      if(anInt963 > -1)
                {
         method127(true, ((Class30_Sub2_Sub4_Sub1) (obj)), ((Class30_Sub2_Sub4_Sub1) (obj)).anInt1507 + 15);
         int i1 = (((Class30_Sub2_Sub4_Sub1) (obj)).anInt1533 * 30) / ((Class30_Sub2_Sub4_Sub1) (obj)).anInt1534;
         if(i1 > 30)
             i1 = 30;
         int HpPercent = (int)((((Class30_Sub2_Sub4_Sub1)(obj)).anInt1533 * 56) / ((Class30_Sub2_Sub4_Sub1) (obj)).anInt1534);
         if(HpPercent > 56)
             HpPercent = 56;
          if(!HPBarToggle){
                       Class30_Sub2_Sub1.method336(5, anInt964 - 3, anInt963 - 15, 65280, i1, 0);
                       Class30_Sub2_Sub1.method336(5, anInt964 - 3, (anInt963 - 15) + i1, 0xff0000, 30 - i1, 0);
          } else {
                       HPBarEmpty.method348(anInt963 - 28, 16083, anInt964 - 3);
         HPBarFull = new Class30_Sub2_Sub1_Sub1(sign.signlink.findcachedir() + "Sprites/HITPOINTS_0.PNG", HpPercent, 7);
         HPBarFull.method348(anInt963 - 28, 16083, anInt964 - 3);
          }
                }
            }
Declare these:
Code:

   private Class30_Sub2_Sub1_Sub1 HPBarFull;
   private Class30_Sub2_Sub1_Sub1 HPBarEmpty;
In method8() add these
Code:

   HPBarFull = null;
   HPBarEmpty = null;
Under "Unpacking media" add these
Code:

   HPBarFull = new Class30_Sub2_Sub1_Sub1(sign.signlink.findcachedir() + "Sprites/HITPOINTS_0.PNG");
   HPBarEmpty = new Class30_Sub2_Sub1_Sub1(sign.signlink.findcachedir() + "Sprites/HITPOINTS_1.PNG");
In Class30_Sub2_Sub1_Sub1.java add this method
Code:

    public Class30_Sub2_Sub1_Sub1(String s, int width, int height){
        try {
            Image image = Toolkit.getDefaultToolkit().createImage(FileOperations.ReadFile(s));
            anInt1440 = width;
            anInt1441 = height;
            anInt1444 = anInt1440;
            anInt1445 = anInt1441;
            anInt1442 = 0;
            anInt1443 = 0;
            anIntArray1439 = new int[anInt1440 * anInt1441];
            PixelGrabber pixelgrabber = new PixelGrabber(image, 0, 0, anInt1440, anInt1441, anIntArray1439, 0, anInt1440);
            pixelgrabber.grabPixels();
        } catch(Exception exception) {
            exception.printStackTrace();
        }
    }


============= Renamed ============

Search for
Code:

if (((Entity) (obj)).loopCycleStatus > loopCycle) {
You should see this:
Code:

                if (((Entity) (obj)).loopCycleStatus > loopCycle) {
                    try {
                        npcScreenPos(((Entity) (obj)),
                                ((Entity) (obj)).height + 15);
                        if (spriteDrawX > -1) {
                            int i1 = (((Entity) (obj)).currentHealth * 30)
                                    / ((Entity) (obj)).maxHealth;

                            if (i1 > 30) {
                                i1 = 30;
                            }
                            DrawingArea.method336(5, spriteDrawY - 3,
                                    spriteDrawX - 15, 65280, i1);
                            DrawingArea.method336(5, spriteDrawY - 3,
                                    (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
                        }
                    } catch (Exception e) {}
                }
Replace all of that with this
Code:

                if (((Entity) (obj)).loopCycleStatus > loopCycle) {
                    try {
                        npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
                        if (spriteDrawX > -1) {
                            int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;

                            if (i1 > 30) {
                                i1 = 30;
                            }
                            int HpPercent = (((Entity) (obj)).currentHealth * 56) / ((Entity) (obj)).maxHealth;

                            if (HpPercent > 56) {
                                HpPercent = 56;
                            }
             if(!HPBarToggle){
            DrawingArea.method336(5, spriteDrawY - 3, spriteDrawX - 15, 65280, i1);
            DrawingArea.method336(5, spriteDrawY - 3, (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
             } else {
            HPBarEmpty.drawSprite(spriteDrawX - 28, spriteDrawY - 3);
            HPBarFull = new Sprite(sign.signlink.findcachedir() + "Sprites/HITPOINTS_0.PNG", HpPercent, 7);
            HPBarFull.drawSprite(spriteDrawX - 28, spriteDrawY - 3);
             }
                        }
                    } catch (Exception e) {}
                }
Declare these:
Code:

   private Sprite HPBarFull;
   private Sprite HPBarEmpty;
In cleanUpForQuit() add these
Code:

   HPBarFull = null;
   HPBarEmpty = null;
Under "Unpacking media" add these
Code:

   HPBarFull = new Sprite(sign.signlink.findcachedir() + "Sprites/HITPOINTS_0.PNG", 1);
   HPBarEmpty = new Sprite(sign.signlink.findcachedir() + "Sprites/HITPOINTS_1.PNG", 1);
In Sprite.java add these methods
Code:

    public Sprite(String img, int i)
    {
        ImageIcon imageicon = new ImageIcon(img);
        imageicon.getIconHeight();
        imageicon.getIconWidth();
        try {
       Image image = Toolkit.getDefaultToolkit().createImage(FileOperations.ReadFile(img));
       myWidth = imageicon.getIconWidth();
       myHeight = imageicon.getIconHeight();
            anInt1444 = myWidth;
            anInt1445 = myHeight;
            anInt1442 = 0;
            anInt1443 = 0;
            myPixels = new int[myWidth * myHeight];
            PixelGrabber pixelgrabber = new PixelGrabber(image, 0, 0, myWidth, myHeight, myPixels, 0, myWidth);
            pixelgrabber.grabPixels();
       image = null;
        } catch(Exception _ex) {
            System.out.println(_ex);
        }
    }
Code:

    public Sprite(String img, int width, int height)
    {
        try {
       Image image = Toolkit.getDefaultToolkit().createImage(FileOperations.ReadFile(img));
       myWidth = width;
       myHeight = height;
            anInt1444 = myWidth;
            anInt1445 = myHeight;
            anInt1442 = 0;
            anInt1443 = 0;
            myPixels = new int[myWidth * myHeight];
            PixelGrabber pixelgrabber = new PixelGrabber(image, 0, 0, myWidth, myHeight, myPixels, 0, myWidth);
            pixelgrabber.grabPixels();
       image = null;
        } catch(Exception _ex) {
            System.out.println(_ex);
        }
    }



Results:







Extra:
To make a command client-sided to toggle the hp bar.

Find
Code:

if(s.startsWith("yellow:"))
Above that add this:


Non renamed:
Code:

if(aString887.equals("::newbar"))
    HPBarToggle = true;
if(aString887.equals("::oldbar"))
    HPBarToggle = false;
Renamed:
Code:

if(inputString.equals("::newbar"))
    HPBarToggle = true;
if(inputString.equals("::oldbar"))
    HPBarToggle = false;

Go to your cache folder then file_store32 then make the sprites folder and add them in it.
Back to top Go down
View user profile
Pwnz
Moderator
avatar

Posts : 34
Reputation : 0
Join date : 2009-11-15
Age : 24
Location : mansfield center connecticut 06250

PostSubject: nice cool!   Tue Nov 17, 2009 10:32 pm

i think it's really awsome that you guys are helping us out with this community Smile thanks for posting Very Happy
Back to top Go down
View user profile
Owner
Admin
avatar

Posts : 41
Reputation : 2
Join date : 2009-11-15
Age : 24
Location : Everywhere.

PostSubject: Re: The new runescape HP bars!   Wed Nov 18, 2009 2:32 am

I totally agree, thanks so much.
Back to top Go down
View user profile http://Www.megamedialife.com
Sponsored content




PostSubject: Re: The new runescape HP bars!   

Back to top Go down
 
The new runescape HP bars!
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
MegaMediaLife :: Runescape Private Servers :: 317 Related Boards :: Tutorials-
Jump to: