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...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock