Package net.sf.l2j.gameserver.model

Examples of net.sf.l2j.gameserver.model.L2ClanMember


          return;
        //do we need powers to do that??
        L2Clan clan = activeChar.getClan();
        if(clan == null)
          return;
        L2ClanMember member = clan.getClanMember(_player);
        if(member == null)
          return;
        activeChar.sendPacket(new PledgeReceiveMemberInfo(member));
    }
View Full Code Here


        {
          activeChar.sendPacket(new SystemMessage(SystemMessageId.YOU_DO_NOT_HAVE_THE_RIGHT_TO_DISMISS_AN_APPRENTICE));
          return;
        }

        L2ClanMember currentMember = clan.getClanMember(_currPlayerName);
        L2ClanMember targetMember = clan.getClanMember(_targetPlayerName);
        if (currentMember == null || targetMember == null) return;

        L2ClanMember apprenticeMember, sponsorMember;
        if (currentMember.getPledgeType() == L2Clan.SUBUNIT_ACADEMY)
        {
          apprenticeMember = currentMember;
          sponsorMember = targetMember;
        }
        else
        {
          apprenticeMember = targetMember;
          sponsorMember = currentMember;
        }

        L2PcInstance apprentice = apprenticeMember.getPlayerInstance();
        L2PcInstance sponsor = sponsorMember.getPlayerInstance();

        SystemMessage sm = null;
        if(_set == 0)
        {
          // test: do we get the current sponsor & apprentice from this packet or no?
          if (apprentice != null) apprentice.setSponsor(0);
          else // offline
            apprenticeMember.initApprenticeAndSponsor(0, 0);

          if (sponsor != null) sponsor.setApprentice(0);
          else // offline
            sponsorMember.initApprenticeAndSponsor(0, 0);

          apprenticeMember.saveApprenticeAndSponsor(0, 0);
          sponsorMember.saveApprenticeAndSponsor(0, 0);

          sm = new SystemMessage(SystemMessageId.S2_CLAN_MEMBER_S1_S_APPRENTICE_HAS_BEEN_REMOVED);
        }
        else
        {
          if (apprenticeMember.getSponsor() != 0 || sponsorMember.getApprentice() != 0
              || apprenticeMember.getApprentice() != 0 || sponsorMember.getSponsor() != 0)
          {
            activeChar.sendMessage("Remove previous connections first.");
            return;
          }
          if (apprentice != null)
            apprentice.setSponsor(sponsorMember.getObjectId());
          else // offline
            apprenticeMember.initApprenticeAndSponsor(0, sponsorMember.getObjectId());

          if (sponsor != null)
            sponsor.setApprentice(apprenticeMember.getObjectId());
          else // offline
            sponsorMember.initApprenticeAndSponsor(apprenticeMember.getObjectId(), 0);

          // saving to database even if online, since both must match
          apprenticeMember.saveApprenticeAndSponsor(0, sponsorMember.getObjectId());
          sponsorMember.saveApprenticeAndSponsor(apprenticeMember.getObjectId(), 0);

          sm = new SystemMessage(SystemMessageId.S2_HAS_BEEN_DESIGNATED_AS_APPRENTICE_OF_CLAN_MEMBER_S1);
        }
        sm.addString(sponsorMember.getName());
      sm.addString(apprenticeMember.getName());
      if (sponsor != activeChar && sponsor != apprentice) activeChar.sendPacket(sm);
      if (sponsor != null) sponsor.sendPacket(sm);
      if (apprentice != null) apprentice.sendPacket(sm);
    }
View Full Code Here

             return;
         //do we need powers to do that??
      L2Clan clan = activeChar.getClan();
          if(clan == null)
             return;
      L2ClanMember member = clan.getClanMember(_memberName);
          if(member == null)
             return;
      member.setPledgeType(_newPledgeType);
      clan.broadcastToOnlineMembers(new PledgeShowMemberListUpdate(member));
  }
View Full Code Here

          sm = null;
            return null;
    }

    L2Clan clan = new L2Clan(IdFactory.getInstance().getNextId(), clanName);
    L2ClanMember leader = new L2ClanMember(clan, player.getName(), player.getLevel(), player.getClassId().getId(), player.getObjectId(), player.getPledgeType(), player.getPowerGrade(), player.getTitle());
    clan.setLeader(leader);
    leader.setPlayerInstance(player);
    clan.store();
    player.setClan(clan);
    player.setPledgeClass(leader.calculatePledgeClass(player));
    player.setClanPrivileges(L2Clan.CP_ALL);

    if (Config.DEBUG)
      _log.fine("New clan created: "+clan.getClanId() + " " +clan.getName());
