Package l2p.gameserver.model

Examples of l2p.gameserver.model.L2Party$UpdatePositionTask


    //
    int npcId = npc.getNpcId();
    int cond = qs.getCond();
    //
    L2Player player = qs.getPlayer();
    L2Party party = player.getParty();
    //
    long refId = player.getReflectionId();
    DefendTheHallofSuffering inst = mSoI.defendTheHallofSuffering.get(refId);
    //
    if(npcId == mSoI.npcTepios)
    {
      if(player.getLevel() < 75)
      {
        htmltext = "32603-02.htm";
        qs.exitCurrentQuest(true);
      }
      else if(player.getLevel() > 82)
      {
        htmltext = "32603-02a.htm";
        qs.exitCurrentQuest(true);
      }
      else if(cond == 0)
      {
        htmltext = "32603-01.htm";
      }
      else if(cond == 1)
      {
        htmltext = "32603-06.htm";
      }
    }
    else if(npcId == mSoI.npcMouthOfEkimus)
    {
      if(mSoI.getStage() != 2)
      {
        player.sendMessage("В данный момент прохождение Defend The Hall Of Suffering не доступно.");
        return null;
      }
      if(party != null)
      {
        if(mSoI.defendTheHallofSuffering.size() >= Config.DefendTheHallofSuffering)
        {
          player.sendMessage("Проходить Defend The Hall Of Suffering могут параллельно не более" + Config.DefendTheHallofSuffering + " групп.");
          return null;
        }
        for(L2Player member : party.getPartyMembers())
        {
          QuestState qsm = member.getQuestState(this.getName());
          if(qsm == null || qsm.getCond() != 1)
          {
            party.broadcastToPartyMembers(new SystemMessage("У персонажа " + member.getName() + ", не взят квест для входа."));
            return null;
          }
        }
        if(mInstance.enterInstance(player, 116, true, true))
        {
View Full Code Here


    if(pkiller == null || pkilled == null)
    {
      return;
    }
    Quest q = QuestManager.getQuest(_736_WeakenMagic.class);
    L2Party party = pkiller.getParty();
    if(party == null)
    {
      takeQuest(q, pkilled, pkiller);
    }
    else
    {
      for(L2Player member : party.getPartyMembers())
      {
        if(member != null && member.isInRange(pkiller, 2000))
        {
          takeQuest(q, pkilled, member);
        }
View Full Code Here

  private void createNewParty(L2GameClient client, int itemDistribution, L2Player target, L2Player requestor)
  {
    if(!target.isInTransaction())
    {
      requestor.setParty(new L2Party(requestor, itemDistribution));
      new Transaction(TransactionType.PARTY, requestor, target, 10000);
      target.sendPacket(new AskJoinParty(requestor.getName(), itemDistribution));
      requestor.sendPacket(new SystemMessage(SystemMessage.YOU_HAVE_INVITED_C1_TO_JOIN_YOUR_PARTY).addString(target.getName()));
    }
    else
View Full Code Here

      int val = Integer.parseInt(command.substring(13));
      showChatWindow(player, val, null, true);
    }
    else if(command.startsWith("Festival"))
    {
      L2Party playerParty = player.getParty();
      int val = Integer.parseInt(command.substring(9, 10));
      switch(val)
      {
        case 1: // Become a Participant
          showChatWindow(player, 1, null, false);
          break;
        case 2: // Festival 2 xxxx
          // Check if the festival period is active, if not then don't allow registration.
          if(SevenSigns.getInstance().getCurrentPeriod() != SevenSigns.PERIOD_COMPETITION)
          {
            showChatWindow(player, 2, "a", false);
            return;
          }
          // Check if a festival is in progress, then don't allow registration yet.
          if(SevenSignsFestival.getInstance().isFestivalInitialized())
          {
            player.sendMessage(new CustomMessage("l2p.gameserver.model.instances.L2FestivalGuideInstance.InProgress", player));
            return;
          }
          // Check if the player is in a formed party already.
          if(playerParty == null || playerParty.getMemberCount() < Config.FESTIVAL_MIN_PARTY_SIZE)
          {
            showChatWindow(player, 2, "b", false);
            return;
          }
          // Check if the player is the party leader.
          if(!playerParty.isLeader(player))
          {
            showChatWindow(player, 2, "c", false);
            return;
          }
          // Check if all the party members are in the required level range.
          int maxlevel = SevenSignsFestival.getMaxLevelForFestival(_festivalType);
          for(L2Player p : playerParty.getPartyMembers())
          {
            if(p.getLevel() > maxlevel)
            {
              showChatWindow(player, 2, "d", false);
              return;
            }
            else if(SevenSigns.getInstance().getPlayerCabal(p) == SevenSigns.CABAL_NULL)
            {
              showChatWindow(player, 2, "g", false);
              return;
            }
          }
          if(player.isFestivalParticipant())
          {
            showChatWindow(player, 2, "f", false);
            return;
          }
          int stoneType = Integer.parseInt(command.substring(11));
          long stonesNeeded = (long) Math.floor(SevenSignsFestival.getStoneCount(_festivalType, stoneType) * Config.FESTIVAL_RATE_PRICE);
          L2ItemInstance sealStoneInst = player.getInventory().getItemByItemId(stoneType);
          if(sealStoneInst == null || sealStoneInst.getCount() < stonesNeeded)
          {
            player.sendMessage(new CustomMessage("l2p.gameserver.model.instances.L2FestivalGuideInstance.NotEnoughSSType", player));
            return;
          }
          player.getInventory().destroyItem(sealStoneInst, stonesNeeded, true);
          player.sendPacket(SystemMessage.removeItems(stoneType, stonesNeeded));
          SevenSignsFestival.getInstance().addAccumulatedBonus(_festivalType, stoneType, stonesNeeded);
          new DarknessFestival(player.getParty(), SevenSigns.getInstance().getPlayerCabal(player), _festivalType);
          showChatWindow(player, 2, "e", false);
          break;
        case 4: // Current High Scores
          StringBuffer strBuffer = new StringBuffer("<html><body>Festival Guide:<br>These are the top scores of the week, for the ");
          final StatsSet dawnData = SevenSignsFestival.getInstance().getHighestScoreData(SevenSigns.CABAL_DAWN, _festivalType);
          final StatsSet duskData = SevenSignsFestival.getInstance().getHighestScoreData(SevenSigns.CABAL_DUSK, _festivalType);
          final StatsSet overallData = SevenSignsFestival.getInstance().getOverallHighestScoreData(_festivalType);
          final int dawnScore = dawnData.getInteger("score");
          final int duskScore = duskData.getInteger("score");
          int overallScore = 0;
          // If no data is returned, assume there is no record, or all scores are 0.
          if(overallData != null)
          {
            overallScore = overallData.getInteger("score");
          }
          strBuffer.append(SevenSignsFestival.getFestivalName(_festivalType) + " festival.<br>");
          if(dawnScore > 0)
          {
            strBuffer.append("Dawn: " + calculateDate(dawnData.getString("date")) + ". Score " + dawnScore + "<br>" + dawnData.getString("names").replaceAll(",", ", ") + "<br>");
          }
          else
          {
            strBuffer.append("Dawn: No record exists. Score 0<br>");
          }
          if(duskScore > 0)
          {
            strBuffer.append("Dusk: " + calculateDate(duskData.getString("date")) + ". Score " + duskScore + "<br>" + duskData.getString("names").replaceAll(",", ", ") + "<br>");
          }
          else
          {
            strBuffer.append("Dusk: No record exists. Score 0<br>");
          }
          if(overallScore > 0 && overallData != null)
          {
            String cabalStr = "Children of Dusk";
            if(overallData.getInteger("cabal") == SevenSigns.CABAL_DAWN)
            {
              cabalStr = "Children of Dawn";
            }
            strBuffer.append("Consecutive top scores: " + calculateDate(overallData.getString("date")) + ". Score " + overallScore + "<br>Affilated side: " + cabalStr + "<br>" + overallData.getString("names").replaceAll(",", ", ") + "<br>");
          }
          else
          {
            strBuffer.append("Consecutive top scores: No record exists. Score 0<br>");
          }
          strBuffer.append("<a action=\"bypass -h npc_" + getObjectId() + "_Chat 0\">Go back.</a></body></html>");
          NpcHtmlMessage html = new NpcHtmlMessage(player, this);
          html.setHtml(strBuffer.toString());
          player.sendPacket(html);
          break;
        case 8: // Increase the Festival Challenge
          if(playerParty == null)
          {
            return;
          }
          if(!playerParty.isLeader(player))
          {
            showChatWindow(player, 8, "a", false);
            break;
          }
          Reflection r = getReflection();
          if(r instanceof DarknessFestival)
          {
            if(((DarknessFestival) r).increaseChallenge())
            {
              showChatWindow(player, 8, "b", false);
            }
            else
            {
              showChatWindow(player, 8, "c", false);
            }
          }
          break;
        case 9: // Leave the Festival
          if(playerParty == null)
          {
            return;
          }
          r = getReflection();
          if(!(r instanceof DarknessFestival))
          {
            return;
          }
          if(playerParty.isLeader(player))
          {
            ((DarknessFestival) r).collapse();
          }
          else if(playerParty.getMemberCount() > Config.FESTIVAL_MIN_PARTY_SIZE)
          {
            playerParty.oustPartyMember(player);
          }
          else
          {
            player.sendMessage("Only party leader can leave festival, if minmum party member is reached.");
          }
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.L2Party$UpdatePositionTask

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.