Originally Posted by
Paepay
So basically I'm looking to re-code my server into a survival server because it sounds like an awesome idea.
I want the players' HP to decrease instead of increasing with each tick.
Any help would be appreciated!
Entity.java
Code:
public boolean restoreHitPoints() {
int maxHp = getMaxHitpoints();
if (hitpoints > maxHp) {
if (this instanceof Player) {
Player player = (Player) this;
if (player.getPrayer().usingPrayer(1, 5) && Utils.getRandom(100) <= 15)
return false;
}
setHitpoints(hitpoints - 1);
return true;
} else if (hitpoints < maxHp) {
setHitpoints(hitpoints + 1);
if (this instanceof Player) {
Player player = (Player) this;
if (player.getPrayer().usingPrayer(0, 9) && hitpoints < maxHp)
setHitpoints(hitpoints + 1);
else if (player.getPrayer().usingPrayer(0, 26) && hitpoints < maxHp)
setHitpoints(hitpoints + (hitpoints + 4 > maxHp ? maxHp - hitpoints : 4));
}
return true;
}
return false;
}
Code:
setHitpoints(hitpoints + 1);
Code:
setHitpoints(hitpoints - 1);