Package lineage2.gameserver.network.serverpackets

Examples of lineage2.gameserver.network.serverpackets.SystemMessage2


   */
  private static boolean validPlayer(Player sendPlayer, Player validPlayer, CompType type)
  {
    if (!validPlayer.isNoble())
    {
      sendPlayer.sendPacket(new SystemMessage2(SystemMsg.C1_DOES_NOT_MEET_THE_PARTICIPATION_REQUIREMENTS_ONLY_NOBLESSE_CHARACTERS_CAN_PARTICIPATE_IN_THE_OLYMPIAD).addName(validPlayer));
      return false;
    }
    if (validPlayer.getBaseClassId() != validPlayer.getClassId().getId())
    {
      sendPlayer.sendPacket(new SystemMessage2(SystemMsg.C1_DOES_NOT_MEET_THE_PARTICIPATION_REQUIREMENTS_SUBCLASS_CHARACTER_CANNOT_PARTICIPATE_IN_THE_OLYMPIAD).addName(validPlayer));
      return false;
    }
    if (!validPlayer.isAwaking())
    {
      sendPlayer.sendMessage("You don't meet the requirement to play in the Olympiad.");
      return false;
    }
    int[] ar = getWeekGameCounts(validPlayer.getObjectId());
    switch (type)
    {
      case CLASSED:
        if (_classBasedRegisters.containsValue(validPlayer.getObjectId()))
        {
          sendPlayer.sendPacket(new SystemMessage2(SystemMsg.C1_IS_ALREADY_REGISTERED_ON_THE_CLASS_MATCH_WAITING_LIST).addName(validPlayer));
          return false;
        }
        if (ar[1] == 0)
        {
          validPlayer.sendPacket(SystemMsg.THE_TOTAL_NUMBER_OF_MATCHES_THAT_CAN_BE_ENTERED_IN_1_WEEK_IS_60_CLASS_IRRELEVANT_INDIVIDUAL_MATCHES_30_SPECIFIC_MATCHES_AND_10_TEAM_MATCHES);
          return false;
        }
        break;
      case NON_CLASSED:
        if (_nonClassBasedRegisters.contains(validPlayer.getObjectId()))
        {
          sendPlayer.sendPacket(new SystemMessage2(SystemMsg.C1_IS_ALREADY_REGISTERED_ON_THE_WAITING_LIST_FOR_THE_CLASS_IRRELEVANT_INDIVIDUAL_MATCH).addName(validPlayer));
          return false;
        }
        if (ar[2] == 0)
        {
          validPlayer.sendPacket(SystemMsg.THE_TOTAL_NUMBER_OF_MATCHES_THAT_CAN_BE_ENTERED_IN_1_WEEK_IS_60_CLASS_IRRELEVANT_INDIVIDUAL_MATCHES_30_SPECIFIC_MATCHES_AND_10_TEAM_MATCHES);
          return false;
        }
        break;
      default:
        break;
    }
    if (ar[0] == 0)
    {
      validPlayer.sendPacket(SystemMsg.THE_MAXIMUM_MATCHES_YOU_CAN_PARTICIPATE_IN_1_WEEK_IS_70);
      return false;
    }
    if (isRegisteredInComp(validPlayer))
    {
      sendPlayer.sendPacket(new SystemMessage2(SystemMsg.C1_IS_ALREADY_REGISTERED_ON_THE_MATCH_WAITING_LIST).addName(validPlayer));
      return false;
    }
    return true;
  }
View Full Code Here


      }
      set.set(GAME_CLASSES_COUNT, 0);
      set.set(GAME_NOCLASSES_COUNT, 0);
      if (player != null)
      {
        player.sendPacket(new SystemMessage2(SystemMsg.C1_HAS_EARNED_S2_POINTS_IN_THE_GRAND_OLYMPIAD_GAMES).addName(player).addInteger(Config.OLYMPIAD_POINTS_WEEKLY));
      }
    }
  }
