Package net.sf.l2j.gameserver.serverpackets

Examples of net.sf.l2j.gameserver.serverpackets.CreatureSay


      _log.warning("saving the announcements file has failed: " + e);
    }
  }

  public void announceToAll(String text) {
    CreatureSay cs = new CreatureSay(0, Say2.ANNOUNCEMENT, "", text);

    for (L2PcInstance player : L2World.getInstance().getAllPlayers())
    {
      player.sendPacket(cs);
    }
View Full Code Here


    public void sendMessageToAll(String senderName, String message)
    {
        if (_dawnChatGuide == null || _duskChatGuide == null)
            return;

        CreatureSay cs = new CreatureSay(_dawnChatGuide.getObjectId(), 1, senderName, message);
        _dawnChatGuide.broadcastPacket(cs);

        cs = new CreatureSay(_duskChatGuide.getObjectId(), 1, senderName, message);
        _duskChatGuide.broadcastPacket(cs);
    }
View Full Code Here

                        String val = _usrCommand.substring(4);
                        StringTokenizer st = new StringTokenizer(val);
                        String name = st.nextToken();
                        String message = val.substring(name.length()+1);
                        L2PcInstance reciever = L2World.getInstance().getPlayer(name);
                        CreatureSay cs = new CreatureSay(0, Say2.TELL, "Telnet Priv", message);
                        if(reciever != null)
                        {
                            reciever.sendPacket(cs);
                            _print.println("Telnet Priv->" + name + ": " + message);
                            _print.println("Message Sent!");
                        }
                        else
                        {
                            _print.println("Unable To Find Username: " + name);
                        }
                    }
                    catch (StringIndexOutOfBoundsException e)
                    {
                        _print.println("Please Enter Some Text!");
                    }
                }
                else if (_usrCommand.startsWith("gmchat"))
                {
                    try
                    {
                        _usrCommand = _usrCommand.substring(7);
                        CreatureSay cs = new CreatureSay(0, 9, "Telnet GM Broadcast from " + _cSocket.getInetAddress().getHostAddress(), _usrCommand);
                        GmListTable.broadcastToGMs(cs);
                        _print.println("Your Message Has Been Sent To " + getOnlineGMS() + " GM(s).");
                    }
                    catch (StringIndexOutOfBoundsException e)
                    {
View Full Code Here

                LogRecord record = new LogRecord(Level.INFO, ar3);
                record.setLoggerName("chat");
                record.setParameters(new Object[]{"TELL", "[" + activeChar.getName() + " to "+receiver.getName()+"]"});
                _logChat.log(record);
        }
              CreatureSay cs = new CreatureSay(activeChar.getObjectId(), Say2.TELL, activeChar.getName(), ar3);
              if (!BlockList.isBlocked(receiver, activeChar))
        {
                if (!receiver.getMessageRefusal())
                {
                  receiver.sendPacket(cs);
                  activeChar.sendPacket(new CreatureSay(activeChar.getObjectId(), Say2.TELL, "->" + receiver.getName(), ar3));
                  htmlCode.append("Message Sent<br><button value=\"Back\" action=\"bypass _bbsloc;playerinfo;"+receiver.getName()+"\" width=40 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
                  htmlCode.append("</td></tr></table></body></html>");
                  separateAndSend(htmlCode.toString(),activeChar;
          }
                else
View Full Code Here

  public void setPlayerToKill(L2PcInstance ptk)
  {
    if (Rnd.nextInt(100) <= 80)
    {
      CreatureSay cs = new CreatureSay(getObjectId(), Say2.ALL, getName(),
                        "mmm your bait was delicious");
      this.broadcastPacket(cs);
    }
    _ptk = ptk;
    addDamageHate(ptk, 10, 10);
View Full Code Here

    if (!super.doDie(killer))
      return false;

    if (Rnd.nextInt(100) <= 75)
    {
      CreatureSay cs = new CreatureSay(getObjectId(), Say2.ALL, getName(),
                        "I will tell fishes not to take your bait");
      this.broadcastPacket(cs);
    }
    return true;
  }
View Full Code Here

    }

    public static void announceAllPlayers(String text)
    {
        CreatureSay cs = new CreatureSay(0, Say2.ANNOUNCEMENT, "", text);

        for (L2PcInstance player : L2World.getInstance().getAllPlayers())
        {
            player.sendPacket(cs);
        }
View Full Code Here

      if (command.contains("menu"))
        offset=17;
      else
        offset=13;
      text = command.substring(offset);
      CreatureSay cs = new CreatureSay(0, 9, activeChar.getName(), text);
      GmListTable.broadcastToGMs(cs);
    }
    catch (StringIndexOutOfBoundsException e)
    {
      // empty message.. ignore
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.serverpackets.CreatureSay

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.