Package lineage2.gameserver.model.pledge

Examples of lineage2.gameserver.model.pledge.UnitMember


     * Method runImpl.
     */
    @Override
    public void runImpl()
    {
      final NpcInstance actor = getActor();
      if (actor.getNpcState() == 1)
      {
        actor.setNpcState(2);
      }
      else
      {
        actor.setNpcState(1);
      }
    }
View Full Code Here


    {
      return;
    }
    if ((activeChar.getClanPrivileges() & Clan.CP_CL_MANAGE_RANKS) == Clan.CP_CL_MANAGE_RANKS)
    {
      UnitMember member = activeChar.getClan().getAnyMember(_name);
      if (member != null)
      {
        if (Clan.isAcademy(member.getPledgeType()))
        {
          activeChar.sendMessage("You cannot change academy member grade.");
          return;
        }
        if (_powerGrade > 5)
        {
          member.setPowerGrade(clan.getAffiliationRank(member.getPledgeType()));
        }
        else
        {
          member.setPowerGrade(_powerGrade);
        }
        if (member.isOnline())
        {
          member.getPlayer().sendUserInfo();
        }
      }
      else
      {
        activeChar.sendMessage(new CustomMessage("lineage2.gameserver.clientpackets.RequestPledgeSetMemberPowerGrade.NotBelongClan", activeChar));
View Full Code Here

    SubUnit subUnit = activeChar.getSubUnit();
    if ((clan == null) || (subUnit == null))
    {
      return;
    }
    UnitMember member = subUnit.getUnitMember(activeChar.getObjectId());
    if (member == null)
    {
      return;
    }
    member.setPlayerInstance(activeChar, false);
    int sponsor = activeChar.getSponsor();
    int apprentice = activeChar.getApprentice();
    L2GameServerPacket msg = new SystemMessage2(SystemMsg.CLAN_MEMBER_S1_HAS_LOGGED_INTO_GAME).addName(activeChar);
    PledgeShowMemberListUpdate memberUpdate = new PledgeShowMemberListUpdate(activeChar);
    for (Player clanMember : clan.getOnlineMembers(activeChar.getObjectId()))
View Full Code Here

    {
      return;
    }
    if ((activeChar.getClanPrivileges() & Clan.CP_CL_APPRENTICE) == Clan.CP_CL_APPRENTICE)
    {
      UnitMember sponsor = activeChar.getClan().getAnyMember(_sponsorName);
      UnitMember apprentice = activeChar.getClan().getAnyMember(_apprenticeName);
      if ((sponsor != null) && (apprentice != null))
      {
        if ((apprentice.getPledgeType() != Clan.SUBUNIT_ACADEMY) || (sponsor.getPledgeType() == Clan.SUBUNIT_ACADEMY))
        {
          return;
        }
        if (_mode == 1)
        {
          if (sponsor.hasApprentice())
          {
            activeChar.sendMessage(new CustomMessage("lineage2.gameserver.clientpackets.RequestOustAlly.MemberAlreadyHasApprentice", activeChar));
            return;
          }
          if (apprentice.hasSponsor())
          {
            activeChar.sendMessage(new CustomMessage("lineage2.gameserver.clientpackets.RequestOustAlly.ApprenticeAlreadyHasSponsor", activeChar));
            return;
          }
          sponsor.setApprentice(apprentice.getObjectId());
          clan.broadcastToOnlineMembers(new PledgeShowMemberListUpdate(apprentice));
          clan.broadcastToOnlineMembers(new SystemMessage(SystemMessage.S2_HAS_BEEN_DESIGNATED_AS_THE_APPRENTICE_OF_CLAN_MEMBER_S1).addString(sponsor.getName()).addString(apprentice.getName()));
        }
        else
        {
          if (!sponsor.hasApprentice())
          {
            activeChar.sendMessage(new CustomMessage("lineage2.gameserver.clientpackets.RequestOustAlly.MemberHasNoApprentice", activeChar));
            return;
          }
          sponsor.setApprentice(0);
          clan.broadcastToOnlineMembers(new PledgeShowMemberListUpdate(apprentice));
          clan.broadcastToOnlineMembers(new SystemMessage(SystemMessage.S2_CLAN_MEMBER_S1S_APPRENTICE_HAS_BEEN_REMOVED).addString(sponsor.getName()).addString(apprentice.getName()));
        }
        if (apprentice.isOnline())
        {
          apprentice.getPlayer().broadcastCharInfo();
        }
        activeChar.sendPacket(new PledgeReceiveMemberInfo(sponsor));
      }
    }
    else
View Full Code Here

    {
      activeChar.sendMessage(new CustomMessage("lineage2.gameserver.clientpackets.RequestPledgeReorganizeMember.ChangeAffiliations", activeChar));
      activeChar.sendActionFailed();
      return;
    }
    UnitMember subject = clan.getAnyMember(_subjectName);
    if (subject == null)
    {
      activeChar.sendMessage(new CustomMessage("lineage2.gameserver.clientpackets.RequestPledgeReorganizeMember.NotInYourClan", activeChar));
      activeChar.sendActionFailed();
      return;
    }
    if (subject.getPledgeType() == _targetUnit)
    {
      activeChar.sendMessage(new CustomMessage("lineage2.gameserver.clientpackets.RequestPledgeReorganizeMember.AlreadyInThatCombatUnit", activeChar));
      activeChar.sendActionFailed();
      return;
    }
    if ((_targetUnit != 0) && (clan.getSubUnit(_targetUnit) == null))
    {
      activeChar.sendMessage(new CustomMessage("lineage2.gameserver.clientpackets.RequestPledgeReorganizeMember.NoSuchCombatUnit", activeChar));
      activeChar.sendActionFailed();
      return;
    }
    if (Clan.isAcademy(_targetUnit))
    {
      activeChar.sendMessage(new CustomMessage("lineage2.gameserver.clientpackets.RequestPledgeReorganizeMember.AcademyViaInvitation", activeChar));
      activeChar.sendActionFailed();
      return;
    }
    if (Clan.isAcademy(subject.getPledgeType()))
    {
      activeChar.sendMessage(new CustomMessage("lineage2.gameserver.clientpackets.RequestPledgeReorganizeMember.CantMoveAcademyMember", activeChar));
      activeChar.sendActionFailed();
      return;
    }
    UnitMember replacement = null;
    if (_replace > 0)
    {
      replacement = clan.getAnyMember(_replaceName);
      if (replacement == null)
      {
        activeChar.sendMessage(new CustomMessage("lineage2.gameserver.clientpackets.RequestPledgeReorganizeMember.CharacterNotBelongClan", activeChar));
        activeChar.sendActionFailed();
        return;
      }
      if (replacement.getPledgeType() != _targetUnit)
      {
        activeChar.sendMessage(new CustomMessage("lineage2.gameserver.clientpackets.RequestPledgeReorganizeMember.CharacterNotBelongCombatUnit", activeChar));
        activeChar.sendActionFailed();
        return;
      }
      if (replacement.isSubLeader() != 0)
      {
        activeChar.sendMessage(new CustomMessage("lineage2.gameserver.clientpackets.RequestPledgeReorganizeMember.CharacterLeaderAnotherCombatUnit", activeChar));
        activeChar.sendActionFailed();
        return;
      }
    }
    else
    {
      if (clan.getUnitMembersSize(_targetUnit) >= clan.getSubPledgeLimit(_targetUnit))
      {
        if (_targetUnit == Clan.SUBUNIT_MAIN_CLAN)
        {
          activeChar.sendPacket(new SystemMessage(SystemMessage.S1_IS_FULL_AND_CANNOT_ACCEPT_ADDITIONAL_CLAN_MEMBERS_AT_THIS_TIME).addString(clan.getName()));
        }
        else
        {
          activeChar.sendPacket(Msg.THE_ACADEMY_ROYAL_GUARD_ORDER_OF_KNIGHTS_IS_FULL_AND_CANNOT_ACCEPT_NEW_MEMBERS_AT_THIS_TIME);
        }
        activeChar.sendActionFailed();
        return;
      }
      if (subject.isSubLeader() != 0)
      {
        activeChar.sendMessage(new CustomMessage("lineage2.gameserver.clientpackets.RequestPledgeReorganizeMember.MemberLeaderAnotherUnit", activeChar));
        activeChar.sendActionFailed();
        return;
      }
    }
    SubUnit oldUnit = null;
    if (replacement != null)
    {
      oldUnit = replacement.getSubUnit();
      oldUnit.replace(replacement.getObjectId(), subject.getPledgeType());
      clan.broadcastToOnlineMembers(new PledgeShowMemberListUpdate(replacement));
      if (replacement.isOnline())
      {
        replacement.getPlayer().updatePledgeClass();
        replacement.getPlayer().broadcastCharInfo();
      }
    }
    oldUnit = subject.getSubUnit();
    oldUnit.replace(subject.getObjectId(), _targetUnit);
    clan.broadcastToOnlineMembers(new PledgeShowMemberListUpdate(subject));
View Full Code Here

        _owner.getWarehouse().destroyItemByItemId(ItemTemplate.ITEM_ID_ADENA, _rentalFee);
        setPaidCycle(0);
      }
      else
      {
        UnitMember member = _owner.getLeader();
        if (member.isOnline())
        {
          member.getPlayer().sendPacket(SystemMsg.THE_CLAN_HALL_FEE_IS_ONE_WEEK_OVERDUE_THEREFORE_THE_CLAN_HALL_OWNERSHIP_HAS_BEEN_REVOKED);
        }
        else
        {
          PlayerMessageStack.getInstance().mailto(member.getObjectId(), SystemMsg.THE_CLAN_HALL_FEE_IS_ONE_WEEK_OVERDUE_THEREFORE_THE_CLAN_HALL_OWNERSHIP_HAS_BEEN_REVOKED.packet(null));
        }
        changeOwner(null);
      }
    }
  }
