Package lineage2.gameserver.model.pledge

Examples of lineage2.gameserver.model.pledge.SubUnit


    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);
View Full Code Here


    {
      leader.sendMessage(new CustomMessage("scripts.services.Rename.SiegeNow", leader));
      return;
    }
    Clan clan = leader.getClan();
    SubUnit mainUnit = clan.getSubUnit(Clan.SUBUNIT_MAIN_CLAN);
    UnitMember member = mainUnit.getUnitMember(newLeader);
    if (member == null)
    {
      showChatWindow(leader, "villagemaster/clan-20.htm");
      return;
    }
View Full Code Here

    if (clan.getLevel() < minClanLvl)
    {
      player.sendPacket(Msg.THE_CONDITIONS_NECESSARY_TO_CREATE_A_MILITARY_UNIT_HAVE_NOT_BEEN_MET);
      return;
    }
    SubUnit unit = clan.getSubUnit(Clan.SUBUNIT_MAIN_CLAN);
    if (pledgeType != Clan.SUBUNIT_ACADEMY)
    {
      subLeader = unit.getUnitMember(leaderName);
      if (subLeader == null)
      {
        player.sendMessage(new CustomMessage("lineage2.gameserver.model.instances.L2VillageMasterInstance.PlayerCantBeAssignedAsSubUnitLeader", player));
        return;
      }
View Full Code Here

    if (!player.isClanLeader())
    {
      player.sendPacket(Msg.ONLY_THE_CLAN_LEADER_IS_ENABLED);
      return;
    }
    SubUnit targetUnit = null;
    for (SubUnit unit : clan.getAllSubUnits())
    {
      if ((unit.getType() == Clan.SUBUNIT_MAIN_CLAN) || (unit.getType() == Clan.SUBUNIT_ACADEMY))
      {
        continue;
      }
      if (unit.getName().equalsIgnoreCase(clanName))
      {
        targetUnit = unit;
      }
    }
    if (targetUnit == null)
    {
      player.sendMessage(new CustomMessage("lineage2.gameserver.model.instances.L2VillageMasterInstance.SubUnitNotFound", player));
      return;
    }
    SubUnit mainUnit = clan.getSubUnit(Clan.SUBUNIT_MAIN_CLAN);
    UnitMember subLeader = mainUnit.getUnitMember(leaderName);
    if (subLeader == null)
    {
      player.sendMessage(new CustomMessage("lineage2.gameserver.model.instances.L2VillageMasterInstance.PlayerCantBeAssignedAsSubUnitLeader", player));
      return;
    }
View Full Code Here

    }
    try
    {
      player.sendPacket(new JoinPledge(requestor.getClanId()));
      int pledgeType = request.getInteger("pledgeType");
      SubUnit subUnit = clan.getSubUnit(pledgeType);
      if (subUnit == null)
      {
        return;
      }
      UnitMember member = new UnitMember(clan, player.getName(), player.getTitle(), player.getLevel(), player.getClassId().getId(), player.getObjectId(), pledgeType, player.getPowerGrade(), player.getApprentice(), player.getSex(), Clan.SUBUNIT_NONE);
      subUnit.addUnitMember(member);
      player.setPledgeType(pledgeType);
      player.setClan(clan);
      member.setPlayerInstance(player, false);
      if (pledgeType == Clan.SUBUNIT_ACADEMY)
      {
View Full Code Here

        }
        else
        {
          newLeaderName = target.getName();
        }
        SubUnit mainUnit = clan.getSubUnit(Clan.SUBUNIT_MAIN_CLAN);
        UnitMember newLeader = mainUnit.getUnitMember(newLeaderName);
        if (newLeader == null)
        {
          activeChar.sendPacket(Msg.INVALID_TARGET);
          return false;
        }
View Full Code Here

    stopAllTimers();
    if (isInBoat())
    {
      getBoat().removePlayer(this);
    }
    SubUnit unit = getSubUnit();
    UnitMember member = unit == null ? null : unit.getUnitMember(getObjectId());
    if (member != null)
    {
      int sponsor = member.getSponsor();
      int apprentice = getApprentice();
      PledgeShowMemberListUpdate memberUpdate = new PledgeShowMemberListUpdate(this);
View Full Code Here

    int CLAN_LEVEL = _clan == null ? -1 : _clan.getLevel();
    boolean IN_ACADEMY = (_clan != null) && Clan.isAcademy(_pledgeType);
    boolean IS_GUARD = (_clan != null) && Clan.isRoyalGuard(_pledgeType);
    boolean IS_KNIGHT = (_clan != null) && Clan.isOrderOfKnights(_pledgeType);
    boolean IS_GUARD_CAPTAIN = false, IS_KNIGHT_COMMANDER = false, IS_LEADER = false;
    SubUnit unit = getSubUnit();
    if (unit != null)
    {
      UnitMember unitMember = unit.getUnitMember(getObjectId());
      if (unitMember == null)
      {
        _log.warn("Player: unitMember null, clan: " + _clan.getClanId() + "; pledgeType: " + unit.getType());
        return;
      }
      IS_GUARD_CAPTAIN = Clan.isRoyalGuard(unitMember.getLeaderOf());
      IS_KNIGHT_COMMANDER = Clan.isOrderOfKnights(unitMember.getLeaderOf());
      IS_LEADER = unitMember.getLeaderOf() == Clan.SUBUNIT_MAIN_CLAN;
View Full Code Here

    Clan clan = player.getClan();
    if (clan == null)
    {
      return;
    }
    SubUnit sub = clan.getSubUnit(id);
    if (sub == null)
    {
      return;
    }
    if ((player.getClanPrivileges() & Clan.CP_CL_TROOPS_FAME) != Clan.CP_CL_TROOPS_FAME)
    {
      player.sendPacket(SystemMsg.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT);
      return;
    }
    int lvl = sub.getSkillLevel(skillLearn.getId(), 0);
    if (lvl >= skillLearn.getLevel())
    {
      player.sendPacket(SystemMsg.THIS_SQUAD_SKILL_HAS_ALREADY_BEEN_ACQUIRED);
      return;
    }
    if (lvl != (skillLearn.getLevel() - 1))
    {
      player.sendPacket(SystemMsg.THE_PREVIOUS_LEVEL_SKILL_HAS_NOT_BEEN_LEARNED);
      return;
    }
    if (clan.getReputationScore() < skillLearn.getCost())
    {
      player.sendPacket(SystemMsg.THE_CLAN_REPUTATION_SCORE_IS_TOO_LOW);
      return;
    }
    if (skillLearn.getItemId() > 0)
    {
      if (!player.consumeItem(skillLearn.getItemId(), skillLearn.getItemCount()))
      {
        return;
      }
    }
    clan.incReputation(-skillLearn.getCost(), false, "AquireSkill2: " + skillLearn.getId() + ", lvl " + skillLearn.getLevel());
    sub.addSkill(skill, true);
    player.sendPacket(new SystemMessage2(SystemMsg.THE_CLAN_SKILL_S1_HAS_BEEN_ADDED).addSkillName(skill));
    if (trainer != null)
    {
      NpcInstance.showSubUnitSkillList(player);
    }
View Full Code Here

      Player player = cha.getPlayer();
     
      QuestState qs = player.getQuestState(_10301_ShadowOfTerrorBlackishRedFog.class);
      if(qs != null && qs.getCond() == 3 && player.getVar("instance10301") == null)
      {
        Quest q = QuestManager.getQuest(10301);
        player.processQuestEvent(q.getName(), "enterInstance", null);
        //player.setVar("instance10301", "true", -1);
        return;
      }
      if (!player.getVarB("@25_20_telzone_to_magmeld"))
      {
View Full Code Here

TOP

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

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.