Beispiel #1
0
  /**
   * This function is called whenever a player leaves a party
   *
   * @param player the player quitting.
   */
  public void onRemoveFromParty(L2PcInstance player) {
    // if it isn't a party duel ignore this
    if (!_partyDuel) {
      return;
    }

    // this player is leaving his party during party duel
    // if he's either playerA or playerB cancel the duel and port the players back
    if ((player == _playerA) || (player == _playerB)) {
      for (PlayerCondition cond : _playerConditions.values()) {
        cond.teleportBack();
        cond.getPlayer().setIsInDuel(0);
      }

      _playerA = null;
      _playerB = null;
    } else
    // teleport the player back & delete his PlayerCondition record
    {
      final PlayerCondition cond = _playerConditions.get(player.getObjectId());
      if (cond != null) {
        cond.teleportBack();
        _playerConditions.remove(cond);
      }
      player.setIsInDuel(0);
    }
  }
Beispiel #2
0
 public void onBuff(L2PcInstance player, Skill debuff) {
   final PlayerCondition cond = _playerConditions.get(player.getObjectId());
   if (cond != null) {
     cond.registerDebuff(debuff);
   }
 }