alassyr
-
Posts
21 -
Credits
0 -
Joined
-
Last visited
-
Feedback
0%
Content Type
Articles
Profiles
Forums
Store
Posts posted by alassyr
-
-
nice work xAddytzu
You are wonderful
Good Luck
-
read my pm to discuss about some codes
Best regards
-
i added you on skype accepted me there are something i wan discuss it with you
-
[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
-
I test it after compile
:(
Not work and a npc stay without unspawn
-
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
-
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 ;)
-
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
-
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
-
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
-
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
-
anyone can help me???
-
thx guys but where i can add schedule time which class i must use help me to run it perfect
B1ggBoss i use Item to summon a npc i make it throw "summon_items.xml"By using this
<item id="14559">
<npcId val="40007"/>
<summonType val="0"/>
<unsummon val="2" />
</item>
I read there are command "<unsummon val="2" />" make it unsummon after 1 minute is that true coz i use it but no result :(
sorry about that but cant use above code
-
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.getLastSpawn(), false); npc.deleteMe(); } } }
Where you wanna use it:
long delay = YOUR TIME IN SECS * 1000; L2Npc yourNpc; ThreadPoolManager.getInstance().scheduleGeneral(new UnSpawn(yourNpc), delay);
Thx Amazing But i relay noob Plz tell me where i can add it
i use l2jfree gracia final
-
ok thank you i will tell you
i think to make a custom NPC like(GM shop,Buffer,Teleport) that can be show when you press an item
i success to make it but stay forever I need to hide it after X second
anyone Know how to do that
-
yes its possible and already exist in game so find the npc and u will have the code ;)
I search for along time about that if you have it plz post it here
-
i never read any guide about this:/
i dont think that is possible.
no i thank that may be done by skill if you seen a quest NPC there are some quest hide after X seconds in the game
-
Hello
how i can unsummon a NPC after X seconds is that possible if yes plz help me
-
help me pleese
I own l2j server and writing in the chat write words from left to right
because the language is english
And I want to change it so that the written words from right to left
Because my language need it
Thank you very much
Lineage 2 Tower 1.4 [IL-GOD]
in Botting [English]
Posted
good work dude
amazing program from you
thank you so much
keep it up