Status bars(ruse)

Hello today i going show how to add status bars (ruse)

goo to client.java

post somwhere outside any methods this:

private void drawSkillStatus(int x, int y, int skillId, int icon, int barHeight, Color barColor) {
try
{
drawingArea.drawAlphaGradient(x, y, 20, barHeight + 1, 0, 0, 180);

    Graphics2D g2d = DrawingArea.createGraphics(true);

    int currentLevel = currentStats[skillId];

    int maxLevel = currentMaxStats[skillId];

    double percentage = 100 - ((double) currentLevel / (double) maxLevel * (double) 100);

    Area shape = new Area(new Rectangle(x + 1, y + 1, 18, barHeight));

    shape.subtract(new Area(new Rectangle(x + 1, y + 1, 18, (int) ((double) barHeight / (double) 100 * percentage))));

    if (skillId == 3) {
        cacheSprite[icon].drawSprite(x + 2, y + 6);
    } else if (skillId == 5) {
        cacheSprite[icon].drawSprite(x + 2, y + 4);
    }

    g2d.setColor(barColor);

    g2d.fill(shape);

    g2d.setColor(Color.white);

    if (skillId == 5 && currentLevel < 100) {
        drawingArea.drawCenteredString(g2d, "0." + Integer.toString(currentLevel / 10), new Rectangle(x + 5, y + 24, 9, 14), new Font("Arial", Font.PLAIN, 11));
    } else {
        drawingArea.drawCenteredString(g2d, Integer.toString(currentLevel / 100), new Rectangle(x + 5, y + 24, 9, 14), new Font("Arial", Font.PLAIN, 11));
    }

} catch (Exception e) {
    System.out.println("Error drawing skill status for skill: " + skillId);
}

}

then go find

private void drawTabArea() {

if (clientSize == 0) {
    tabAreaIP.initDrawingArea();
}

and add in this method:

if (clientSize == 0)
{
drawSkillStatus(8, 41, 3, 1062, 250, new Color(255, 0, 0, 45));
drawSkillStatus(218, 41, 5, 1064, 250, new Color(0, 0, 255, 45));
} else
{
boolean small = clientWidth > smallTabs;
drawSkillStatus(!showTab ? clientWidth - 50 : clientWidth - 255, small ? clientHeight - 312 : clientHeight - 350, 3, 1062, small ? 271 : 271, new Color(255, 0, 0, 45));
drawSkillStatus(!showTab ? clientWidth - 25 : clientWidth - 230, small ? clientHeight - 312 : clientHeight - 350, 5, 1064, small ? 271 : 271, new Color(0, 0, 255, 45));
}

int y = clientWidth >= smallTabs ? 37 : 74;
if (showTab) {

goo to Drawlingarea.java
search:

private static final ColorModel COLOR_MODEL = new DirectColorModel(

and add

public static Graphics2D createGraphics(int[] pixels, int width, int height) {
return new BufferedImage(COLOR_MODEL, Raster.createWritableRaster(COLOR_MODEL.createCompatibleSampleModel(width, height), new DataBufferInt(pixels, width * height), null), false,
new Hashtable<Object, Object>()).createGraphics();
}

public static Graphics2D createGraphics(boolean renderingHints) {
    Graphics2D g2d = createGraphics(pixels, width, height);
    if (renderingHints) {
        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    }
    return g2d;
}

public void drawCenteredString(Graphics g, String text, Rectangle rect, Font font)
{
    FontMetrics metrics = g.getFontMetrics(font);
    int x = rect.x + (rect.width - metrics.stringWidth(text)) / 2;
    int y = rect.y + ((rect.height - metrics.getHeight()) / 2) + metrics.getAscent();
    g.setFont(font);
    g.drawString(text, x, y);
}

}

(you might have some same code just add what you missing)

dont forget change sprites id for you hp and pray sprites if you doesnt have you need pack them into your cache

that it!

End result

scree