Package l2p.gameserver.instancemanager

Examples of l2p.gameserver.instancemanager.InstancedZoneManager$InstancedZone


    if(player == null)
    {
      return;
    }
    int instancedZoneId = Integer.parseInt(param[0]);
    InstancedZoneManager izm = InstancedZoneManager.getInstance();
    FastMap<Integer, InstancedZone> izs = izm.getById(instancedZoneId);
    if(izs == null)
    {
      player.sendPacket(Msg.SYSTEM_ERROR);
      return;
    }
    InstancedZone iz = izs.get(0);
    assert iz != null;
    String name = iz.getName();
    int timelimit = iz.getTimelimit();
    boolean dispellBuffs = iz.isDispellBuffs();
    int min_level = iz.getMinLevel();
    int max_level = iz.getMaxLevel();
    int minParty = iz.getMinParty();
    int maxParty = iz.getMaxParty();
    if(!player.isInParty())
    {
      player.sendPacket(Msg.YOU_ARE_NOT_CURRENTLY_IN_A_PARTY_SO_YOU_CANNOT_ENTER);
      return;
    }
    if(player.getParty().isInReflection())
    {
      if(player.getLevel() < min_level || player.getLevel() > max_level)
      {
        player.sendPacket(new SystemMessage(SystemMessage.C1S_LEVEL_REQUIREMENT_IS_NOT_SUFFICIENT_AND_CANNOT_BE_ENTERED).addName(player));
        return;
      }
      if(player.isCursedWeaponEquipped())
      {
        player.sendPacket(new SystemMessage(SystemMessage.C1S_QUEST_REQUIREMENT_IS_NOT_SUFFICIENT_AND_CANNOT_BE_ENTERED).addName(player));
        return;
      }
      Reflection old_ref = player.getParty().getReflection();
      if(old_ref != null)
      {
        if(!iz.equals(old_ref.getInstancedZone()))
        {
          player.sendMessage("Your party is in instanced zone already.");
          return;
        }
        if(!Config.ALT_KAMALOKA_LIMITS.equalsIgnoreCase("Leader") && izm.getTimeToNextEnterInstance(name, player) > 0)
        {
          player.sendPacket(new SystemMessage(SystemMessage.C1_MAY_NOT_RE_ENTER_YET).addName(player));
          return;
        }
        if(player.getLevel() < min_level || player.getLevel() > max_level)
        {
          player.sendPacket(new SystemMessage(SystemMessage.C1S_LEVEL_REQUIREMENT_IS_NOT_SUFFICIENT_AND_CANNOT_BE_ENTERED).addName(player));
          return;
        }
        player.teleToLocation(old_ref.getTeleportLoc(), old_ref.getId());
        if(dispellBuffs)
        {
          for(L2Effect e : player.getEffectList().getAllEffects())
          {
            if(!e.getSkill().isOffensive() && !e.getSkill().getName().startsWith("Adventurer's "))
            {
              e.exit();
            }
          }
          if(player.getPet() != null)
          {
            for(L2Effect e : player.getPet().getEffectList().getAllEffects())
            {
              if(!e.getSkill().isOffensive() && !e.getSkill().getName().startsWith("Adventurer's "))
              {
                e.exit();
              }
            }
          }
        }
        return;
      }
    }
    if(!player.getParty().isLeader(player))
    {
      player.sendPacket(Msg.ONLY_A_PARTY_LEADER_CAN_TRY_TO_ENTER);
      return;
    }
    if(player.getParty().getMemberCount() > maxParty)
    {
      player.sendPacket(Msg.YOU_CANNOT_ENTER_DUE_TO_THE_PARTY_HAVING_EXCEEDED_THE_LIMIT);
      return;
    }
    for(L2Player member : player.getParty().getPartyMembers())
    {
      if(member.getLevel() < min_level || member.getLevel() > max_level)
      {
        SystemMessage sm = new SystemMessage(SystemMessage.C1S_LEVEL_REQUIREMENT_IS_NOT_SUFFICIENT_AND_CANNOT_BE_ENTERED).addName(member);
        member.sendPacket(sm);
        player.sendPacket(sm);
        return;
      }
      if(!player.isInRange(member, 500))
      {
        member.sendPacket(Msg.ITS_TOO_FAR_FROM_THE_NPC_TO_WORK);
        player.sendPacket(Msg.ITS_TOO_FAR_FROM_THE_NPC_TO_WORK);
        return;
      }
    }
    if(Config.ALT_KAMALOKA_LIMITS.equalsIgnoreCase("Leader"))
    {
      if(izm.getTimeToNextEnterInstance(name, player) > 0)
      {
        player.sendPacket(new SystemMessage(SystemMessage.C1_MAY_NOT_RE_ENTER_YET).addName(player));
        return;
      }
    }
    else
    {
      for(L2Player member : player.getParty().getPartyMembers())
      {
        if(izm.getTimeToNextEnterInstance(name, member) > 0)
        {
          player.sendPacket(new SystemMessage(SystemMessage.C1_MAY_NOT_RE_ENTER_YET).addName(member));
          return;
        }
      }
View Full Code Here


    if(Config.ALT_KAMALOKA_NIGHTMARES_PREMIUM_ONLY && player.getBonus().RATE_XP <= 1)
    {
      player.sendMessage(new CustomMessage("common.PremiumOnly", player));
      return;
    }
    InstancedZoneManager izm = InstancedZoneManager.getInstance();
    FastMap<Integer, InstancedZone> izs = InstancedZoneManager.getInstance().getById(Integer.parseInt(param[0]));
    if(izs == null)
    {
      player.sendPacket(Msg.SYSTEM_ERROR);
      return;
    }
    InstancedZone iz = izs.get(0);
    assert iz != null;
    String name = iz.getName();
    int timelimit = iz.getTimelimit();
    int min_level = iz.getMinLevel();
    int max_level = iz.getMaxLevel();
    if(player.getLevel() < min_level || player.getLevel() > max_level)
    {
      player.sendPacket(new SystemMessage(SystemMessage.C1S_LEVEL_REQUIREMENT_IS_NOT_SUFFICIENT_AND_CANNOT_BE_ENTERED).addName(player));
      return;
    }
    if(izm.getTimeToNextEnterInstance(name, player) > 0)
    {
      player.sendPacket(new SystemMessage(SystemMessage.C1_MAY_NOT_RE_ENTER_YET).addName(player));
      return;
    }
    if(player.isCursedWeaponEquipped())
View Full Code Here

    if(cc.getChannelLeader() != player)
    {
      player.sendMessage("You must be leader of the command channel.");
      return;
    }
    InstancedZoneManager izm = InstancedZoneManager.getInstance();
    FastMap<Integer, InstancedZone> izs = InstancedZoneManager.getInstance().getById(instancedZoneId);
    if(izs == null)
    {
      player.sendPacket(Msg.SYSTEM_ERROR);
      return;
    }
    InstancedZone iz = izs.get(0);
    assert iz != null;
    String name = iz.getName();
    int timelimit = iz.getTimelimit();
    int minMembers = iz.getMinParty();
    int maxMembers = iz.getMaxParty();
    if(cc.getMemberCount() < minMembers)
    {
      player.sendMessage("The command channel must contains at least " + minMembers + " members.");
      return;
    }
    if(cc.getMemberCount() > maxMembers)
    {
      player.sendMessage("The command channel must contains not more than " + maxMembers + " members.");
      return;
    }
    for(L2Player member : cc.getMembers())
    {
      if(member.getLevel() < iz.getMinLevel() || member.getLevel() > iz.getMaxLevel())
      {
        cc.broadcastToChannelMembers(new SystemMessage(SystemMessage.C1S_LEVEL_REQUIREMENT_IS_NOT_SUFFICIENT_AND_CANNOT_BE_ENTERED).addName(member));
        return;
      }
      if(member.isCursedWeaponEquipped() || member.isInFlyingTransform() || member.isDead())
      {
        player.sendPacket(new SystemMessage(SystemMessage.C1S_QUEST_REQUIREMENT_IS_NOT_SUFFICIENT_AND_CANNOT_BE_ENTERED).addName(member));
        return;
      }
      if(!player.isInRange(member, 500))
      {
        member.sendPacket(Msg.ITS_TOO_FAR_FROM_THE_NPC_TO_WORK);
        player.sendPacket(Msg.ITS_TOO_FAR_FROM_THE_NPC_TO_WORK);
        return;
      }
      if(izm.getTimeToNextEnterInstance(name, member) > 0)
      {
        cc.broadcastToChannelMembers(new SystemMessage(SystemMessage.C1_MAY_NOT_RE_ENTER_YET).addName(member));
        return;
      }
    }
View Full Code Here

      //TODO: Сделать отображение названия активного инстанса.
      // SystemMessage.INSTANT_ZONE_CURRENTLY_IN_USE__S1
      activeChar.sendPacket(Msg.INSTANCE_ZONE_TIME_LIMIT);
      int limit;
      boolean noLimit = true;
      InstancedZoneManager ilm = InstancedZoneManager.getInstance();
      for(String name : ilm.getNames())
      {
        limit = ilm.getTimeToNextEnterInstance(name, activeChar);
        if(limit > 0)
        {
          noLimit = false;
          activeChar.sendPacket(new SystemMessage(SystemMessage.S1_WILL_BE_AVAILABLE_FOR_RE_USE_AFTER_S2_HOURS_S3_MINUTES).addString(name).addNumber(limit / 60).addNumber(limit % 60));
        }
View Full Code Here

  }

  private void enterInstance(L2NpcInstance npc, L2Player player)
  {
    int instancedZoneId = 11;
    InstancedZoneManager ilm = InstancedZoneManager.getInstance();
    FastMap<Integer, InstancedZone> ils = ilm.getById(11);
    if(ils == null)
    {
      player.sendPacket(Msg.SYSTEM_ERROR);
      return;
    }
    InstancedZone il = ils.get(0);
    assert il != null;
    String name = il.getName();
    int timelimit = il.getTimelimit();
    int min_level = il.getMinLevel();
    int max_level = il.getMaxLevel();
    int minParty = il.getMinParty();
    int maxParty = il.getMaxParty();
    if(minParty > 1 && !player.isInParty())
    {
      player.sendPacket(Msg.YOU_ARE_NOT_CURRENTLY_IN_A_PARTY_SO_YOU_CANNOT_ENTER);
      return;
    }
    if(player.isInParty())
    {
      if(player.getParty().isInReflection())
      {
        player.sendPacket(new SystemMessage(SystemMessage.C1_MAY_NOT_RE_ENTER_YET).addName(player));
        return;
      }
      for(L2Player member : player.getParty().getPartyMembers())
      {
        if(ilm.getTimeToNextEnterInstance(name, member) > 0)
        {
          player.sendPacket(new SystemMessage(SystemMessage.C1_MAY_NOT_RE_ENTER_YET).addName(member));
          return;
        }
      }
View Full Code Here

      {
        sb.append("There are no offerings for your level.");
      }
      else
      {
        InstancedZoneManager ilm = InstancedZoneManager.getInstance();
        if(ilm.getTimeToNextEnterInstance("Kamaloka, Hall of the Nightmares", player) > 0)
        {
          sb.append("You can not enter hall of nightmares now, you must get some rest. Or... Maybe you have extra entrace pass?<br>");
        }
        for(int i = 25; i <= 75; i += 5)
        {
View Full Code Here

    {
      player.sendPacket(Msg.ONLY_A_PARTY_LEADER_CAN_TRY_TO_ENTER);
      return;
    }
    int instancedZoneId = 101;
    InstancedZoneManager ilm = InstancedZoneManager.getInstance();
    FastMap<Integer, InstancedZone> ils = ilm.getById(instancedZoneId);
    if(ils == null)
    {
      player.sendPacket(Msg.SYSTEM_ERROR);
      return;
    }
    InstancedZone il = ils.get(0);
    assert il != null;
    String name = il.getName();
    int timelimit = il.getTimelimit();
    int min_level = il.getMinLevel();
    int max_level = il.getMaxLevel();
    int minParty = il.getMinParty();
    int maxParty = il.getMaxParty();
    if(minParty > 1 && !player.isInParty())
    {
      player.sendPacket(Msg.YOU_ARE_NOT_CURRENTLY_IN_A_PARTY_SO_YOU_CANNOT_ENTER);
      return;
    }
    if(player.isInParty())
    {
      if(player.getParty().isInReflection())
      {
        player.sendPacket(new SystemMessage(SystemMessage.C1_MAY_NOT_RE_ENTER_YET).addName(player));
        return;
      }
      for(L2Player member : player.getParty().getPartyMembers())
      {
        if(ilm.getTimeToNextEnterInstance(name, member) > 0)
        {
          player.sendPacket(new SystemMessage(SystemMessage.C1_MAY_NOT_RE_ENTER_YET).addName(member));
          return;
        }
      }
View Full Code Here

    // Крепость должна быть независимой
    if(fort.getFortState() != 1)
    {
      return "gludio_fort_a_campkeeper_q0511_13.htm";
    }
    InstancedZoneManager ilm = InstancedZoneManager.getInstance();
    FastMap<Integer, InstancedZone> ils = ilm.getById(200);
    if(ils == null)
    {
      player.sendPacket(Msg.SYSTEM_ERROR);
      return null;
    }
    InstancedZone il = ils.get(0);
    assert il != null;
    String name = il.getName();
    int timelimit = il.getTimelimit();
    int min_level = il.getMinLevel();
    int max_level = il.getMaxLevel();
    int minParty = il.getMinParty();
    int maxParty = il.getMaxParty();
    if(minParty > 1 && !player.isInParty())
    {
      player.sendPacket(Msg.YOU_ARE_NOT_CURRENTLY_IN_A_PARTY_SO_YOU_CANNOT_ENTER);
      return null;
    }
    if(player.isInParty())
    {
      if(player.getParty().isInReflection())
      {
        player.sendPacket(new SystemMessage(SystemMessage.C1_MAY_NOT_RE_ENTER_YET).addName(player));
        return null;
      }
      for(L2Player member : player.getParty().getPartyMembers())
      {
        if(ilm.getTimeToNextEnterInstance(name, member) > 0)
        {
          player.sendPacket(new SystemMessage(SystemMessage.C1_MAY_NOT_RE_ENTER_YET).addName(member));
          return null;
        }
      }
View Full Code Here

    Castle castle = CastleManager.getInstance().getCastleByObject(player);
    if(castle == null || castle.getOwner() != player.getClan())
    {
      return "gludio_prison_keeper_q0512_01a.htm";
    }
    InstancedZoneManager ilm = InstancedZoneManager.getInstance();
    FastMap<Integer, InstancedZone> ils = ilm.getById(201);
    if(ils == null)
    {
      player.sendPacket(Msg.SYSTEM_ERROR);
      return null;
    }
    InstancedZone il = ils.get(0);
    assert il != null;
    String name = il.getName();
    int timelimit = il.getTimelimit();
    int min_level = il.getMinLevel();
    int max_level = il.getMaxLevel();
    int minParty = il.getMinParty();
    int maxParty = il.getMaxParty();
    if(minParty > 1 && !player.isInParty())
    {
      player.sendPacket(Msg.YOU_ARE_NOT_CURRENTLY_IN_A_PARTY_SO_YOU_CANNOT_ENTER);
      return null;
    }
    if(player.isInParty())
    {
      if(player.getParty().isInReflection())
      {
        player.sendPacket(new SystemMessage(SystemMessage.C1_MAY_NOT_RE_ENTER_YET).addName(player));
        return null;
      }
      for(L2Player member : player.getParty().getPartyMembers())
      {
        if(ilm.getTimeToNextEnterInstance(name, member) > 0)
        {
          player.sendPacket(new SystemMessage(SystemMessage.C1_MAY_NOT_RE_ENTER_YET).addName(member));
          return null;
        }
      }
View Full Code Here

      {
        player.sendMessage("Вы не лидер группы.");
        return false;
      }
    }
    InstancedZoneManager izm = InstancedZoneManager.getInstance();
    FastMap<Integer, InstancedZoneManager.InstancedZone> izs = InstancedZoneManager.getInstance().getById(id);
    if(izs == null)
    {
      player.sendPacket(Msg.SYSTEM_ERROR);
      return false;
    }
    InstancedZoneManager.InstancedZone iz = izs.get(0);
    if(iz == null)
    {
      player.sendPacket(Msg.SYSTEM_ERROR);
      return false;
    }
    String name = iz.getName();
    if(izm.getTimeToNextEnterInstance(name, player) > 0)
    {
      player.sendPacket(new SystemMessage(SystemMessage.C1_MAY_NOT_RE_ENTER_YET).addName(player));
      return false;
    }
    int timelimit = iz.getTimelimit();
    if(party)
    {
      int minMembers = iz.getMinParty();
      int maxMembers = iz.getMaxParty();
      if(player.getParty().getMemberCount() < minMembers)
      {
        player.sendMessage("В группе должно быть не меньше " + minMembers + " человек.");
        return false;
      }
      if(player.getParty().getMemberCount() > maxMembers)
      {
        player.sendMessage("В группе должно быть не больше " + maxMembers + " человек.");
        return false;
      }
      for(L2Player member : player.getParty().getPartyMembers())
      {
        if(member.isCursedWeaponEquipped() || member.isInFlyingTransform() || member.isDead())
        {
          player.sendPacket(new SystemMessage(SystemMessage.C1S_QUEST_REQUIREMENT_IS_NOT_SUFFICIENT_AND_CANNOT_BE_ENTERED).addName(member));
          return false;
        }
        if(!player.isInRange(member, 500))
        {
          member.sendPacket(Msg.ITS_TOO_FAR_FROM_THE_NPC_TO_WORK);
          player.sendPacket(Msg.ITS_TOO_FAR_FROM_THE_NPC_TO_WORK);
          return false;
        }
        if(izm.getTimeToNextEnterInstance(name, member) > 0)
        {
          player.getParty().broadcastToPartyMembers(new SystemMessage(SystemMessage.C1_MAY_NOT_RE_ENTER_YET).addName(member));
          return false;
        }
      }
View Full Code Here

TOP

Related Classes of l2p.gameserver.instancemanager.InstancedZoneManager$InstancedZone

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.