Package l2p.gameserver.serverpackets

Examples of l2p.gameserver.serverpackets.SystemMessage


      onStart();
      // Fake Death и Silent Move не отображаются
      // Отображать сообщение только для первого эффекта скилла
      if(_skill.getId() != 60 && _skill.getId() != 221 && getEffected().getEffectList().getEffectsCountForSkill(getSkill().getId()) == 1)
      {
        getEffected().sendPacket(new SystemMessage(SystemMessage.S1_S2S_EFFECT_CAN_BE_FELT).addSkillName(_displayId, _displayLevel));
      }
      updateEffects(); // Обрабатываем отображение статов
      EffectTaskManager.getInstance().addDispelTask(this, (int) (_period / 1000));
      _periodStartTime = System.currentTimeMillis();
      return;
    }
    if(_state == EffectState.ACTING)
    {
      if(_count > 0)
      {
        _count--;
        if((!isActive() || onActionTime()) && _count > 0)
        {
          return;
        }
      }
      _state = EffectState.FINISHING;
    }
    if(_state == EffectState.FINISHING)
    {
      _state = EffectState.FINISHED;
      // Для ускоренной "остановки" эффекта
      _inUse = false;
      // Cancel the effect in the the abnormal effect map of the L2Character
      onExit();
      // If the time left is equal to zero, send the message
      // Отображать сообщение только для последнего оставшегося эффекта скилла
      if(_count <= 0 && getEffected().getEffectList().getEffectsCountForSkill(getSkill().getId()) == 1)
      {
        getEffected().sendPacket(new SystemMessage(SystemMessage.S1_HAS_WORN_OFF).addSkillName(_displayId, _displayLevel));
      }
      // Stop the task of the L2Effect, remove it and update client magic icon
      stopEffectTask();
      if(getSkill().getDelayedEffect() > 0)
      {
View Full Code Here


    player.getInventory().equipItem(item, false);
    player.sendChanges();
    _item = item;
    player.sendPacket(Msg.YOU_VE_ACQUIRED_THE_WARD_MOVE_QUICKLY_TO_YOUR_FORCES__OUTPOST);
    String terrName = CastleManager.getInstance().getCastleByIndex(_baseTerritoryId).getName();
    TerritorySiege.announceToPlayer(new SystemMessage(SystemMessage.THE_S1_WARD_HAS_BEEN_DESTROYED_C2_NOW_HAS_THE_TERRITORY_WARD).addString(terrName).addName(player), true);
  }
View Full Code Here

      TerritorySiege.spawnFlags(_baseTerritoryId); // Заспавнит только нужный нам флаг в замке
      TerritorySiege.setWardLoc(_baseTerritoryId, getLoc());
      TerritorySiege.refreshTerritorySkills();
      player.sendPacket(Msg.THE_EFFECT_OF_TERRITORY_WARD_IS_DISAPPEARING);
      String terrName = CastleManager.getInstance().getCastleByIndex(_baseTerritoryId).getName();
      TerritorySiege.announceToPlayer(new SystemMessage(SystemMessage.CLAN_S1_HAS_SUCCEEDED_IN_CAPTURING_S2_S_TERRITORY_WARD).addString(player.getClan().getName()).addString(terrName), true);
      deleteMe();
    }
  }
