Player.Java
Code:
public void appendHitUpdate(Stream str) {
synchronized(this) {
str.writeByte(getHitDiff()); // What the perseon got 'hit' for
if (poisonMask == 1) {
str.writeByteA(2);
} else if (getHitDiff() > 0) {
str.writeByteA(1); // 0: red hitting - 1: blue hitting
} else {
str.writeByteA(0); // 0: red hitting - 1: blue hitting
}
if (playerLevel[3] <= 0) {
playerLevel[3] = 0;
isDead = true;
}
str.writeByte(CIcon); // The combat icon
str.writeByteC(playerLevel[3]); // Their current hp, for HP bar
str.writeByte(getLevelForXP(playerXP[3])); // Their max hp, for HP bar
}
}
public void appendHitUpdate2(Stream str) {
synchronized(this) {
str.writeByte(hitDiff2); // What the perseon got 'hit' for
if (poisonMask == 2) {
str.writeByteS(2);
poisonMask = -1;
} else if (hitDiff2 > 0) {
str.writeByteS(1); // 0: red hitting - 1: blue hitting
} else {
str.writeByteS(0); // 0: red hitting - 1: blue hitting
}
if (playerLevel[3] <= 0) {
playerLevel[3] = 0;
isDead = true;
}
str.writeByte(CIcon); // The combat icon
str.writeByte(playerLevel[3]); // Their current hp, for HP bar
str.writeByteC(getLevelForXP(playerXP[3])); // Their max hp, for HP bar
}
}
NPC.Java
Code:
public void appendHitUpdate(Stream str) {
if (HP <= 0) {
isDead = true;
}
str.writeByteC(hitDiff);
if (hitDiff > 0) {
str.writeByteS(1);
} else {
str.writeByteS(0);
}
//HP Bar Fix
str.writeByte(CIcon); // The combat icon
str.writeByteS(Misc.getCurrentHP(HP, MaxHP, 100));
str.writeByteC(100);
}
public int hitDiff2 = 0;
public boolean hitUpdateRequired2 = false;
public int CIcon = 0;
public void appendHitUpdate2(Stream str) {
if (HP <= 0) {
isDead = true;
}
str.writeByteA(hitDiff2);
if (hitDiff2 > 0) {
str.writeByteC(1);
} else {
str.writeByteC(0);
}
str.writeByte(CIcon); // The combat icon
str.writeByteA(HP);
str.writeByte(MaxHP);
}
Also, I'm using Project Insanity Enhanced V4