Package l2p.gameserver.serverpackets

Examples of l2p.gameserver.serverpackets.Say2


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


  public void SetPlayerToKill(L2Player ptk)
  {
    setPtk(ptk);
    if(Rnd.chance(80))
    {
      broadcastPacket(new Say2(getObjectId(), Say2C.ALL, getName(), "mmm your bait was delicious"));
    }
    getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, ptk, 10);
    getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, ptk);
  }
View Full Code Here

  @Override
  public void doDie(L2Character killer)
  {
    if(Rnd.chance(75))
    {
      Say2 cs = new Say2(getObjectId(), Say2C.ALL, getName(), "I will tell fishes not to take your bait");
      broadcastPacket(cs);
    }
    super.doDie(killer);
  }
View Full Code Here

    for(L2Player player : L2World.getAroundPlayers(npc, 4000, 1000))
    {
      if(player != null && !player.isBlockAll())
      {
        String[] m = new CustomMessage(msg, player).addNumber(arenaId).toString().split(": ");
        player.sendPacket(new Say2(0, Say2C.SHOUT, m[0], m[1]));
      }
    }
  }
View Full Code Here

    String translit = activeChar.getVar("translit");
    if(translit != null)
    {
      _text = Strings.fromTranslit(_text, translit.equals("tl") ? 1 : 2);
    }
    Say2 cs = new Say2(activeChar.getObjectId(), _type, activeChar.getName(), _text);
    int mapregion = MapRegion.getInstance().getMapRegion(activeChar.getX(), activeChar.getY());
    long curTime = System.currentTimeMillis();
    switch(_type)
    {
      case TELL:
        L2Player receiver = L2World.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())
        {
          Long lastShoutTime = (Long) activeChar.getProperty(PropertyCollection.TellChatLaunched);
          if(lastShoutTime != null && lastShoutTime + (activeChar.getLevel() >= 20 ? 1000L : 10000L) > curTime)
          {
            activeChar.sendMessage("Tell chat is allowed once per " + (activeChar.getLevel() >= 20 ? "1 second." : "10 seconds."));
            return;
          }
          activeChar.addProperty(PropertyCollection.TellChatLaunched, curTime);
          if(!receiver.getMessageRefusal())
          {
            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), Msg.ActionFail);
        }
        else
        {
          activeChar.sendPacket(Msg.YOU_HAVE_BEEN_BLOCKED_FROM_THE_CONTACT_YOU_SELECTED, Msg.ActionFail);
        }
        break;
      case SHOUT:
        if(activeChar.isCursedWeaponEquipped())
        {
          activeChar.sendPacket(Msg.SHOUT_AND_TRADE_CHATING_CANNOT_BE_USED_SHILE_POSSESSING_A_CURSED_WEAPON);
          return;
        }
        if(activeChar.inObserverMode())
        {
          activeChar.sendPacket(Msg.YOU_CANNOT_CHAT_LOCALLY_WHILE_OBSERVING);
          return;
        }
        Long lastShoutTime = (Long) activeChar.getProperty(PropertyCollection.ShoutChatLaunched);
        if(lastShoutTime != null && lastShoutTime + Config.SHOUT_CHAT_TIME * 1000L > curTime)
        {
          activeChar.sendMessage("Shout chat is allowed once per " + Config.SHOUT_CHAT_TIME + " seconds.");
          return;
        }
        if(Config.CHAT_RESTRICTIONS)
        {
          if(activeChar.getLevel() < Config.SHOUT_CHAT)
          {
            activeChar.sendMessage("You must be " + Config.SHOUT_CHAT + " level to use Shout chat!");
            return;
          }
        }
        activeChar.addProperty(PropertyCollection.ShoutChatLaunched, curTime);
        if(activeChar.getLevel() >= Config.GLOBAL_CHAT || activeChar.isGM() && Config.GLOBAL_CHAT < Experience.LEVEL.length)
        {
          for(L2Player player : L2ObjectsStorage.getAllPlayersForIterate())
          {
            if(!player.isInBlockList(activeChar) && !player.isBlockAll())
            {
              player.sendPacket(cs);
            }
          }
        }
        else
        {
          if(Config.SHOUT_CHAT_MODE == 1)
          {
            for(L2Player player : L2World.getAroundPlayers(activeChar, 10000, 1500))
            {
              if(!player.isInBlockList(activeChar) && !player.isBlockAll() && player != activeChar)
              {
                player.sendPacket(cs);
              }
            }
          }
          else
          {
            for(L2Player player : L2ObjectsStorage.getAllPlayersForIterate())
            {
              if(MapRegion.getInstance().getMapRegion(player.getX(), player.getY()) == mapregion && !player.isInBlockList(activeChar) && !player.isBlockAll() && player != activeChar)
              {
                player.sendPacket(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.inObserverMode())
        {
          activeChar.sendPacket(Msg.YOU_CANNOT_CHAT_LOCALLY_WHILE_OBSERVING);
          return;
        }
        Long lastTradeTime = (Long) activeChar.getProperty(PropertyCollection.TradeChatLaunched);
        if(lastTradeTime != null && lastTradeTime + Config.TRADE_CHAT_TIME * 1000L > curTime)
        {
          activeChar.sendMessage("Trade chat is allowed once per " + Config.TRADE_CHAT_TIME + " seconds.");
          return;
        }
        if(Config.CHAT_RESTRICTIONS)
        {
          if(activeChar.getLevel() < Config.TRADE_CHAT)
          {
            activeChar.sendMessage("You must be " + Config.TRADE_CHAT + " level to use Trade chat!");
            return;
          }
        }
        activeChar.addProperty(PropertyCollection.TradeChatLaunched, curTime);
        if(activeChar.getLevel() >= Config.GLOBAL_TRADE_CHAT || activeChar.isGM() && Config.GLOBAL_TRADE_CHAT < Experience.LEVEL.length)
        {
          for(L2Player player : L2ObjectsStorage.getAllPlayersForIterate())
          {
            if(!player.isInBlockList(activeChar) && !player.isBlockAll())
            {
              player.sendPacket(cs);
            }
          }
        }
        else
        {
          if(Config.TRADE_CHAT_MODE == 1)
          {
            for(L2Player player : L2World.getAroundPlayers(activeChar, 10000, 1500))
            {
              if(!player.isInBlockList(activeChar) && !player.isBlockAll() && player != activeChar)
              {
                player.sendPacket(cs);
              }
            }
          }
          else
          {
            for(L2Player player : L2ObjectsStorage.getAllPlayersForIterate())
            {
              if(MapRegion.getInstance().getMapRegion(player.getX(), player.getY()) == mapregion && !player.isInBlockList(activeChar) && !player.isBlockAll() && player != activeChar)
              {
                player.sendPacket(cs);
              }
            }
          }
          activeChar.sendPacket(cs);
        }
        break;
      case ALL:
        if(activeChar.isCursedWeaponEquipped())
        {
          cs = new Say2(activeChar.getObjectId(), _type, activeChar.getTransformationName(), _text);
        }
        if(activeChar.inObserverMode() && activeChar.getObservNeighbor() != null)
        {
          GArray<L2Player> result = new GArray<L2Player>(50);
          for(L2WorldRegion neighbor : activeChar.getObservNeighbor().getNeighbors())
View Full Code Here

  {
    if(npc == null || text == null || npc.isEmpty() || text.isEmpty())
    {
      return;
    }
    Say2 s1 = new Say2(0, Say2C.SHOUT, npc, text);
    PlaySound s2 = sound == null ? null : new PlaySound(0, sound, 1, getObjectId(), getLoc());
    for(L2Player player : L2World.getAroundPlayers(this, 10000, 1000))
    {
      if(player != null)
      {
View Full Code Here

    GArray<L2Player> knownPlayers = L2ObjectsStorage.getAllPlayers();
    if(knownPlayers == null || knownPlayers.isEmpty())
    {
      return;
    }
    Say2 sm = new Say2(0, Say2C.SHOUT, getName(), msg);
    for(L2Player player : knownPlayers)
    {
      if(player == null)
      {
        continue;
View Full Code Here

        _print.println("Unable to find Player: " + argv[1]);
      }
      else
      {
        String msg = Util.joinStrings(" ", argv, 2);
        Say2 cs = new Say2(0, Say2C.TELL, "Server Admin", msg);
        player.sendPacket(cs);
        _print.println("Private message ->" + argv[1] + ": " + msg);
      }
    }
  }
View Full Code Here

    {
      _print.println("USAGE: gmchat Text");
    }
    else
    {
      Say2 cs = new Say2(0, 9, "Telnet GM Broadcast from " + _csocket.getInetAddress().getHostAddress(), Util.joinStrings(" ", argv, 1));
      GmListTable.broadcastToGMs(cs);
      _print.println("Your Message Has Been Sent To " + GmListTable.getAllGMs().size() + " GM(s).");
    }
  }
View Full Code Here

  public void showAnnouncements(L2Player activeChar)
  {
    for(String _announcement : _announcements)
    {
      Say2 cs = new Say2(0, _type, activeChar.getName(), _announcement);
      activeChar.sendPacket(cs);
    }
  }
View Full Code Here

TOP

Related Classes of l2p.gameserver.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.