View Full Code Here

      int val = Integer.parseInt(command.substring(15));
      showChatWindow(player, val, null, true);
    }
    else if(command.startsWith("SevenSigns"))
    {
      SystemMessage sm;
      String path;
      int cabal = SevenSigns.CABAL_NULL;
      int stoneType = 0;
      //      int inventorySize = player.getInventory().getSize() + 1;
      L2ItemInstance ancientAdena = player.getInventory().getItemByItemId(SevenSigns.ANCIENT_ADENA_ID);
      long ancientAdenaAmount = ancientAdena == null ? 0 : ancientAdena.getCount();
      int val = Integer.parseInt(command.substring(11, 12).trim());
      if(command.length() > 12) // SevenSigns x[x] x [x..x]
      {
        val = Integer.parseInt(command.substring(11, 13).trim());
      }
      if(command.length() > 13)
      {
        try
        {
          cabal = Integer.parseInt(command.substring(14, 15).trim());
        }
        catch(Exception e)
        {
          try
          {
            cabal = Integer.parseInt(command.substring(13, 14).trim());
          }
          catch(Exception e2)
          {
          }
        }
      }
      switch(val)
      {
        case 2: // Purchase Record of the Seven Signs
          if(!player.getInventory().validateCapacity(1))
          {
            player.sendPacket(Msg.YOUR_INVENTORY_IS_FULL);
            return;
          }
          if(SevenSigns.RECORD_SEVEN_SIGNS_COST > player.getAdena())
          {
            player.sendPacket(Msg.YOU_DO_NOT_HAVE_ENOUGH_ADENA);
            return;
          }
          player.reduceAdena(SevenSigns.RECORD_SEVEN_SIGNS_COST, true);
          player.getInventory().addItem(ItemTable.getInstance().createItem(SevenSigns.RECORD_SEVEN_SIGNS_ID));
          player.sendPacket(SystemMessage.obtainItems(SevenSigns.RECORD_SEVEN_SIGNS_ID, 1, 0));
          break;
        case 3: // Join Cabal Intro 1
        case 8: // Festival of Darkness Intro - SevenSigns x [0]1
          cabal = SevenSigns.getInstance().getPriestCabal(getNpcId());
          showChatWindow(player, val, SevenSigns.getCabalShortName(cabal), false);
          break;
        case 10: // Teleport Locations List
          cabal = SevenSigns.getInstance().getPriestCabal(getNpcId());
          if(SevenSigns.getInstance().isSealValidationPeriod())
          {
            showChatWindow(player, val, "", false);
          }
          else
          {
            int town = TownManager.getInstance().getClosestTownNumber(this);
            if(town >= 6 && town <= 16)
            {
              showChatWindow(player, val, String.valueOf(town), false);
            }
            else
            {
              showChatWindow(player, val, "no", false);
            }
          }
          break;
        case 4: // Join a Cabal - SevenSigns 4 [0]1 x
          int newSeal = Integer.parseInt(command.substring(15));
          int oldCabal = SevenSigns.getInstance().getPlayerCabal(player);
          if(oldCabal != SevenSigns.CABAL_NULL)
          {
            player.sendMessage(new CustomMessage("l2p.gameserver.model.instances.L2SignsPriestInstance.AlreadyMember", player).addString(SevenSigns.getCabalName(cabal)));
            return;
          }
          if(player.getClassId().level() == 0)
          {
            player.sendMessage(new CustomMessage("l2p.gameserver.model.instances.L2SignsPriestInstance.YouAreNewbie", player));
            break;
          }
          else if(player.getClassId().level() >= 2)
          {
            if(Config.ALT_GAME_REQUIRE_CASTLE_DAWN)
            {
              if(getPlayerAllyHasCastle(player))
              {
                if(cabal == SevenSigns.CABAL_DUSK)
                {
                  player.sendMessage(new CustomMessage("l2p.gameserver.model.instances.L2SignsPriestInstance.CastleOwning", player));
                  return;
                }
              }
              else
                /*
                               * If the player is trying to join the Lords of Dawn, check if they are
                               * carrying a Lord's certificate.
                               *
                               * If not then try to take the required amount of adena instead.
                               */
                if(cabal == SevenSigns.CABAL_DAWN)
                {
                  boolean allowJoinDawn = false;
                  if(Functions.getItemCount(player, SevenSigns.CERTIFICATE_OF_APPROVAL_ID) > 0)
                  {
                    Functions.removeItem(player, SevenSigns.CERTIFICATE_OF_APPROVAL_ID, 1);
                    allowJoinDawn = true;
                  }
                  else if(Config.ALT_GAME_ALLOW_ADENA_DAWN && player.getAdena() >= SevenSigns.ADENA_JOIN_DAWN_COST)
                  {
                    player.reduceAdena(SevenSigns.ADENA_JOIN_DAWN_COST, true);
                    allowJoinDawn = true;
                  }
                  if(!allowJoinDawn)
                  {
                    if(Config.ALT_GAME_ALLOW_ADENA_DAWN)
                    {
                      player.sendMessage(new CustomMessage("l2p.gameserver.model.instances.L2SignsPriestInstance.CastleOwningCertificate", player));
                    }
                    else
                    {
                      player.sendMessage(new CustomMessage("l2p.gameserver.model.instances.L2SignsPriestInstance.CastleOwningCertificate2", player));
                    }
                    return;
                  }
                }
            }
          }
          SevenSigns.getInstance().setPlayerInfo(player.getObjectId(), cabal, newSeal);
          if(cabal == SevenSigns.CABAL_DAWN)
          {
            player.sendPacket(Msg.YOU_WILL_PARTICIPATE_IN_THE_SEVEN_SIGNS_AS_A_MEMBER_OF_THE_LORDS_OF_DAWN); // Joined Dawn
          }
          else
          {
            player.sendPacket(Msg.YOU_WILL_PARTICIPATE_IN_THE_SEVEN_SIGNS_AS_A_MEMBER_OF_THE_REVOLUTIONARIES_OF_DUSK);
          } // Joined Dusk
          //Show a confirmation message to the user, indicating which seal they chose.
          switch(newSeal)
          {
            case SevenSigns.SEAL_AVARICE:
              player.sendPacket(Msg.YOUVE_CHOSEN_TO_FIGHT_FOR_THE_SEAL_OF_AVARICE_DURING_THIS_QUEST_EVENT_PERIOD);
              break;
            case SevenSigns.SEAL_GNOSIS:
              player.sendPacket(Msg.YOUVE_CHOSEN_TO_FIGHT_FOR_THE_SEAL_OF_GNOSIS_DURING_THIS_QUEST_EVENT_PERIOD);
              break;
            case SevenSigns.SEAL_STRIFE:
              player.sendPacket(Msg.YOUVE_CHOSEN_TO_FIGHT_FOR_THE_SEAL_OF_STRIFE_DURING_THIS_QUEST_EVENT_PERIOD);
              break;
          }
          showChatWindow(player, 4, SevenSigns.getCabalShortName(cabal), false);
          break;
        case 6: // Contribute Seal Stones - SevenSigns 6 x
          stoneType = Integer.parseInt(command.substring(13));
          L2ItemInstance redStones = player.getInventory().getItemByItemId(SevenSigns.SEAL_STONE_RED_ID);
          long redStoneCount = redStones == null ? 0 : redStones.getCount();
          L2ItemInstance greenStones = player.getInventory().getItemByItemId(SevenSigns.SEAL_STONE_GREEN_ID);
          long greenStoneCount = greenStones == null ? 0 : greenStones.getCount();
          L2ItemInstance blueStones = player.getInventory().getItemByItemId(SevenSigns.SEAL_STONE_BLUE_ID);
          long blueStoneCount = blueStones == null ? 0 : blueStones.getCount();
          long contribScore = SevenSigns.getInstance().getPlayerContribScore(player);
          boolean stonesFound = false;
          if(contribScore == SevenSigns.MAXIMUM_PLAYER_CONTRIB)
          {
            player.sendPacket(Msg.CONTRIBUTION_LEVEL_HAS_EXCEEDED_THE_LIMIT_YOU_MAY_NOT_CONTINUE);
          }
          else
          {
            long redContribCount = 0;
            long greenContribCount = 0;
            long blueContribCount = 0;
            switch(stoneType)
            {
              case 1:
                blueContribCount = (SevenSigns.MAXIMUM_PLAYER_CONTRIB - contribScore) / SevenSigns.BLUE_CONTRIB_POINTS;
                if(blueContribCount > blueStoneCount)
                {
                  blueContribCount = blueStoneCount;
                }
                break;
              case 2:
                greenContribCount = (SevenSigns.MAXIMUM_PLAYER_CONTRIB - contribScore) / SevenSigns.GREEN_CONTRIB_POINTS;
                if(greenContribCount > greenStoneCount)
                {
                  greenContribCount = greenStoneCount;
                }
                break;
              case 3:
                redContribCount = (SevenSigns.MAXIMUM_PLAYER_CONTRIB - contribScore) / SevenSigns.RED_CONTRIB_POINTS;
                if(redContribCount > redStoneCount)
                {
                  redContribCount = redStoneCount;
                }
                break;
              case 4:
                long tempContribScore = contribScore;
                redContribCount = (SevenSigns.MAXIMUM_PLAYER_CONTRIB - tempContribScore) / SevenSigns.RED_CONTRIB_POINTS;
                if(redContribCount > redStoneCount)
                {
                  redContribCount = redStoneCount;
                }
                tempContribScore += redContribCount * SevenSigns.RED_CONTRIB_POINTS;
                greenContribCount = (SevenSigns.MAXIMUM_PLAYER_CONTRIB - tempContribScore) / SevenSigns.GREEN_CONTRIB_POINTS;
                if(greenContribCount > greenStoneCount)
                {
                  greenContribCount = greenStoneCount;
                }
                tempContribScore += greenContribCount * SevenSigns.GREEN_CONTRIB_POINTS;
                blueContribCount = (SevenSigns.MAXIMUM_PLAYER_CONTRIB - tempContribScore) / SevenSigns.BLUE_CONTRIB_POINTS;
                if(blueContribCount > blueStoneCount)
                {
                  blueContribCount = blueStoneCount;
                }
                break;
            }
            if(redContribCount > 0)
            {
              L2ItemInstance temp = player.getInventory().getItemByItemId(SevenSigns.SEAL_STONE_RED_ID);
              if(temp != null && temp.getCount() >= redContribCount)
              {
                player.getInventory().destroyItemByItemId(SevenSigns.SEAL_STONE_RED_ID, (int) redContribCount, true);
                stonesFound = true;
              }
            }
            if(greenContribCount > 0)
            {
              L2ItemInstance temp = player.getInventory().getItemByItemId(SevenSigns.SEAL_STONE_GREEN_ID);
              if(temp != null && temp.getCount() >= greenContribCount)
              {
                player.getInventory().destroyItemByItemId(SevenSigns.SEAL_STONE_GREEN_ID, (int) greenContribCount, true);
                stonesFound = true;
              }
            }
            if(blueContribCount > 0)
            {
              L2ItemInstance temp = player.getInventory().getItemByItemId(SevenSigns.SEAL_STONE_BLUE_ID);
              if(temp != null && temp.getCount() >= blueContribCount)
              {
                player.getInventory().destroyItemByItemId(SevenSigns.SEAL_STONE_BLUE_ID, (int) blueContribCount, true);
                stonesFound = true;
              }
            }
            if(!stonesFound)
            {
              player.sendMessage(new CustomMessage("l2p.gameserver.model.instances.L2SignsPriestInstance.DontHaveAnySSType", player));
              return;
            }
            contribScore = SevenSigns.getInstance().addPlayerStoneContrib(player, blueContribCount, greenContribCount, redContribCount);
            sm = new SystemMessage(SystemMessage.YOUR_CONTRIBUTION_SCORE_IS_INCREASED_BY_S1);
            sm.addNumber(contribScore);
            player.sendPacket(sm);
            showChatWindow(player, 6, null, false);
          }
          break;
        case 7: // Exchange Ancient Adena for Adena - SevenSigns 7 xxxxxxx
View Full Code Here

      activeChar.sendMessage("Changed enchantment of " + player.getName() + "'s " + itemInstance.getName() + " from " + curEnchant + " to " + ench + ".");
      player.sendMessage("Admin has changed the enchantment of your " + itemInstance.getName() + " from " + curEnchant + " to " + ench + ".");
      if(activeChar != player && ench >= (itemInstance.getItem().getType2() == L2Item.TYPE2_WEAPON ? 6 : 5))
      {
        player.altUseSkill(SkillTable.getInstance().getInfo(21006, 1), player);
        player.broadcastPacket(new SystemMessage(SystemMessage.C1_HAS_SUCCESSFULY_ENCHANTED_A__S2_S3).addName(player).addNumber(ench).addItemName(itemInstance.getItemId()));
      }
      if(Config.ProtectEnchantGMEnable && ench > Config.ProtectEnchantGMMax)
      {
        mOption.banAcc(activeChar, "ProtectEnchantGM");
        mOption.banAcc(player, "ProtectEnchantGM");
View Full Code Here

      {
        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));
        }
      }
      if(noLimit)
      {
        activeChar.sendPacket(Msg.THERE_IS_NO_INSTANCE_ZONE_UNDER_A_TIME_LIMIT);
View Full Code Here

    if(clan == null)
    {
      activeChar.sendPacket(Msg.NOT_JOINED_IN_ANY_CLAN);
      return false;
    }
    SystemMessage sm;
    GArray<L2Clan> data = new GArray<L2Clan>();
    if(id == 88)
    {
      // attack list
      activeChar.sendPacket(Msg._ATTACK_LIST_);
      data = clan.getEnemyClans();
    }
    else if(id == 89)
    {
      // under attack list
      activeChar.sendPacket(Msg._UNDER_ATTACK_LIST_);
      data = clan.getAttackerClans();
    }
    else
    // id = 90
    {
      // war list
      activeChar.sendPacket(Msg._WAR_LIST_);
      for(L2Clan c : clan.getEnemyClans())
      {
        if(clan.getAttackerClans().contains(c))
        {
          data.add(c);
        }
      }
    }
    for(L2Clan c : data)
    {
      String clanName = c.getName();
      int ally_id = c.getAllyId();
      if(ally_id > 0)
      {
        sm = new SystemMessage(SystemMessage.S1_S2_ALLIANCE).addString(clanName).addString(c.getAlliance().getAllyName());
      }
      else
      {
        sm = new SystemMessage(SystemMessage.S1_NO_ALLIANCE_EXISTS).addString(clanName);
      }
      activeChar.sendPacket(sm);
    }
    activeChar.sendPacket(Msg.__EQUALS__);
    return true;
View Full Code Here

        msg = SystemMessage.CURRENT_LOCATION__S1_S2_S3_INSIDE_THE_STEEL_CITADEL;
        break;
      default:
        msg = SystemMessage.CURRENT_LOCATION__S1_S2_S3_NEAR_ADEN_CASTLE_TOWN;
    }
    activeChar.sendPacket(new SystemMessage(msg).addNumber(activeChar.getX()).addNumber(activeChar.getY()).addNumber(activeChar.getZ()));
    return true;
  }
View Full Code Here

        }
        L2Skill skill = SkillTable.getInstance().getInfo(skillId, skillLevel);
        if(activeChar.getEffectList().getEffectsBySkill(skill) == null)
        {
          skill.getEffects(activeChar, activeChar, false, false);
          activeChar.sendPacket(new SystemMessage(SystemMessage.S1_S2S_EFFECT_CAN_BE_FELT).addSkillName(skillId, skillLevel));
        }
      }
      return false;
    }
    L2Player ptarget = (L2Player) activeChar.getTarget();
View Full Code Here

    {
      return false;
    }
    Calendar c = Calendar.getInstance();
    c.setTimeInMillis(activeChar.getCreateTime());
    activeChar.sendPacket(new SystemMessage(SystemMessage.C1S_CHARACTER_BIRTHDAY_IS_S3S4S2).addString(activeChar.getName()).addNumber(c.get(Calendar.YEAR)).addNumber(c.get(Calendar.MONTH) + 1).addNumber(c.get(Calendar.DAY_OF_MONTH)));
    return true;
  }
View Full Code Here

TOP

Related Classes of l2p.gameserver.serverpackets.SystemMessage

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.