Jump to content
  • 0

Help Unsummon a NPC


alassyr

Question

Recommended Posts

  • 0

as i told check the exist one.... from the dwarf (maestro) "Summon Merchant Golem"

 

<skill id="831" levels="1" name="Summon Merchant Golem">
	<set name="itemConsumeId" val="1458" />
	<set name="itemConsumeCount" val="5" />
	<set name="mpConsume" val="122" />
	<set name="target" val="TARGET_SELF" />
	<set name="hitTime" val="15000" />
	<set name="reuseDelay" val="75000" />
	<set name="skillType" val="SUMMON" />
	<set name="operateType" val="OP_ACTIVE" />
	<!-- Summon-specific -->
	<set name="summonTotalLifeTime" val="180000" />
	<set name="summonTimeLostIdle" val="1000" />
	<set name="summonTimeLostActive" val="1000" />
	<set name="npcId" val="13128" />
</skill>

 

NPC: \gameserver\data\html\merchant\13128

 

 

u can also use this npc/skill for all classes just add them to all auto learn and edit the html as u want...

 

or u check this codes and learn how its working and do your own one... HF

Link to comment
Share on other sites

  • 0

as i told check the exist one.... from the dwarf (maestro) "Summon Merchant Golem"

 

<skill id="831" levels="1" name="Summon Merchant Golem">
	<set name="itemConsumeId" val="1458" />
	<set name="itemConsumeCount" val="5" />
	<set name="mpConsume" val="122" />
	<set name="target" val="TARGET_SELF" />
	<set name="hitTime" val="15000" />
	<set name="reuseDelay" val="75000" />
	<set name="skillType" val="SUMMON" />
	<set name="operateType" val="OP_ACTIVE" />
	<!-- Summon-specific -->
	<set name="summonTotalLifeTime" val="180000" />
	<set name="summonTimeLostIdle" val="1000" />
	<set name="summonTimeLostActive" val="1000" />
	<set name="npcId" val="13128" />
</skill>

 

NPC: \gameserver\data\html\merchant\13128

 

 

u can also use this npc/skill for all classes just add them to all auto learn and edit the html as u want...

 

or u check this codes and learn how its working and do your own one... HF

 

thank you i think that what i need

 

I will test it soon

 

Best Regards

Link to comment
Share on other sites

  • 0

Skynet all thank to your help  I test this way but I cant show any htm which i need when summon NPC (when press on it show me a pet menu)

How i change it to show Htm file and how make it in Constant location without follow a player 

Link to comment
Share on other sites

  • 0

well i just try to give u some hints i never tested anything with it so i dunno...

but since its and "npc/summoner" its should have anywhere stats about run spd etc...

 

maybe u should try to contact B1ggBoss so he can explain you his way which he gave u here...

Link to comment
Share on other sites

  • 0

then you may schedule it in the SummonItems class (itemhandlers)

 

Thank you so much

I make as you said and add it inside case like bellow code

 

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());
		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());

		ThreadPoolManager.getInstance().scheduleGeneral(new UnSpawn(yourNpc), 90000);
		break;

The above code is same as Static Summons (like christmas tree) But with your cade Make me add custom Temp summon that Unspawn after 90 seconds

 

When I add

ThreadPoolManager.getInstance().scheduleGeneral(new UnSpawn(yourNpc), 90000);

yourNpc is deference than other type of summon = L2Spawn that make class Unspwan you give me deference Can you give me new class make my above code work perfect

 

Best regards

 

Link to comment
Share on other sites

  • 0

I relay use this method on the unspwan class

 

package com.l2jfree.gameserver.handler.itemhandlers;

import com.l2jfree.gameserver.datatables.SpawnTable;
import com.l2jfree.gameserver.model.actor.L2Npc;

