Max enchant warning message.

This commit is contained in:
MobiusDev 2015-09-07 04:25:43 +00:00
parent 1ebe8b4076
commit d77d07d0a3
3 changed files with 9 additions and 2 deletions

View File

@ -418,6 +418,11 @@ ChangeChanceElement = 60
# 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

@ -1043,6 +1043,7 @@ public final class Config
public static double ENCHANT_CHANCE_ELEMENT_ENERGY;
public static int CHANGE_CHANCE_ELEMENT;
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;
@ -1555,6 +1556,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);

View File

@ -122,8 +122,8 @@ public final class RequestEnchantItem extends L2GameClientPacket
supportTemplate = EnchantItemData.getInstance().getSupportItem(support);
}
// first validation check
if (!scrollTemplate.isValid(item, supportTemplate))
// 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.removeRequest(request.getClass());