Exemplo n.º 1
0
  public void setPlayerInstance(L2PcInstance player) {
    if (player == null && _player != null) {
      // this is here to keep the data when the player logs off
      _name = _player.getName();
      _level = _player.getLevel();
      _classId = _player.getBaseClassId();
      _objectId = _player.getObjectId();
      _powerGrade = _player.getPowerGrade();
      _pledgeType = _player.getPledgeType();
      _title = _player.getTitle();
      _apprentice = _player.getApprentice();
      _sponsor = _player.getSponsor();
      _sex = _player.getAppearance().getSex();
      _raceOrdinal = _player.getRace().ordinal();
    }

    if (player != null) {
      _clan.addSkillEffects(player);
      if (_clan.getLevel() > 3 && player.isClanLeader()) {
        CastleSiegeManager.getInstance().addSiegeSkills(player);
      }
      if (player.isClanLeader()) {
        _clan.setLeader(this);
      }
    }

    _player = player;
  }
Exemplo n.º 2
0
  public String getApprenticeOrSponsorName() {
    if (_player != null) {
      _apprentice = _player.getApprentice();
      _sponsor = _player.getSponsor();
    }

    if (_apprentice != 0) {
      L2ClanMember apprentice = _clan.getClanMember(_apprentice);
      return apprentice != null ? apprentice.getName() : "Error";
    }
    if (_sponsor != 0) {
      L2ClanMember sponsor = _clan.getClanMember(_sponsor);
      return sponsor != null ? sponsor.getName() : "Error";
    }
    return "";
  }
Exemplo n.º 3
0
 public int getApprentice() {
   return _player != null ? _player.getApprentice() : _apprentice;
 }