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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..