diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/config/Olympiad.ini b/L2J_Mobius_1.0_Ertheia/dist/game/config/Olympiad.ini index 5ff680b062..844fb51db4 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/config/Olympiad.ini +++ b/L2J_Mobius_1.0_Ertheia/dist/game/config/Olympiad.ini @@ -130,7 +130,8 @@ AltOlyRestrictedItems = # Enchant limit for items during Olympiad battles. Disabled = -1. # Default: -1 -AltOlyEnchantLimit = -1 +AltOlyWeaponEnchantLimit = -1 +AltOlyArmorEnchantLimit = -1 # Log all Olympiad fights and outcome to olympiad.csv file. # Default: False diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/Config.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/Config.java index 0210fb2710..89bb4a61cd 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/Config.java @@ -543,7 +543,8 @@ public class Config public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS; public static boolean ALT_OLY_ANNOUNCE_GAMES; public static List LIST_OLY_RESTRICTED_ITEMS = new ArrayList<>(); - public static int ALT_OLY_ENCHANT_LIMIT; + public static int ALT_OLY_WEAPON_ENCHANT_LIMIT; + public static int ALT_OLY_ARMOR_ENCHANT_LIMIT; public static int ALT_OLY_WAIT_TIME; public static boolean ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS; public static String ALT_OLY_PERIOD; @@ -2356,7 +2357,8 @@ public class Config { LIST_OLY_RESTRICTED_ITEMS.clear(); } - ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1); + ALT_OLY_WEAPON_ENCHANT_LIMIT = Olympiad.getInt("AltOlyWeaponEnchantLimit", -1); + ALT_OLY_ARMOR_ENCHANT_LIMIT = Olympiad.getInt("AltOlyArmorEnchantLimit", -1); ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 60); ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS = Olympiad.getBoolean("AltOlyUseCustomPeriodSettings", false); ALT_OLY_PERIOD = Olympiad.getString("AltOlyPeriod", "MONTH"); diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java index 02ff168aec..7426c36266 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java @@ -2004,9 +2004,22 @@ public class ItemInstance extends WorldObject return enchant; } - if (player.isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (player.isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (_item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } return enchant; diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java index 00e2ff03fd..5003b7ae7b 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java @@ -129,9 +129,22 @@ public interface IStatFunction final double blessedBonus = item.isBlessed() ? 1.5 : 1; int enchant = equippedItem.getEnchantLevel(); - if (creature.getActingPlayer().isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (creature.getActingPlayer().isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } if ((stat == Stat.MAGICAL_DEFENCE) || (stat == Stat.PHYSICAL_DEFENCE)) diff --git a/L2J_Mobius_2.5_Underground/dist/game/config/Olympiad.ini b/L2J_Mobius_2.5_Underground/dist/game/config/Olympiad.ini index 8c4963bfc2..7a80e060be 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/config/Olympiad.ini +++ b/L2J_Mobius_2.5_Underground/dist/game/config/Olympiad.ini @@ -130,7 +130,8 @@ AltOlyRestrictedItems = # Enchant limit for items during Olympiad battles. Disabled = -1. # Default: -1 -AltOlyEnchantLimit = -1 +AltOlyWeaponEnchantLimit = -1 +AltOlyArmorEnchantLimit = -1 # Log all Olympiad fights and outcome to olympiad.csv file. # Default: False diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/Config.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/Config.java index 77b18d8dc6..cb7ef63863 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/Config.java @@ -550,7 +550,8 @@ public class Config public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS; public static boolean ALT_OLY_ANNOUNCE_GAMES; public static List LIST_OLY_RESTRICTED_ITEMS = new ArrayList<>(); - public static int ALT_OLY_ENCHANT_LIMIT; + public static int ALT_OLY_WEAPON_ENCHANT_LIMIT; + public static int ALT_OLY_ARMOR_ENCHANT_LIMIT; public static int ALT_OLY_WAIT_TIME; public static boolean ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS; public static String ALT_OLY_PERIOD; @@ -2372,7 +2373,8 @@ public class Config { LIST_OLY_RESTRICTED_ITEMS.clear(); } - ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1); + ALT_OLY_WEAPON_ENCHANT_LIMIT = Olympiad.getInt("AltOlyWeaponEnchantLimit", -1); + ALT_OLY_ARMOR_ENCHANT_LIMIT = Olympiad.getInt("AltOlyArmorEnchantLimit", -1); ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 60); ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS = Olympiad.getBoolean("AltOlyUseCustomPeriodSettings", false); ALT_OLY_PERIOD = Olympiad.getString("AltOlyPeriod", "MONTH"); diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java index 9705033b06..66bed613d5 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java @@ -2011,9 +2011,22 @@ public class ItemInstance extends WorldObject return enchant; } - if (player.isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (player.isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (_item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } return enchant; diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java index 00e2ff03fd..5003b7ae7b 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java @@ -129,9 +129,22 @@ public interface IStatFunction final double blessedBonus = item.isBlessed() ? 1.5 : 1; int enchant = equippedItem.getEnchantLevel(); - if (creature.getActingPlayer().isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (creature.getActingPlayer().isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } if ((stat == Stat.MAGICAL_DEFENCE) || (stat == Stat.PHYSICAL_DEFENCE)) diff --git a/L2J_Mobius_3.0_Helios/dist/game/config/Olympiad.ini b/L2J_Mobius_3.0_Helios/dist/game/config/Olympiad.ini index 8c4963bfc2..7a80e060be 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/config/Olympiad.ini +++ b/L2J_Mobius_3.0_Helios/dist/game/config/Olympiad.ini @@ -130,7 +130,8 @@ AltOlyRestrictedItems = # Enchant limit for items during Olympiad battles. Disabled = -1. # Default: -1 -AltOlyEnchantLimit = -1 +AltOlyWeaponEnchantLimit = -1 +AltOlyArmorEnchantLimit = -1 # Log all Olympiad fights and outcome to olympiad.csv file. # Default: False diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/Config.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/Config.java index 16910e3782..db03ddcb24 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/Config.java @@ -550,7 +550,8 @@ public class Config public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS; public static boolean ALT_OLY_ANNOUNCE_GAMES; public static List LIST_OLY_RESTRICTED_ITEMS = new ArrayList<>(); - public static int ALT_OLY_ENCHANT_LIMIT; + public static int ALT_OLY_WEAPON_ENCHANT_LIMIT; + public static int ALT_OLY_ARMOR_ENCHANT_LIMIT; public static int ALT_OLY_WAIT_TIME; public static boolean ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS; public static String ALT_OLY_PERIOD; @@ -2386,7 +2387,8 @@ public class Config { LIST_OLY_RESTRICTED_ITEMS.clear(); } - ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1); + ALT_OLY_WEAPON_ENCHANT_LIMIT = Olympiad.getInt("AltOlyWeaponEnchantLimit", -1); + ALT_OLY_ARMOR_ENCHANT_LIMIT = Olympiad.getInt("AltOlyArmorEnchantLimit", -1); ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 60); ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS = Olympiad.getBoolean("AltOlyUseCustomPeriodSettings", false); ALT_OLY_PERIOD = Olympiad.getString("AltOlyPeriod", "MONTH"); diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java index 9705033b06..66bed613d5 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java @@ -2011,9 +2011,22 @@ public class ItemInstance extends WorldObject return enchant; } - if (player.isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (player.isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (_item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } return enchant; diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java index 00e2ff03fd..5003b7ae7b 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java @@ -129,9 +129,22 @@ public interface IStatFunction final double blessedBonus = item.isBlessed() ? 1.5 : 1; int enchant = equippedItem.getEnchantLevel(); - if (creature.getActingPlayer().isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (creature.getActingPlayer().isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } if ((stat == Stat.MAGICAL_DEFENCE) || (stat == Stat.PHYSICAL_DEFENCE)) diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/config/Olympiad.ini b/L2J_Mobius_4.0_GrandCrusade/dist/game/config/Olympiad.ini index d85079af0b..6bdc191c3c 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/config/Olympiad.ini +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/config/Olympiad.ini @@ -116,7 +116,8 @@ AltOlyRestrictedItems = # Enchant limit for items during Olympiad battles. Disabled = -1. # Default: -1 -AltOlyEnchantLimit = -1 +AltOlyWeaponEnchantLimit = -1 +AltOlyArmorEnchantLimit = -1 # Log all Olympiad fights and outcome to olympiad.csv file. # Default: False diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/Config.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/Config.java index 2ce58d83dc..8a37219a93 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/Config.java @@ -539,7 +539,8 @@ public class Config public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS; public static boolean ALT_OLY_ANNOUNCE_GAMES; public static List LIST_OLY_RESTRICTED_ITEMS = new ArrayList<>(); - public static int ALT_OLY_ENCHANT_LIMIT; + public static int ALT_OLY_WEAPON_ENCHANT_LIMIT; + public static int ALT_OLY_ARMOR_ENCHANT_LIMIT; public static int ALT_OLY_WAIT_TIME; public static String ALT_OLY_PERIOD; public static int ALT_OLY_PERIOD_MULTIPLIER; @@ -2362,7 +2363,8 @@ public class Config { LIST_OLY_RESTRICTED_ITEMS.clear(); } - ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1); + ALT_OLY_WEAPON_ENCHANT_LIMIT = Olympiad.getInt("AltOlyWeaponEnchantLimit", -1); + ALT_OLY_ARMOR_ENCHANT_LIMIT = Olympiad.getInt("AltOlyArmorEnchantLimit", -1); ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 60); ALT_OLY_PERIOD = Olympiad.getString("AltOlyPeriod", "MONTH"); ALT_OLY_PERIOD_MULTIPLIER = Olympiad.getInt("AltOlyPeriodMultiplier", 1); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java index 9765ba9d45..2418bfa500 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java @@ -2011,9 +2011,22 @@ public class ItemInstance extends WorldObject return enchant; } - if (player.isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (player.isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (_item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } return enchant; diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java index 00e2ff03fd..5003b7ae7b 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java @@ -129,9 +129,22 @@ public interface IStatFunction final double blessedBonus = item.isBlessed() ? 1.5 : 1; int enchant = equippedItem.getEnchantLevel(); - if (creature.getActingPlayer().isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (creature.getActingPlayer().isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } if ((stat == Stat.MAGICAL_DEFENCE) || (stat == Stat.PHYSICAL_DEFENCE)) diff --git a/L2J_Mobius_5.0_Salvation/dist/game/config/Olympiad.ini b/L2J_Mobius_5.0_Salvation/dist/game/config/Olympiad.ini index d85079af0b..6bdc191c3c 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/config/Olympiad.ini +++ b/L2J_Mobius_5.0_Salvation/dist/game/config/Olympiad.ini @@ -116,7 +116,8 @@ AltOlyRestrictedItems = # Enchant limit for items during Olympiad battles. Disabled = -1. # Default: -1 -AltOlyEnchantLimit = -1 +AltOlyWeaponEnchantLimit = -1 +AltOlyArmorEnchantLimit = -1 # Log all Olympiad fights and outcome to olympiad.csv file. # Default: False diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/Config.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/Config.java index 64787fa908..95d6f48c7b 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/Config.java @@ -534,7 +534,8 @@ public class Config public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS; public static boolean ALT_OLY_ANNOUNCE_GAMES; public static List LIST_OLY_RESTRICTED_ITEMS = new ArrayList<>(); - public static int ALT_OLY_ENCHANT_LIMIT; + public static int ALT_OLY_WEAPON_ENCHANT_LIMIT; + public static int ALT_OLY_ARMOR_ENCHANT_LIMIT; public static int ALT_OLY_WAIT_TIME; public static String ALT_OLY_PERIOD; public static int ALT_OLY_PERIOD_MULTIPLIER; @@ -2362,7 +2363,8 @@ public class Config { LIST_OLY_RESTRICTED_ITEMS.clear(); } - ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1); + ALT_OLY_WEAPON_ENCHANT_LIMIT = Olympiad.getInt("AltOlyWeaponEnchantLimit", -1); + ALT_OLY_ARMOR_ENCHANT_LIMIT = Olympiad.getInt("AltOlyArmorEnchantLimit", -1); ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 60); ALT_OLY_PERIOD = Olympiad.getString("AltOlyPeriod", "MONTH"); ALT_OLY_PERIOD_MULTIPLIER = Olympiad.getInt("AltOlyPeriodMultiplier", 1); diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java index eee2a531e5..6e47cf4d44 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java @@ -2019,9 +2019,22 @@ public class ItemInstance extends WorldObject return enchant; } - if (player.isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (player.isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (_item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } return enchant; diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java index 9026f10ca6..de110a62cf 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java @@ -129,9 +129,22 @@ public interface IStatFunction final double blessedBonus = item.isBlessed() ? 1.5 : 1; int enchant = equippedItem.getEnchantLevel(); - if (creature.getActingPlayer().isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (creature.getActingPlayer().isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } if ((stat == Stat.MAGICAL_DEFENCE) || (stat == Stat.PHYSICAL_DEFENCE)) diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/config/Olympiad.ini b/L2J_Mobius_5.5_EtinasFate/dist/game/config/Olympiad.ini index d85079af0b..6bdc191c3c 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/config/Olympiad.ini +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/config/Olympiad.ini @@ -116,7 +116,8 @@ AltOlyRestrictedItems = # Enchant limit for items during Olympiad battles. Disabled = -1. # Default: -1 -AltOlyEnchantLimit = -1 +AltOlyWeaponEnchantLimit = -1 +AltOlyArmorEnchantLimit = -1 # Log all Olympiad fights and outcome to olympiad.csv file. # Default: False diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/Config.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/Config.java index 7aa2d2a445..9275eb8320 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/Config.java @@ -534,7 +534,8 @@ public class Config public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS; public static boolean ALT_OLY_ANNOUNCE_GAMES; public static List LIST_OLY_RESTRICTED_ITEMS = new ArrayList<>(); - public static int ALT_OLY_ENCHANT_LIMIT; + public static int ALT_OLY_WEAPON_ENCHANT_LIMIT; + public static int ALT_OLY_ARMOR_ENCHANT_LIMIT; public static int ALT_OLY_WAIT_TIME; public static String ALT_OLY_PERIOD; public static int ALT_OLY_PERIOD_MULTIPLIER; @@ -2369,7 +2370,8 @@ public class Config { LIST_OLY_RESTRICTED_ITEMS.clear(); } - ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1); + ALT_OLY_WEAPON_ENCHANT_LIMIT = Olympiad.getInt("AltOlyWeaponEnchantLimit", -1); + ALT_OLY_ARMOR_ENCHANT_LIMIT = Olympiad.getInt("AltOlyArmorEnchantLimit", -1); ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 60); ALT_OLY_PERIOD = Olympiad.getString("AltOlyPeriod", "MONTH"); ALT_OLY_PERIOD_MULTIPLIER = Olympiad.getInt("AltOlyPeriodMultiplier", 1); diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java index eee2a531e5..6e47cf4d44 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java @@ -2019,9 +2019,22 @@ public class ItemInstance extends WorldObject return enchant; } - if (player.isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (player.isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (_item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } return enchant; diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java index 9026f10ca6..de110a62cf 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java @@ -129,9 +129,22 @@ public interface IStatFunction final double blessedBonus = item.isBlessed() ? 1.5 : 1; int enchant = equippedItem.getEnchantLevel(); - if (creature.getActingPlayer().isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (creature.getActingPlayer().isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } if ((stat == Stat.MAGICAL_DEFENCE) || (stat == Stat.PHYSICAL_DEFENCE)) diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/config/Olympiad.ini b/L2J_Mobius_6.0_Fafurion/dist/game/config/Olympiad.ini index d85079af0b..6bdc191c3c 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/config/Olympiad.ini +++ b/L2J_Mobius_6.0_Fafurion/dist/game/config/Olympiad.ini @@ -116,7 +116,8 @@ AltOlyRestrictedItems = # Enchant limit for items during Olympiad battles. Disabled = -1. # Default: -1 -AltOlyEnchantLimit = -1 +AltOlyWeaponEnchantLimit = -1 +AltOlyArmorEnchantLimit = -1 # Log all Olympiad fights and outcome to olympiad.csv file. # Default: False diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/Config.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/Config.java index 3591ef1b53..d1f6414e07 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/Config.java @@ -535,7 +535,8 @@ public class Config public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS; public static boolean ALT_OLY_ANNOUNCE_GAMES; public static List LIST_OLY_RESTRICTED_ITEMS = new ArrayList<>(); - public static int ALT_OLY_ENCHANT_LIMIT; + public static int ALT_OLY_WEAPON_ENCHANT_LIMIT; + public static int ALT_OLY_ARMOR_ENCHANT_LIMIT; public static int ALT_OLY_WAIT_TIME; public static String ALT_OLY_PERIOD; public static int ALT_OLY_PERIOD_MULTIPLIER; @@ -2408,7 +2409,8 @@ public class Config { LIST_OLY_RESTRICTED_ITEMS.clear(); } - ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1); + ALT_OLY_WEAPON_ENCHANT_LIMIT = Olympiad.getInt("AltOlyWeaponEnchantLimit", -1); + ALT_OLY_ARMOR_ENCHANT_LIMIT = Olympiad.getInt("AltOlyArmorEnchantLimit", -1); ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 60); ALT_OLY_PERIOD = Olympiad.getString("AltOlyPeriod", "MONTH"); ALT_OLY_PERIOD_MULTIPLIER = Olympiad.getInt("AltOlyPeriodMultiplier", 1); diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java index eee2a531e5..6e47cf4d44 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java @@ -2019,9 +2019,22 @@ public class ItemInstance extends WorldObject return enchant; } - if (player.isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (player.isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (_item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } return enchant; diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java index 9026f10ca6..de110a62cf 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java @@ -129,9 +129,22 @@ public interface IStatFunction final double blessedBonus = item.isBlessed() ? 1.5 : 1; int enchant = equippedItem.getEnchantLevel(); - if (creature.getActingPlayer().isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (creature.getActingPlayer().isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } if ((stat == Stat.MAGICAL_DEFENCE) || (stat == Stat.PHYSICAL_DEFENCE)) diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/config/Olympiad.ini b/L2J_Mobius_7.0_PreludeOfWar/dist/game/config/Olympiad.ini index d85079af0b..6bdc191c3c 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/config/Olympiad.ini +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/config/Olympiad.ini @@ -116,7 +116,8 @@ AltOlyRestrictedItems = # Enchant limit for items during Olympiad battles. Disabled = -1. # Default: -1 -AltOlyEnchantLimit = -1 +AltOlyWeaponEnchantLimit = -1 +AltOlyArmorEnchantLimit = -1 # Log all Olympiad fights and outcome to olympiad.csv file. # Default: False diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/Config.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/Config.java index bcbd17e8b4..512eecd5ae 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/Config.java @@ -535,7 +535,8 @@ public class Config public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS; public static boolean ALT_OLY_ANNOUNCE_GAMES; public static List LIST_OLY_RESTRICTED_ITEMS = new ArrayList<>(); - public static int ALT_OLY_ENCHANT_LIMIT; + public static int ALT_OLY_WEAPON_ENCHANT_LIMIT; + public static int ALT_OLY_ARMOR_ENCHANT_LIMIT; public static int ALT_OLY_WAIT_TIME; public static String ALT_OLY_PERIOD; public static int ALT_OLY_PERIOD_MULTIPLIER; @@ -2430,7 +2431,8 @@ public class Config { LIST_OLY_RESTRICTED_ITEMS.clear(); } - ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1); + ALT_OLY_WEAPON_ENCHANT_LIMIT = Olympiad.getInt("AltOlyWeaponEnchantLimit", -1); + ALT_OLY_ARMOR_ENCHANT_LIMIT = Olympiad.getInt("AltOlyArmorEnchantLimit", -1); ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 60); ALT_OLY_PERIOD = Olympiad.getString("AltOlyPeriod", "MONTH"); ALT_OLY_PERIOD_MULTIPLIER = Olympiad.getInt("AltOlyPeriodMultiplier", 1); diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java index eee2a531e5..6e47cf4d44 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java @@ -2019,9 +2019,22 @@ public class ItemInstance extends WorldObject return enchant; } - if (player.isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (player.isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (_item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } return enchant; diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java index 9026f10ca6..de110a62cf 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java @@ -129,9 +129,22 @@ public interface IStatFunction final double blessedBonus = item.isBlessed() ? 1.5 : 1; int enchant = equippedItem.getEnchantLevel(); - if (creature.getActingPlayer().isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (creature.getActingPlayer().isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } if ((stat == Stat.MAGICAL_DEFENCE) || (stat == Stat.PHYSICAL_DEFENCE)) diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Olympiad.ini b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Olympiad.ini index cf45813e46..c821ccdbc8 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Olympiad.ini +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Olympiad.ini @@ -116,7 +116,8 @@ AltOlyRestrictedItems = # Enchant limit for items during Olympiad battles. Disabled = -1. # Default: -1 -AltOlyEnchantLimit = -1 +AltOlyWeaponEnchantLimit = -1 +AltOlyArmorEnchantLimit = -1 # Log all Olympiad fights and outcome to olympiad.csv file. # Default: False diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/Config.java index ad0134a7de..92ee9a3744 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/Config.java @@ -544,7 +544,8 @@ public class Config public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS; public static boolean ALT_OLY_ANNOUNCE_GAMES; public static List LIST_OLY_RESTRICTED_ITEMS = new ArrayList<>(); - public static int ALT_OLY_ENCHANT_LIMIT; + public static int ALT_OLY_WEAPON_ENCHANT_LIMIT; + public static int ALT_OLY_ARMOR_ENCHANT_LIMIT; public static int ALT_OLY_WAIT_TIME; public static String ALT_OLY_PERIOD; public static int ALT_OLY_PERIOD_MULTIPLIER; @@ -2276,7 +2277,8 @@ public class Config { LIST_OLY_RESTRICTED_ITEMS.clear(); } - ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1); + ALT_OLY_WEAPON_ENCHANT_LIMIT = Olympiad.getInt("AltOlyWeaponEnchantLimit", -1); + ALT_OLY_ARMOR_ENCHANT_LIMIT = Olympiad.getInt("AltOlyArmorEnchantLimit", -1); ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 60); ALT_OLY_PERIOD = Olympiad.getString("AltOlyPeriod", "MONTH"); ALT_OLY_PERIOD_MULTIPLIER = Olympiad.getInt("AltOlyPeriodMultiplier", 1); diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java index a2008372bf..ca2856f8d1 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java @@ -2009,9 +2009,22 @@ public class ItemInstance extends WorldObject return enchant; } - if (player.isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (player.isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (_item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } return enchant; diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java index 00e2ff03fd..5003b7ae7b 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java @@ -129,9 +129,22 @@ public interface IStatFunction final double blessedBonus = item.isBlessed() ? 1.5 : 1; int enchant = equippedItem.getEnchantLevel(); - if (creature.getActingPlayer().isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (creature.getActingPlayer().isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } if ((stat == Stat.MAGICAL_DEFENCE) || (stat == Stat.PHYSICAL_DEFENCE)) diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Olympiad.ini b/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Olympiad.ini index cf45813e46..c821ccdbc8 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Olympiad.ini +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Olympiad.ini @@ -116,7 +116,8 @@ AltOlyRestrictedItems = # Enchant limit for items during Olympiad battles. Disabled = -1. # Default: -1 -AltOlyEnchantLimit = -1 +AltOlyWeaponEnchantLimit = -1 +AltOlyArmorEnchantLimit = -1 # Log all Olympiad fights and outcome to olympiad.csv file. # Default: False diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java index b03e4e94ac..b7f4c6e50a 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java @@ -544,7 +544,8 @@ public class Config public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS; public static boolean ALT_OLY_ANNOUNCE_GAMES; public static List LIST_OLY_RESTRICTED_ITEMS = new ArrayList<>(); - public static int ALT_OLY_ENCHANT_LIMIT; + public static int ALT_OLY_WEAPON_ENCHANT_LIMIT; + public static int ALT_OLY_ARMOR_ENCHANT_LIMIT; public static int ALT_OLY_WAIT_TIME; public static String ALT_OLY_PERIOD; public static int ALT_OLY_PERIOD_MULTIPLIER; @@ -2280,7 +2281,8 @@ public class Config { LIST_OLY_RESTRICTED_ITEMS.clear(); } - ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1); + ALT_OLY_WEAPON_ENCHANT_LIMIT = Olympiad.getInt("AltOlyWeaponEnchantLimit", -1); + ALT_OLY_ARMOR_ENCHANT_LIMIT = Olympiad.getInt("AltOlyArmorEnchantLimit", -1); ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 60); ALT_OLY_PERIOD = Olympiad.getString("AltOlyPeriod", "MONTH"); ALT_OLY_PERIOD_MULTIPLIER = Olympiad.getInt("AltOlyPeriodMultiplier", 1); diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java index a2008372bf..ca2856f8d1 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java @@ -2009,9 +2009,22 @@ public class ItemInstance extends WorldObject return enchant; } - if (player.isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (player.isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (_item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } return enchant; diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java index 00e2ff03fd..5003b7ae7b 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java @@ -129,9 +129,22 @@ public interface IStatFunction final double blessedBonus = item.isBlessed() ? 1.5 : 1; int enchant = equippedItem.getEnchantLevel(); - if (creature.getActingPlayer().isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (creature.getActingPlayer().isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } if ((stat == Stat.MAGICAL_DEFENCE) || (stat == Stat.PHYSICAL_DEFENCE)) diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/Olympiad.ini b/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/Olympiad.ini index cf45813e46..c821ccdbc8 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/Olympiad.ini +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/Olympiad.ini @@ -116,7 +116,8 @@ AltOlyRestrictedItems = # Enchant limit for items during Olympiad battles. Disabled = -1. # Default: -1 -AltOlyEnchantLimit = -1 +AltOlyWeaponEnchantLimit = -1 +AltOlyArmorEnchantLimit = -1 # Log all Olympiad fights and outcome to olympiad.csv file. # Default: False diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/Config.java index b03e4e94ac..b7f4c6e50a 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/Config.java @@ -544,7 +544,8 @@ public class Config public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS; public static boolean ALT_OLY_ANNOUNCE_GAMES; public static List LIST_OLY_RESTRICTED_ITEMS = new ArrayList<>(); - public static int ALT_OLY_ENCHANT_LIMIT; + public static int ALT_OLY_WEAPON_ENCHANT_LIMIT; + public static int ALT_OLY_ARMOR_ENCHANT_LIMIT; public static int ALT_OLY_WAIT_TIME; public static String ALT_OLY_PERIOD; public static int ALT_OLY_PERIOD_MULTIPLIER; @@ -2280,7 +2281,8 @@ public class Config { LIST_OLY_RESTRICTED_ITEMS.clear(); } - ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1); + ALT_OLY_WEAPON_ENCHANT_LIMIT = Olympiad.getInt("AltOlyWeaponEnchantLimit", -1); + ALT_OLY_ARMOR_ENCHANT_LIMIT = Olympiad.getInt("AltOlyArmorEnchantLimit", -1); ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 60); ALT_OLY_PERIOD = Olympiad.getString("AltOlyPeriod", "MONTH"); ALT_OLY_PERIOD_MULTIPLIER = Olympiad.getInt("AltOlyPeriodMultiplier", 1); diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java index a2008372bf..ca2856f8d1 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java @@ -2009,9 +2009,22 @@ public class ItemInstance extends WorldObject return enchant; } - if (player.isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (player.isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (_item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } return enchant; diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java index 9026f10ca6..de110a62cf 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java @@ -129,9 +129,22 @@ public interface IStatFunction final double blessedBonus = item.isBlessed() ? 1.5 : 1; int enchant = equippedItem.getEnchantLevel(); - if (creature.getActingPlayer().isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (creature.getActingPlayer().isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } if ((stat == Stat.MAGICAL_DEFENCE) || (stat == Stat.PHYSICAL_DEFENCE)) diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/Olympiad.ini b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/Olympiad.ini index cf45813e46..c821ccdbc8 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/Olympiad.ini +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/Olympiad.ini @@ -116,7 +116,8 @@ AltOlyRestrictedItems = # Enchant limit for items during Olympiad battles. Disabled = -1. # Default: -1 -AltOlyEnchantLimit = -1 +AltOlyWeaponEnchantLimit = -1 +AltOlyArmorEnchantLimit = -1 # Log all Olympiad fights and outcome to olympiad.csv file. # Default: False diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/Config.java index ca972acdf9..2b713e7438 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/Config.java @@ -544,7 +544,8 @@ public class Config public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS; public static boolean ALT_OLY_ANNOUNCE_GAMES; public static List LIST_OLY_RESTRICTED_ITEMS = new ArrayList<>(); - public static int ALT_OLY_ENCHANT_LIMIT; + public static int ALT_OLY_WEAPON_ENCHANT_LIMIT; + public static int ALT_OLY_ARMOR_ENCHANT_LIMIT; public static int ALT_OLY_WAIT_TIME; public static String ALT_OLY_PERIOD; public static int ALT_OLY_PERIOD_MULTIPLIER; @@ -2281,7 +2282,8 @@ public class Config { LIST_OLY_RESTRICTED_ITEMS.clear(); } - ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1); + ALT_OLY_WEAPON_ENCHANT_LIMIT = Olympiad.getInt("AltOlyWeaponEnchantLimit", -1); + ALT_OLY_ARMOR_ENCHANT_LIMIT = Olympiad.getInt("AltOlyArmorEnchantLimit", -1); ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 60); ALT_OLY_PERIOD = Olympiad.getString("AltOlyPeriod", "MONTH"); ALT_OLY_PERIOD_MULTIPLIER = Olympiad.getInt("AltOlyPeriodMultiplier", 1); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java index a2008372bf..ca2856f8d1 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java @@ -2009,9 +2009,22 @@ public class ItemInstance extends WorldObject return enchant; } - if (player.isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (player.isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (_item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } return enchant; diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java index 9026f10ca6..de110a62cf 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java @@ -129,9 +129,22 @@ public interface IStatFunction final double blessedBonus = item.isBlessed() ? 1.5 : 1; int enchant = equippedItem.getEnchantLevel(); - if (creature.getActingPlayer().isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (creature.getActingPlayer().isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } if ((stat == Stat.MAGICAL_DEFENCE) || (stat == Stat.PHYSICAL_DEFENCE)) diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/config/Olympiad.ini b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/config/Olympiad.ini index cf45813e46..c821ccdbc8 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/config/Olympiad.ini +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/config/Olympiad.ini @@ -116,7 +116,8 @@ AltOlyRestrictedItems = # Enchant limit for items during Olympiad battles. Disabled = -1. # Default: -1 -AltOlyEnchantLimit = -1 +AltOlyWeaponEnchantLimit = -1 +AltOlyArmorEnchantLimit = -1 # Log all Olympiad fights and outcome to olympiad.csv file. # Default: False diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/Config.java index 74ea1dfbdf..c5234476ac 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/Config.java @@ -544,7 +544,8 @@ public class Config public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS; public static boolean ALT_OLY_ANNOUNCE_GAMES; public static List LIST_OLY_RESTRICTED_ITEMS = new ArrayList<>(); - public static int ALT_OLY_ENCHANT_LIMIT; + public static int ALT_OLY_WEAPON_ENCHANT_LIMIT; + public static int ALT_OLY_ARMOR_ENCHANT_LIMIT; public static int ALT_OLY_WAIT_TIME; public static String ALT_OLY_PERIOD; public static int ALT_OLY_PERIOD_MULTIPLIER; @@ -2290,7 +2291,8 @@ public class Config { LIST_OLY_RESTRICTED_ITEMS.clear(); } - ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1); + ALT_OLY_WEAPON_ENCHANT_LIMIT = Olympiad.getInt("AltOlyWeaponEnchantLimit", -1); + ALT_OLY_ARMOR_ENCHANT_LIMIT = Olympiad.getInt("AltOlyArmorEnchantLimit", -1); ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 60); ALT_OLY_PERIOD = Olympiad.getString("AltOlyPeriod", "MONTH"); ALT_OLY_PERIOD_MULTIPLIER = Olympiad.getInt("AltOlyPeriodMultiplier", 1); diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java index a2008372bf..ca2856f8d1 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java @@ -2009,9 +2009,22 @@ public class ItemInstance extends WorldObject return enchant; } - if (player.isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (player.isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (_item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } return enchant; diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java index 9026f10ca6..de110a62cf 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java @@ -129,9 +129,22 @@ public interface IStatFunction final double blessedBonus = item.isBlessed() ? 1.5 : 1; int enchant = equippedItem.getEnchantLevel(); - if (creature.getActingPlayer().isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (creature.getActingPlayer().isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } if ((stat == Stat.MAGICAL_DEFENCE) || (stat == Stat.PHYSICAL_DEFENCE)) diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Olympiad.ini b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Olympiad.ini index cf45813e46..c821ccdbc8 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Olympiad.ini +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Olympiad.ini @@ -116,7 +116,8 @@ AltOlyRestrictedItems = # Enchant limit for items during Olympiad battles. Disabled = -1. # Default: -1 -AltOlyEnchantLimit = -1 +AltOlyWeaponEnchantLimit = -1 +AltOlyArmorEnchantLimit = -1 # Log all Olympiad fights and outcome to olympiad.csv file. # Default: False diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/Config.java index 9ab34a551b..03d6a70896 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/Config.java @@ -544,7 +544,8 @@ public class Config public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS; public static boolean ALT_OLY_ANNOUNCE_GAMES; public static List LIST_OLY_RESTRICTED_ITEMS = new ArrayList<>(); - public static int ALT_OLY_ENCHANT_LIMIT; + public static int ALT_OLY_WEAPON_ENCHANT_LIMIT; + public static int ALT_OLY_ARMOR_ENCHANT_LIMIT; public static int ALT_OLY_WAIT_TIME; public static String ALT_OLY_PERIOD; public static int ALT_OLY_PERIOD_MULTIPLIER; @@ -2307,7 +2308,8 @@ public class Config { LIST_OLY_RESTRICTED_ITEMS.clear(); } - ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1); + ALT_OLY_WEAPON_ENCHANT_LIMIT = Olympiad.getInt("AltOlyWeaponEnchantLimit", -1); + ALT_OLY_ARMOR_ENCHANT_LIMIT = Olympiad.getInt("AltOlyArmorEnchantLimit", -1); ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 60); ALT_OLY_PERIOD = Olympiad.getString("AltOlyPeriod", "MONTH"); ALT_OLY_PERIOD_MULTIPLIER = Olympiad.getInt("AltOlyPeriodMultiplier", 1); diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java index a2008372bf..ca2856f8d1 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java @@ -2009,9 +2009,22 @@ public class ItemInstance extends WorldObject return enchant; } - if (player.isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (player.isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (_item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } return enchant; diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java index 9026f10ca6..de110a62cf 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java @@ -129,9 +129,22 @@ public interface IStatFunction final double blessedBonus = item.isBlessed() ? 1.5 : 1; int enchant = equippedItem.getEnchantLevel(); - if (creature.getActingPlayer().isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (creature.getActingPlayer().isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } if ((stat == Stat.MAGICAL_DEFENCE) || (stat == Stat.PHYSICAL_DEFENCE)) diff --git a/L2J_Mobius_Classic_Interlude/dist/game/config/Olympiad.ini b/L2J_Mobius_Classic_Interlude/dist/game/config/Olympiad.ini index c7dd83af3f..2f1b32adcd 100644 --- a/L2J_Mobius_Classic_Interlude/dist/game/config/Olympiad.ini +++ b/L2J_Mobius_Classic_Interlude/dist/game/config/Olympiad.ini @@ -116,7 +116,8 @@ AltOlyRestrictedItems = # Enchant limit for items during Olympiad battles. Disabled = -1. # Default: -1 -AltOlyEnchantLimit = -1 +AltOlyWeaponEnchantLimit = -1 +AltOlyArmorEnchantLimit = -1 # Log all Olympiad fights and outcome to olympiad.csv file. # Default: False diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java index 67ce449e26..5a747cc991 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java @@ -547,7 +547,8 @@ public class Config public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS; public static boolean ALT_OLY_ANNOUNCE_GAMES; public static List LIST_OLY_RESTRICTED_ITEMS = new ArrayList<>(); - public static int ALT_OLY_ENCHANT_LIMIT; + public static int ALT_OLY_WEAPON_ENCHANT_LIMIT; + public static int ALT_OLY_ARMOR_ENCHANT_LIMIT; public static int ALT_OLY_WAIT_TIME; public static String ALT_OLY_PERIOD; public static int ALT_OLY_PERIOD_MULTIPLIER; @@ -2302,7 +2303,8 @@ public class Config { LIST_OLY_RESTRICTED_ITEMS.clear(); } - ALT_OLY_ENCHANT_LIMIT = Olympiad.getInt("AltOlyEnchantLimit", -1); + ALT_OLY_WEAPON_ENCHANT_LIMIT = Olympiad.getInt("AltOlyWeaponEnchantLimit", -1); + ALT_OLY_ARMOR_ENCHANT_LIMIT = Olympiad.getInt("AltOlyArmorEnchantLimit", -1); ALT_OLY_WAIT_TIME = Olympiad.getInt("AltOlyWaitTime", 60); ALT_OLY_PERIOD = Olympiad.getString("AltOlyPeriod", "MONTH"); ALT_OLY_PERIOD_MULTIPLIER = Olympiad.getInt("AltOlyPeriodMultiplier", 1); diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java index 9297549a09..574a393539 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java @@ -1991,9 +1991,22 @@ public class ItemInstance extends WorldObject return enchant; } - if (player.isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (player.isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (_item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } return enchant; diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java index 00e2ff03fd..5003b7ae7b 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java @@ -129,9 +129,22 @@ public interface IStatFunction final double blessedBonus = item.isBlessed() ? 1.5 : 1; int enchant = equippedItem.getEnchantLevel(); - if (creature.getActingPlayer().isInOlympiadMode() && (Config.ALT_OLY_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ENCHANT_LIMIT)) + if (creature.getActingPlayer().isInOlympiadMode()) { - enchant = Config.ALT_OLY_ENCHANT_LIMIT; + if (item.isWeapon()) + { + if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT; + } + } + else + { + if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT)) + { + enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT; + } + } } if ((stat == Stat.MAGICAL_DEFENCE) || (stat == Stat.PHYSICAL_DEFENCE))