Package com.l2jfrozen.gameserver.templates

Examples of com.l2jfrozen.gameserver.templates.L2NpcTemplate


          if(Config.ENABLE_ALL_EXCEPTIONS)
            e.printStackTrace();
        }
      }

      L2NpcTemplate witchTemplate = NpcTable.getInstance().getTemplate(_witchSpawn._npcId);

      // Spawn the festival witch for this arena
      try
      {
        L2Spawn npcSpawn = new L2Spawn(witchTemplate);
View Full Code Here


        if(spawnType == 1 && isFestivalArcher(currSpawn._npcId))
        {
          continue;
        }

        L2NpcTemplate npcTemplate = NpcTable.getInstance().getTemplate(currSpawn._npcId);

        try
        {
          L2Spawn npcSpawn = new L2Spawn(npcTemplate);
View Full Code Here

    if(target == null)
      target = activeChar;
    if(target != activeChar && activeChar.getAccessLevel().isGm())
      target = activeChar;
   
    L2NpcTemplate template1;
    if(monsterId.matches("[0-9]*"))
    {
      //First parameter was an ID number
      int monsterTemplate = Integer.parseInt(monsterId);
      template1 = NpcTable.getInstance().getTemplate(monsterTemplate);
    }
    else
    {
      //First parameter wasn't just numbers so go by name not ID
      monsterId = monsterId.replace('_', ' ');
      template1 = NpcTable.getInstance().getTemplateByName(monsterId);
    }

    if(template1 == null){
      activeChar.sendMessage("Attention, wrong NPC ID/Name");
      return;
    }
   
    try
    {
      L2Spawn spawn = new L2Spawn(template1);
      if(Config.SAVE_GMSPAWN_ON_CUSTOM)
        spawn.setCustom(true);
      spawn.setLocx(target.getX());
      spawn.setLocy(target.getY());
      spawn.setLocz(target.getZ());
      spawn.setAmount(mobCount);
      spawn.setHeading(activeChar.getHeading());
      spawn.setRespawnDelay(respawnTime);
     
      if(RaidBossSpawnManager.getInstance().isDefined(spawn.getNpcid()) || GrandBossManager.getInstance().isDefined(spawn.getNpcid()))
      {
        activeChar.sendMessage("Another instance of " + template1.name + " already present into database:");
        activeChar.sendMessage("It will be spawned but not saved on Database");
        activeChar.sendMessage("After server restart or raid dead, the spawned npc will desappear");
        permanent=false;
        spawn.set_customBossInstance(true); //for raids, this value is used in order to segnalate to not save respawn time - status for custom instance

      }
      //else
      //{
        if(RaidBossSpawnManager.getInstance().getValidTemplate(spawn.getNpcid()) != null)
        {
          RaidBossSpawnManager.getInstance().addNewSpawn(spawn, 0, template1.getStatsSet().getDouble("baseHpMax"), template1.getStatsSet().getDouble("baseMpMax"), permanent);
        }
        else
        {
          SpawnTable.getInstance().addNewSpawn(spawn, permanent);
        }
View Full Code Here

         
          // advanced check too if not already cursed
          if (!to_be_cursed)
          {         
            int boss_id = -1;
            L2NpcTemplate boss_template = null;
            L2BossZone boss_zone = GrandBossManager.getInstance().getZone(this);
           
            if (boss_zone != null)
            {
              boss_id = boss_zone.getBossId();
            }
           
            // boolean alive = false;
           
            if (boss_id != -1)
            {         
              boss_template = NpcTable.getInstance().getTemplate(boss_id);
             
              if (boss_template != null && getLevel() > boss_template.getLevel() + 8)
              {           
                L2MonsterInstance boss_instance = null;
               
                if (boss_template.type.equals("L2RaidBoss"))
                {           
View Full Code Here

             
              // advanced check too if not already cursed
              if (!to_be_cursed)
              {
                int boss_id = -1;
                L2NpcTemplate boss_template = null;
                L2BossZone boss_zone = GrandBossManager.getInstance().getZone(this);
               
                if (boss_zone != null)
                {
                  boss_id = boss_zone.getBossId();
                }
               
                // boolean alive = false;
               
                if (boss_id != -1)
                {
                  boss_template = NpcTable.getInstance().getTemplate(boss_id);
                 
                  if (boss_template != null && getLevel() > boss_template.getLevel() + 8)
                  {
                    L2MonsterInstance boss_instance = null;
                   
                    if (boss_template.type.equals("L2RaidBoss"))
                    {
View Full Code Here

   * @param minionid The I2NpcTemplate Identifier of the Minion to spawn
   */
  public void spawnSingleMinion(int minionid)
  {
    // Get the template of the Minion to spawn
    L2NpcTemplate minionTemplate = NpcTable.getInstance().getTemplate(minionid);

    // Create and Init the Minion and generate its Identifier
    L2MinionInstance monster = new L2MinionInstance(IdFactory.getInstance().getNextId(), minionTemplate);

    // Set the Minion HP, MP and Heading
View Full Code Here

    if(!receiver_is_gm && _activeChar.getAppearance().getInvisible())
      return;
   
    if(_activeChar.getPoly().isMorphed())
    {
      L2NpcTemplate template = NpcTable.getInstance().getTemplate(_activeChar.getPoly().getPolyId());

      if(template != null)
      {
        writeC(0x16);
        writeD(_activeChar.getObjectId());
View Full Code Here

  @Override
  public void useItem(L2PlayableInstance playable, L2ItemInstance item)
  {
    L2PcInstance activeChar = (L2PcInstance) playable;
    L2NpcTemplate template1 = null;
    int itemId = item.getItemId();
    for(int i = 0; i < _itemIds.length; i++)
    {
      if(_itemIds[i] == itemId)
      {
View Full Code Here

        }
        break;
      }
      try
      {
        L2NpcTemplate template = NpcTable.getInstance().getTemplate(id + random);
        _constructor = Class.forName("com.l2jfrozen.gameserver.model.actor.instance." + template.type + "Instance").getConstructors()[0];
        int objectId = IdFactory.getInstance().getNextId();
        _monsters[i] = (L2NpcInstance) _constructor.newInstance(objectId, template);
      }
      catch(Exception e)
View Full Code Here

    return -1;
  }

  private void spawnMercenary(int npcId, int x, int y, int z, int despawnDelay, String[] messages, int chatDelay)
  {
    L2NpcTemplate template = NpcTable.getInstance().getTemplate(npcId);
    if(template != null)
    {
      final L2SiegeGuardInstance npc = new L2SiegeGuardInstance(IdFactory.getInstance().getNextId(), template);
      npc.setCurrentHpMp(npc.getMaxHp(), npc.getMaxMp());
      npc.setDecayed(false);
View Full Code Here

TOP

Related Classes of com.l2jfrozen.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.