Whenever I lose health, the number goes down but the orb stays full. I ripped a drawhealth method out of another server that has health orb draining, but it still didnt work.
Picture:
Code:
Code:
public void drawHPOrb() {
String OrbDirectory = signlink.findcachedir()
+ "Sprites/GameFrame/Orbs/";
String s1 = RSInterface.interfaceCache[4016].message;
s1 = s1.replaceAll("%", "");
int j = Integer.parseInt(s1);
String s2 = RSInterface.interfaceCache[4017].message;
int health;
s2 = s2.replaceAll("%", "");
int k = Integer.parseInt(s2);
int i = (int) (((double) j / (double) k) * 100D);
String cHP = RSInterface.interfaceCache[4016].message;
int currentHP = Integer.parseInt(cHP);
String mHP = RSInterface.interfaceCache[4017].message;
int maxHP2 = Integer.parseInt(mHP);
health = (int) (((double) currentHP / (double) maxHP2) * 100D);
int x = isFullScreen ? 363 + extraWidth : 0;
int y = isFullScreen ? +32 : 0;
int xPos = isFullScreen ? 387 + extraWidth : 0;
int xPosTXT = isFullScreen ? 335 + extraWidth : 0;
int yPos = isFullScreen ? +32 : 0;
if (isFullScreen) {
emptyOrb = new Sprite("GameFrame/Orbs/ORBS 12");
} else {
emptyOrb = new Sprite("GameFrame/Orbs/emptyorb");
}
orbFill = new Sprite(OrbDirectory + "Orb 2.PNG", 27, getOrbFill(health));
/* Draws empty orb */
emptyOrb.drawSprite(170 + x, 13 + y);
/* Draws current HP text */
if (health <= 99999 && health >= 75) {
smallText.method382(65280, 213 + xPosTXT, cHP, 39 + yPos, true);
} else if (health <= 74 && health >= 50) {
smallText.method382(0xffff00, 213 + xPosTXT, cHP, 39 + yPos, true);
} else if (health <= 49 && health >= 25) {
smallText.method382(0xfca607, 213 + xPosTXT, cHP, 39 + yPos, true);
} else if (health <= 24 && health >= 0) {
smallText.method382(0xf50d0d, 213 + xPosTXT, cHP, 39 + yPos, true);
}
hitPointsFill.drawSprite(173 + xPos, 16 + yPos);
orbFill.drawSprite(173 + xPos, 16 + yPos);
/* Draws inside orb sprites */
if (i <= 20) {
if (loopCycle % 20 < 10) {
hitPointsIcon.drawSprite(179 + xPos, 24 + yPos);
}
} else {
hitPointsIcon.drawSprite(179 + xPos, 24 + yPos);
}
}