Package l2p.gameserver.model

Examples of l2p.gameserver.model.L2ClanMember


    if(clan.getSiege() != null || clan.getTerritorySiege() > -1)
    {
      leader.sendMessage(new CustomMessage("scripts.services.Rename.SiegeNow", leader));
      return;
    }
    L2ClanMember member = clan.getClanMember(newLeader);
    if(member == null)
    {
      leader.sendMessage(new CustomMessage("l2p.gameserver.model.instances.L2VillageMasterInstance.S1IsNotMemberOfTheClan", leader).addString(newLeader));
      showChatWindow(leader, "data/html/villagemaster/clan-20.htm");
      return;
View Full Code Here


  }

  public void createSubPledge(L2Player player, String clanName, int pledgeType, int minClanLvl, String leaderName)
  {
    int subLeaderId = 0;
    L2ClanMember subLeader = null;
    L2Clan clan = player.getClan();
    if(clan == null || !player.isClanLeader())
    {
      player.sendPacket(Msg.YOU_HAVE_FAILED_TO_CREATE_A_CLAN);
      return;
    }
    if(!Util.isMatchingRegexp(clanName, Config.CLAN_NAME_TEMPLATE))
    {
      player.sendPacket(Msg.CLAN_NAME_IS_INCORRECT);
      return;
    }
    SubPledge[] subPledge = clan.getAllSubPledges();
    for(SubPledge element : subPledge)
    {
      if(element.getName().equals(clanName))
      {
        player.sendPacket(Msg.ANOTHER_MILITARY_UNIT_IS_ALREADY_USING_THAT_NAME_PLEASE_ENTER_A_DIFFERENT_NAME);
        return;
      }
    }
    if(ClanTable.getInstance().getClanByName(clanName) != null)
    {
      player.sendPacket(Msg.ANOTHER_MILITARY_UNIT_IS_ALREADY_USING_THAT_NAME_PLEASE_ENTER_A_DIFFERENT_NAME);
      return;
    }
    if(clan.getLevel() < minClanLvl)
    {
      player.sendPacket(Msg.THE_CONDITIONS_NECESSARY_TO_CREATE_A_MILITARY_UNIT_HAVE_NOT_BEEN_MET);
      return;
    }
    if(pledgeType != L2Clan.SUBUNIT_ACADEMY)
    {
      subLeader = clan.getClanMember(leaderName);
      if(subLeader == null || subLeader.getPledgeType() != L2Clan.SUBUNIT_NONE)
      {
        player.sendMessage(new CustomMessage("l2p.gameserver.model.instances.L2VillageMasterInstance.PlayerCantBeAssignedAsSubUnitLeader", player));
        return;
      }
      else if(subLeader.isClanLeader())
      {
        player.sendMessage(new CustomMessage("l2p.gameserver.model.instances.L2VillageMasterInstance.YouCantBeASubUnitLeader", player));
        return;
      }
      else
      {
        subLeaderId = subLeader.getObjectId();
      }
    }
    pledgeType = clan.createSubPledge(player, pledgeType, subLeaderId, clanName);
    if(pledgeType == L2Clan.SUBUNIT_NONE)
    {
      return;
    }
    clan.broadcastToOnlineMembers(new PledgeReceiveSubPledgeCreated(clan.getSubPledge(pledgeType)));
    SystemMessage sm;
    if(pledgeType == L2Clan.SUBUNIT_ACADEMY)
    {
      sm = new SystemMessage(SystemMessage.CONGRATULATIONS_THE_S1S_CLAN_ACADEMY_HAS_BEEN_CREATED);
      sm.addString(player.getClan().getName());
    }
    else if(pledgeType >= L2Clan.SUBUNIT_KNIGHT1)
    {
      sm = new SystemMessage(SystemMessage.THE_KNIGHTS_OF_S1_HAVE_BEEN_CREATED);
      sm.addString(player.getClan().getName());
    }
    else if(pledgeType >= L2Clan.SUBUNIT_ROYAL1)
    {
      sm = new SystemMessage(SystemMessage.THE_ROYAL_GUARD_OF_S1_HAVE_BEEN_CREATED);
      sm.addString(player.getClan().getName());
    }
    else
    {
      sm = Msg.CLAN_HAS_BEEN_CREATED;
    }
    player.sendPacket(sm);
    if(subLeader != null)
    {
      clan.broadcastToOnlineMembers(new PledgeShowMemberListUpdate(subLeader));
      if(subLeader.isOnline())
      {
        subLeader.getPlayer().updatePledgeClass();
        subLeader.getPlayer().broadcastUserInfo(true);
      }
    }
  }
