Addition of over enchanting prohibition config.

This commit is contained in:
MobiusDev 2018-04-07 01:19:35 +00:00
parent 49770b1c19
commit 4030e2cbbc
3 changed files with 11 additions and 3 deletions

View File

@ -414,6 +414,12 @@ EnchantChanceElementEnergy = 10
# Default: 7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,13293,13294,13296
EnchantBlackList = 7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,13293,13294,13296
# If enabled, enchanting over the maximum enchant limit will not be possible; instead, a warning message will be sent to the player.
# You can set custom maxEnchant values at EnchantItemData.xml
# Default: True
DisableOverEnchanting = True
# ---------------------------------------------------------------------------
# Augmenting
# ---------------------------------------------------------------------------

View File

@ -400,6 +400,7 @@ public final class Config
public static int FS_MAX_SUPPLY_LEVEL;
public static int FS_FEE_FOR_CASTLE;
public static int FS_MAX_OWN_TIME;
// --------------------------------------------------
// Feature Settings
// --------------------------------------------------
@ -925,6 +926,7 @@ public final class Config
public static double ENCHANT_CHANCE_ELEMENT_JEWEL;
public static double ENCHANT_CHANCE_ELEMENT_ENERGY;
public static int[] ENCHANT_BLACKLIST;
public static boolean DISABLE_OVER_ENCHANTING;
public static int AUGMENTATION_NG_SKILL_CHANCE;
public static int AUGMENTATION_NG_GLOW_CHANCE;
public static int AUGMENTATION_MID_SKILL_CHANCE;
@ -1649,7 +1651,7 @@ public final class Config
ENCHANT_BLACKLIST[i] = Integer.parseInt(notenchantable[i]);
}
Arrays.sort(ENCHANT_BLACKLIST);
DISABLE_OVER_ENCHANTING = Character.getBoolean("DisableOverEnchanting", true);
AUGMENTATION_NG_SKILL_CHANCE = Character.getInt("AugmentationNGSkillChance", 15);
AUGMENTATION_NG_GLOW_CHANCE = Character.getInt("AugmentationNGGlowChance", 0);
AUGMENTATION_MID_SKILL_CHANCE = Character.getInt("AugmentationMidSkillChance", 30);

View File

@ -110,8 +110,8 @@ public final class RequestEnchantItem implements IClientIncomingPacket
supportTemplate = EnchantItemData.getInstance().getSupportItem(support);
}
// first validation check
if (!scrollTemplate.isValid(item, supportTemplate) || (item.getEnchantLevel() == scrollTemplate.getMaxEnchantLevel()))
// first validation check - also over enchant check
if (!scrollTemplate.isValid(item, supportTemplate) || (Config.DISABLE_OVER_ENCHANTING && (item.getEnchantLevel() == scrollTemplate.getMaxEnchantLevel())))
{
activeChar.sendPacket(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITIONS);
activeChar.setActiveEnchantItemId(L2PcInstance.ID_NONE);