Package lineage2.gameserver.network.serverpackets

Examples of lineage2.gameserver.network.serverpackets.Say2


   * @param text String
   * @param type ChatType
   */
  public void announceToAll(String text, ChatType type)
  {
    Say2 cs = new Say2(0, type, "", text);
    for (Player player : GameObjectsStorage.getAllPlayersForIterate())
    {
      player.sendPacket(cs);
    }
  }
View Full Code Here


      for (String s : replacements)
      {
        cm.addString(s);
      }
    }
    player.sendPacket(new Say2(0, ChatType.ANNOUNCEMENT, "", cm.toString()));
  }
View Full Code Here

      for (String s : replacements)
      {
        cm.addString(s);
      }
    }
    player.sendPacket(new Say2(0, type, "", cm.toString()));
  }
View Full Code Here

     * Method showAnnounce.
     * @param player Player
     */
    public void showAnnounce(Player player)
    {
      Say2 cs = new Say2(0, ChatType.ANNOUNCEMENT, player.getName(), _announce);
      player.sendPacket(cs);
    }
View Full Code Here

      if (PetitionManager.getInstance().cancelActivePetition(activeChar))
      {
        int numRemaining = Config.MAX_PETITIONS_PER_PLAYER - PetitionManager.getInstance().getPlayerTotalPetitionCount(activeChar);
        activeChar.sendPacket(new SystemMessage(SystemMessage.THE_PETITION_WAS_CANCELED_YOU_MAY_SUBMIT_S1_MORE_PETITIONS_TODAY).addString(String.valueOf(numRemaining)));
        String msgContent = activeChar.getName() + " has canceled a pending petition.";
        GmListTable.broadcastToGMs(new Say2(activeChar.getObjectId(), ChatType.HERO_VOICE, "Petition System", msgContent));
      }
      else
      {
        activeChar.sendPacket(new SystemMessage(SystemMessage.FAILED_TO_CANCEL_PETITION_PLEASE_TRY_AGAIN_LATER));
      }