View Full Code Here

    if(match < 0)
    {
      player.sendMessage(new CustomMessage("l2p.gameserver.model.instances.L2VillageMasterInstance.SubUnitNotFound", player));
      return;
    }
    L2ClanMember subLeader = clan.getClanMember(leaderName);
    if(subLeader == null || subLeader.getPledgeType() != L2Clan.SUBUNIT_NONE)
    {
      player.sendMessage(new CustomMessage("l2p.gameserver.model.instances.L2VillageMasterInstance.PlayerCantBeAssignedAsSubUnitLeader", player));
      return;
    }
    if(subLeader.isClanLeader())
    {
      player.sendMessage(new CustomMessage("l2p.gameserver.model.instances.L2VillageMasterInstance.YouCantBeASubUnitLeader", player));
      return;
    }
    subPledge[match].setLeaderId(subLeader.getObjectId());
    clan.broadcastToOnlineMembers(new PledgeReceiveSubPledgeCreated(subPledge[match]));
    clan.broadcastToOnlineMembers(new PledgeShowMemberListUpdate(subLeader));
    if(subLeader.isOnline())
    {
      subLeader.getPlayer().updatePledgeClass();
      subLeader.getPlayer().broadcastUserInfo(true);
    }
    player.sendMessage(new CustomMessage("l2p.gameserver.model.instances.L2VillageMasterInstance.NewSubUnitLeaderHasBeenAssigned", player));
  }
View Full Code Here

        }
        else
        {
          newLeaderName = target.getName();
        }
        L2ClanMember newLeader = clan.getClanMember(newLeaderName);
        if(newLeader == null)
        {
          activeChar.sendPacket(Msg.INVALID_TARGET);
          return false;
        }