public class UnSpawn implements Runnable {

private final L2Npc npc;

public UnSpawn(final L2Npc npc)
{
	this.npc = npc;
}

@Override
public void run()
{
	if(npc != null)
	{
		SpawnTable.getInstance().deleteSpawn(npc.getSpawn(), false);
		npc.deleteMe();
	}
}

}


But the problem On l2jfree  The method getLastSpawn() is undefined for the type L2Npc

and there are efferent between he constructor UnSpawn(L2Spawn) and constructor UnSpawn(L2NPC) each of them in efferent way any other solution to use it PLz

 

Link to comment
Share on other sites

  • 0

i said to use the method getLastSpawn() for TempSpawn (L2Spawn).

L2Npc myNpc = TempSpawn.getLastSpawn();
ThreadPoolManager.getInstance().scheduleGeneral(new UnSpawn(myNpc), 600000);

Link to comment
Share on other sites

  • 0

thank you so mach abit help from you to finish that :)

 

Ok we change type  of myNpc from L2Spawn to the L2Npc to use getLastSpawn() Method

that good no error in the SummonItems

 

But :(

 

in the Unspawn Class there are error in the

 



		SpawnTable.getInstance().deleteSpawn(npc, false);
		npc.deleteMe();

 

The method deleteSpawn(L2Spawn, boolean) in the type SpawnTable is not applicable for the arguments (L2Npc, boolean)

 

I apologize for the inconvenience  ;)

 

Link to comment
Share on other sites

  • 0

Try this:

Index: src/main/java/com/l2jfree/gameserver/handler/itemhandlers/SummonItems.java
===================================================================
--- src/main/java/com/l2jfree/gameserver/handler/itemhandlers/SummonItems.java	(revision 8804)
+++ src/main/java/com/l2jfree/gameserver/handler/itemhandlers/SummonItems.java	(working copy)
@@ -18,6 +18,7 @@
import com.l2jfree.gameserver.ThreadPoolManager;
import com.l2jfree.gameserver.datatables.NpcTable;
import com.l2jfree.gameserver.datatables.SummonItemsData;
+import com.l2jfree.gameserver.datatables.SpawnTable;
import com.l2jfree.gameserver.handler.IItemHandler;
import com.l2jfree.gameserver.idfactory.IdFactory;
import com.l2jfree.gameserver.instancemanager.ClanHallManager;
@@ -134,6 +135,8 @@
			spawn.setLocx(activeChar.getX());
			spawn.setLocy(activeChar.getY());
			spawn.setLocz(activeChar.getZ());
+			UnSpawn unSpawn = new UnSpawn(spawn);
+			ThreadPoolManager.getInstance().scheduleGeneral(unSpawn, 600000);
			L2World.getInstance().storeObject(spawn.spawnOne(true));
			activeChar.destroyItem("Summon", item.getObjectId(), 1, null, false);
			activeChar.sendMessage("Created " + npcTemplate.getName() + " at x: " + spawn.getLocx() + " y: " + spawn.getLocy() + " z: " + spawn.getLocz());
@@ -285,6 +288,23 @@
			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();
+		}
+	}

	@Override
	public int[] getItemIds()

Link to comment
Share on other sites

  • 0

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

 

 

Link to comment
Share on other sites

  • 0

[move] :D yes :D [/move]

 

It's work perfect thank you to help me

 

code is very good that give anyone add a custom summon in specific time

 

All thank to B1ggBoss   ;) and Skynet  ;)

 

