Package net.sf.l2j.gameserver.serverpackets

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


   */
  public void say(int i)
  {

    Collection<L2PcInstance> knownPlayers = getKnownList().getKnownPlayers().values();
    CreatureSay sm;
    PlaySound ps;
    switch(i)
    {
    case 10:
      if(_cycle == 1)
      {
        sm =new CreatureSay(0, Say2.SHOUT,_t1.npc1, _t1.sysmess10_1);
      }
      else
      {
        sm =new CreatureSay(0, Say2.SHOUT,_t2.npc1, _t2.sysmess10_1);
      }
      ps = new PlaySound(0,"itemsound.ship_arrival_departure",1,getObjectId(),getX(),getY(),getZ());
      if (knownPlayers == null || knownPlayers.isEmpty())
        return;
      for (L2PcInstance player : knownPlayers)
      {
        player.sendPacket(sm);
        player.sendPacket(ps);
      }
      break;
    case 5:
      if(_cycle == 1)
      {
        sm =new CreatureSay(0, Say2.SHOUT,_t1.npc1, _t1.sysmess5_1);
      }
      else
      {
        sm =new CreatureSay(0, Say2.SHOUT,_t2.npc1, _t2.sysmess5_1);
      }
      ps = new PlaySound(0,"itemsound.ship_5min",1,getObjectId(),getX(),getY(),getZ());
      if (knownPlayers == null || knownPlayers.isEmpty())
        return;
      for (L2PcInstance player : knownPlayers)
      {
        player.sendPacket(sm);
        player.sendPacket(ps);
      }
      break;
    case 1:

      if(_cycle == 1)
      {
        sm =new CreatureSay(0, Say2.SHOUT,_t1.npc1, _t1.sysmess1_1);
      }
      else
      {
        sm =new CreatureSay(0, Say2.SHOUT,_t2.npc1, _t2.sysmess1_1);
      }
      ps = new PlaySound(0,"itemsound.ship_1min",1,getObjectId(),getX(),getY(),getZ());
      if (knownPlayers == null || knownPlayers.isEmpty())
        return;
      for (L2PcInstance player : knownPlayers)
      {
        player.sendPacket(sm);
        player.sendPacket(ps);
      }
      break;
    case 0:

      if(_cycle == 1)
      {
        sm =new CreatureSay(0, Say2.SHOUT,_t1.npc1, _t1.sysmess0_1);
      }
      else
      {
        sm =new CreatureSay(0, Say2.SHOUT,_t2.npc1, _t2.sysmess0_1);
      }
      if (knownPlayers == null || knownPlayers.isEmpty())
        return;
      for (L2PcInstance player : knownPlayers)
      {
        player.sendPacket(sm);
        //player.sendPacket(ps);
      }
      break;
    case -1:
      if(_cycle == 1)
      {
        sm =new CreatureSay(0, Say2.SHOUT,_t1.npc1, _t1.sysmessb_1);
      }
      else
      {
        sm =new CreatureSay(0, Say2.SHOUT,_t2.npc1, _t2.sysmessb_1);
      }
      ps = new PlaySound(0,"itemsound.ship_arrival_departure",1,getObjectId(),getX(),getY(),getZ());
      for (L2PcInstance player : knownPlayers)
      {
        player.sendPacket(sm);
View Full Code Here


                        if (text.contains("%player_cabal_loser%")
                            || text.contains("%player_cabal_winner%")
                            || text.contains("%player_random%")) return;

                        CreatureSay cs = new CreatureSay(chatNpc.getObjectId(), 0, creatureName, text);

                        for (L2PcInstance nearbyPlayer : nearbyPlayers)
                            nearbyPlayer.sendPacket(cs);
                        for (L2PcInstance nearbyGM : nearbyGMs)
                            nearbyGM.sendPacket(cs);
View Full Code Here

              && attacker.getParty().getCommandChannel().meetRaidWarCondition(this))
          {
            _firstCommandChannelAttacked = attacker.getParty().getCommandChannel();
            _commandChannelTimer = new CommandChannelTimer(this, attacker.getParty().getCommandChannel());
            ThreadPoolManager.getInstance().scheduleGeneral(_commandChannelTimer, 300000); // 5 min
            _firstCommandChannelAttacked.broadcastToChannelMembers(new CreatureSay(0, Say2.PARTYROOM_ALL, "", "You have looting rights!"));
          }
        }

        if (isEventMob) return;
View Full Code Here

    }

    //we send message to known players only!
    if(_knownPlayers.size() > 0)
    {
      CreatureSay cs = new CreatureSay(getObjectId(), 0, getName(), chat);

      //we interact and list players here
      for(L2PcInstance players : _knownPlayers.values())

        //finally send packet :D
View Full Code Here

          activeChar.sendPacket(sm);
          sm = null;

                    // Notify all GMs that the player's pending petition has been cancelled.
                    String msgContent = activeChar.getName() + " has canceled a pending petition.";
                    GmListTable.broadcastToGMs(new CreatureSay(activeChar.getObjectId(), 17, "Petition System", msgContent));
        }
        else
        {
          activeChar.sendPacket(new SystemMessage(SystemMessageId.FAILED_CANCEL_PETITION_TRY_LATER));
        }