View Full Code Here

        String[] param = args.split(" ");
        if(param.length > 0)
        {
          if(param[0].equalsIgnoreCase("allowwh") && param.length > 1)
          {
            L2ClanMember cm = activeChar.getClan().getClanMember(param[1]);
            if(cm != null && cm.getPlayer() != null) // цель онлайн
            {
              if(cm.getPlayer().getVarB("canWhWithdraw"))
              {
                cm.getPlayer().unsetVar("canWhWithdraw");
                activeChar.sendMessage("Privilege removed successfully");
              }
              else
              {
                cm.getPlayer().setVar("canWhWithdraw", "1");
                activeChar.sendMessage("Privilege given successfully");
              }
            }
            else if(cm != null) // цель оффлайн
            {
              int state = mysql.simple_get_int("value", "character_variables", "obj_id=" + cm.getObjectId() + " AND name LIKE 'canWhWithdraw'");
              if(state > 0)
              {
                mysql.set("DELETE FROM `character_variables` WHERE obj_id=" + cm.getObjectId() + " AND name LIKE 'canWhWithdraw' LIMIT 1");
                activeChar.sendMessage("Privilege removed successfully");
              }
              else
              {
                mysql.set("INSERT INTO character_variables  (obj_id, type, name, value, expire_time) VALUES (" + cm.getObjectId() + ",'user-var','canWhWithdraw','1',-1)");
                activeChar.sendMessage("Privilege given successfully");
              }
            }
            else
            {
View Full Code Here

    if(activeChar.getClan().getLevel() < 3)
    {
      activeChar.sendPacket(Msg.TITLE_ENDOWMENT_IS_ONLY_POSSIBLE_WHEN_CLANS_SKILL_LEVELS_ARE_ABOVE_3);
      return;
    }
    L2ClanMember member = activeChar.getClan().getClanMember(_target);
    if(member != null)
    {
      member.setTitle(_title);
      if(member.isOnline())
      {
        member.getPlayer().sendPacket(Msg.TITLE_HAS_CHANGED);
        member.getPlayer().sendChanges();
      }
    }
    else
    {
      activeChar.sendMessage(new CustomMessage("l2p.gameserver.clientpackets.RequestGiveNickName.NotInClan", activeChar));
View Full Code Here

    if(activeChar == null || !((activeChar.getClanPrivileges() & L2Clan.CP_CL_DISMISS) == L2Clan.CP_CL_DISMISS))
    {
      return;
    }
    L2Clan clan = activeChar.getClan();
    L2ClanMember member = clan.getClanMember(_target);
    if(member == null)
    {
      activeChar.sendPacket(Msg.THE_TARGET_MUST_BE_A_CLAN_MEMBER);
      return;
    }
    if(member.isOnline() && member.getPlayer().isInCombat())
    {
      activeChar.sendPacket(Msg.A_CLAN_MEMBER_MAY_NOT_BE_DISMISSED_DURING_COMBAT);
      return;
    }
    if(member.isClanLeader())
    {
      activeChar.sendMessage("A clan leader may not be dismissed.");
      return;
    }
    clan.removeClanMember(member.getObjectId());
    clan.broadcastToOnlineMembers(new SystemMessage(SystemMessage.CLAN_MEMBER_S1_HAS_BEEN_EXPELLED).addString(_target), new PledgeShowMemberListDelete(_target));
    clan.setExpelledMember();
    if(member.isOnline())
    {
      L2Player player = member.getPlayer();
      if(player.getPledgeType() == L2Clan.SUBUNIT_ACADEMY)
      {
        player.setLvlJoinedAcademy(0);
      }
      player.setClan(null);
View Full Code Here

  public L2Clan createClan(L2Player player, String clanName)
  {
    L2Clan clan = null;
    if(getClanByName(clanName) == null)
    {
      L2ClanMember leader = new L2ClanMember(player);
      clan = new L2Clan(IdFactory.getInstance().getNextId(), clanName, leader);
      clan.store();
      player.setClan(clan);
      player.setPowerGrade(6);
      leader.setPlayerInstance(player);
      _clans.put(clan.getClanId(), clan);
    }
    return clan;
  }
View Full Code Here

    {
      return;
    }
    if((activeChar.getClanPrivileges() & L2Clan.CP_CL_APPRENTICE) == L2Clan.CP_CL_APPRENTICE)
    {
      L2ClanMember sponsor = activeChar.getClan().getClanMember(_sponsorName);
      L2ClanMember apprentice = activeChar.getClan().getClanMember(_apprenticeName);
      if(sponsor != null && apprentice != null)
      {
        if(apprentice.getPledgeType() != L2Clan.SUBUNIT_ACADEMY || sponsor.getPledgeType() == L2Clan.SUBUNIT_ACADEMY)
        {
          return;
        } // hack?
        if(_mode == 1)
        {
          if(sponsor.hasApprentice())
          {
            activeChar.sendMessage(new CustomMessage("l2p.gameserver.clientpackets.RequestOustAlly.MemberAlreadyHasApprentice", activeChar));
            return;
          }
          if(apprentice.hasSponsor())
          {
            activeChar.sendMessage(new CustomMessage("l2p.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("l2p.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().broadcastUserInfo(true);
        }
        activeChar.sendPacket(new PledgeReceiveMemberInfo(sponsor));
      }
    }
    else
View Full Code Here

      return;
    }
    L2Clan clan = activeChar.getClan();
    if(clan != null)
    {
      L2ClanMember cm = clan.getClanMember(_target);
      if(cm != null)
      {
        activeChar.sendPacket(new PledgeReceivePowerInfo(cm));
      }
    }
View Full Code Here

TOP

Related Classes of l2p.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.