Hi i made a funpk zone , but there are a few glitches ; the first one is that you can only attack people from the same level , i want everyone to be attackable at no matter what level .. and also , sometimes it happens that you get 0 hp , but you wont die , you just can't move and stand there , you have to relog to be able to walk again.
for the first problem i have no idea where to look , for the second : could it have to do with my exectute method in skills.java ? :
First Execute method is for the Safepvp , second is just for outside safepvp.
Code:
public void execute() {
stop();
if (!player.isOnline() || player.destroyed()) {
return;
}
if(player.safePVP()) {
player.animate(9055);
heal(hitPoints);
hitPoints = getMaxHitpoints();
player.animate(Animation.RESET);
player.getPrayer().closeAllPrayers();
player.sendMessage("Oh dear, you have died.");
ActionSender.sendConfig(player, 1240, hitPoints * 2);
player.setSpecialAmount(1000);
player.heal(1555);
player.getSkills().restorePray(120);
player.resetCombat();
player.getPoisonManager().removePoison();
player.setAttribute("teleblock", 0);
player.setAttribute("freezeTime", 0);
player.teleport(Mob.DEFAULT);
return;
}
player.animate(9055);
Prayer.wrathEffect(player, player.getCombatExecutor().getLastAttacker());
Prayer.retributionEffect(player, player.getCombatExecutor().getLastAttacker());
player.removeTick("nex_virus");
player.submitTick("death_tick", new Tick(4) {
@Override
public void execute() {
stop();
dead = false;
for (int i = 0; i < SKILL_COUNT; i++) {
set(i, getLevelForExperience(i));
}
player.getSkullManager().removeSkull();
hitPoints = getMaxHitpoints();
player.animate(Animation.RESET);
player.getPrayer().closeAllPrayers();
player.sendMessage("Oh dear, you have died.");
ActionSender.sendConfig(player, 1240, hitPoints * 2);
player.setSpecialAmount(1000);
player.resetCombat();
if(player.getInventory().contains(14596)) {
player.getInventory().addItem(14596, 1);
}
player.getPoisonManager().removePoison();
player.setAttribute("teleblock", 0);
player.setAttribute("freezeTime", 0);
Mob killer = player.getDamageManager().getKiller();
if (!player.getActivity().onDeath(player)) {
if (killer != null && killer != player) {
if (player.getRights() != 2) {
GraveStoneManager.appendDeath(player, killer);
}
}
player.teleport(Mob.DEFAULT);
}
}
}, true);
}
});
}
Any help is appreaciated