View Full Code Here

        sb.append(_text.substring(end, end = m.end()));
      }
      _text = sb.append(Strings.fromTranslit(_text.substring(end, _text.length()), translit.equals("tl") ? 1 : 2)).toString();
    }
    Log.LogChat(_type.name(), activeChar.getName(), _target, _text);
    Say2 cs = new Say2(activeChar.getObjectId(), _type, activeChar.getName(), _text);
    switch (_type)
    {
      case TELL:
        Player receiver = World.getPlayer(_target);
        if ((receiver == null) && Config.ALLOW_FAKE_PLAYERS && FakePlayersTable.getActiveFakePlayers().contains(_target))
        {
          cs = new Say2(activeChar.getObjectId(), _type, "->" + _target, _text);
          activeChar.sendPacket(cs);
          return;
        }
        else if ((receiver != null) && receiver.isInOfflineMode())
        {
          activeChar.sendMessage("The person is in offline trade mode.");
          activeChar.sendActionFailed();
        }
        else if ((receiver != null) && !receiver.isInBlockList(activeChar) && !receiver.isBlockAll())
        {
          if (!receiver.getMessageRefusal())
          {
            if (activeChar.antiFlood.canTell(receiver.getObjectId(), _text))
            {
              receiver.sendPacket(cs);
            }
            cs = new Say2(activeChar.getObjectId(), _type, "->" + receiver.getName(), _text);
            activeChar.sendPacket(cs);
          }
          else
          {
            activeChar.sendPacket(Msg.THE_PERSON_IS_IN_A_MESSAGE_REFUSAL_MODE);
          }
        }
        else if (receiver == null)
        {
          activeChar.sendPacket(new SystemMessage(SystemMessage.S1_IS_NOT_CURRENTLY_LOGGED_IN).addString(_target), ActionFail.STATIC);
        }
        else
        {
          activeChar.sendPacket(Msg.YOU_HAVE_BEEN_BLOCKED_FROM_THE_CONTACT_YOU_SELECTED, ActionFail.STATIC);
        }
        break;
      case SHOUT:
        if (activeChar.isCursedWeaponEquipped())
        {
          activeChar.sendPacket(Msg.SHOUT_AND_TRADE_CHATING_CANNOT_BE_USED_SHILE_POSSESSING_A_CURSED_WEAPON);
          return;
        }
        if (activeChar.isInObserverMode())
        {
          activeChar.sendPacket(Msg.YOU_CANNOT_CHAT_LOCALLY_WHILE_OBSERVING);
          return;
        }
        if (!activeChar.isGM() && !activeChar.antiFlood.canShout(_text))
        {
          activeChar.sendMessage("Shout chat is allowed once per 5 seconds.");
          return;
        }
        if (Config.GLOBAL_SHOUT)
        {
          announce(activeChar, cs);
        }
        else
        {
          shout(activeChar, cs);
        }
        activeChar.sendPacket(cs);
        break;
      case TRADE:
        if (activeChar.isCursedWeaponEquipped())
        {
          activeChar.sendPacket(Msg.SHOUT_AND_TRADE_CHATING_CANNOT_BE_USED_SHILE_POSSESSING_A_CURSED_WEAPON);
          return;
        }
        if (activeChar.isInObserverMode())
        {
          activeChar.sendPacket(Msg.YOU_CANNOT_CHAT_LOCALLY_WHILE_OBSERVING);
          return;
        }
        if (!activeChar.isGM() && !activeChar.antiFlood.canTrade(_text))
        {
          activeChar.sendMessage("Trade chat is allowed once per 5 seconds.");
          return;
        }
        if (Config.GLOBAL_TRADE_CHAT)
        {
          announce(activeChar, cs);
        }
        else
        {
          shout(activeChar, cs);
        }
        activeChar.sendPacket(cs);
        break;
      case ALL:
        if (activeChar.isCursedWeaponEquipped())
        {
          cs = new Say2(activeChar.getObjectId(), _type, activeChar.getTransformationName(), _text);
        }
        List<Player> list = null;
        if (activeChar.isInObserverMode() && (activeChar.getObserverRegion() != null) && (activeChar.getOlympiadObserveGame() != null))
        {
          OlympiadGame game = activeChar.getOlympiadObserveGame();
View Full Code Here

    {
      case admin_gmchat:
        try
        {
          String text = fullString.replaceFirst(Commands.admin_gmchat.name(), "");
          Say2 cs = new Say2(0, ChatType.ALLIANCE, activeChar.getName(), text);
          GmListTable.broadcastToGMs(cs);
        }
        catch (StringIndexOutOfBoundsException e)
        {
        }
View Full Code Here

  {
    if (npcId != actor.getDisplayId())
    {
      actor.setDisplayId(npcId);
      DeleteObject d = new DeleteObject(actor);
      L2GameServerPacket su = new StatusUpdate(actor).addAttribute(StatusUpdateField.CUR_HP, StatusUpdateField.MAX_HP);
      for (Player player : World.getAroundPlayers(actor))
      {
        player.sendPacket(d, new NpcInfo(actor, player));
        if (player.getTarget() == actor)
        {
View Full Code Here

          break;
        case 30:
        case 20:
        case 10:
        case 5:
          Announcements.getInstance().announceToAll(new SystemMessage(SystemMessage.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECONDS__PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT).addNumber(shutdownCounter));
          break;
        case 0:
          switch (shutdownMode)
          {
            case SHUTDOWN:
View Full Code Here

            spawnRoom(7);
            setReenterTime(System.currentTimeMillis());
            for(Player p : getPlayers())
            {
              p.sendPacket(new ExSendUIEvent(p, 1, 1, 0, 0));
              p.sendPacket(new SystemMessage(SystemMessage.THIS_DUNGEON_WILL_EXPIRE_IN_S1_MINUTES).addNumber(5));
            }
            startCollapseTimer(5 * 60 * 1000L);
            timeSpent = (int) (System.currentTimeMillis() - _savedTime) / 1000;
          }
        }, 10000L);
View Full Code Here

TOP

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

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.