Example #1
0
  public void addPlayerOnKillListener() {
    if (_onKillListener != null) {
      throw new IllegalArgumentException("Cant add twice kill listener to player");
    }

    _onKillListener = new PlayerOnKillListenerImpl();
    _player.addListener(_onKillListener);
  }
Example #2
0
 /**
  * Add player to get notification of characters death
  *
  * @param player : L2Character of the character to get notification of death
  */
 public void addNotifyOfDeath(Player player, boolean withPet) {
   OnDeathListenerImpl listener = new OnDeathListenerImpl();
   player.addListener(listener);
   if (withPet) {
     for (Summon summon : player.getSummonList()) {
       summon.addListener(listener);
     }
   }
 }