Package com.l2jfrozen.gameserver.model.actor.instance

Examples of com.l2jfrozen.gameserver.model.actor.instance.L2NpcInstance


  {
    L2Object obj = activeChar.getTarget();

    if(obj != null && obj instanceof L2NpcInstance)
    {
      L2NpcInstance target = (L2NpcInstance) obj;
      target.deleteMe();

      L2Spawn spawn = target.getSpawn();
      if(spawn != null)
      {
        spawn.stopRespawn();

        if(RaidBossSpawnManager.getInstance().isDefined(spawn.getNpcid()) && !spawn.is_customBossInstance())
        {
          RaidBossSpawnManager.getInstance().deleteSpawn(spawn, true);
         
        }else
        {
          boolean update_db = true;
          if(GrandBossManager.getInstance().isDefined(spawn.getNpcid()) && spawn.is_customBossInstance()) //if custom grandboss instance, it's not saved on database
            update_db = false;
         
          SpawnTable.getInstance().deleteSpawn(spawn, update_db);
        }
      }

      spawn = null;
      obj = null;

      SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
      sm.addString("Deleted " + target.getName() + " from " + target.getObjectId() + ".");
      activeChar.sendPacket(sm);
      sm = null;
    }
    else
    {
View Full Code Here


   * @param despawnDelay
   * @return
   */
  public L2NpcInstance addSpawn(int npcId, int x, int y, int z, int heading, boolean randomOffset, int despawnDelay)
  {
    L2NpcInstance result = null;

    try
    {
      L2NpcTemplate template = NpcTable.getInstance().getTemplate(npcId);

View Full Code Here

    return name;
  }

  void destroyEventNpcs()
  {
    L2NpcInstance npc;
    while(L2Event.npcs.size() > 0)
    {
      try
      {
        npc = (L2NpcInstance) L2World.getInstance().findObject(Integer.parseInt(L2Event.npcs.getFirst()));
        L2Spawn spawn = npc.getSpawn();

        if(spawn != null)
        {
          spawn.stopRespawn();
          SpawnTable.getInstance().deleteSpawn(spawn, true);
        }

        npc.deleteMe();
        L2Event.npcs.removeFirst();

        npc = null;
        spawn = null;
      }
View Full Code Here

    }

    Announce("Siege registration of Devastated castle has begun!");
    Announce("Now its open for 2 hours!");

    L2NpcInstance result = null;
    try
    {
      L2NpcTemplate template = NpcTable.getInstance().getTemplate(MESSENGER_ID);

      L2Spawn spawn = new L2Spawn(template);
View Full Code Here

    }
  }

  public void Siege()
  {
    L2NpcInstance result = null;
    L2NpcTemplate template = null;
    L2Spawn spawn = null;

    ClanHall CH = ClanHallManager.getInstance().getClanHallById(34);
    CH.banishForeigners();
View Full Code Here

  {
    L2Object obj = activeChar.getTarget();

    if(obj != null && obj instanceof L2NpcInstance)
    {
      L2NpcInstance target = (L2NpcInstance) obj;

      int monsterTemplate = target.getTemplate().npcId;

      L2NpcTemplate template1 = NpcTable.getInstance().getTemplate(monsterTemplate);

      if(template1 == null)
      {
        activeChar.sendMessage("Incorrect monster template.");
        _log.warning("ERROR: NPC " + target.getObjectId() + " has a 'null' template.");
        return;
      }

      L2Spawn spawn = target.getSpawn();

      if(spawn == null)
      {
        activeChar.sendMessage("Incorrect monster spawn.");
        _log.warning("ERROR: NPC " + target.getObjectId() + " has a 'null' spawn.");
        return;
      }

      int respawnTime = spawn.getRespawnDelay()/1000;
      boolean custom_boss_spawn = spawn.is_customBossInstance();
       
      target.deleteMe();
      spawn.stopRespawn();
     
      //check to avoid that recalling a custom raid it will be saved into database
      SpawnTable.getInstance().deleteSpawn(spawn, !custom_boss_spawn);

      try
      {
        //L2MonsterInstance mob = new L2MonsterInstance(monsterTemplate, template1);

        spawn = new L2Spawn(template1);
        spawn.setLocx(activeChar.getX());
        spawn.setLocy(activeChar.getY());
        spawn.setLocz(activeChar.getZ());
        spawn.setAmount(1);
        spawn.setHeading(activeChar.getHeading());
        spawn.setRespawnDelay(respawnTime);
        SpawnTable.getInstance().addNewSpawn(spawn, !custom_boss_spawn);
        spawn.init();

        SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
        sm.addString("Created " + template1.name + " on " + target.getObjectId() + ".");
        activeChar.sendPacket(sm);
        sm = null;

        if(Config.DEBUG)
        {
          _log.fine("Spawn at X=" + spawn.getLocx() + " Y=" + spawn.getLocy() + " Z=" + spawn.getLocz());
          _log.warning("GM: " + activeChar.getName() + "(" + activeChar.getObjectId() + ") moved NPC " + target.getObjectId());
        }

        spawn = null;
        template1 = null;
        target = null;
View Full Code Here

    }

    Announce("Capture registration of Partisan Hideout has begun!");
    Announce("Now its open for 1 hours!");

    L2NpcInstance result = null;
    try
    {
      L2NpcTemplate template = NpcTable.getInstance().getTemplate(MESSENGER_ID);

      L2Spawn spawn = new L2Spawn(template);
View Full Code Here

    if(!_clansDamageInfo.isEmpty())
    {
      _clansDamageInfo.clear();
    }

    L2NpcInstance result = null;
    try
    {
      L2NpcTemplate template = NpcTable.getInstance().getTemplate(BOSS_ID);

      L2Spawn spawn = new L2Spawn(template);
View Full Code Here

TOP

Related Classes of com.l2jfrozen.gameserver.model.actor.instance.L2NpcInstance

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.