View Full Code Here

    if (owner != null)
    {
      for (Skill skill : _skills)
      {
        owner.addSkill(skill, false);
        owner.broadcastToOnlineMembers(new SystemMessage2(SystemMsg.THE_CLAN_SKILL_S1_HAS_BEEN_ADDED).addSkillName(skill));
      }
    }
  }
View Full Code Here

  {
    Request request = new Request(Request.L2RequestType.DUEL, player, target).setTimeout(10000L);
    request.set("duelType", 0);
    player.setRequest(request);
    target.setRequest(request);
    player.sendPacket(new SystemMessage2(SystemMsg.C1_HAS_BEEN_CHALLENGED_TO_A_DUEL).addName(target));
    target.sendPacket(new SystemMessage2(SystemMsg.C1_HAS_CHALLENGED_YOU_TO_A_DUEL).addName(player), new ExDuelAskStart(player.getName(), 0));
  }
View Full Code Here

        break;
      case RED:
      case BLUE:
        List<DuelSnapshotObject> winners = getObjects(_winner.name());
        List<DuelSnapshotObject> lossers = getObjects(_winner.revert().name());
        sendPacket(new SystemMessage2(SystemMsg.C1_HAS_WON_THE_DUEL).addName(winners.get(0).getPlayer()));
        for (DuelSnapshotObject d : lossers)
        {
          d.getPlayer().broadcastPacket(new SocialAction(d.getPlayer().getObjectId(), SocialAction.BOW));
        }
        break;
View Full Code Here

        }

        List<SiegeClanObject> attackers = getObjects(ATTACKERS);
        if (attackers.isEmpty()) {
            if (_oldOwner == null)
                broadcastToWorld(new SystemMessage2(SystemMsg.THE_SIEGE_OF_S1_HAS_BEEN_CANCELED_DUE_TO_LACK_OF_INTEREST).addResidenceName(getResidence()));
            else
                broadcastToWorld(new SystemMessage2(SystemMsg.S1S_SIEGE_WAS_CANCELED_BECAUSE_THERE_WERE_NO_CLANS_THAT_PARTICIPATED).addResidenceName(getResidence()));

            reCalcNextTime(false);
            return;
        }

        SiegeClanDAO.getInstance().delete(getResidence());

        updateParticles(true, ATTACKERS, DEFENDERS);

        broadcastTo(SystemMsg.THE_TEMPORARY_ALLIANCE_OF_THE_CASTLE_ATTACKER_TEAM_IS_IN_EFFECT, ATTACKERS);
        broadcastTo(new SystemMessage2(SystemMsg.YOU_ARE_PARTICIPATING_IN_THE_SIEGE_OF_S1_THIS_SIEGE_IS_SCHEDULED_FOR_2_HOURS).addResidenceName(getResidence()), ATTACKERS, DEFENDERS);

        super.startEvent();

        if (_oldOwner == null)
            initControlTowers();
