From 19e7469695d49d05440baec04b9feef6d1612e03 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Wed, 18 Oct 2017 23:09:09 +0000 Subject: [PATCH] Retail configurable prohibition for henna premium slot. --- .../dist/game/config/Custom/PremiumSystem.ini | 5 +++++ .../java/com/l2jmobius/Config.java | 2 ++ .../model/actor/instance/L2PcInstance.java | 16 ++++++++++++++++ .../dist/game/config/Custom/PremiumSystem.ini | 5 +++++ .../java/com/l2jmobius/Config.java | 2 ++ .../model/actor/instance/L2PcInstance.java | 16 ++++++++++++++++ .../dist/game/config/Custom/PremiumSystem.ini | 5 +++++ .../java/com/l2jmobius/Config.java | 2 ++ .../model/actor/instance/L2PcInstance.java | 16 ++++++++++++++++ 9 files changed, 69 insertions(+) diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/config/Custom/PremiumSystem.ini b/L2J_Mobius_1.0_Ertheia/dist/game/config/Custom/PremiumSystem.ini index f8cbd4b528..8f467505ba 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/config/Custom/PremiumSystem.ini +++ b/L2J_Mobius_1.0_Ertheia/dist/game/config/Custom/PremiumSystem.ini @@ -31,6 +31,11 @@ PremiumRateSpoilAmount = 2 # Default: True EnablePremiumHennaSlot = True +# Enable any henna at premium slot. +# Also premium henna drawn at normal slots. +# Retail: False +EnableAnyHennaAtPremiumSlot = False + # Caution: Raid bosses and herbs are not affected by premium rates, but specific items can be affected by rates bellow. # List of items affected by custom drop rate by id, used now for Adena rate too. # Usage: itemId1,multiplier1;itemId2,multiplier2;... 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 89a3321bb4..dcbe8fe7c5 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/Config.java @@ -1112,6 +1112,7 @@ public final class Config public static float PREMIUM_RATE_SPOIL_CHANCE; public static float PREMIUM_RATE_SPOIL_AMOUNT; public static boolean PREMIUM_HENNA_SLOT_ENABLED; + public static boolean PREMIUM_HENNA_SLOT_ALL_DYES; public static Map PREMIUM_RATE_DROP_CHANCE_BY_ID; public static Map PREMIUM_RATE_DROP_AMOUNT_BY_ID; public static boolean PC_CAFE_ENABLED; @@ -2548,6 +2549,7 @@ public final class Config PREMIUM_RATE_SPOIL_CHANCE = PremiumSystem.getFloat("PremiumRateSpoilChance", 2); PREMIUM_RATE_SPOIL_AMOUNT = PremiumSystem.getFloat("PremiumRateSpoilAmount", 1); PREMIUM_HENNA_SLOT_ENABLED = PremiumSystem.getBoolean("EnablePremiumHennaSlot", true); + PREMIUM_HENNA_SLOT_ALL_DYES = PremiumSystem.getBoolean("EnableAnyHennaAtPremiumSlot", false); final String[] premiumDropChanceMultiplier = PremiumSystem.getString("PremiumRateDropChanceByItemId", "").split(";"); PREMIUM_RATE_DROP_CHANCE_BY_ID = new HashMap<>(premiumDropChanceMultiplier.length); if (!premiumDropChanceMultiplier[0].isEmpty()) diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index c606ea4b1b..f4912c0f28 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -7940,6 +7940,22 @@ public final class L2PcInstance extends L2Playable { for (int i = 1; i < 5; i++) { + // Check for retail premium dyes slot + if (!Config.PREMIUM_HENNA_SLOT_ALL_DYES) + { + if (i == 4) + { + if ((_henna[3] != null) || (henna.getDyeItemId() < 23825) || (henna.getDyeItemId() > 23830)) + { + return false; + } + } + else if ((henna.getDyeItemId() > 23824) && (henna.getDyeItemId() < 23831)) + { + continue; + } + } + if (_henna[i - 1] == null) { _henna[i - 1] = henna; diff --git a/L2J_Mobius_2.5_Underground/dist/game/config/Custom/PremiumSystem.ini b/L2J_Mobius_2.5_Underground/dist/game/config/Custom/PremiumSystem.ini index f8cbd4b528..8f467505ba 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/config/Custom/PremiumSystem.ini +++ b/L2J_Mobius_2.5_Underground/dist/game/config/Custom/PremiumSystem.ini @@ -31,6 +31,11 @@ PremiumRateSpoilAmount = 2 # Default: True EnablePremiumHennaSlot = True +# Enable any henna at premium slot. +# Also premium henna drawn at normal slots. +# Retail: False +EnableAnyHennaAtPremiumSlot = False + # Caution: Raid bosses and herbs are not affected by premium rates, but specific items can be affected by rates bellow. # List of items affected by custom drop rate by id, used now for Adena rate too. # Usage: itemId1,multiplier1;itemId2,multiplier2;... 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 8c07f5857e..8c5d68cf9f 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/Config.java @@ -1113,6 +1113,7 @@ public final class Config public static float PREMIUM_RATE_SPOIL_CHANCE; public static float PREMIUM_RATE_SPOIL_AMOUNT; public static boolean PREMIUM_HENNA_SLOT_ENABLED; + public static boolean PREMIUM_HENNA_SLOT_ALL_DYES; public static Map PREMIUM_RATE_DROP_CHANCE_BY_ID; public static Map PREMIUM_RATE_DROP_AMOUNT_BY_ID; public static boolean PC_CAFE_ENABLED; @@ -2550,6 +2551,7 @@ public final class Config PREMIUM_RATE_SPOIL_CHANCE = PremiumSystem.getFloat("PremiumRateSpoilChance", 2); PREMIUM_RATE_SPOIL_AMOUNT = PremiumSystem.getFloat("PremiumRateSpoilAmount", 1); PREMIUM_HENNA_SLOT_ENABLED = PremiumSystem.getBoolean("EnablePremiumHennaSlot", true); + PREMIUM_HENNA_SLOT_ALL_DYES = PremiumSystem.getBoolean("EnableAnyHennaAtPremiumSlot", false); final String[] premiumDropChanceMultiplier = PremiumSystem.getString("PremiumRateDropChanceByItemId", "").split(";"); PREMIUM_RATE_DROP_CHANCE_BY_ID = new HashMap<>(premiumDropChanceMultiplier.length); if (!premiumDropChanceMultiplier[0].isEmpty()) diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 8f3a73d632..0f2d6a1942 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -7940,6 +7940,22 @@ public final class L2PcInstance extends L2Playable { for (int i = 1; i < 5; i++) { + // Check for retail premium dyes slot + if (!Config.PREMIUM_HENNA_SLOT_ALL_DYES) + { + if (i == 4) + { + if ((_henna[3] != null) || (henna.getDyeItemId() < 23825) || (henna.getDyeItemId() > 23830)) + { + return false; + } + } + else if ((henna.getDyeItemId() > 23824) && (henna.getDyeItemId() < 23831)) + { + continue; + } + } + if (_henna[i - 1] == null) { _henna[i - 1] = henna; diff --git a/L2J_Mobius_3.0_Helios/dist/game/config/Custom/PremiumSystem.ini b/L2J_Mobius_3.0_Helios/dist/game/config/Custom/PremiumSystem.ini index f8cbd4b528..8f467505ba 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/config/Custom/PremiumSystem.ini +++ b/L2J_Mobius_3.0_Helios/dist/game/config/Custom/PremiumSystem.ini @@ -31,6 +31,11 @@ PremiumRateSpoilAmount = 2 # Default: True EnablePremiumHennaSlot = True +# Enable any henna at premium slot. +# Also premium henna drawn at normal slots. +# Retail: False +EnableAnyHennaAtPremiumSlot = False + # Caution: Raid bosses and herbs are not affected by premium rates, but specific items can be affected by rates bellow. # List of items affected by custom drop rate by id, used now for Adena rate too. # Usage: itemId1,multiplier1;itemId2,multiplier2;... 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 9d93c8b01e..85cb12d0f6 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/Config.java @@ -1121,6 +1121,7 @@ public final class Config public static float PREMIUM_RATE_SPOIL_CHANCE; public static float PREMIUM_RATE_SPOIL_AMOUNT; public static boolean PREMIUM_HENNA_SLOT_ENABLED; + public static boolean PREMIUM_HENNA_SLOT_ALL_DYES; public static Map PREMIUM_RATE_DROP_CHANCE_BY_ID; public static Map PREMIUM_RATE_DROP_AMOUNT_BY_ID; public static boolean PC_CAFE_ENABLED; @@ -2567,6 +2568,7 @@ public final class Config PREMIUM_RATE_SPOIL_CHANCE = PremiumSystem.getFloat("PremiumRateSpoilChance", 2); PREMIUM_RATE_SPOIL_AMOUNT = PremiumSystem.getFloat("PremiumRateSpoilAmount", 1); PREMIUM_HENNA_SLOT_ENABLED = PremiumSystem.getBoolean("EnablePremiumHennaSlot", true); + PREMIUM_HENNA_SLOT_ALL_DYES = PremiumSystem.getBoolean("EnableAnyHennaAtPremiumSlot", false); final String[] premiumDropChanceMultiplier = PremiumSystem.getString("PremiumRateDropChanceByItemId", "").split(";"); PREMIUM_RATE_DROP_CHANCE_BY_ID = new HashMap<>(premiumDropChanceMultiplier.length); if (!premiumDropChanceMultiplier[0].isEmpty()) diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 6fcaf62602..9df9350a31 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -7942,6 +7942,22 @@ public final class L2PcInstance extends L2Playable { for (int i = 1; i < 5; i++) { + // Check for retail premium dyes slot + if (!Config.PREMIUM_HENNA_SLOT_ALL_DYES) + { + if (i == 4) + { + if ((_henna[3] != null) || (henna.getDyeItemId() < 23825) || (henna.getDyeItemId() > 23830)) + { + return false; + } + } + else if ((henna.getDyeItemId() > 23824) && (henna.getDyeItemId() < 23831)) + { + continue; + } + } + if (_henna[i - 1] == null) { _henna[i - 1] = henna;