Package net.sf.l2j.gameserver.serverpackets

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


  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);
        player.sendPacket(ps);
      }
View Full Code Here


          //Consuming used seed
        _activeChar.destroyItem("Consume", item.getObjectId(), 1, null, false);

        SystemMessage sm = null;
        if (calcSuccess()) {
            _activeChar.sendPacket(new PlaySound("Itemsound.quest_itemget"));
              _target.setSeeded();
              sm = new SystemMessage(SystemMessageId.THE_SEED_WAS_SUCCESSFULLY_SOWN);
          } else {
            sm = new SystemMessage(SystemMessageId.THE_SEED_WAS_NOT_SOWN);
      }
View Full Code Here

                  }
                  else {
                    //test with: activeChar.sendPacket(new SystemMessage(SystemMessage.FAILED_TO_UNLOCK_DOOR));
                    activeChar.sendMessage("You failed to open Anterooms Door.");
                    activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), 13));
                PlaySound playSound = new PlaySound("interfacesound.system_close_01");
                activeChar.sendPacket(playSound);
                  }
        }
        else{
          activeChar.sendMessage("Incorrect Door.");
        }
        break;
    case 8274: //Chapelkey, Capel Door has a Gatekeeper?? I use this key for Altar Entrance
      if (door.getDoorName().startsWith("Altar_Entrance")){
              if (openChance > 0 && Rnd.get(100) < openChance) {
                activeChar.sendMessage("You opened Altar Entrance.");
                door.openMe();
                door.onOpen();
                activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), 3));
              }
              else {
                activeChar.sendMessage("You failed to open Altar Entrance.");
                activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), 13));
            PlaySound playSound = new PlaySound("interfacesound.system_close_01");
            activeChar.sendPacket(playSound);
              }
            }
      else{
        activeChar.sendMessage("Incorrect Door.");
      }
      break;
    case 8275: //Key of Darkness
      if (door.getDoorName().startsWith("Door_of_Darkness")){
              if (openChance > 0 && Rnd.get(100) < openChance) {
                activeChar.sendMessage("You opened Door of Darkness.");
                door.openMe();
                door.onOpen();
                activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), 3));
              }
              else {
                activeChar.sendMessage("You failed to open Door of Darkness.");
                activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), 13));
            PlaySound playSound = new PlaySound("interfacesound.system_close_01");
            activeChar.sendPacket(playSound);
              }
            }
      else{
        activeChar.sendMessage("Incorrect Door.");
View Full Code Here

        player.sendPacket(packet);
  }

  private void playAdminSound(L2PcInstance activeChar, String sound)
  {
    PlaySound _snd = new PlaySound(1,sound,0,0,0,0,0);
    activeChar.sendPacket(_snd);
    activeChar.broadcastPacket(_snd);
    activeChar.sendMessage("Playing "+sound+".");
  }
View Full Code Here

            L2Event.participatingPlayers.clear();

            muestraNpcConInfoAPlayers(activeChar, L2Event.id);

            PlaySound _snd = new PlaySound(1,"B03_F",0,0,0,0,0);
            activeChar.sendPacket(_snd);
            activeChar.broadcastPacket(_snd);

            NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
View Full Code Here

        {
            state++;
            SystemMessage sm = new SystemMessage(SystemMessageId.MONSRACE_RACE_START);
            sm.addNumber(0);
            activeChar.sendPacket(sm);
            PlaySound SRace = new PlaySound(1, "S_Race", 0, 0, 0, 0, 0);
            activeChar.sendPacket(SRace);
            activeChar.broadcastPacket(SRace);
            PlaySound SRace2 = new PlaySound(0, "ItemSound2.race_start", 1, 121209259, 12125, 182487,
                                             -3559);
            activeChar.sendPacket(SRace2);
            activeChar.broadcastPacket(SRace2);
            MonRaceInfo spk = new MonRaceInfo(codes[state][0], codes[state][1], race.getMonsters(),
                                              race.getSpeeds());
View Full Code Here

   * Send a packet in order to play sound at client terminal
   * @param sound
   */
  public void playSound(String sound)
    {
    getPlayer().sendPacket(new PlaySound(sound));
  }
View Full Code Here

    {
        MonsterRace race = MonsterRace.getInstance();
        if (_state == STARTING_RACE)
        {
            //state++;
            PlaySound SRace = new PlaySound(1, "S_Race", 0, 0, 0, 0, 0);
            broadcast(SRace);
            PlaySound SRace2 = new PlaySound(0,"ItemSound2.race_start",1,121209259,12125,182487,-3559);
            broadcast(SRace2);
            _packet = new MonRaceInfo(_codes[1][0], _codes[1][1], race.getMonsters(), race.getSpeeds());
            sendMonsterInfo();

            ThreadPoolManager.getInstance().scheduleGeneral(new RunRace(), 5000);
View Full Code Here

      _playerA.broadcastUserInfo();
      _playerB.broadcastUserInfo();
    }

    // play sound
    PlaySound ps = new PlaySound(1, "B04_S01", 0, 0, 0, 0, 0);
    broadcastToTeam1(ps);
    broadcastToTeam2(ps);

    // start duelling task
    ThreadPoolManager.getInstance().scheduleGeneral(new ScheduleDuelTask(this), 1000);
View Full Code Here

TOP

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

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.