View Full Code Here

        List<SiegeClanObject> attackers = removeObjects(ATTACKERS);
        for (SiegeClanObject siegeClan : attackers)
            siegeClan.deleteFlag();

        broadcastToWorld(new SystemMessage2(SystemMsg.THE_SIEGE_OF_S1_IS_FINISHED).addResidenceName(getResidence()));

        removeObjects(DEFENDERS);
        removeObjects(DEFENDERS_WAITING);
        removeObjects(DEFENDERS_REFUSED);

        Clan ownerClan = getResidence().getOwner();
        if (ownerClan != null) {
            if (_oldOwner == ownerClan) {
                getResidence().setRewardCount(getResidence().getRewardCount() + 1);
                ownerClan.broadcastToOnlineMembers(new SystemMessage2(SystemMsg.SINCE_YOUR_CLAN_EMERGED_VICTORIOUS_FROM_THE_SIEGE_S1_POINTS_HAVE_BEEN_ADDED_TO_YOUR_CLANS_REPUTATION_SCORE).addInteger(ownerClan.incReputation(1500, false, toString())));
            } else {
                broadcastToWorld(new SystemMessage2(SystemMsg.CLAN_S1_IS_VICTORIOUS_OVER_S2S_CASTLE_SIEGE).addString(ownerClan.getName()).addResidenceName(getResidence()));

                ownerClan.broadcastToOnlineMembers(new SystemMessage2(SystemMsg.SINCE_YOUR_CLAN_EMERGED_VICTORIOUS_FROM_THE_SIEGE_S1_POINTS_HAVE_BEEN_ADDED_TO_YOUR_CLANS_REPUTATION_SCORE).addInteger(ownerClan.incReputation(3000, false, toString())));

                if (_oldOwner != null)
                    _oldOwner.broadcastToOnlineMembers(new SystemMessage2(SystemMsg.YOUR_CLAN_HAS_FAILED_TO_DEFEND_THE_CASTLE_S1_POINTS_HAVE_BEEN_DEDUCTED_FROM_YOU_CLAN_REPUTATION_SCORE_AND_ADDED_TO_YOUR_OPPONENTS).addInteger(-_oldOwner.incReputation(-3000, false, toString())));

                for (UnitMember member : ownerClan) {
                    Player player = member.getPlayer();
                    if (player != null) {
                        player.sendPacket(PlaySound.SIEGE_VICTORY);
                        if (player.isOnline() && player.isNoble())
                            Hero.getInstance().addHeroDiary(player.getObjectId(), HeroDiary.ACTION_CASTLE_TAKEN, getResidence().getId());
                    }
                }
            }

            getResidence().getOwnDate().setTimeInMillis(System.currentTimeMillis());
            getResidence().getLastSiegeDate().setTimeInMillis(getResidence().getSiegeDate().getTimeInMillis());
        } else {
            broadcastToWorld(new SystemMessage2(SystemMsg.THE_SIEGE_OF_S1_HAS_ENDED_IN_A_DRAW).addResidenceName(getResidence()));

            getResidence().getOwnDate().setTimeInMillis(0);
            getResidence().getLastSiegeDate().setTimeInMillis(0);
        }
View Full Code Here

    }

    @Override
    public void setRegistrationOver(boolean b) {
        if (b)
            broadcastToWorld(new SystemMessage2(SystemMsg.THE_DEADLINE_TO_REGISTER_FOR_THE_SIEGE_OF_S1_HAS_PASSED).addResidenceName(getResidence()));

        super.setRegistrationOver(b);
    }
View Full Code Here

        super.setRegistrationOver(b);
    }

    @Override
    public void announce(int val) {
        SystemMessage2 msg;
        int min = val / 60;
        int hour = min / 60;

        if (hour > 0)
            msg = new SystemMessage2(SystemMsg.S1_HOURS_UNTIL_CASTLE_SIEGE_CONCLUSION).addInteger(hour);
        else if (min > 0)
            msg = new SystemMessage2(SystemMsg.S1_MINUTES_UNTIL_CASTLE_SIEGE_CONCLUSION).addInteger(min);
        else
            msg = new SystemMessage2(SystemMsg.THIS_CASTLE_SIEGE_WILL_END_IN_S1_SECONDS).addInteger(val);

        broadcastTo(msg, ATTACKERS, DEFENDERS);
    }
View Full Code Here

        setNextSiegeTime(calendar.getTimeInMillis());
    }

    private void setNextSiegeTime(long g) {
        broadcastToWorld(new SystemMessage2(SystemMsg.S1_HAS_ANNOUNCED_THE_NEXT_CASTLE_SIEGE_TIME).addResidenceName(getResidence()));

        clearActions();

        getResidence().getSiegeDate().setTimeInMillis(g);
        getResidence().setJdbcState(JdbcEntityState.UPDATED);
View Full Code Here

TOP

Related Classes of lineage2.gameserver.network.serverpackets.SystemMessage2

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.