View Full Code Here

        record.setParameters(new Object[]{CHAT_NAMES[_type], "[" + activeChar.getName() + "]"});

      _logChat.log(record);
    }

    CreatureSay cs = new CreatureSay(activeChar.getObjectId(), _type, activeChar.getName(), _text);

    switch (_type)
    {
      case TELL:
        L2PcInstance receiver = L2World.getInstance().getPlayer(_target);

        if (receiver != null &&
            !BlockList.isBlocked(receiver, activeChar))
        {
          if (Config.JAIL_DISABLE_CHAT && receiver.isInJail())
              {
                      activeChar.sendMessage("Player is in jail.");
                      return;
              }
          if (receiver.isChatBanned())
              {
                      activeChar.sendMessage("Player is chat banned.");
                      return;
              }

          if (!receiver.getMessageRefusal())
          {
            receiver.sendPacket(cs);
            activeChar.sendPacket(new CreatureSay(activeChar.getObjectId(),  _type, "->" + receiver.getName(), _text));
          }
          else
          {
            activeChar.sendPacket(new SystemMessage(SystemMessageId.THE_PERSON_IS_IN_MESSAGE_REFUSAL_MODE));
          }
View Full Code Here

  public boolean sendActivePetitionMessage(L2PcInstance player, String messageText)
  {
    //if (!isPlayerInConsultation(player))
    //return false;

    CreatureSay cs;

    for (Petition currPetition : getPendingPetitions().values())
    {
            if (currPetition == null)
                continue;

      if (currPetition.getPetitioner() != null && currPetition.getPetitioner().getObjectId() == player.getObjectId())
      {
        cs = new CreatureSay(player.getObjectId(), Say2.PETITION_PLAYER, player.getName(), messageText);
        currPetition.addLogMessage(cs);

        currPetition.sendResponderPacket(cs);
        currPetition.sendPetitionerPacket(cs);
        return true;
      }

      if (currPetition.getResponder() != null && currPetition.getResponder().getObjectId() == player.getObjectId())
      {
        cs = new CreatureSay(player.getObjectId(), Say2.PETITION_GM, player.getName(), messageText);
        currPetition.addLogMessage(cs);

        currPetition.sendResponderPacket(cs);
        currPetition.sendPetitionerPacket(cs);
        return true;
View Full Code Here

    int newPetitionId = newPetition.getId();
    getPendingPetitions().put(newPetitionId, newPetition);

    // Notify all GMs that a new petition has been submitted.
    String msgContent = petitioner.getName() + " has submitted a new petition."; //(ID: " + newPetitionId + ").";
    GmListTable.broadcastToGMs(new CreatureSay(petitioner.getObjectId(), 17, "Petition System", msgContent));

    return newPetitionId;
  }
View Full Code Here

        public void sendMessageToParticipants(String message)
        {
            if (_participants.size() > 0)
            {
                CreatureSay cs = new CreatureSay(_witchInst.getObjectId(), 0, "Festival Witch", message);

                for (L2PcInstance participant : _participants)
                {
                  try {
                    participant.sendPacket(cs);
View Full Code Here

  public void showAnnouncements(L2PcInstance activeChar)
  {
    for (int i = 0; i < _announcements.size(); i++)
    {
      CreatureSay cs = new CreatureSay(0, Say2.ANNOUNCEMENT, activeChar.getName(), _announcements.get(i));
      activeChar.sendPacket(cs);
    }

    for (int i = 0; i < _eventAnnouncements.size(); i++)
    {
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.