From 643d9c2d1085b78700724aa319711a95e7194951 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Fri, 1 Dec 2017 23:46:55 +0000 Subject: [PATCH] Auto pickup for specific items. --- .../dist/game/config/Character.ini | 13 +++++++++--- .../java/com/l2jmobius/Config.java | 20 +++++++++++++++++++ .../gameserver/datatables/ItemTable.java | 2 +- .../gameserver/model/actor/L2Attackable.java | 10 +++++----- .../dist/game/config/Character.ini | 13 +++++++++--- .../java/com/l2jmobius/Config.java | 20 +++++++++++++++++++ .../gameserver/datatables/ItemTable.java | 2 +- .../gameserver/model/actor/L2Attackable.java | 10 +++++----- .../dist/game/config/Character.ini | 13 +++++++++--- .../java/com/l2jmobius/Config.java | 20 +++++++++++++++++++ .../gameserver/datatables/ItemTable.java | 2 +- .../gameserver/model/actor/L2Attackable.java | 10 +++++----- .../dist/game/config/Character.ini | 13 +++++++++--- .../java/com/l2jmobius/Config.java | 20 +++++++++++++++++++ .../gameserver/datatables/ItemTable.java | 2 +- .../gameserver/model/actor/L2Attackable.java | 10 +++++----- .../dist/game/config/Character.ini | 13 +++++++++--- .../java/com/l2jmobius/Config.java | 18 +++++++++++++++++ .../gameserver/datatables/ItemTable.java | 2 +- .../gameserver/model/actor/L2Attackable.java | 8 ++++---- .../dist/game/config/Character.ini | 13 +++++++++--- .../java/com/l2jmobius/Config.java | 20 +++++++++++++++++++ .../gameserver/datatables/ItemTable.java | 2 +- .../gameserver/model/actor/L2Attackable.java | 10 +++++----- 24 files changed, 213 insertions(+), 53 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/config/Character.ini b/L2J_Mobius_1.0_Ertheia/dist/game/config/Character.ini index e0600fe8ba..00307ad914 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/config/Character.ini +++ b/L2J_Mobius_1.0_Ertheia/dist/game/config/Character.ini @@ -85,9 +85,6 @@ AutoLearnSkills = False # Default: False AutoLearnForgottenScrollSkills = False -# Default: False -AutoLootHerbs = False - # Maximum number of buffs and songs/dances. # Remember that Divine Inspiration will give players 4 additional buff slots on top of the number specified in "maxbuffamount". # Default: 20, 12, 12 @@ -679,6 +676,10 @@ StartingSP = 0 # Default: 9999999999999 (9 Trillion 999 Billion 999 Million 999 Thousand 999 Adena) MaxAdena = 9999999999999 +# Enable herbs auto pickup. +# Default: False +AutoLootHerbs = False + # This option, when set to True, will enable automatically picking up items. # If set False it will force the player to pickup dropped items from mobs. # This excludes herbs mentioned above and items from Raid/GrandBosses with minions. @@ -701,6 +702,12 @@ RaidLootRightsInterval = 900 # Default: 45 RaidLootRightsCCSize = 45 +# Specific item ids for auto pickup. +# Overrides all methods above. +# Format: itemId,itemId,itemId,.... +# Default: 0 +AutoLootItemIds = 0 + # This is the time in seconds that it will take for the player command "/unstuck" to activate. # Default: 300 UnstuckInterval = 300 diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/Config.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/Config.java index 8d8e0f6587..9d30282876 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/Config.java @@ -263,6 +263,7 @@ public final class Config public static boolean AUTO_LOOT_RAIDS; public static int LOOT_RAIDS_PRIVILEGE_INTERVAL; public static int LOOT_RAIDS_PRIVILEGE_CC_SIZE; + public static List AUTO_LOOT_ITEM_IDS; public static int UNSTUCK_INTERVAL; public static int TELEPORT_WATCHDOG_TIMEOUT; public static int PLAYER_SPAWN_PROTECTION; @@ -1678,6 +1679,25 @@ public final class Config AUTO_LOOT_RAIDS = Character.getBoolean("AutoLootRaids", false); LOOT_RAIDS_PRIVILEGE_INTERVAL = Character.getInt("RaidLootRightsInterval", 900) * 1000; LOOT_RAIDS_PRIVILEGE_CC_SIZE = Character.getInt("RaidLootRightsCCSize", 45); + final String[] autoLootItemIds = Character.getString("AutoLootItemIds", "0").split(","); + AUTO_LOOT_ITEM_IDS = new ArrayList<>(autoLootItemIds.length); + for (String item : autoLootItemIds) + { + Integer itm = 0; + try + { + itm = Integer.parseInt(item); + } + catch (NumberFormatException nfe) + { + LOGGER.warning("Auto loot item ids: Wrong ItemId passed: " + item); + LOGGER.warning(nfe.getMessage()); + } + if (itm != 0) + { + AUTO_LOOT_ITEM_IDS.add(itm); + } + } UNSTUCK_INTERVAL = Character.getInt("UnstuckInterval", 300); TELEPORT_WATCHDOG_TIMEOUT = Character.getInt("TeleportWatchdogTimeout", 0); PLAYER_SPAWN_PROTECTION = Character.getInt("PlayerSpawnProtection", 0); diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/datatables/ItemTable.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/datatables/ItemTable.java index ace19486b5..8e700cdd85 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/datatables/ItemTable.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/datatables/ItemTable.java @@ -212,7 +212,7 @@ public class ItemTable // Create and Init the L2ItemInstance corresponding to the Item Identifier final L2ItemInstance item = new L2ItemInstance(IdFactory.getInstance().getNextId(), itemId); - if (process.equalsIgnoreCase("loot")) + if (process.equalsIgnoreCase("loot") && !Config.AUTO_LOOT_ITEM_IDS.contains(itemId)) { ScheduledFuture itemLootShedule; if ((reference instanceof L2Attackable) && ((L2Attackable) reference).isRaid()) // loot privilege for raids diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java index cb75e3c3b1..976203d745 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java @@ -975,7 +975,7 @@ public class L2Attackable extends L2Npc { final L2Item item = ItemTable.getInstance().getTemplate(drop.getId()); // Check if the autoLoot mode is active - if (isFlying() || (!item.hasExImmediateEffect() && ((!isRaid() && Config.AUTO_LOOT) || (isRaid() && Config.AUTO_LOOT_RAIDS)))) + if (Config.AUTO_LOOT_ITEM_IDS.contains(item.getId()) || isFlying() || (!item.hasExImmediateEffect() && ((!isRaid() && Config.AUTO_LOOT) || (isRaid() && Config.AUTO_LOOT_RAIDS)))) { // do nothing } @@ -1017,7 +1017,7 @@ public class L2Attackable extends L2Npc { final L2Item item = ItemTable.getInstance().getTemplate(drop.getId()); // Check if the autoLoot mode is active - if (isFlying() || (!item.hasExImmediateEffect() && ((!isRaid() && Config.AUTO_LOOT) || (isRaid() && Config.AUTO_LOOT_RAIDS))) || (item.hasExImmediateEffect() && Config.AUTO_LOOT_HERBS)) + if (Config.AUTO_LOOT_ITEM_IDS.contains(item.getId()) || isFlying() || (!item.hasExImmediateEffect() && ((!isRaid() && Config.AUTO_LOOT) || (isRaid() && Config.AUTO_LOOT_RAIDS))) || (item.hasExImmediateEffect() && Config.AUTO_LOOT_HERBS)) { player.doAutoLoot(this, drop); // Give the item(s) to the L2PcInstance that has killed the L2Attackable } @@ -1046,7 +1046,7 @@ public class L2Attackable extends L2Npc if ((player.getLevel() <= getLevel()) && (Rnd.get(100) < Config.CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE)) { - if (Config.AUTO_LOOT || isFlying()) + if (Config.AUTO_LOOT_ITEM_IDS.contains(item.getId()) || Config.AUTO_LOOT || isFlying()) { player.addItem("ChampionLoot", item.getId(), item.getCount(), this, true); // Give the item(s) to the L2PcInstance that has killed the L2Attackable } @@ -1057,7 +1057,7 @@ public class L2Attackable extends L2Npc } else if ((player.getLevel() > getLevel()) && (Rnd.get(100) < Config.CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE)) { - if (Config.AUTO_LOOT || isFlying()) + if (Config.AUTO_LOOT_ITEM_IDS.contains(item.getId()) || Config.AUTO_LOOT || isFlying()) { player.addItem("ChampionLoot", item.getId(), item.getCount(), this, true); // Give the item(s) to the L2PcInstance that has killed the L2Attackable } @@ -1110,7 +1110,7 @@ public class L2Attackable extends L2Npc { final int itemId = drop.getEventDrop().getItemIdList()[Rnd.get(drop.getEventDrop().getItemIdList().length)]; final long itemCount = Rnd.get(drop.getEventDrop().getMinCount(), drop.getEventDrop().getMaxCount()); - if (Config.AUTO_LOOT || isFlying()) + if (Config.AUTO_LOOT_ITEM_IDS.contains(itemId) || Config.AUTO_LOOT || isFlying()) { player.doAutoLoot(this, itemId, itemCount); // Give the item(s) to the L2PcInstance that has killed the L2Attackable } diff --git a/L2J_Mobius_2.5_Underground/dist/game/config/Character.ini b/L2J_Mobius_2.5_Underground/dist/game/config/Character.ini index af50adc3b7..96b16f52bb 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/config/Character.ini +++ b/L2J_Mobius_2.5_Underground/dist/game/config/Character.ini @@ -85,9 +85,6 @@ AutoLearnSkills = False # Default: False AutoLearnForgottenScrollSkills = False -# Default: False -AutoLootHerbs = False - # Maximum number of buffs and songs/dances. # Remember that Divine Inspiration will give players 4 additional buff slots on top of the number specified in "maxbuffamount". # Default: 20, 12, 12 @@ -679,6 +676,10 @@ StartingSP = 0 # Default: 9999999999999 (9 Trillion 999 Billion 999 Million 999 Thousand 999 Adena) MaxAdena = 9999999999999 +# Enable herbs auto pickup. +# Default: False +AutoLootHerbs = False + # This option, when set to True, will enable automatically picking up items. # If set False it will force the player to pickup dropped items from mobs. # This excludes herbs mentioned above and items from Raid/GrandBosses with minions. @@ -701,6 +702,12 @@ RaidLootRightsInterval = 900 # Default: 45 RaidLootRightsCCSize = 45 +# Specific item ids for auto pickup. +# Overrides all methods above. +# Format: itemId,itemId,itemId,.... +# Default: 0 +AutoLootItemIds = 0 + # This is the time in seconds that it will take for the player command "/unstuck" to activate. # Default: 300 UnstuckInterval = 300 diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/Config.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/Config.java index b08660752f..dca09d456e 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/Config.java @@ -263,6 +263,7 @@ public final class Config public static boolean AUTO_LOOT_RAIDS; public static int LOOT_RAIDS_PRIVILEGE_INTERVAL; public static int LOOT_RAIDS_PRIVILEGE_CC_SIZE; + public static List AUTO_LOOT_ITEM_IDS; public static int UNSTUCK_INTERVAL; public static int TELEPORT_WATCHDOG_TIMEOUT; public static int PLAYER_SPAWN_PROTECTION; @@ -1679,6 +1680,25 @@ public final class Config AUTO_LOOT_RAIDS = Character.getBoolean("AutoLootRaids", false); LOOT_RAIDS_PRIVILEGE_INTERVAL = Character.getInt("RaidLootRightsInterval", 900) * 1000; LOOT_RAIDS_PRIVILEGE_CC_SIZE = Character.getInt("RaidLootRightsCCSize", 45); + final String[] autoLootItemIds = Character.getString("AutoLootItemIds", "0").split(","); + AUTO_LOOT_ITEM_IDS = new ArrayList<>(autoLootItemIds.length); + for (String item : autoLootItemIds) + { + Integer itm = 0; + try + { + itm = Integer.parseInt(item); + } + catch (NumberFormatException nfe) + { + LOGGER.warning("Auto loot item ids: Wrong ItemId passed: " + item); + LOGGER.warning(nfe.getMessage()); + } + if (itm != 0) + { + AUTO_LOOT_ITEM_IDS.add(itm); + } + } UNSTUCK_INTERVAL = Character.getInt("UnstuckInterval", 300); TELEPORT_WATCHDOG_TIMEOUT = Character.getInt("TeleportWatchdogTimeout", 0); PLAYER_SPAWN_PROTECTION = Character.getInt("PlayerSpawnProtection", 0); diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/datatables/ItemTable.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/datatables/ItemTable.java index ace19486b5..8e700cdd85 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/datatables/ItemTable.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/datatables/ItemTable.java @@ -212,7 +212,7 @@ public class ItemTable // Create and Init the L2ItemInstance corresponding to the Item Identifier final L2ItemInstance item = new L2ItemInstance(IdFactory.getInstance().getNextId(), itemId); - if (process.equalsIgnoreCase("loot")) + if (process.equalsIgnoreCase("loot") && !Config.AUTO_LOOT_ITEM_IDS.contains(itemId)) { ScheduledFuture itemLootShedule; if ((reference instanceof L2Attackable) && ((L2Attackable) reference).isRaid()) // loot privilege for raids diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java index e9b8952567..b0e622b61a 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java @@ -971,7 +971,7 @@ public class L2Attackable extends L2Npc { final L2Item item = ItemTable.getInstance().getTemplate(drop.getId()); // Check if the autoLoot mode is active - if (isFlying() || (!item.hasExImmediateEffect() && ((!isRaid() && Config.AUTO_LOOT) || (isRaid() && Config.AUTO_LOOT_RAIDS)))) + if (Config.AUTO_LOOT_ITEM_IDS.contains(item.getId()) || isFlying() || (!item.hasExImmediateEffect() && ((!isRaid() && Config.AUTO_LOOT) || (isRaid() && Config.AUTO_LOOT_RAIDS)))) { // do nothing } @@ -1013,7 +1013,7 @@ public class L2Attackable extends L2Npc { final L2Item item = ItemTable.getInstance().getTemplate(drop.getId()); // Check if the autoLoot mode is active - if (isFlying() || (!item.hasExImmediateEffect() && ((!isRaid() && Config.AUTO_LOOT) || (isRaid() && Config.AUTO_LOOT_RAIDS))) || (item.hasExImmediateEffect() && Config.AUTO_LOOT_HERBS)) + if (Config.AUTO_LOOT_ITEM_IDS.contains(item.getId()) || isFlying() || (!item.hasExImmediateEffect() && ((!isRaid() && Config.AUTO_LOOT) || (isRaid() && Config.AUTO_LOOT_RAIDS))) || (item.hasExImmediateEffect() && Config.AUTO_LOOT_HERBS)) { player.doAutoLoot(this, drop); // Give the item(s) to the L2PcInstance that has killed the L2Attackable } @@ -1042,7 +1042,7 @@ public class L2Attackable extends L2Npc if ((player.getLevel() <= getLevel()) && (Rnd.get(100) < Config.CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE)) { - if (Config.AUTO_LOOT || isFlying()) + if (Config.AUTO_LOOT_ITEM_IDS.contains(item.getId()) || Config.AUTO_LOOT || isFlying()) { player.addItem("ChampionLoot", item.getId(), item.getCount(), this, true); // Give the item(s) to the L2PcInstance that has killed the L2Attackable } @@ -1053,7 +1053,7 @@ public class L2Attackable extends L2Npc } else if ((player.getLevel() > getLevel()) && (Rnd.get(100) < Config.CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE)) { - if (Config.AUTO_LOOT || isFlying()) + if (Config.AUTO_LOOT_ITEM_IDS.contains(item.getId()) || Config.AUTO_LOOT || isFlying()) { player.addItem("ChampionLoot", item.getId(), item.getCount(), this, true); // Give the item(s) to the L2PcInstance that has killed the L2Attackable } @@ -1106,7 +1106,7 @@ public class L2Attackable extends L2Npc { final int itemId = drop.getEventDrop().getItemIdList()[Rnd.get(drop.getEventDrop().getItemIdList().length)]; final long itemCount = Rnd.get(drop.getEventDrop().getMinCount(), drop.getEventDrop().getMaxCount()); - if (Config.AUTO_LOOT || isFlying()) + if (Config.AUTO_LOOT_ITEM_IDS.contains(itemId) || Config.AUTO_LOOT || isFlying()) { player.doAutoLoot(this, itemId, itemCount); // Give the item(s) to the L2PcInstance that has killed the L2Attackable } diff --git a/L2J_Mobius_3.0_Helios/dist/game/config/Character.ini b/L2J_Mobius_3.0_Helios/dist/game/config/Character.ini index af50adc3b7..96b16f52bb 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/config/Character.ini +++ b/L2J_Mobius_3.0_Helios/dist/game/config/Character.ini @@ -85,9 +85,6 @@ AutoLearnSkills = False # Default: False AutoLearnForgottenScrollSkills = False -# Default: False -AutoLootHerbs = False - # Maximum number of buffs and songs/dances. # Remember that Divine Inspiration will give players 4 additional buff slots on top of the number specified in "maxbuffamount". # Default: 20, 12, 12 @@ -679,6 +676,10 @@ StartingSP = 0 # Default: 9999999999999 (9 Trillion 999 Billion 999 Million 999 Thousand 999 Adena) MaxAdena = 9999999999999 +# Enable herbs auto pickup. +# Default: False +AutoLootHerbs = False + # This option, when set to True, will enable automatically picking up items. # If set False it will force the player to pickup dropped items from mobs. # This excludes herbs mentioned above and items from Raid/GrandBosses with minions. @@ -701,6 +702,12 @@ RaidLootRightsInterval = 900 # Default: 45 RaidLootRightsCCSize = 45 +# Specific item ids for auto pickup. +# Overrides all methods above. +# Format: itemId,itemId,itemId,.... +# Default: 0 +AutoLootItemIds = 0 + # This is the time in seconds that it will take for the player command "/unstuck" to activate. # Default: 300 UnstuckInterval = 300 diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/Config.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/Config.java index 35800fd571..9ada9122d5 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/Config.java @@ -263,6 +263,7 @@ public final class Config public static boolean AUTO_LOOT_RAIDS; public static int LOOT_RAIDS_PRIVILEGE_INTERVAL; public static int LOOT_RAIDS_PRIVILEGE_CC_SIZE; + public static List AUTO_LOOT_ITEM_IDS; public static int UNSTUCK_INTERVAL; public static int TELEPORT_WATCHDOG_TIMEOUT; public static int PLAYER_SPAWN_PROTECTION; @@ -1687,6 +1688,25 @@ public final class Config AUTO_LOOT_RAIDS = Character.getBoolean("AutoLootRaids", false); LOOT_RAIDS_PRIVILEGE_INTERVAL = Character.getInt("RaidLootRightsInterval", 900) * 1000; LOOT_RAIDS_PRIVILEGE_CC_SIZE = Character.getInt("RaidLootRightsCCSize", 45); + final String[] autoLootItemIds = Character.getString("AutoLootItemIds", "0").split(","); + AUTO_LOOT_ITEM_IDS = new ArrayList<>(autoLootItemIds.length); + for (String item : autoLootItemIds) + { + Integer itm = 0; + try + { + itm = Integer.parseInt(item); + } + catch (NumberFormatException nfe) + { + LOGGER.warning("Auto loot item ids: Wrong ItemId passed: " + item); + LOGGER.warning(nfe.getMessage()); + } + if (itm != 0) + { + AUTO_LOOT_ITEM_IDS.add(itm); + } + } UNSTUCK_INTERVAL = Character.getInt("UnstuckInterval", 300); TELEPORT_WATCHDOG_TIMEOUT = Character.getInt("TeleportWatchdogTimeout", 0); PLAYER_SPAWN_PROTECTION = Character.getInt("PlayerSpawnProtection", 0); diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/datatables/ItemTable.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/datatables/ItemTable.java index ace19486b5..8e700cdd85 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/datatables/ItemTable.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/datatables/ItemTable.java @@ -212,7 +212,7 @@ public class ItemTable // Create and Init the L2ItemInstance corresponding to the Item Identifier final L2ItemInstance item = new L2ItemInstance(IdFactory.getInstance().getNextId(), itemId); - if (process.equalsIgnoreCase("loot")) + if (process.equalsIgnoreCase("loot") && !Config.AUTO_LOOT_ITEM_IDS.contains(itemId)) { ScheduledFuture itemLootShedule; if ((reference instanceof L2Attackable) && ((L2Attackable) reference).isRaid()) // loot privilege for raids diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java index e9b8952567..b0e622b61a 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java @@ -971,7 +971,7 @@ public class L2Attackable extends L2Npc { final L2Item item = ItemTable.getInstance().getTemplate(drop.getId()); // Check if the autoLoot mode is active - if (isFlying() || (!item.hasExImmediateEffect() && ((!isRaid() && Config.AUTO_LOOT) || (isRaid() && Config.AUTO_LOOT_RAIDS)))) + if (Config.AUTO_LOOT_ITEM_IDS.contains(item.getId()) || isFlying() || (!item.hasExImmediateEffect() && ((!isRaid() && Config.AUTO_LOOT) || (isRaid() && Config.AUTO_LOOT_RAIDS)))) { // do nothing } @@ -1013,7 +1013,7 @@ public class L2Attackable extends L2Npc { final L2Item item = ItemTable.getInstance().getTemplate(drop.getId()); // Check if the autoLoot mode is active - if (isFlying() || (!item.hasExImmediateEffect() && ((!isRaid() && Config.AUTO_LOOT) || (isRaid() && Config.AUTO_LOOT_RAIDS))) || (item.hasExImmediateEffect() && Config.AUTO_LOOT_HERBS)) + if (Config.AUTO_LOOT_ITEM_IDS.contains(item.getId()) || isFlying() || (!item.hasExImmediateEffect() && ((!isRaid() && Config.AUTO_LOOT) || (isRaid() && Config.AUTO_LOOT_RAIDS))) || (item.hasExImmediateEffect() && Config.AUTO_LOOT_HERBS)) { player.doAutoLoot(this, drop); // Give the item(s) to the L2PcInstance that has killed the L2Attackable } @@ -1042,7 +1042,7 @@ public class L2Attackable extends L2Npc if ((player.getLevel() <= getLevel()) && (Rnd.get(100) < Config.CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE)) { - if (Config.AUTO_LOOT || isFlying()) + if (Config.AUTO_LOOT_ITEM_IDS.contains(item.getId()) || Config.AUTO_LOOT || isFlying()) { player.addItem("ChampionLoot", item.getId(), item.getCount(), this, true); // Give the item(s) to the L2PcInstance that has killed the L2Attackable } @@ -1053,7 +1053,7 @@ public class L2Attackable extends L2Npc } else if ((player.getLevel() > getLevel()) && (Rnd.get(100) < Config.CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE)) { - if (Config.AUTO_LOOT || isFlying()) + if (Config.AUTO_LOOT_ITEM_IDS.contains(item.getId()) || Config.AUTO_LOOT || isFlying()) { player.addItem("ChampionLoot", item.getId(), item.getCount(), this, true); // Give the item(s) to the L2PcInstance that has killed the L2Attackable } @@ -1106,7 +1106,7 @@ public class L2Attackable extends L2Npc { final int itemId = drop.getEventDrop().getItemIdList()[Rnd.get(drop.getEventDrop().getItemIdList().length)]; final long itemCount = Rnd.get(drop.getEventDrop().getMinCount(), drop.getEventDrop().getMaxCount()); - if (Config.AUTO_LOOT || isFlying()) + if (Config.AUTO_LOOT_ITEM_IDS.contains(itemId) || Config.AUTO_LOOT || isFlying()) { player.doAutoLoot(this, itemId, itemCount); // Give the item(s) to the L2PcInstance that has killed the L2Attackable } diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/config/Character.ini b/L2J_Mobius_4.0_GrandCrusade/dist/game/config/Character.ini index e13141eae5..6f409dd872 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/config/Character.ini +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/config/Character.ini @@ -85,9 +85,6 @@ AutoLearnSkills = False # Default: False AutoLearnForgottenScrollSkills = False -# Default: False -AutoLootHerbs = False - # Maximum number of buffs and songs/dances. # Remember that Divine Inspiration will give players 4 additional buff slots on top of the number specified in "maxbuffamount". # Default: 20, 12, 12 @@ -679,6 +676,10 @@ StartingSP = 0 # Default: 9999999999999 (9 Trillion 999 Billion 999 Million 999 Thousand 999 Adena) MaxAdena = 9999999999999 +# Enable herbs auto pickup. +# Default: False +AutoLootHerbs = False + # This option, when set to True, will enable automatically picking up items. # If set False it will force the player to pickup dropped items from mobs. # This excludes herbs mentioned above and items from Raid/GrandBosses with minions. @@ -701,6 +702,12 @@ RaidLootRightsInterval = 900 # Default: 45 RaidLootRightsCCSize = 45 +# Specific item ids for auto pickup. +# Overrides all methods above. +# Format: itemId,itemId,itemId,.... +# Default: 0 +AutoLootItemIds = 0 + # This is the time in seconds that it will take for the player command "/unstuck" to activate. # Default: 300 UnstuckInterval = 300 diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/Config.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/Config.java index 5cb23d5a70..d94ba4a8e3 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/Config.java @@ -263,6 +263,7 @@ public final class Config public static boolean AUTO_LOOT_RAIDS; public static int LOOT_RAIDS_PRIVILEGE_INTERVAL; public static int LOOT_RAIDS_PRIVILEGE_CC_SIZE; + public static List AUTO_LOOT_ITEM_IDS; public static int UNSTUCK_INTERVAL; public static int TELEPORT_WATCHDOG_TIMEOUT; public static int PLAYER_SPAWN_PROTECTION; @@ -1686,6 +1687,25 @@ public final class Config AUTO_LOOT_RAIDS = Character.getBoolean("AutoLootRaids", false); LOOT_RAIDS_PRIVILEGE_INTERVAL = Character.getInt("RaidLootRightsInterval", 900) * 1000; LOOT_RAIDS_PRIVILEGE_CC_SIZE = Character.getInt("RaidLootRightsCCSize", 45); + final String[] autoLootItemIds = Character.getString("AutoLootItemIds", "0").split(","); + AUTO_LOOT_ITEM_IDS = new ArrayList<>(autoLootItemIds.length); + for (String item : autoLootItemIds) + { + Integer itm = 0; + try + { + itm = Integer.parseInt(item); + } + catch (NumberFormatException nfe) + { + LOGGER.warning("Auto loot item ids: Wrong ItemId passed: " + item); + LOGGER.warning(nfe.getMessage()); + } + if (itm != 0) + { + AUTO_LOOT_ITEM_IDS.add(itm); + } + } UNSTUCK_INTERVAL = Character.getInt("UnstuckInterval", 300); TELEPORT_WATCHDOG_TIMEOUT = Character.getInt("TeleportWatchdogTimeout", 0); PLAYER_SPAWN_PROTECTION = Character.getInt("PlayerSpawnProtection", 0); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/datatables/ItemTable.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/datatables/ItemTable.java index ace19486b5..8e700cdd85 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/datatables/ItemTable.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/datatables/ItemTable.java @@ -212,7 +212,7 @@ public class ItemTable // Create and Init the L2ItemInstance corresponding to the Item Identifier final L2ItemInstance item = new L2ItemInstance(IdFactory.getInstance().getNextId(), itemId); - if (process.equalsIgnoreCase("loot")) + if (process.equalsIgnoreCase("loot") && !Config.AUTO_LOOT_ITEM_IDS.contains(itemId)) { ScheduledFuture itemLootShedule; if ((reference instanceof L2Attackable) && ((L2Attackable) reference).isRaid()) // loot privilege for raids diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java index e9b8952567..b0e622b61a 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java @@ -971,7 +971,7 @@ public class L2Attackable extends L2Npc { final L2Item item = ItemTable.getInstance().getTemplate(drop.getId()); // Check if the autoLoot mode is active - if (isFlying() || (!item.hasExImmediateEffect() && ((!isRaid() && Config.AUTO_LOOT) || (isRaid() && Config.AUTO_LOOT_RAIDS)))) + if (Config.AUTO_LOOT_ITEM_IDS.contains(item.getId()) || isFlying() || (!item.hasExImmediateEffect() && ((!isRaid() && Config.AUTO_LOOT) || (isRaid() && Config.AUTO_LOOT_RAIDS)))) { // do nothing } @@ -1013,7 +1013,7 @@ public class L2Attackable extends L2Npc { final L2Item item = ItemTable.getInstance().getTemplate(drop.getId()); // Check if the autoLoot mode is active - if (isFlying() || (!item.hasExImmediateEffect() && ((!isRaid() && Config.AUTO_LOOT) || (isRaid() && Config.AUTO_LOOT_RAIDS))) || (item.hasExImmediateEffect() && Config.AUTO_LOOT_HERBS)) + if (Config.AUTO_LOOT_ITEM_IDS.contains(item.getId()) || isFlying() || (!item.hasExImmediateEffect() && ((!isRaid() && Config.AUTO_LOOT) || (isRaid() && Config.AUTO_LOOT_RAIDS))) || (item.hasExImmediateEffect() && Config.AUTO_LOOT_HERBS)) { player.doAutoLoot(this, drop); // Give the item(s) to the L2PcInstance that has killed the L2Attackable } @@ -1042,7 +1042,7 @@ public class L2Attackable extends L2Npc if ((player.getLevel() <= getLevel()) && (Rnd.get(100) < Config.CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE)) { - if (Config.AUTO_LOOT || isFlying()) + if (Config.AUTO_LOOT_ITEM_IDS.contains(item.getId()) || Config.AUTO_LOOT || isFlying()) { player.addItem("ChampionLoot", item.getId(), item.getCount(), this, true); // Give the item(s) to the L2PcInstance that has killed the L2Attackable } @@ -1053,7 +1053,7 @@ public class L2Attackable extends L2Npc } else if ((player.getLevel() > getLevel()) && (Rnd.get(100) < Config.CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE)) { - if (Config.AUTO_LOOT || isFlying()) + if (Config.AUTO_LOOT_ITEM_IDS.contains(item.getId()) || Config.AUTO_LOOT || isFlying()) { player.addItem("ChampionLoot", item.getId(), item.getCount(), this, true); // Give the item(s) to the L2PcInstance that has killed the L2Attackable } @@ -1106,7 +1106,7 @@ public class L2Attackable extends L2Npc { final int itemId = drop.getEventDrop().getItemIdList()[Rnd.get(drop.getEventDrop().getItemIdList().length)]; final long itemCount = Rnd.get(drop.getEventDrop().getMinCount(), drop.getEventDrop().getMaxCount()); - if (Config.AUTO_LOOT || isFlying()) + if (Config.AUTO_LOOT_ITEM_IDS.contains(itemId) || Config.AUTO_LOOT || isFlying()) { player.doAutoLoot(this, itemId, itemCount); // Give the item(s) to the L2PcInstance that has killed the L2Attackable } diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Character.ini b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Character.ini index 95fbb3f517..3e73ff2993 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Character.ini +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Character.ini @@ -94,9 +94,6 @@ AutoLearnSkills = True # Default: False AutoLearnForgottenScrollSkills = False -# Default: False -AutoLootHerbs = False - # Maximum number of buffs and songs/dances. # Remember that Divine Inspiration will give players 4 additional buff slots on top of the number specified in "maxbuffamount". # Default: 20, 12, 12 @@ -702,6 +699,10 @@ StartingSP = 0 # Default: 99900000000 (99 bilion and 900 milion) MaxAdena = 3000000000000000 +# Enable herbs auto pickup. +# Default: False +AutoLootHerbs = False + # This option, when set to True, will enable automatically picking up items. # If set False it will force the player to pickup dropped items from mobs. # This excludes herbs mentioned above and items from Raid/GrandBosses with minions. @@ -724,6 +725,12 @@ RaidLootRightsInterval = 900 # Default: 45 RaidLootRightsCCSize = 45 +# Specific item ids for auto pickup. +# Overrides all methods above. +# Format: itemId,itemId,itemId,.... +# Default: 0 +AutoLootItemIds = 0 + # This is the time in seconds that it will take for the player command "/unstuck" to activate. # Default: 300 UnstuckInterval = 300 diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/Config.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/Config.java index 52acf64bdb..87efed59f3 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/Config.java @@ -229,6 +229,7 @@ public final class Config public static boolean AUTO_LOOT_RAIDS; public static int LOOT_RAIDS_PRIVILEGE_INTERVAL; public static int LOOT_RAIDS_PRIVILEGE_CC_SIZE; + public static List AUTO_LOOT_ITEM_IDS; public static int UNSTUCK_INTERVAL; public static int TELEPORT_WATCHDOG_TIMEOUT; public static int PLAYER_SPAWN_PROTECTION; @@ -1696,6 +1697,23 @@ public final class Config AUTO_LOOT_RAIDS = character.getBoolean("AutoLootRaids", false); LOOT_RAIDS_PRIVILEGE_INTERVAL = character.getInt("RaidLootRightsInterval", 900) * 1000; LOOT_RAIDS_PRIVILEGE_CC_SIZE = character.getInt("RaidLootRightsCCSize", 45); + final String[] autoLootItemIds = character.getString("AutoLootItemIds", "0").split(","); + AUTO_LOOT_ITEM_IDS = new ArrayList<>(autoLootItemIds.length); + for (String item : autoLootItemIds) + { + try + { + if (!item.isEmpty()) + { + AUTO_LOOT_ITEM_IDS.add(Integer.parseInt(item)); + } + } + catch (NumberFormatException nfe) + { + _log.warning("Auto loot item ids: Wrong ItemId passed: " + item); + _log.warning(nfe.getMessage()); + } + } UNSTUCK_INTERVAL = character.getInt("UnstuckInterval", 300); TELEPORT_WATCHDOG_TIMEOUT = character.getInt("TeleportWatchdogTimeout", 0); PLAYER_SPAWN_PROTECTION = character.getInt("PlayerSpawnProtection", 0); diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/datatables/ItemTable.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/datatables/ItemTable.java index a251fac089..14cbdbf9dd 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/datatables/ItemTable.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/datatables/ItemTable.java @@ -210,7 +210,7 @@ public class ItemTable // Create and Init the L2ItemInstance corresponding to the Item Identifier final L2ItemInstance item = new L2ItemInstance(IdFactory.getInstance().getNextId(), itemId); - if (process.equalsIgnoreCase("loot")) + if (process.equalsIgnoreCase("loot") && !Config.AUTO_LOOT_ITEM_IDS.contains(itemId)) { ScheduledFuture itemLootShedule; if ((reference instanceof L2Attackable) && ((L2Attackable) reference).isRaid()) // loot privilege for raids diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java index 79d6bad63e..1f3ac04f3e 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java @@ -971,7 +971,7 @@ public class L2Attackable extends L2Npc { final L2Item item = ItemTable.getInstance().getTemplate(drop.getId()); // Check if the autoLoot mode is active - if (isFlying() || (!item.hasExImmediateEffect() && ((!isRaid() && Config.AUTO_LOOT) || (isRaid() && Config.AUTO_LOOT_RAIDS))) || (item.hasExImmediateEffect() && Config.AUTO_LOOT_HERBS)) + if (Config.AUTO_LOOT_ITEM_IDS.contains(item.getId()) || isFlying() || (!item.hasExImmediateEffect() && ((!isRaid() && Config.AUTO_LOOT) || (isRaid() && Config.AUTO_LOOT_RAIDS))) || (item.hasExImmediateEffect() && Config.AUTO_LOOT_HERBS)) { player.doAutoLoot(this, drop); // Give the item(s) to the L2PcInstance that has killed the L2Attackable } @@ -1003,7 +1003,7 @@ public class L2Attackable extends L2Npc if ((player.getLevel() <= getLevel()) && (Rnd.get(100) < Config.L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE)) { - if (Config.AUTO_LOOT || isFlying()) + if (Config.AUTO_LOOT_ITEM_IDS.contains(item.getId()) || Config.AUTO_LOOT || isFlying()) { player.addItem("ChampionLoot", item.getId(), item.getCount(), this, true); // Give the item(s) to the L2PcInstance that has killed the L2Attackable } @@ -1014,7 +1014,7 @@ public class L2Attackable extends L2Npc } else if ((player.getLevel() > getLevel()) && (Rnd.get(100) < Config.L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE)) { - if (Config.AUTO_LOOT || isFlying()) + if (Config.AUTO_LOOT_ITEM_IDS.contains(item.getId()) || Config.AUTO_LOOT || isFlying()) { player.addItem("ChampionLoot", item.getId(), item.getCount(), this, true); // Give the item(s) to the L2PcInstance that has killed the L2Attackable } @@ -1061,7 +1061,7 @@ public class L2Attackable extends L2Npc { final int itemId = drop.getEventDrop().getItemIdList()[Rnd.get(drop.getEventDrop().getItemIdList().length)]; final long itemCount = Rnd.get(drop.getEventDrop().getMinCount(), drop.getEventDrop().getMaxCount()); - if (Config.AUTO_LOOT || isFlying()) + if (Config.AUTO_LOOT_ITEM_IDS.contains(itemId) || Config.AUTO_LOOT || isFlying()) { player.doAutoLoot(this, itemId, itemCount); // Give the item(s) to the L2PcInstance that has killed the L2Attackable } diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Character.ini b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Character.ini index fcf5ea494c..5fb73b9a9a 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Character.ini +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Character.ini @@ -85,9 +85,6 @@ AutoLearnSkills = False # Default: False AutoLearnForgottenScrollSkills = False -# Default: False -AutoLootHerbs = False - # Maximum number of buffs and songs/dances. # Remember that Divine Inspiration will give players 4 additional buff slots on top of the number specified in "maxbuffamount". # Default: 20, 12, 12 @@ -632,6 +629,10 @@ StartingSP = 0 # Default: 9999999999999 (9 Trillion 999 Billion 999 Million 999 Thousand 999 Adena) MaxAdena = 9999999999999 +# Enable herbs auto pickup. +# Default: False +AutoLootHerbs = False + # This option, when set to True, will enable automatically picking up items. # If set False it will force the player to pickup dropped items from mobs. # This excludes herbs mentioned above and items from Raid/GrandBosses with minions. @@ -654,6 +655,12 @@ RaidLootRightsInterval = 900 # Default: 45 RaidLootRightsCCSize = 45 +# Specific item ids for auto pickup. +# Overrides all methods above. +# Format: itemId,itemId,itemId,.... +# Default: 0 +AutoLootItemIds = 0 + # This is the time in seconds that it will take for the player command "/unstuck" to activate. # Default: 300 UnstuckInterval = 300 diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/Config.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/Config.java index 5de629cc8e..82c79f42d4 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/Config.java @@ -262,6 +262,7 @@ public final class Config public static boolean AUTO_LOOT_RAIDS; public static int LOOT_RAIDS_PRIVILEGE_INTERVAL; public static int LOOT_RAIDS_PRIVILEGE_CC_SIZE; + public static List AUTO_LOOT_ITEM_IDS; public static int UNSTUCK_INTERVAL; public static int TELEPORT_WATCHDOG_TIMEOUT; public static int PLAYER_SPAWN_PROTECTION; @@ -1610,6 +1611,25 @@ public final class Config AUTO_LOOT_RAIDS = Character.getBoolean("AutoLootRaids", false); LOOT_RAIDS_PRIVILEGE_INTERVAL = Character.getInt("RaidLootRightsInterval", 900) * 1000; LOOT_RAIDS_PRIVILEGE_CC_SIZE = Character.getInt("RaidLootRightsCCSize", 45); + final String[] autoLootItemIds = Character.getString("AutoLootItemIds", "0").split(","); + AUTO_LOOT_ITEM_IDS = new ArrayList<>(autoLootItemIds.length); + for (String item : autoLootItemIds) + { + Integer itm = 0; + try + { + itm = Integer.parseInt(item); + } + catch (NumberFormatException nfe) + { + LOGGER.warning("Auto loot item ids: Wrong ItemId passed: " + item); + LOGGER.warning(nfe.getMessage()); + } + if (itm != 0) + { + AUTO_LOOT_ITEM_IDS.add(itm); + } + } UNSTUCK_INTERVAL = Character.getInt("UnstuckInterval", 300); TELEPORT_WATCHDOG_TIMEOUT = Character.getInt("TeleportWatchdogTimeout", 0); PLAYER_SPAWN_PROTECTION = Character.getInt("PlayerSpawnProtection", 0); diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/datatables/ItemTable.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/datatables/ItemTable.java index ace19486b5..8e700cdd85 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/datatables/ItemTable.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/datatables/ItemTable.java @@ -212,7 +212,7 @@ public class ItemTable // Create and Init the L2ItemInstance corresponding to the Item Identifier final L2ItemInstance item = new L2ItemInstance(IdFactory.getInstance().getNextId(), itemId); - if (process.equalsIgnoreCase("loot")) + if (process.equalsIgnoreCase("loot") && !Config.AUTO_LOOT_ITEM_IDS.contains(itemId)) { ScheduledFuture itemLootShedule; if ((reference instanceof L2Attackable) && ((L2Attackable) reference).isRaid()) // loot privilege for raids diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java index 4a547bd1e8..cca8dcef2d 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java @@ -971,7 +971,7 @@ public class L2Attackable extends L2Npc { final L2Item item = ItemTable.getInstance().getTemplate(drop.getId()); // Check if the autoLoot mode is active - if (isFlying() || (!item.hasExImmediateEffect() && ((!isRaid() && Config.AUTO_LOOT) || (isRaid() && Config.AUTO_LOOT_RAIDS)))) + if (Config.AUTO_LOOT_ITEM_IDS.contains(item.getId()) || isFlying() || (!item.hasExImmediateEffect() && ((!isRaid() && Config.AUTO_LOOT) || (isRaid() && Config.AUTO_LOOT_RAIDS)))) { // do nothing } @@ -1013,7 +1013,7 @@ public class L2Attackable extends L2Npc { final L2Item item = ItemTable.getInstance().getTemplate(drop.getId()); // Check if the autoLoot mode is active - if (isFlying() || (!item.hasExImmediateEffect() && ((!isRaid() && Config.AUTO_LOOT) || (isRaid() && Config.AUTO_LOOT_RAIDS))) || (item.hasExImmediateEffect() && Config.AUTO_LOOT_HERBS)) + if (Config.AUTO_LOOT_ITEM_IDS.contains(item.getId()) || isFlying() || (!item.hasExImmediateEffect() && ((!isRaid() && Config.AUTO_LOOT) || (isRaid() && Config.AUTO_LOOT_RAIDS))) || (item.hasExImmediateEffect() && Config.AUTO_LOOT_HERBS)) { player.doAutoLoot(this, drop); // Give the item(s) to the L2PcInstance that has killed the L2Attackable } @@ -1042,7 +1042,7 @@ public class L2Attackable extends L2Npc if ((player.getLevel() <= getLevel()) && (Rnd.get(100) < Config.CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE)) { - if (Config.AUTO_LOOT || isFlying()) + if (Config.AUTO_LOOT_ITEM_IDS.contains(item.getId()) || Config.AUTO_LOOT || isFlying()) { player.addItem("ChampionLoot", item.getId(), item.getCount(), this, true); // Give the item(s) to the L2PcInstance that has killed the L2Attackable } @@ -1053,7 +1053,7 @@ public class L2Attackable extends L2Npc } else if ((player.getLevel() > getLevel()) && (Rnd.get(100) < Config.CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE)) { - if (Config.AUTO_LOOT || isFlying()) + if (Config.AUTO_LOOT_ITEM_IDS.contains(item.getId()) || Config.AUTO_LOOT || isFlying()) { player.addItem("ChampionLoot", item.getId(), item.getCount(), this, true); // Give the item(s) to the L2PcInstance that has killed the L2Attackable } @@ -1106,7 +1106,7 @@ public class L2Attackable extends L2Npc { final int itemId = drop.getEventDrop().getItemIdList()[Rnd.get(drop.getEventDrop().getItemIdList().length)]; final long itemCount = Rnd.get(drop.getEventDrop().getMinCount(), drop.getEventDrop().getMaxCount()); - if (Config.AUTO_LOOT || isFlying()) + if (Config.AUTO_LOOT_ITEM_IDS.contains(itemId) || Config.AUTO_LOOT || isFlying()) { player.doAutoLoot(this, itemId, itemCount); // Give the item(s) to the L2PcInstance that has killed the L2Attackable }