Package l2p.gameserver.serverpackets

Examples of l2p.gameserver.serverpackets.SocialAction


      _action = actionId;
    }

    public void run()
    {
      SocialAction sa = new SocialAction(_npc.getObjectId(), _action);
      _npc.broadcastPacket(sa);
    }
View Full Code Here


    }

    public void run()
    {
      int npcId;
      SocialAction sa = null;
      if(_socialTask != null)
      {
        _socialTask.cancel(false);
        _socialTask = null;
      }
      switch(_taskId)
      {
        case 1: // spawn.
          if(_antharas != null)
          {
            return;
          }
          // Strength of Antharas is decided by the number of players that invaded the lair.
          if(_players.size() <= FWA_LIMITOFWEAK)
          {
            npcId = 29066; // weak
          }
          else if(_players.size() >= FWA_LIMITOFNORMAL)
          {
            npcId = 29068; // strong
          }
          else
          {
            npcId = 29067;
          } // normal
          Dying = false;
          // do spawn.
          _antharas = new L2BossInstance(IdFactory.getInstance().getNextId(), NpcTable.getTemplate(npcId));
          _antharas.setSpawnedLoc(_antharasLocation);
          _antharas.onSpawn();
          _antharas.spawnMe(_antharas.getSpawnedLoc());
          _antharas.setImobilised(true);
          _state.setRespawnDate(Rnd.get(FWA_FIXINTERVALOFANTHARAS, FWA_FIXINTERVALOFANTHARAS + FWA_RANDOMINTERVALOFANTHARAS));
          _state.setState(EpicBossState.State.ALIVE);
          _state.update();
          // setting 1st time of minions spawn task.
          int intervalOfBehemoth;
          int intervalOfBomber;
          // Interval of minions is decided by the number of players
          // that invaded the lair.
          if(_players.size() <= FWA_LIMITOFWEAK) // weak
          {
            intervalOfBehemoth = FWA_INTERVALOFBEHEMOTHONWEAK;
            intervalOfBomber = FWA_INTERVALOFBOMBERONWEAK;
          }
          else if(_players.size() >= FWA_LIMITOFNORMAL) // strong
          {
            intervalOfBehemoth = FWA_INTERVALOFBEHEMOTHONSTRONG;
            intervalOfBomber = FWA_INTERVALOFBOMBERONSTRONG;
          }
          else
          // normal
          {
            intervalOfBehemoth = FWA_INTERVALOFBEHEMOTHONNORMAL;
            intervalOfBomber = FWA_INTERVALOFBOMBERONNORMAL;
          }
          // spawn Behemoth.
          _behemothSpawnTask = ThreadPoolManager.getInstance().scheduleGeneral(new BehemothSpawn(intervalOfBehemoth), 30000);
          // spawn Bomber.
          _bomberSpawnTask = ThreadPoolManager.getInstance().scheduleGeneral(new BomberSpawn(intervalOfBomber), 30000);
          _socialTask = ThreadPoolManager.getInstance().scheduleGeneral(new AntharasSpawn(2), 16);
          break;
        case 2:
          // set camera.
          for(L2Player pc : _players)
          {
            if(pc.getDistance(_antharas) <= _distance)
            {
              pc.enterMovieMode();
              pc.specialCamera(_antharas, 700, 13, -19, 0, 10000);
            }
            else
            {
              pc.leaveMovieMode();
            }
          }
          _socialTask = ThreadPoolManager.getInstance().scheduleGeneral(new AntharasSpawn(3), 3000);
          break;
        case 3:
          // do social.
          sa = new SocialAction(_antharas.getObjectId(), 1);
          _antharas.broadcastPacket(sa);
          // set camera.
          for(L2Player pc : _players)
          {
            if(pc.getDistance(_antharas) <= _distance)
            {
              pc.enterMovieMode();
              pc.specialCamera(_antharas, 700, 13, 0, 6000, 10000);
            }
            else
            {
              pc.leaveMovieMode();
            }
          }
          _socialTask = ThreadPoolManager.getInstance().scheduleGeneral(new AntharasSpawn(4), 10000);
          break;
        case 4:
          // set camera.
          for(L2Player pc : _players)
          {
            if(pc.getDistance(_antharas) <= _distance)
            {
              pc.enterMovieMode();
              pc.specialCamera(_antharas, 3800, 0, -3, 0, 10000);
            }
            else
            {
              pc.leaveMovieMode();
            }
          }
          _socialTask = ThreadPoolManager.getInstance().scheduleGeneral(new AntharasSpawn(5), 200);
          break;
        case 5:
          // do social.
          sa = new SocialAction(_antharas.getObjectId(), 2);
          _antharas.broadcastPacket(sa);
          // set camera.
          for(L2Player pc : _players)
          {
            if(pc.getDistance(_antharas) <= _distance)
View Full Code Here

    }
    boolean needStatusUpdate = true;
    if(old_level < _level)
    {
      owner.sendMessage(new CustomMessage("l2p.gameserver.model.instances.L2PetInstance.PetLevelUp", owner).addNumber(_level));
      broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
      setCurrentHpMp(getMaxHp(), getMaxMp());
      needStatusUpdate = false;
    }
    if(needStatusUpdate && (addToExp > 0 || addToSp > 0))
    {
View Full Code Here

  @Override
  public void onRandomAnimation()
  {
    // Action id для живности 1-3
    broadcastPacket(new SocialAction(getObjectId(), Rnd.get(1, 3)));
  }
View Full Code Here

        {
          L2Spawn sp = new L2Spawn(NpcTable.getTemplate(Stakato_Cheif));
          Location pos = GeoEngine.findPointToStay(actor.getX(), actor.getY(), actor.getZ(), 0, 0, actor.getReflection().getGeoIndex());
          sp.setLoc(pos);
          L2NpcInstance npc = sp.doSpawn(true);
          actor.broadcastPacket(new SocialAction(actor.getObjectId(), 1));
          npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, caster, Rnd.get(1, 100));
          actor.doDie(caster);
        }
        catch(Exception e)
        {
          e.printStackTrace();
        }
      }
      else
      {
        actor.broadcastPacket(new SocialAction(actor.getObjectId(), 1));
        actor.doDie(caster);
      }
    }
  }
