Thread: Level vars
View Single Post
  #3  
Old 07-25-2010, 12:48 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
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(attackerdamageweapon) {
  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).
__________________
Reply With Quote