Hello amazing code i change some of it
New patch is
#P l2jfree-core
Index: src/main/java/com/l2jfree/gameserver/handler/itemhandlers/SummonItems.java
===================================================================
--- src/main/java/com/l2jfree/gameserver/handler/itemhandlers/SummonItems.java (revision 8802)
+++ src/main/java/com/l2jfree/gameserver/handler/itemhandlers/SummonItems.java (working copy)
@@ -19,6 +19,7 @@
import com.l2jfree.gameserver.datatables.NpcTable;
import com.l2jfree.gameserver.datatables.SummonItemsData;
import com.l2jfree.gameserver.handler.IItemHandler;
+import com.l2jfree.gameserver.datatables.SpawnTable;
import com.l2jfree.gameserver.idfactory.IdFactory;
import com.l2jfree.gameserver.instancemanager.ClanHallManager;
import com.l2jfree.gameserver.model.L2ItemInstance;
@@ -153,6 +154,23 @@
case 4: // Light Purple Maned Horse
activeChar.mount(sitem.getNpcId(), item.getObjectId(), false);
break;
+ case 5: // Static Temp Summons (like christmas tree)
+ final L2Spawn TempSpwan = new L2Spawn(npcTemplate);
+
+ TempSpwan.setId(IdFactory.getInstance().getNextId());
+ TempSpwan.setLocx(activeChar.getX());
+ TempSpwan.setLocy(activeChar.getY());
+ TempSpwan.setLocz(activeChar.getZ());
+ UnSummon unSpawn = new UnSummon(TempSpwan);
+ ThreadPoolManager.getInstance().scheduleGeneral(unSpawn, 900000);
+ L2World.getInstance().storeObject(TempSpwan.spawnOne(true));
+ activeChar.destroyItem("Summon", item.getObjectId(), 1, null, false);
+ activeChar.sendMessage("Created " + npcTemplate.getName() + " at x: " + TempSpwan.getLocx() + " y: " + TempSpwan.getLocy() + " z: " + TempSpwan.getLocz());
+ //L2Spawn yourNpc = TempSpwan;
+ //L2Npc myNpc = TempSpwan.getLastSpawn();
+ //ThreadPoolManager.getInstance().scheduleGeneral(new UnSpawn(TempSpwan), 90000);
+ //ThreadPoolManager.getInstance().scheduleGeneral(new UnSpawn(myNpc), 90000);
+ break;
}
}
@@ -282,7 +300,22 @@
petSummon.broadcastStatusUpdate();
}
}
-
+private class UnSummon implements Runnable
+{
+ private L2Spawn spawn;
+
+ private UnSummon(L2Spawn spawn)
+ {
+ this.spawn = spawn;
+ }
+
+ @Override
+ public void run()
+ {
+ SpawnTable.getInstance().deleteSpawn(spawn, false);
+ spawn.getLastSpawn().deleteMe();
+ }
+ }
public int[] getItemIds()
{
return SummonItemsData.getInstance().itemIDs();
I will test it after compile to see result soon