activeChar.isNewbie Posted May 12, 2016 Posted May 12, 2016 can anyone help me and tell how to add item(for example coin of luck) to drop for all monsters? I thought it must be in L2Attackable.java, but i can't understand where... I use aCis.... Quote
0 Pauler Posted May 12, 2016 Posted May 12, 2016 Hello there. If i remember correctly you have to modify the calculateRewards(L2Character) in L2Attackable.java. Just add a line killer.giveItem(...) with the proper arguments including the id of the item you want to give. Quote
0 activeChar.isNewbie Posted May 12, 2016 Author Posted May 12, 2016 Need to add seal stones to all monsters because seven signs have some problems.... I tried and did this to add to monsters between 70-75 levels Index: java/net/sf/l2j/gameserver/model/actor/L2Attackable.java =================================================================== --- a/java/net/sf/l2j/gameserver/model/actor/L2Attackable.java +++ b/java/net/sf/l2j/gameserver/model/actor/L2Attackable.java @@ -302,4 +302,5 @@ } } + // Manage Base, Quests and Sweep drops of the L2Attackable. @@ -1129,5 +1130,11 @@ else item = calculateCategorizedRewardItem(player, cat, levelModifier); - + if(getLevel() >= 70 && getLevel() <= 75) + { + int min_seal_red = Rnd.get(700,1400); + int min_seal_green = Rnd.get(34350,69000); + player.addItem("BlueSealStone", 6362, min_seal_red, null, true); + player.addItem("GreenSealStone", 6361, min_seal_green, null, true); + } if (item != null) { But when i kill for example hot springs monsters it gives me 2 times red and 2 times green stones. Quote
0 AccessDenied Posted May 12, 2016 Posted May 12, 2016 dont even go at java, do it via SQL... use some command in droplist Quote
0 activeChar.isNewbie Posted May 12, 2016 Author Posted May 12, 2016 On 5/12/2016 at 6:15 PM, AccessDenied said: dont even go at java, do it via SQL... use some command in droplist I use aCis so they don't have droplist in SQL they have it on every npc in xml files. Quote
0 Tryskell Posted May 12, 2016 Posted May 12, 2016 On 5/12/2016 at 6:11 PM, activeChar.isNewbie said: Need to add seal stones to all monsters because seven signs have some problems.... I tried and did this to add to monsters between 70-75 levels Index: java/net/sf/l2j/gameserver/model/actor/L2Attackable.java =================================================================== --- a/java/net/sf/l2j/gameserver/model/actor/L2Attackable.java +++ b/java/net/sf/l2j/gameserver/model/actor/L2Attackable.java @@ -302,4 +302,5 @@ } } + // Manage Base, Quests and Sweep drops of the L2Attackable. @@ -1129,5 +1130,11 @@ else item = calculateCategorizedRewardItem(player, cat, levelModifier); - + if(getLevel() >= 70 && getLevel() <= 75) + { + int min_seal_red = Rnd.get(700,1400); + int min_seal_green = Rnd.get(34350,69000); + player.addItem("BlueSealStone", 6362, min_seal_red, null, true); + player.addItem("GreenSealStone", 6361, min_seal_green, null, true); + } if (item != null) { But when i kill for example hot springs monsters it gives me 2 times red and 2 times green stones. I already answered you, we use a spawnlist which doesn't use sealstone. Which means there are mobs which got those stones. Which means, edit the godamn spawns to pick directly mobs with stones. You can help yourself with any L2J IL spawnlist. Quote
0 Pauler Posted May 12, 2016 Posted May 12, 2016 On 5/12/2016 at 6:11 PM, activeChar.isNewbie said: Need to add seal stones to all monsters because seven signs have some problems.... I tried and did this to add to monsters between 70-75 levels Index: java/net/sf/l2j/gameserver/model/actor/L2Attackable.java =================================================================== --- a/java/net/sf/l2j/gameserver/model/actor/L2Attackable.java +++ b/java/net/sf/l2j/gameserver/model/actor/L2Attackable.java @@ -302,4 +302,5 @@ } } + // Manage Base, Quests and Sweep drops of the L2Attackable. @@ -1129,5 +1130,11 @@ else item = calculateCategorizedRewardItem(player, cat, levelModifier); - + if(getLevel() >= 70 && getLevel() <= 75) + { + int min_seal_red = Rnd.get(700,1400); + int min_seal_green = Rnd.get(34350,69000); + player.addItem("BlueSealStone", 6362, min_seal_red, null, true); + player.addItem("GreenSealStone", 6361, min_seal_green, null, true); + } if (item != null) { But when i kill for example hot springs monsters it gives me 2 times red and 2 times green stones. You have added your code inside this loop. for (DropCategory cat : npcTemplate.getDropData()) {} That's why it is being executed more than once. Quote
0 activeChar.isNewbie Posted May 12, 2016 Author Posted May 12, 2016 On 5/12/2016 at 6:43 PM, Tryskell said: I already answered you, we use a spawnlist which doesn't use sealstone. Which means there are mobs which got those stones. Which means, edit the godamn spawns to pick directly mobs with stones. You can help yourself with any L2J IL spawnlist. i don't understand what you mean... spawnlist don't include drop.... I just want to add seal stones to all monsters based on their level. On 5/12/2016 at 6:48 PM, Pauler said: You have added your code inside this loop. for (DropCategory cat : npcTemplate.getDropData()) {} That's why it is being executed more than once. So where should I add this code? Quote
0 xxdem Posted May 12, 2016 Posted May 12, 2016 Stop listening to idiots, the correct way to do it is to add a static reference of your L2DropItem object into the monster's droplist while loading it. Quote
0 tazerman2 Posted May 12, 2016 Posted May 12, 2016 (edited) try this net/sf/l2j/gameserver/model/actor/L2Attackable.java ----------------------------------------------------- private L2Character _overhitAttacker; + private L2PcInstance _PlayerDrop; @Override public boolean doDie(L2Character killer) { // Kill the L2Npc (the corpse disappeared after 7 seconds) if (!super.doDie(killer)) return false; + if(this instanceof L2MonsterInstance) + { + if (getLevel() >= 70 && getLevel() <= 75) + { + int min_seal_red = Rnd.get(700, 1400); + int min_seal_green = Rnd.get(34350, 69000); + _PlayerDrop.addItem("BlueSealStone", 6362, min_seal_red, null, true); + _PlayerDrop.addItem("GreenSealStone", 6361, min_seal_green, null, true); + } + } Edited May 12, 2016 by tazerman2 Quote
0 activeChar.isNewbie Posted May 12, 2016 Author Posted May 12, 2016 No still when i kill mob it several times gives me that item. Quote
0 Lioy Posted May 12, 2016 Posted May 12, 2016 (edited) Better work on NpcTable.java , as you can see it loads all npcs and adds drops with this method template.addDropData(dropDat, category) where dropDat is is a DropData instance. Simply use this method again with your own DropData instance (with whatever items and item counts you want). Edited May 12, 2016 by LAGLAG Quote
Question
activeChar.isNewbie
can anyone help me and tell how to add item(for example coin of luck) to drop for all monsters?
I thought it must be in L2Attackable.java, but i can't understand where...
I use aCis....
11 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.