Best regards to you my friends

 

 

 

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.



  • Posts

    • Hello everyone,   We're shifting our focus away from implementing as much as possible from the Essence gameplay. Instead, the server will now be Interlude, but using the Essence client.   This should be good news for everyone.   The Beta phase will most likely take place in November, with the grand opening to follow shortly after.   Cheers!
    • We remind you that the opening will take place today, on September 28 at: 19:00 (UTC+3) - server time Check current server time(UTC +3) On 17:00 (UTC +3) We allow you login to create character! Dear friends, this topic important! So please take time to read it. First we want to thank all players who took part in the Open Beta testing, was good activity and nice Olympiad Event yesterday, we all get a lot of fun  Thanks to all who conducted tests with us and prepared this game world! You are amazing!  On 17:00 (UTC +3) We allow you to login for create character! To restrict your name and transfer ToDs/Season Pack to your character. Make it before start! On start, we can have problems with WEB! Everything you need to start on the server: It is IMPORTANT to prepare everything for starting the game RIGHT NOW, do not postpone for later, during the opening there may be problems with the web part of the project, and you simply can not register. - Registration and files Download archive unzip it, run launcher, choose SEASON x25 server and press FULL CHECK What you need to know at the start: Registration for 7 seals from Monday, September 30, full cycle 1 week. First Mammons on Friday October 4 All Epic Raid Bosses dead on start. First epic QA will appear on Monday, next day Core + Zaken + QA and so on by schedule All other RBs alive on server start (including Sub and Nobl RB) - Full RoadMap   About possible attacks on server start. We have prepared as good as we can. We will control the start of the server together with you. Want to ask you, in the case of a problem, don't panic, panic is the worst possible thing that could be, even worse than any attack. We have enough specialists to solve any problems, all that will need from you is patience and trust. Wish you all a smooth start and months of enjoyable play in new Season Interlude x25! Have a fun!
    • 🚨🇦🇷🇧🇷🇪🇸🇸🇰🇺🇳🇨🇱🚨 Devianne - Lineage 2 Interlude  Client - Classic. 🔷Rates 🔸Experience (EXP) - 10x 🔸Skill Points (SP) - 10x 🔸Adena - 6x 🔸Drop Items - 3x 🔸Spoil - 3x 🔸Quest Experience (EXP) - 1x 🔸Quest Skill Points (SP) - 1x 🔸Quest Adena - 1x 🔸Quest Items Drop - 1x 🔸Seal stone Drop - 1x 🔸Epic raid - 1x 🔸Raid Drop - 2.0x 🔸Manor - 5x 🔷Dynamic Rates XP/SP 🔸Lv. 1-52 EXP/SP X10 (x7 without VIP or vote reward) 🔸Lv. 52-61 EXP/SP X7(x5 without VIP or vote reward) 🔸Lv. 61-76 EXP-SP X5 (x3 without VIP or vote reward) 🔸Lv. 76-78 EXP/SP X3 (x2 without VIP or vote reward) 🔸Lv. 78-80 EXP/SP X2 (x1 without VIP or vote reward) ⚠️Extra Settings⚠️ 🔸Server time, site - GMT -3 🔸Buffs, Dances, and Songs duration - 1 hour 🔸Max Buffs Slots - 22 + 4 divine 🔸Maximum Slots Dances and Songs - 12 🔸GmShop Grade - C 🔸Global teleport 🔸Grade B-A-S - Craft 🔸Mana potion recharge 🔸1000 (9 seconds delay) 🔸Raid HP - x1.4 🔸Raid epic HP - x1 🔸Blacksmith Mammon - 24/7 🔸Champions System - Yes chance respawn 0.5% 🔸Offline mode Shop - Yes 🔸Auto Learn Skills - Yes 🔸Auto Learn Loot - Yes 🔸Auto Learn Raid & Grand 🔸Boss Loot - No 🔸Buffer offline - Yes 🔸Wedding System - Yes 🔸Max level diff distribution drop in party - 14 🔸Limit the number of active gaming clients on one PC - 2 🔸Limit the number of active gaming clients on one PC for Premium - 3 🔸The clan leader will be replaced after server restart ⚠️Class and Subclass Change⚠️ 🔸1st profession Quest - No 🔸2nd profession Quest - No 🔸3rd profession Quest - Yes 🔸Sub Class Quest- Yes 🔸Sub Class Raid - 8 hours +-30m random 🔸Nobility and Olympiads Nobility Quest - Yes 🔸Olympiads (duration) - 14 days 🔸Max enchant - +6 🔸Respawn Barakiel 6 hours - +-15 min random 🔸Olympiad schedule - 13:00 to 00:00 🔸Minimum players to start olympiad - 11 Clans and Sieges Penalty duration - 8 hours 🔸Sieges every - 15 days Max Ally - 2 🔸Max Members - 36 🔸Slots for academies in clan - 40 ⚠️Enchants Rate⚠️ 🔸Blessed Scroll chance 60% 1-10 11-16 40% 🔸Crystal Scroll chance 65% 1-10 11-16 40% 🔸Normal Scroll chance - 55% 🔸Safe Enchant - +4 ⚠️Premium Info⚠️ 🔅+20% xp sp drop spoil adena 🔅+5% additional enchant rate (premium 30 days)   Free autofarm ⚠️Starter Pack⚠️ 🔅Free Premium - 24 hours 🔅Free Autofarm - 24 hours ❇️Raid boss Info❇️ 🔸Anakim/Lilith respawn 18 hours +1:30min random 🔸Tyrannosaurus - respawn 8 min drop Tl 76 🔸Queen Ant (LVL 80) - Respawn Monday and Saturday 22:00 🔸CORE (LVL 80) - Respawn Tuesday-Friday 20:00 🔸ORFEN (LVL 80) - Respawn Tuesday-Friday 21:00 🔸BAIUM (LVL 80) - Respawn Saturday 21:00 🔸ZAKEN (LVL 80) - Respawn Wednesday-Thursday 22:00 🔸FRINTEZZA (LVL 85) - Sunday 19:45 ⚔️Quest Details⚔️ QUEST WEAPON RECIPES: - Relics of the Old Empire x1: - Gather the Flames x1 x1: QUEST ARMOR RECIPES: - Alliance with Varka Silenos x1 - Alliance with Ketra Orcs x1 - War with Ketra x1 - War with Varka x1 - Gather the Exploration of the Giants’ Cave Part 1 x3 - Exploration of the Giants’ Cave Part 2 x1 - Whispers of Dream part 2 x2 - Legacy of Insolence x1 QUEST RECIPES JEWERLY - The Finest Food x1 QUEST RESOURCES - The Zero Hour x2 - Golden Ram Mercenary x2 - An Ice Merchant dream x2 QUEST FOR FABRIC: - Whispers of Dream part 1 x1 BEAST FARM : - Delicious Top Choice Meat x2 👁️OTHER QUEST👁️ 👁️- Yoke of the Past x2 👁️- In Search of Fragments of Dimension x2 👁️- The finest Ingredients x3 👁️- Supplier of reagents x3 - 👁️3rd class Halisha Marks drop x3 - 👁️Into the flames x3 - 👁️Audience with the land dragon x3 - 👁️An Arrogant Search x3 - 👁️Last Imperial Prince x3 🚨Soul Crystal Details🚨 🔸- Level up crystals to 11, 12, 13 🔸- All epics can level up crystals for the whole party (Queen Ant, Core, Orfen, Zaken, Baium, Antharas, Valakas, Frintezza). - 🔸Bosses in PVP zone: Master Anays, High Priest Van Halter. 👁️🔸- Anakim/Lilith, Uruka. - You can level up crystals in Rift, but only 1 party can challenge Anakazel (10%)PARTY_RANDOM at the same time (if one party is in the boss, you need wait them to go out). 👁️🔸- You can level up crystals in Primeval Island by killing tyrannosaurus with 10% chance PARTY_ALL for the person who cast the crystal and makes last hit. ⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️ WEB: https://devianne-l2.com/ DISCORD: https://discord.gg/Q3HAMzasUk 🔥🔥SERVER TEST OPEN !!🔥🔥🔥
    • I am here for the plank jumps and the cookies any news about that?
  • Topics

×
×
  • Create New...