From 3ae533f32d8dcabf638c1f6f1f66f82bc2f27d1e Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Mon, 10 Sep 2018 17:11:00 +0000 Subject: [PATCH] Config for dropping items when slot limit is exceeded. --- L2J_Mobius_1.0_Ertheia/dist/game/config/Character.ini | 5 +++++ L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/Config.java | 2 ++ .../gameserver/model/itemcontainer/PcInventory.java | 2 +- L2J_Mobius_2.5_Underground/dist/game/config/Character.ini | 5 +++++ L2J_Mobius_2.5_Underground/java/com/l2jmobius/Config.java | 2 ++ .../gameserver/model/itemcontainer/PcInventory.java | 2 +- L2J_Mobius_3.0_Helios/dist/game/config/Character.ini | 5 +++++ L2J_Mobius_3.0_Helios/java/com/l2jmobius/Config.java | 2 ++ .../gameserver/model/itemcontainer/PcInventory.java | 2 +- L2J_Mobius_4.0_GrandCrusade/dist/game/config/Character.ini | 5 +++++ L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/Config.java | 2 ++ .../gameserver/model/itemcontainer/PcInventory.java | 2 +- L2J_Mobius_CT_2.6_HighFive/dist/game/config/Character.ini | 5 +++++ L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/Config.java | 2 ++ .../gameserver/model/itemcontainer/PcInventory.java | 2 +- .../dist/game/config/Character.ini | 5 +++++ .../java/com/l2jmobius/Config.java | 2 ++ .../gameserver/model/itemcontainer/PcInventory.java | 2 +- L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Character.ini | 5 +++++ L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/Config.java | 2 ++ .../gameserver/model/itemcontainer/PcInventory.java | 2 +- .../dist/game/config/Character.ini | 5 +++++ .../java/com/l2jmobius/Config.java | 2 ++ .../gameserver/model/itemcontainer/PcInventory.java | 2 +- 24 files changed, 64 insertions(+), 8 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 9c84363207..8978cbd19d 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/config/Character.ini +++ b/L2J_Mobius_1.0_Ertheia/dist/game/config/Character.ini @@ -648,6 +648,11 @@ AutoLoot = False # Default: False AutoLootRaids = False +# Prevent auto loot when inventory slot limit is reached. +# The items will be dropped to the ground instead. +# Default: False +AutoLootSlotLimit = False + # Delay for raid drop items loot privilege # Require Command Channel , check next option # Value is in seconds 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 7293a9b365..a0f4e07a2c 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/Config.java @@ -258,6 +258,7 @@ public final class Config public static long MAX_ADENA; public static boolean AUTO_LOOT; public static boolean AUTO_LOOT_RAIDS; + public static boolean AUTO_LOOT_SLOT_LIMIT; public static int LOOT_RAIDS_PRIVILEGE_INTERVAL; public static int LOOT_RAIDS_PRIVILEGE_CC_SIZE; public static List AUTO_LOOT_ITEM_IDS; @@ -1601,6 +1602,7 @@ public final class Config } AUTO_LOOT = Character.getBoolean("AutoLoot", false); AUTO_LOOT_RAIDS = Character.getBoolean("AutoLootRaids", false); + AUTO_LOOT_SLOT_LIMIT = Character.getBoolean("AutoLootSlotLimit", 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(","); diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java index 815125ad28..54e61a3737 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java @@ -840,7 +840,7 @@ public class PcInventory extends Inventory public boolean validateCapacity(long slots, boolean questItem) { - return (slots == 0) || questItem ? (getSize(item -> item.isQuestItem()) + slots) <= _owner.getQuestInventoryLimit() : (getSize(item -> !item.isQuestItem()) + slots) <= _owner.getInventoryLimit(); + return ((slots == 0) && !Config.AUTO_LOOT_SLOT_LIMIT) || questItem ? (getSize(item -> item.isQuestItem()) + slots) <= _owner.getQuestInventoryLimit() : (getSize(item -> !item.isQuestItem()) + slots) <= _owner.getInventoryLimit(); } @Override 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 3641826a38..98f726b2f1 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/config/Character.ini +++ b/L2J_Mobius_2.5_Underground/dist/game/config/Character.ini @@ -648,6 +648,11 @@ AutoLoot = False # Default: False AutoLootRaids = False +# Prevent auto loot when inventory slot limit is reached. +# The items will be dropped to the ground instead. +# Default: False +AutoLootSlotLimit = False + # Delay for raid drop items loot privilege # Require Command Channel , check next option # Value is in seconds 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 00b33207a5..e53bd35ec5 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/Config.java @@ -264,6 +264,7 @@ public final class Config public static long MAX_ADENA; public static boolean AUTO_LOOT; public static boolean AUTO_LOOT_RAIDS; + public static boolean AUTO_LOOT_SLOT_LIMIT; public static int LOOT_RAIDS_PRIVILEGE_INTERVAL; public static int LOOT_RAIDS_PRIVILEGE_CC_SIZE; public static List AUTO_LOOT_ITEM_IDS; @@ -1616,6 +1617,7 @@ public final class Config } AUTO_LOOT = Character.getBoolean("AutoLoot", false); AUTO_LOOT_RAIDS = Character.getBoolean("AutoLootRaids", false); + AUTO_LOOT_SLOT_LIMIT = Character.getBoolean("AutoLootSlotLimit", 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(","); diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java index a3a85dfeba..fe69f256b5 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java @@ -840,7 +840,7 @@ public class PcInventory extends Inventory public boolean validateCapacity(long slots, boolean questItem) { - return (slots == 0) || questItem ? (getSize(item -> item.isQuestItem()) + slots) <= _owner.getQuestInventoryLimit() : (getSize(item -> !item.isQuestItem()) + slots) <= _owner.getInventoryLimit(); + return ((slots == 0) && !Config.AUTO_LOOT_SLOT_LIMIT) || questItem ? (getSize(item -> item.isQuestItem()) + slots) <= _owner.getQuestInventoryLimit() : (getSize(item -> !item.isQuestItem()) + slots) <= _owner.getInventoryLimit(); } @Override 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 3641826a38..98f726b2f1 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/config/Character.ini +++ b/L2J_Mobius_3.0_Helios/dist/game/config/Character.ini @@ -648,6 +648,11 @@ AutoLoot = False # Default: False AutoLootRaids = False +# Prevent auto loot when inventory slot limit is reached. +# The items will be dropped to the ground instead. +# Default: False +AutoLootSlotLimit = False + # Delay for raid drop items loot privilege # Require Command Channel , check next option # Value is in seconds 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 b86a2c4b1d..9696a2318e 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/Config.java @@ -264,6 +264,7 @@ public final class Config public static long MAX_ADENA; public static boolean AUTO_LOOT; public static boolean AUTO_LOOT_RAIDS; + public static boolean AUTO_LOOT_SLOT_LIMIT; public static int LOOT_RAIDS_PRIVILEGE_INTERVAL; public static int LOOT_RAIDS_PRIVILEGE_CC_SIZE; public static List AUTO_LOOT_ITEM_IDS; @@ -1624,6 +1625,7 @@ public final class Config } AUTO_LOOT = Character.getBoolean("AutoLoot", false); AUTO_LOOT_RAIDS = Character.getBoolean("AutoLootRaids", false); + AUTO_LOOT_SLOT_LIMIT = Character.getBoolean("AutoLootSlotLimit", 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(","); diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java index a3a85dfeba..fe69f256b5 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java @@ -840,7 +840,7 @@ public class PcInventory extends Inventory public boolean validateCapacity(long slots, boolean questItem) { - return (slots == 0) || questItem ? (getSize(item -> item.isQuestItem()) + slots) <= _owner.getQuestInventoryLimit() : (getSize(item -> !item.isQuestItem()) + slots) <= _owner.getInventoryLimit(); + return ((slots == 0) && !Config.AUTO_LOOT_SLOT_LIMIT) || questItem ? (getSize(item -> item.isQuestItem()) + slots) <= _owner.getQuestInventoryLimit() : (getSize(item -> !item.isQuestItem()) + slots) <= _owner.getInventoryLimit(); } @Override 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 7f96953409..b9d5b42d68 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/config/Character.ini +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/config/Character.ini @@ -624,6 +624,11 @@ AutoLoot = False # Default: False AutoLootRaids = False +# Prevent auto loot when inventory slot limit is reached. +# The items will be dropped to the ground instead. +# Default: False +AutoLootSlotLimit = False + # Delay for raid drop items loot privilege # Require Command Channel , check next option # Value is in seconds 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 32520c030a..5e2007e157 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/Config.java @@ -258,6 +258,7 @@ public final class Config public static long MAX_ADENA; public static boolean AUTO_LOOT; public static boolean AUTO_LOOT_RAIDS; + public static boolean AUTO_LOOT_SLOT_LIMIT; public static int LOOT_RAIDS_PRIVILEGE_INTERVAL; public static int LOOT_RAIDS_PRIVILEGE_CC_SIZE; public static List AUTO_LOOT_ITEM_IDS; @@ -1611,6 +1612,7 @@ public final class Config } AUTO_LOOT = Character.getBoolean("AutoLoot", false); AUTO_LOOT_RAIDS = Character.getBoolean("AutoLootRaids", false); + AUTO_LOOT_SLOT_LIMIT = Character.getBoolean("AutoLootSlotLimit", 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(","); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java index a3a85dfeba..fe69f256b5 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java @@ -840,7 +840,7 @@ public class PcInventory extends Inventory public boolean validateCapacity(long slots, boolean questItem) { - return (slots == 0) || questItem ? (getSize(item -> item.isQuestItem()) + slots) <= _owner.getQuestInventoryLimit() : (getSize(item -> !item.isQuestItem()) + slots) <= _owner.getInventoryLimit(); + return ((slots == 0) && !Config.AUTO_LOOT_SLOT_LIMIT) || questItem ? (getSize(item -> item.isQuestItem()) + slots) <= _owner.getQuestInventoryLimit() : (getSize(item -> !item.isQuestItem()) + slots) <= _owner.getInventoryLimit(); } @Override 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 d0af3a0366..aeb40a8ab5 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 @@ -731,6 +731,11 @@ AutoLoot = False # Default: False AutoLootRaids = False +# Prevent auto loot when inventory slot limit is reached. +# The items will be dropped to the ground instead. +# Default: False +AutoLootSlotLimit = False + # Delay for raid drop items loot privilege # Require Command Channel , check next option # Value is in seconds 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 aad82b0fcb..6f80fbede0 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 @@ -263,6 +263,7 @@ public final class Config public static long MAX_ADENA; public static boolean AUTO_LOOT; public static boolean AUTO_LOOT_RAIDS; + public static boolean AUTO_LOOT_SLOT_LIMIT; public static int LOOT_RAIDS_PRIVILEGE_INTERVAL; public static int LOOT_RAIDS_PRIVILEGE_CC_SIZE; public static List AUTO_LOOT_ITEM_IDS; @@ -1902,6 +1903,7 @@ public final class Config } AUTO_LOOT = Character.getBoolean("AutoLoot", false); AUTO_LOOT_RAIDS = Character.getBoolean("AutoLootRaids", false); + AUTO_LOOT_SLOT_LIMIT = Character.getBoolean("AutoLootSlotLimit", 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(","); diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java index 5b7295d965..339c112d6a 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java @@ -852,7 +852,7 @@ public class PcInventory extends Inventory public boolean validateCapacity(long slots, boolean questItem) { - return !questItem ? ((_items.size() - _questSlots) + slots) <= _owner.getInventoryLimit() : (_questSlots + slots) <= _owner.getQuestInventoryLimit(); + return ((slots == 0) && !Config.AUTO_LOOT_SLOT_LIMIT) || questItem ? (_questSlots + slots) <= _owner.getQuestInventoryLimit() : ((_items.size() - _questSlots) + slots) <= _owner.getInventoryLimit(); } @Override 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 f33d2d3ff9..fb393b986e 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 @@ -599,6 +599,11 @@ AutoLoot = False # Default: False AutoLootRaids = False +# Prevent auto loot when inventory slot limit is reached. +# The items will be dropped to the ground instead. +# Default: False +AutoLootSlotLimit = False + # Delay for raid drop items loot privilege # Require Command Channel , check next option # Value is in seconds 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 0e75f4b06f..0d272fb1dc 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 @@ -263,6 +263,7 @@ public final class Config public static long MAX_ADENA; public static boolean AUTO_LOOT; public static boolean AUTO_LOOT_RAIDS; + public static boolean AUTO_LOOT_SLOT_LIMIT; public static int LOOT_RAIDS_PRIVILEGE_INTERVAL; public static int LOOT_RAIDS_PRIVILEGE_CC_SIZE; public static List AUTO_LOOT_ITEM_IDS; @@ -1552,6 +1553,7 @@ public final class Config } AUTO_LOOT = Character.getBoolean("AutoLoot", false); AUTO_LOOT_RAIDS = Character.getBoolean("AutoLootRaids", false); + AUTO_LOOT_SLOT_LIMIT = Character.getBoolean("AutoLootSlotLimit", 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(","); diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java index a3a85dfeba..fe69f256b5 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java @@ -840,7 +840,7 @@ public class PcInventory extends Inventory public boolean validateCapacity(long slots, boolean questItem) { - return (slots == 0) || questItem ? (getSize(item -> item.isQuestItem()) + slots) <= _owner.getQuestInventoryLimit() : (getSize(item -> !item.isQuestItem()) + slots) <= _owner.getInventoryLimit(); + return ((slots == 0) && !Config.AUTO_LOOT_SLOT_LIMIT) || questItem ? (getSize(item -> item.isQuestItem()) + slots) <= _owner.getQuestInventoryLimit() : (getSize(item -> !item.isQuestItem()) + slots) <= _owner.getInventoryLimit(); } @Override diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Character.ini b/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Character.ini index f33d2d3ff9..fb393b986e 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Character.ini +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Character.ini @@ -599,6 +599,11 @@ AutoLoot = False # Default: False AutoLootRaids = False +# Prevent auto loot when inventory slot limit is reached. +# The items will be dropped to the ground instead. +# Default: False +AutoLootSlotLimit = False + # Delay for raid drop items loot privilege # Require Command Channel , check next option # Value is in seconds diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/Config.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/Config.java index 76970d0b48..7204c6601e 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/Config.java @@ -263,6 +263,7 @@ public final class Config public static long MAX_ADENA; public static boolean AUTO_LOOT; public static boolean AUTO_LOOT_RAIDS; + public static boolean AUTO_LOOT_SLOT_LIMIT; public static int LOOT_RAIDS_PRIVILEGE_INTERVAL; public static int LOOT_RAIDS_PRIVILEGE_CC_SIZE; public static List AUTO_LOOT_ITEM_IDS; @@ -1556,6 +1557,7 @@ public final class Config } AUTO_LOOT = Character.getBoolean("AutoLoot", false); AUTO_LOOT_RAIDS = Character.getBoolean("AutoLootRaids", false); + AUTO_LOOT_SLOT_LIMIT = Character.getBoolean("AutoLootSlotLimit", 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(","); diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java index a3a85dfeba..fe69f256b5 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java @@ -840,7 +840,7 @@ public class PcInventory extends Inventory public boolean validateCapacity(long slots, boolean questItem) { - return (slots == 0) || questItem ? (getSize(item -> item.isQuestItem()) + slots) <= _owner.getQuestInventoryLimit() : (getSize(item -> !item.isQuestItem()) + slots) <= _owner.getInventoryLimit(); + return ((slots == 0) && !Config.AUTO_LOOT_SLOT_LIMIT) || questItem ? (getSize(item -> item.isQuestItem()) + slots) <= _owner.getQuestInventoryLimit() : (getSize(item -> !item.isQuestItem()) + slots) <= _owner.getInventoryLimit(); } @Override diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/Character.ini b/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/Character.ini index 2c03e93a4f..7964c48fea 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/Character.ini +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/Character.ini @@ -599,6 +599,11 @@ AutoLoot = False # Default: False AutoLootRaids = False +# Prevent auto loot when inventory slot limit is reached. +# The items will be dropped to the ground instead. +# Default: False +AutoLootSlotLimit = False + # Delay for raid drop items loot privilege # Require Command Channel , check next option # Value is in seconds diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/Config.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/Config.java index 76970d0b48..7204c6601e 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/Config.java @@ -263,6 +263,7 @@ public final class Config public static long MAX_ADENA; public static boolean AUTO_LOOT; public static boolean AUTO_LOOT_RAIDS; + public static boolean AUTO_LOOT_SLOT_LIMIT; public static int LOOT_RAIDS_PRIVILEGE_INTERVAL; public static int LOOT_RAIDS_PRIVILEGE_CC_SIZE; public static List AUTO_LOOT_ITEM_IDS; @@ -1556,6 +1557,7 @@ public final class Config } AUTO_LOOT = Character.getBoolean("AutoLoot", false); AUTO_LOOT_RAIDS = Character.getBoolean("AutoLootRaids", false); + AUTO_LOOT_SLOT_LIMIT = Character.getBoolean("AutoLootSlotLimit", 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(","); diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java index 432c0017f8..a89caa3cfa 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java @@ -840,7 +840,7 @@ public class PcInventory extends Inventory public boolean validateCapacity(long slots, boolean questItem) { - return (slots == 0) || questItem ? (getSize(item -> item.isQuestItem()) + slots) <= _owner.getQuestInventoryLimit() : (getSize(item -> !item.isQuestItem()) + slots) <= _owner.getInventoryLimit(); + return ((slots == 0) && !Config.AUTO_LOOT_SLOT_LIMIT) || questItem ? (getSize(item -> item.isQuestItem()) + slots) <= _owner.getQuestInventoryLimit() : (getSize(item -> !item.isQuestItem()) + slots) <= _owner.getInventoryLimit(); } @Override