Thread: [Elvarg] Combat HP Overlay

Page 1 of 2 12 LastLast
Results 1 to 10 of 20
  1. #1 [Elvarg] Combat HP Overlay 
    Extreme Donator


    Join Date
    Oct 2010
    Posts
    2,853
    Thanks given
    1,213
    Thanks received
    1,622
    Rep Power
    5000
    What you're adding:

    Attached image

    Client.java, add this piece of code:
    Code:
    /**
    	 * Draws information about our current target
    	 * during combat.
    	 */
    	public static void drawCombatBox(Mob mob) {
    		//Get health..
    		int currentHp = mob.currentHealth;
    		int maxHp = mob.maxHealth;
    		
    		//Make sure the mob isn't dead!
    		if(currentHp == 0) {
    			return;
    		}
    		
    		//Get name..
    		String name = null;
    		if(mob instanceof Player) {
    			name = ((Player)mob).name;
    		} else if(mob instanceof Npc) {
    			if(((Npc)mob).desc != null) {
    				name = ((Npc)mob).desc.name;
    			}
    		}
    		
    		//Make sure the mob has a name!
    		if(name == null) {
    			return;
    		}
    		
    		//Positioning..
    		int height = 50;
    		int width = 125;
    		int xPos = 7;
    		int yPos = 20;
    		
    		//Draw box ..
    		Rasterizer2D.drawTransparentBox(xPos, yPos, width, height, 000000, 50);
    		
    		//Draw name..
    		if(name != null) {
    			Client.instance.newSmallFont.drawCenteredString(name, xPos+(width/2), yPos + 12, 16777215, 0);
    		}
    		
    		//Draw health..
    		Client.instance.newBoldFont.drawCenteredString(currentHp + "/" + maxHp, xPos+(width/2), yPos + 30, 16777215, 0);
    		
    		//Draw red and green pixels..
    		
    		//Draw missing health
    		Rasterizer2D.drawBox(xPos + 2, yPos + 38, width - 4, 10, 11740160);
    		
    		//Draw existing health
    		int pixelsLength = (int) (((double) currentHp / (double) maxHp) * (width - 4));
    		if(pixelsLength > (width - 4)) {
    			pixelsLength = (width - 4);
    		}
    		Rasterizer2D.drawBox(xPos + 2, yPos + 38, pixelsLength, 10, 31744);
    	}
    Now search for:
    Code:
    if (!Configuration.hitmarks554) {
    Above it, add the following:
    Code:
    //Drawing combat overlay..
    				if(obj instanceof Npc) {
    					Npc npc = ((Npc)obj);
    					if(localPlayer.interactingEntity == -1) {
    						
    						//Is the npc interacting with us?
    						//If we aren't interacting with others,
    						//show combat box.
    						if((npc.interactingEntity - 32768) == localPlayerIndex) {
    							drawCombatBox(npc);
    						}
    						
    					} else {
    						
    						//Are we interacting with the npc?
    						//Show combat box.
    						if(npc.index == localPlayer.interactingEntity) {
    							drawCombatBox(npc);
    						}
    					}
    				} else if(obj instanceof Player) {
    					Player player = ((Player)obj);
    					if(localPlayer.interactingEntity == -1) {
    						
    						//Is the player interacting with us?
    						//If we aren't interacting with others,
    						//show combat box.
    						if((player.interactingEntity - 32768) == localPlayerIndex) {
    							drawCombatBox(player);
    						}
    						
    					} else {
    						//Are we interacting with the player?
    						//Show combat box.
    						if(player.index == localPlayer.interactingEntity - 32768) {
    							drawCombatBox(player);
    						}
    					}
    				}
    Should be done.
    Reply With Quote  
     


  2. #2  
    Registered Member
    Join Date
    Aug 2016
    Posts
    36
    Thanks given
    1
    Thanks received
    16
    Rep Power
    11
    Looks great! will implement this tonight when i get back from work. Loving this base and all the support its been getting, really onto something with this.
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Extreme Donator


    Join Date
    Oct 2010
    Posts
    2,853
    Thanks given
    1,213
    Thanks received
    1,622
    Rep Power
    5000
    Quote Originally Posted by uuid View Post
    Looks great! will implement this tonight when i get back from work. Loving this base and all the support its been getting, really onto something with this.
    Hey, I redid it all and it's much cleaner now.
    Thanks a bunch for the kind words!
    Reply With Quote  
     

  5. #4  
    Registered Member
    Join Date
    Feb 2017
    Posts
    12
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Tried adding this to my client, i cant find the hitmarks554 method and when i added the piece of code it had lots of errors, probably because of my client but yeah is there other client i cud leached from thats compatible :/ im new soz gj tho
    Reply With Quote  
     

  6. #5  
    Registered Member
    Join Date
    Aug 2016
    Posts
    36
    Thanks given
    1
    Thanks received
    16
    Rep Power
    11
    Quote Originally Posted by My3rdLegIsTiny View Post
    Tried adding this to my client, i cant find the hitmarks554 method and when i added the piece of code it had lots of errors, probably because of my client but yeah is there other client i cud leached from thats compatible :/ im new soz gj tho
    This tutorial is using the methods from his "Elvarg" release. Its in the Server download section.
    Reply With Quote  
     

  7. #6  
    Registered Member
    Join Date
    Feb 2017
    Posts
    12
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by uuid View Post
    This tutorial is using the methods from his "Elvarg" release. Its in the Server download section.
    yeah but im not simply ganna abandon my client ;/
    Reply With Quote  
     

  8. #7  
    Registered Member

    Join Date
    Nov 2015
    Age
    24
    Posts
    1,980
    Thanks given
    334
    Thanks received
    1,051
    Rep Power
    5000
    Quote Originally Posted by My3rdLegIsTiny View Post
    yeah but im not simply ganna abandon my client ;/
    no1 is asking you to??
    Reply With Quote  
     

  9. #8  
    Registered Member
    Join Date
    Feb 2017
    Posts
    12
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by Tommeh View Post
    no1 is asking you to??
    O i know. just simply replying to the fact that i know that its in the download section

    p.s ur comments not worth being here
    Reply With Quote  
     

  10. #9  
    Registered Member
    Join Date
    Aug 2016
    Posts
    36
    Thanks given
    1
    Thanks received
    16
    Rep Power
    11
    Quote Originally Posted by My3rdLegIsTiny View Post
    O i know. just simply replying to the fact that i know that its in the download section

    p.s ur comments not worth being here
    If you don't want to abandon your client, then you can easily download the client this tutorial is made for hence the [Elvarg] tag. And rip / convert the methods from his client to yours. Alot more work, but if you don't want to change client for a [Elvarg] specific tutorial release. That's what you'll have to do.
    Reply With Quote  
     

  11. #10  


    RS Wiki's Avatar
    Join Date
    Mar 2011
    Age
    29
    Posts
    9,688
    Thanks given
    1,752
    Thanks received
    3,103
    Rep Power
    5000
    Thanks for add-on
    All the best,
    Wiki




    coming soon
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. osbuddy hp overlay
    By ekram123 in forum Help
    Replies: 4
    Last Post: 07-09-2016, 04:06 PM
  2. Hp overlay will Rep+Thx
    By SkyDog in forum Help
    Replies: 3
    Last Post: 04-03-2016, 09:02 PM
  3. HP Overlay will REP+THX
    By SkyDog in forum Help
    Replies: 0
    Last Post: 04-03-2016, 08:11 PM
  4. HP Overlay
    By Riley in forum Help
    Replies: 5
    Last Post: 03-22-2016, 09:48 PM
  5. OSBuddy HP overlay.
    By myth in forum Buying
    Replies: 5
    Last Post: 11-03-2015, 05:04 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •