Configuration for item enchant announcement.

This commit is contained in:
MobiusDevelopment
2019-10-07 15:28:33 +00:00
parent d80a4dda26
commit 99fc3fb8bb
6 changed files with 56 additions and 10 deletions

View File

@@ -792,6 +792,11 @@ public class Config
public static int[] ENCHANT_BLACKLIST;
public static boolean DISABLE_OVER_ENCHANTING;
public static int MIN_ARMOR_ENCHANT_ANNOUNCE;
public static int MIN_WEAPON_ENCHANT_ANNOUNCE;
public static int MAX_ARMOR_ENCHANT_ANNOUNCE;
public static int MAX_WEAPON_ENCHANT_ANNOUNCE;
public static int[] AUGMENTATION_BLACKLIST;
public static boolean ALT_ALLOW_AUGMENT_PVP_ITEMS;
public static boolean ALT_ALLOW_AUGMENT_TRADE;
@@ -1801,14 +1806,17 @@ public class Config
}
Arrays.sort(ENCHANT_BLACKLIST);
DISABLE_OVER_ENCHANTING = Character.getBoolean("DisableOverEnchanting", true);
MIN_ARMOR_ENCHANT_ANNOUNCE = Character.getInt("MinimumArmorEnchantAnnounce", 6);
MIN_WEAPON_ENCHANT_ANNOUNCE = Character.getInt("MinimumWeaponEnchantAnnounce", 7);
MAX_ARMOR_ENCHANT_ANNOUNCE = Character.getInt("MaximumArmorEnchantAnnounce", 30);
MAX_WEAPON_ENCHANT_ANNOUNCE = Character.getInt("MaximumWeaponEnchantAnnounce", 30);
String[] array = Character.getString("AugmentationBlackList", "6656,6657,6658,6659,6660,6661,6662,8191,10170,10314,13740,13741,13742,13743,13744,13745,13746,13747,13748,14592,14593,14594,14595,14596,14597,14598,14599,14600,14664,14665,14666,14667,14668,14669,14670,14671,14672,14801,14802,14803,14804,14805,14806,14807,14808,14809,15282,15283,15284,15285,15286,15287,15288,15289,15290,15291,15292,15293,15294,15295,15296,15297,15298,15299,16025,16026,21712,22173,22174,22175").split(",");
AUGMENTATION_BLACKLIST = new int[array.length];
for (int i = 0; i < array.length; i++)
{
AUGMENTATION_BLACKLIST[i] = Integer.parseInt(array[i]);
}
Arrays.sort(AUGMENTATION_BLACKLIST);
ALT_ALLOW_AUGMENT_PVP_ITEMS = Character.getBoolean("AltAllowAugmentPvPItems", false);
ALT_ALLOW_AUGMENT_TRADE = Character.getBoolean("AltAllowAugmentTrade", false);

View File

@@ -229,9 +229,8 @@ public class RequestEnchantItem implements IClientIncomingPacket
}
// announce the success
final int minEnchantAnnounce = item.isArmor() ? 6 : 7;
final int maxEnchantAnnounce = item.isArmor() ? 0 : 30;
if ((item.getEnchantLevel() >= minEnchantAnnounce) || (item.getEnchantLevel() == maxEnchantAnnounce))
if ((item.getEnchantLevel() >= (item.isArmor() ? Config.MIN_ARMOR_ENCHANT_ANNOUNCE : Config.MIN_WEAPON_ENCHANT_ANNOUNCE)) //
&& (item.getEnchantLevel() <= (item.isArmor() ? Config.MAX_ARMOR_ENCHANT_ANNOUNCE : Config.MAX_WEAPON_ENCHANT_ANNOUNCE)))
{
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_HAS_SUCCESSFULLY_ENCHANTED_A_S2_S3);
sm.addString(player.getName());