Package l2p.gameserver.templates

Examples of l2p.gameserver.templates.L2NpcTemplate


  }

  public L2Spawn(int npcId) throws ClassNotFoundException
  {
    _npcId = npcId;
    L2NpcTemplate mobTemplate = NpcTable.getTemplate(npcId);
    if(mobTemplate == null || mobTemplate.getInstanceConstructor() == null)
    {
      throw new ClassNotFoundException("Unable to instantiate npc " + npcId);
    }
    _spawned = new GArray<L2NpcInstance>(1);
  }
View Full Code Here


  public L2NpcInstance doSpawn(boolean spawn)
  {
    try
    {
      L2NpcTemplate template = NpcTable.getTemplate(_npcId);
      // Check if the L2Spawn is not a L2Pet or L2Minion spawn
      if(template.isInstanceOf(L2PetInstance.class) || template.isInstanceOf(L2MinionInstance.class))
      {
        _currentCount++;
        return null;
      }
      // Get L2NpcInstance Init parameters and its generate an Identifier
      // Call the constructor of the L2NpcInstance
      // (can be a L2ArtefactInstance, L2FriendlyMobInstance, L2GuardInstance, L2MonsterInstance, L2SiegeGuardInstance, L2BoxInstance or L2NpcInstance)
      Object tmp = template.getNewInstance();
      // Check if the Instance is a L2NpcInstance
      if(!(tmp instanceof L2NpcInstance))
      {
        return null;
      }
View Full Code Here

      Integer roomId;
      int mobId, doorId, respawn, respawnRnd, count;
      // 0 - точечный, в каждой указанной точке; 1 - один точечный спаун в рандомной точке; 2 - локационный
      int spawnType;
      L2Spawn spawnDat;
      L2NpcTemplate template;
      L2DoorInstance door;
      InstancedZone instancedZone;
      for(Node iz = doc.getFirstChild(); iz != null; iz = iz.getNextSibling())
      {
        if("list".equalsIgnoreCase(iz.getNodeName()))
View Full Code Here

      {
        statement.setInt(2, 0);
      }
      rset = statement.executeQuery();
      L2Spawn spawn1;
      L2NpcTemplate template;
      while(rset.next())
      {
        template = NpcTable.getTemplate(rset.getInt("npcId"));
        if(template == null)
        {
View Full Code Here

      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT * FROM spawnlist ORDER by npc_templateid");
      //TODO возможно в будущем понадобится условие: WHERE npc_templateid NOT IN (SELECT bossId FROM epic_boss_spawn)
      rset = statement.executeQuery();
      L2Spawn spawnDat;
      L2NpcTemplate template1;
      while(rset.next())
      {
        template1 = NpcTable.getTemplate(rset.getInt("npc_templateid"));
        if(template1 != null)
        {
          if(template1.isInstanceOf(L2SiegeGuardInstance.class))
          {
            // Don't spawn Siege Guard
          }
          else if(Config.ALLOW_CLASS_MASTERS_LIST.isEmpty() && template1.name.equalsIgnoreCase("L2ClassMaster"))
          {
            // Dont' spawn class masters
          }
          else
          {
            spawnDat = new L2Spawn(template1);
            spawnDat.setAmount(rset.getInt("count") * (Config.ALT_DOUBLE_SPAWN && !template1.isRaid ? 2 : 1));
            spawnDat.setLocx(rset.getInt("locx"));
            spawnDat.setLocy(rset.getInt("locy"));
            spawnDat.setLocz(rset.getInt("locz"));
            spawnDat.setHeading(rset.getInt("heading"));
            spawnDat.setRespawnDelay(rset.getInt("respawn_delay"), rset.getInt("respawn_delay_rnd"));
            spawnDat.setLocation(rset.getInt("loc_id"));
            spawnDat.setReflection(rset.getLong("reflection"));
            spawnDat.setRespawnTime(0);
            if(template1.isInstanceOf(L2MonsterInstance.class))
            {
              if(template1.name.contains("Lilim") || template1.name.contains("Lith"))
              {
                CatacombSpawnManager.getInstance().addDawnMob(spawnDat);
              }
              else if(template1.name.contains("Nephilim") || template1.name.contains("Gigant"))
              {
                CatacombSpawnManager.getInstance().addDuskMob(spawnDat);
              }
              if(CatacombSpawnManager._monsters.contains(template1.getNpcId()))
              {
                spawnDat.setRespawnDelay(Math.round(rset.getInt("respawn_delay") * Config.ALT_CATACOMB_RESPAWN), Math.round(rset.getInt("respawn_delay_rnd") * Config.ALT_CATACOMB_RESPAWN));
              }
            }
            if(template1.isRaid)
 
View Full Code Here

    player.broadcastUserInfo(true);
  }

  public void onLoad()
  {
    L2NpcTemplate t = NpcTable.getTemplate(31860);
    t.title = "Service Manager";
  }
View Full Code Here

    t.title = "Service Manager";
  }

  public void onReload()
  {
    L2NpcTemplate t = NpcTable.getTemplate(31860);
    t.title = "Service Manager";
  }
View Full Code Here

    broadcastPacketToOthers(new PlaySound(1, "BS01_A", 1, 0, getLoc()));
  }

  private L2NpcInstance SpawnNPC(int npcId, Location loc)
  {
    L2NpcTemplate template = NpcTable.getTemplate(npcId);
    if(template == null)
    {
      System.out.println("WARNING! template is null for npc: " + npcId);
      Thread.dumpStack();
      return null;
View Full Code Here

    int npcId = PetDataTable.getSummonId(item);
    if (npcId == 0)
    {
      return false;
    }
    L2NpcTemplate template = NpcTable.getTemplate(npcId);
    if (template == null)
    {
      return false;
    }
    if (player.isInTransaction() || player.isInFlyingTransform())
View Full Code Here

      {
        if (!check(_player, _item))
          return;
       
        int npcId = PetDataTable.getSummonId(_item);
        L2NpcTemplate petTemplate = NpcTable.getTemplate(npcId);
        L2PetInstance pet = L2PetInstance.spawnPet(petTemplate, _player, _item);
        if (pet == null)
          return;
       
        _player.setPet(pet);
View Full Code Here

TOP

Related Classes of l2p.gameserver.templates.L2NpcTemplate

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.