View Full Code Here

        {
          siege.removeSiegeClan(clanId);
        }
      }

      L2ClanMember leaderMember = clan.getLeader();
      if(leaderMember == null)
        clan.getWarehouse().destroyAllItems("ClanRemove", null, null);
      else
        clan.getWarehouse().destroyAllItems("ClanRemove", clan.getLeader().getPlayerInstance(), null);
View Full Code Here

        if(activeChar == null)
          return;
        L2Clan clan = activeChar.getClan();
        if(clan == null)
          return;
        L2ClanMember member = clan.getClanMember(_member);
        if(member == null)
          return;
        if(member.getPledgeType() == L2Clan.SUBUNIT_ACADEMY)
        {
          // also checked from client side
          activeChar.sendMessage("You cannot change academy member grade");
          return;
        }
        member.setPowerGrade(_powerGrade);
        clan.broadcastClanStatus();
    }
View Full Code Here

          return;
        //do we need powers to do that??
        L2Clan clan = activeChar.getClan();
        if(clan == null)
          return;
        L2ClanMember member = clan.getClanMember(_player);
        if(member == null)
          return;
        activeChar.sendPacket(new PledgeReceivePowerInfo(member));
    }
View Full Code Here

      return;
    }

    L2Clan clan = activeChar.getClan();

    L2ClanMember member = clan.getClanMember(_target);
    if (member == null)
    {
      _log.warning("Target ("+_target+") is not member of the clan");
      return;
    }
    if (member.isOnline() && member.getPlayerInstance().isInCombat())
    {
      activeChar.sendPacket(new SystemMessage(SystemMessageId.CLAN_MEMBER_CANNOT_BE_DISMISSED_DURING_COMBAT));
      return;
    }

        // this also updates the database
    clan.removeClanMember(_target, System.currentTimeMillis() + Config.ALT_CLAN_JOIN_DAYS * 86400000L); //24*60*60*1000 = 86400000
        clan.setCharPenaltyExpiryTime(System.currentTimeMillis() + Config.ALT_CLAN_JOIN_DAYS * 86400000L); //24*60*60*1000 = 86400000
        clan.updateClanInDB();

    SystemMessage sm = new SystemMessage(SystemMessageId.CLAN_MEMBER_S1_EXPELLED);
    sm.addString(member.getName());
    clan.broadcastToOnlineMembers(sm);
    sm = null;
    activeChar.sendPacket(new SystemMessage(SystemMessageId.YOU_HAVE_SUCCEEDED_IN_EXPELLING_CLAN_MEMBER));
    activeChar.sendPacket(new SystemMessage(SystemMessageId.YOU_MUST_WAIT_BEFORE_ACCEPTING_A_NEW_MEMBER));

      // Remove the Player From the Member list
    clan.broadcastToOnlineMembers(new PledgeShowMemberListDelete(_target));

    if (member.isOnline())
    {
      L2PcInstance player = member.getPlayerInstance();
      player.sendPacket(new SystemMessage(SystemMessageId.CLAN_MEMBERSHIP_TERMINATED));
    }
  }
View Full Code Here

                activeChar.sendPacket(sm);
                sm = null;
        return;
      }

      L2ClanMember member1 = activeChar.getClan().getClanMember(_target);
            if (member1 != null)
            {
                L2PcInstance member = member1.getPlayerInstance();
                if (member != null)
                {
              //is target from the same clan?
            member.setTitle(_title);
            SystemMessage sm = new SystemMessage(SystemMessageId.TITLE_CHANGED);
View Full Code Here

    if ((getClanId() != 0) && (getClan() != null))
    {
      // set the status for pledge member list to OFFLINE
      try
      {
        L2ClanMember clanMember = getClan().getClanMember(getName());
        if (clanMember != null)
        {
          clanMember.setPlayerInstance(null);
        }
      }
      catch (Throwable t)
      {
        _log.log(Level.SEVERE, "deleteMe()", t);
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.model.L2ClanMember

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.