Package l2p.gameserver.model

Examples of l2p.gameserver.model.L2Spawn


    {
      return;
    }
    try
    {
      L2Spawn spawn = new L2Spawn(template);
      spawn.setLoc(activeChar.getLoc());
      L2NpcInstance npc = spawn.doSpawn(false);
      npc.setTitle(activeChar.getName()); //FIXME Почему-то не устанавливается
      spawn.respawnNpc(npc);
      // АИ вещающее бафф регена устанавливается только для большой елки
      if(itemId == 5561)
      {
        npc.setAI(new ctreeAI(npc));
        npc.getAI().startAITask();
View Full Code Here


    {
      target = activeChar;
    }
    try
    {
      L2Spawn spawn = new L2Spawn(template);
      spawn.setLoc(GeoEngine.findPointToStay(activeChar.getX(), activeChar.getY(), activeChar.getZ(), 30, 70, activeChar.getReflection().getGeoIndex()));
      L2NpcInstance npc = spawn.doSpawn(true);
      npc.setAI(new SquashAI(npc));
      ((SquashInstance) npc).setSpawner(activeChar);
      ThreadPoolManager.getInstance().scheduleAi(new DeSpawnScheduleTimerTask(spawn), 180000, false);
      activeChar.getInventory().destroyItem(item.getObjectId(), 1, false);
    }
View Full Code Here

    }
    for(int[] location : locations)
    {
      try
      {
        L2Spawn sp = new L2Spawn(template);
        sp.setLoc(new Location(location));
        sp.setAmount(1);
        sp.setRespawnDelay(0);
        sp.init();
        if(list != null)
        {
          list.add(sp);
        }
      }
View Full Code Here

    }
    try
    {
      if(!(((L2MonsterInstance) actor).getChampion() > 0) && actor.getCurrentHpPercents() > 50 && Rnd.chance(5))
      {
        L2Spawn spawn = new L2Spawn(NpcTable.getTemplate(21522));
        spawn.setLoc(actor.getLoc());
        L2NpcInstance npc = spawn.doSpawn(true);
        npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, attacker, 100);
        actor.decayMe();
        actor.doDie(actor);
        return;
      }
View Full Code Here

    if(actor != null)
    {
      try
      {
        Location pos = GeoEngine.findPointToStay(actor.getX(), actor.getY(), actor.getZ(), 100, 120, actor.getReflection().getGeoIndex());
        L2Spawn sp = new L2Spawn(NpcTable.getTemplate(id));
        sp.setLoc(pos);
        spawns.add(sp.doSpawn(true));
      }
      catch(Exception e)
      {
        e.printStackTrace();
      }
View Full Code Here

      {
        return;
      }
      try
      {
        _spawn = new L2Spawn(template);
      }
      catch(Exception E)
      {
        return;
      }
View Full Code Here

    NamedNodeMap attr_spawn = spawn.getAttributes();
    int mob_id = Integer.parseInt(attr_spawn.getNamedItem("id").getNodeValue());
    String xyzh = attr_spawn.getNamedItem("xyzh").getNodeValue();
    int count = Integer.parseInt(attr_spawn.getNamedItem("count").getNodeValue());
    int respawn = Integer.parseInt(attr_spawn.getNamedItem("respawn").getNodeValue());
    L2Spawn spawnDat;
    L2NpcTemplate npc;
    npc = NpcTable.getTemplate(mob_id);
    if(npc != null)
    {
      try
      {
        spawnDat = new L2Spawn(npc);
        spawnDat.setAmount(count);
        if(xyzh.equalsIgnoreCase("any"))
        {
          spawnDat.setLocx(0);
          spawnDat.setLocy(0);
          spawnDat.setLocz(0);
          spawnDat.setHeading(0);
          spawnDat.setLocation(id);
        }
        else
        {
          StringTokenizer st = new StringTokenizer(xyzh, " ");
          spawnDat.setLocx(Integer.parseInt(st.nextToken()));
          spawnDat.setLocy(Integer.parseInt(st.nextToken()));
          spawnDat.setLocz(Integer.parseInt(st.nextToken()));
          spawnDat.setHeading(Integer.parseInt(st.nextToken()));
        }
        spawnDat.setRespawnDelay(respawn);
        if(respawn > 0)
        {
          spawnDat.startRespawn();
        }
        spawnDat.setReflection(0);
        if(npc.isRaid)
        {
          RaidBossSpawnManager.getInstance().addNewSpawn(spawnDat);
        }
        spawnDat.init();
        SpawnTable.getInstance()._spawntable.add(spawnDat);
      }
      catch(Exception e)
      {
        e.printStackTrace();
View Full Code Here

              }
            }
          }
          for(L2NpcInstance work : works)
          {
            L2Spawn spawn = work.getSpawn();
            if(spawn == null)
            {
              continue;
            }
            spawn.decreaseScheduledCount();
            if(spawn.isDoRespawn())
            {
              spawn.respawnNpc(work);
            }
          }
        }
        catch(Exception e)
        {
View Full Code Here

        for(int i = 0; i < MOBS1_COUNT; i++)
        {
          try
          {
            Location pos = GeoEngine.findPointToStay(actor.getX(), actor.getY(), actor.getZ(), 100, 120, actor.getReflection().getGeoIndex());
            L2Spawn sp = new L2Spawn(NpcTable.getTemplate(MOB1));
            sp.setLoc(pos);
            L2NpcInstance npc = sp.doSpawn(true);
            npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, killer, Rnd.get(1, 100));
          }
          catch(Exception e)
          {
            e.printStackTrace();
          }
        }
      }
      else
      {
        for(int i = 0; i < MOBS_COUNT; i++)
        {
          try
          {
            Location pos = GeoEngine.findPointToStay(actor.getX(), actor.getY(), actor.getZ(), 100, 120, actor.getReflection().getGeoIndex());
            L2Spawn sp = new L2Spawn(NpcTable.getTemplate(MOB));
            sp.setLoc(pos);
            L2NpcInstance npc = sp.doSpawn(true);
            npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, killer, Rnd.get(1, 100));
          }
          catch(Exception e)
          {
            e.printStackTrace();
View Full Code Here

      for(int i = 0; i < MOBS_COUNT; i++)
      {
        try
        {
          Location pos = GeoEngine.findPointToStay(actor.getX(), actor.getY(), actor.getZ(), 100, 120, actor.getReflection().getGeoIndex());
          L2Spawn sp = new L2Spawn(NpcTable.getTemplate(MOBS));
          sp.setLoc(pos);
          L2NpcInstance npc = sp.doSpawn(true);
          if(caster.isPet() || caster.isSummon())
          {
            npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, caster, Rnd.get(2, 100));
          }
          npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, caster.getPlayer(), Rnd.get(1, 100));
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.L2Spawn

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.