View Full Code Here

    Olympiad.addNoble(player);
    player.setNoble(true);
    player.updatePledgeClass();
    player.updateNobleSkills();
    player.sendPacket(new SkillList(player));
    player.broadcastPacket(new SocialAction(player.getObjectId(), SocialAction.VICTORY));
    player.broadcastUserInfo(true);
    player.sendMessage("Поздравляем, вы стали дворянином");
  }
View Full Code Here

        Hero.addSkills(player);
      }
      player.sendPacket(new SkillList(player));
      if(player.isHero())
      {
        player.broadcastPacket(new SocialAction(player.getObjectId(), 16));
        Announcements.getInstance().announceToAll(player.getName() + " has become a hero.");
      }
      player.sendMessage("Admin changed your hero status.");
      player.broadcastUserInfo(true);
    }
    else if(fullString.startsWith("admin_setnoble"))
    {
      // Статус сохраняется в базе
      L2Object target = activeChar.getTarget();
      L2Player player;
      if(wordList.length > 1 && wordList[1] != null)
      {
        player = L2ObjectsStorage.getPlayer(wordList[1]);
        if(player == null)
        {
          activeChar.sendMessage("Character " + wordList[1] + " not found in game.");
          return false;
        }
      }
      else if(target != null && target.isPlayer())
      {
        player = (L2Player) target;
      }
      else
      {
        activeChar.sendMessage("You must specify the name or target character.");
        return false;
      }
      if(player.isNoble())
      {
        Olympiad.removeNoble(player);
        player.setNoble(false);
        player.sendMessage("Admin changed your noble status, now you are not nobless.");
      }
      else
      {
        Olympiad.addNoble(player);
        player.setNoble(true);
        player.broadcastPacket(new SocialAction(player.getObjectId(), SocialAction.VICTORY));
        player.sendMessage("Admin changed your noble status, now you nobless.");
      }
      player.updatePledgeClass();
      player.updateNobleSkills();
      player.sendPacket(new SkillList(player));
View Full Code Here

      _action = actionId;
    }

    public void run()
    {
      _npc.broadcastPacket(new SocialAction(_npc.getObjectId(), _action));
    }
View Full Code Here

            return false;
          }
        }
        if(target == null || target == activeChar)
        {
          activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), val));
        }
        else if(target.isCharacter())
        {
          ((L2Character) target).broadcastPacket(new SocialAction(target.getObjectId(), val));
        }
        break;
      case admin_abnormal:
        try
        {
View Full Code Here

    }

    // У NPC всегда 2

    public void onRandomAnimation() {
        broadcastPacket(new SocialAction(getObjectId(), 2));
        _lastSocialAction = System.currentTimeMillis();
    }
View Full Code Here

TOP

Related Classes of l2p.gameserver.serverpackets.SocialAction

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.