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

    • to my store : https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11 Telegram : https://t.me/ultrastore11 Whatsapp ; +212614849119
    • 2 Factor Authentication Code for 100% secure login. Account provided with full information (email, password, dob, gender, etc).
    • ready server for sale, also available for testing with ready and beautiful npc zone pvp with custom 2 epic core orfen lvl2 with all maps ready all quests work at 100% ready comm  board with buffer teleport gm shop service anyone interested send me a pm many more that I forget  Exp/Sp : x30 (Premium: x40)    Adena : x7 (Premium: x10)   Drop : x7 (Premium: 10)   Spoil : x7 (Premium: 10)   Seal Stones : x7 (Premium: 10)   Raid Boss EXP/SP : x10   Raid Boss Drop : x3 (Premium: x5)   Epic Boss Drop : x1 Enchants   Safe Enchant : +3   Max Enchant : +16   Normal Scroll of Enchant Chance : 55%   Blessed Scroll of Enchant Chance : 60% Game Features   GMShop (Max. B-Grade)   Mana Potions (1000 MP, 10 sec Cooldown)   NPC Buffer (Include all buffs, 2h duration)   Auto-learn skills (Except Divine Inspiration)   Global Gatekeeper   Skill Escape: 15 seconds or /unstuck   1st Class Transfer (Free)   2nd Class Transfer (Free)   3rd Class Transfer (700 halisha mark)   Subclass (Items required from Cabrio / Hallate / Kernon / Golkonda + Top B Weapon + 984 Cry B)   Subclass 5 Subclasses + Main (Previous subclasses to level 75 to add new one)   Noblesse (Full Retail Quest)   Buff Slots: 24 (28 with Divine Inspiration LVL 4)   Skill Sweeper Festival added (Scavenger level 36)   Skill Block Buff added   Maximum delevel to keep Skills: 10 Levels   Shift + Click to see Droplist   Global Shout & Trade Chat   Retail Geodata and Pathnodes   Seven Signs Retail   Merchant and Blacksmith of Mammon at towns   Dimensional Rift (Min. 3 people in party to enter - Instance)   Tyrannosaurus drop Top LS with fixed 50% chance   Fast Augmentation System (Using Life Stones from Inventory)   Chance of getting skills (Normal 1%, Mid 3%, High 5%, Top 10%)   Wedding System with 30 seconds teleport to husband/wife Olympiad & Siege   Olympiad circle 14 days. (Maximum Enchant +6)   Olympiads time 18:00 - 00:00 (GMT +3)   Non-class 5 minimum participants to begin   Class based disabled   Siege every week.   To gain the reward you need to keep the Castle 2 times. Clans, Alliances & Limits   Max Clients/PC: 2   Max Clan Members: 36   Alliances allowed (Max 1 Clans)   24H Clan Penalties   Alliance penalty reset at daily restart (3-5 AM)   To bid for a Clan Hall required Clan Level 6 Quests x3   Alliance with the Ketra Orcs   Alliance with the Varka Silenos   War with Ketra Orcs   War with the Varka Silenos   The Finest Food   A Powerful Primeval Creature   Legacy of Insolence   Exploration of Giants Cave Part 1   Exploration of Giants Cave Part 2   Seekers of the Holy Grail   Guardians of the Holy Grail   Hunt of the Golden Ram Mercenary Force   The Zero Hour   Delicious Top Choice Meat   Heart in Search of Power   Rise and Fall of the Elroki Tribe   Yoke of the Past     Renegade Boss (Monday to Friday 20:00)   All Raid Boss 18+1 hours random respawn   Core (Jewel +1 STR +1 DEX) Monday, Wednesday and Friday 20:00 - 21:00 (Maximum level allowed to enter Cruma Tower: 80)   Orfen (Jewel +1 INT +1 WIT) Monday to Friday, 20:00 - 21:00 (Maximum level allowed to enter Sea of Spores: 80)   Ant Queen Monday and Friday 21:00 - 22:00 (Maximum level allowed to enter Ant Nest: 80)   Zaken Monday,Wednesday,Friday 22:00 - 23:00 (Maximum level allowed to enter Devil's Isle: 80)   Frintezza Tuesday, Thursday and Sunday 22:00 – 23:00 (Need CC of 4 party and 7 people in each party min to join the lair, max is 8 party of 9 people each)   Baium (lvl80) Saturday 22:00 – 23:00   Antharas Every 2 Saturdays 22:00 - 23:00 Every 2 Sundays (alternating with Valakas) 22:00 – 23:00   Valakas Every 2 Saturdays 22:00 - 23:00 Every 2 Sundays (alternating with Antharas) 22:00 – 23:00   Subclass Raids (Cabrio, Kernon, Hallate, Golkonda) 18hours + 1 random   Noblesse Raid (Barakiel) 6 hours + 15min random   Varka’s Hero Shadith 8 hours + 30 mins random (4th lvl of alliance with Ketra)   Ketra’s Hero Hekaton 8 hours + 30 mins random (4th lvl of alliance with Varka)   Varka’s Commander Mos 8 hours + 30 mins random (5th lvl of alliance with Ketra)   Ketra’s Commander Tayr 8 hours + 30 mins random (5th lvl of alliance with Varka)
    • Have a great day! Unfortunately, we can not give you the codes at the moment, but they will be distributed as soon as trial is back online, thanks for understanding! Other users also can reply there for codes, we will send them out some time after.
  • Topics

×
×
  • 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