View Full Code Here

    _race = player.getRace().ordinal();
    _objectId = player.getObjectId();
    _isOnline = player.isOnline();
    _pledgeType = player.getPledgeType();
    SubUnit subUnit = player.getSubUnit();
    UnitMember member = subUnit == null ? null : subUnit.getUnitMember(_objectId);
    if (member != null)
      _isApprentice = member.hasSponsor() ? 1 : 0;
  }
View Full Code Here

    Clan clan = activeChar.getClan();
    if (clan == null)
    {
      return;
    }
    UnitMember member = clan.getAnyMember(activeChar.getObjectId());
    if (member == null)
    {
      activeChar.sendActionFailed();
      return;
    }
    if (member.isClanLeader())
    {
      activeChar.sendMessage("A clan leader may not be dismissed.");
      return;
    }
    int subUnitType = activeChar.getPledgeType();
View Full Code Here

      return;
    }
    Clan clan = activeChar.getClan();
    if (clan != null)
    {
      UnitMember cm = clan.getAnyMember(_target);
      if (cm != null)
      {
        activeChar.sendPacket(new PledgeReceiveMemberInfo(cm));
      }
    }
View Full Code Here

   */
  public Clan createClan(Player player, String clanName)
  {
    if (getClanByName(clanName) == null)
    {
      UnitMember leader = new UnitMember(player);
      leader.setLeaderOf(Clan.SUBUNIT_MAIN_CLAN);
      Clan clan = new Clan(IdFactory.getInstance().getNextId());
      SubUnit unit = new SubUnit(clan, Clan.SUBUNIT_MAIN_CLAN, leader, clanName);
      unit.addUnitMember(leader);
      clan.addSubUnit(unit, false);
      clan.store();
      player.setPledgeType(Clan.SUBUNIT_MAIN_CLAN);
      player.setClan(clan);
      player.setPowerGrade(6);
      leader.setPlayerInstance(player, false);
      _clans.put(clan.getClanId(), clan);
      return clan;
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of lineage2.gameserver.model.pledge.UnitMember

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.