If I was a scripter on a classic server, I'd rather have some kind of function which is called when the player is hurt that basically requests permission to hurt the player. The function would be called in some standardly-named weapon. If the function/weapon doesn't exist, it would default to this, which replicates default behavior:
PHP Code:
//#CLIENTSIDE
public function getAttackDamage(attacker, damage, weapon) {
if (player.level.nopkzone) {
return 0;
}
if (player.guild == attacker.guild && player.guild != "") {
return 0;
}
if (player.ap == 100 && weapon == "sword") {
return 0;
}
return damage;
}
This would give you much greater flexibility and also allow you to change damages based on different types of hits. Something similar could be done for AP taking on death (serverside).