Jump to content
  • 0

[Help] How to do unsummon item npc


Question

Posted

I created a item that summon NPC, but when I use item the NPC spawn until the next restart.

I need the NPC would be deleted in specific time.

A friend told me that use this script in core for delete NPC, but i dont know where must put and i think is incomplete:

 

//  Por Creado Ashitaka e Implementado por Eggo
  static class DespawnTask implements Runnable
  {
          L2Spawn spawnedNPC = null;
          public DespawnTask(L2Spawn spawn)
          {
              spawnedNPC = spawn;
          }

          public void run()
          {
              try
              {
                  spawnedNPC.getLastSpawn().decayMe();
              } catch (Throwable t){}
          }
  }
  //

 

and this:

 

ThreadPoolManager.getInstance().scheduleGeneral(new DespawnTask(spawn), 600000);

 

Someone can help me?

Thanks

 

Sorry for my english

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...