Jump to content

Napster321

Banned
  • Posts

    1,639
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by Napster321

  1. Is there in java a place that is sending the enchant level of weapon to env.int in client? What i want to do: add a different env* file for some weapons (different enchant colors)
  2. it's easy to get them...send me all the money you got and you will billions of them too
  3. :ooooooooooooooooo VREXEI POUTSOUSSSSSSSSSSSSSSSSSSSSSSSS
  4. i added that code Index: java/config/Character.properties =================================================================== --- java/config/Character.properties (revision 3492) +++ java/config/Character.properties (working copy) @@ -270,6 +270,38 @@ BlessedEnchantChanceArmor = 66 BlessedEnchantChanceJewelry = 66 +# This is a list where you define different enchant chance on different enchant levels +# Format: enchantLevel1,enchantChance1;enchantLevel2,enchantChance2... +# Example: +# The "\"indicates new line, and is only set for formating purposes. +# EnchantChanceWeaponList = 4,90;5,80;6,75;7,70;8,65;\ +# 9,60;10,50;11,20;12,10;13,50;14,25;15,20 +# No ";" or ";\" at the end +# So, if the enchant chance for +15 is set to 30%, the enchanter will have 30% +# chance to enchant the weapon from +14 to +15 +# If a specific enchant level isnt described in the list, or the list is empty, +# the chance will be the one set at default configs +# (ex. EnchantChanceWeapon = ?? / EnchantChanceArmor = ?? / EnchantChanceJewelry = ??) +# So if you miss in the list for example, +15 for weapon, the chance will be +# the one set at EnchantChanceWeapon (BlessedEnchantChanceWeapon for blessed) +EnchantChanceWeaponList = +EnchantChanceArmorList = +EnchantChanceJewelryList = + +BlessedEnchantChanceWeaponList = +BlessedEnchantChanceArmorList = +BlessedEnchantChanceJewelryList = + +# List of item id that will be affected by EnchantChance lists +# (separated by "," like 77,78,79). +# Notes: +# *Make sure the lists do NOT CONTAIN trailing spaces or spaces between the numbers! +# *Items on this list will be affected by normal enchant restrictions aswell. +# For example, even if you add a hero weapon here, you wont be able to enchant it. +# *Default is 0, that means all items will be affected, and if there is 0 somewhere +# in the list, it will still affect all items! Be aware of that! +EnchantChanceListsRestriction = 0 + # This is the enchant limit, if set to 0, there will be no limit. # Example: If this is set to 10, the maximum enchant will be 10. # Default: 0, 0, 0 Index: java/net/sf/l2j/gameserver/network/clientpackets/AbstractEnchantPacket.java =================================================================== --- java/net/sf/l2j/gameserver/network/clientpackets/AbstractEnchantPacket.java (revision 3492) +++ java/net/sf/l2j/gameserver/network/clientpackets/AbstractEnchantPacket.java (working copy) @@ -18,6 +18,7 @@ import java.util.Map; import javolution.util.FastMap; +import gnu.trove.TIntIntHashMap; import net.sf.l2j.Config; import net.sf.l2j.gameserver.model.L2ItemInstance; @@ -172,20 +173,20 @@ return -1; if (_isWeapon) - chance = Config.BLESSED_ENCHANT_CHANCE_WEAPON; + chance = getListChance(Config.BLESSED_ENCHANT_CHANCE_WEAPON_LIST,Config.BLESSED_ENCHANT_CHANCE_WEAPON,enchantItem); else if (isAccessory) - chance = Config.BLESSED_ENCHANT_CHANCE_JEWELRY; + chance = getListChance(Config.BLESSED_ENCHANT_CHANCE_JEWELRY_LIST,Config.BLESSED_ENCHANT_CHANCE_JEWELRY,enchantItem); else - chance = Config.BLESSED_ENCHANT_CHANCE_ARMOR; + chance = getListChance(Config.BLESSED_ENCHANT_CHANCE_ARMOR_LIST,Config.BLESSED_ENCHANT_CHANCE_ARMOR,enchantItem); } else { if (_isWeapon) - chance = Config.ENCHANT_CHANCE_WEAPON; + chance = getListChance(Config.ENCHANT_CHANCE_WEAPON_LIST,Config.ENCHANT_CHANCE_WEAPON,enchantItem); else if (isAccessory) - chance = Config.ENCHANT_CHANCE_JEWELRY; + chance = getListChance(Config.ENCHANT_CHANCE_JEWELRY_LIST,Config.ENCHANT_CHANCE_JEWELRY,enchantItem); else - chance = Config.ENCHANT_CHANCE_ARMOR; + chance = getListChance(Config.ENCHANT_CHANCE_ARMOR_LIST,Config.ENCHANT_CHANCE_ARMOR,enchantItem); } chance += _chanceAdd; @@ -196,6 +197,24 @@ return chance; } } + + public static boolean isInRestrictionList(L2ItemInstance item) + { + if (Config.LIST_ENCHANT_CHANCE_LISTS_RESTRICTION.contains(0)) return true; + return Config.LIST_ENCHANT_CHANCE_LISTS_RESTRICTION.contains(item.getItemId()); + } + public static int getListChance(TIntIntHashMap ConfigEnchantChanceList, Integer ConfigEnchantChance, L2ItemInstance item) + { + int chance = 0; + if (!ConfigEnchantChanceList.isEmpty() && isInRestrictionList(item)) + { + if (ConfigEnchantChanceList.containsKey(item.getEnchantLevel()+1)) + chance = ConfigEnchantChanceList.get(item.getEnchantLevel()+1); + else chance = ConfigEnchantChance; + } + else chance = ConfigEnchantChance; + return chance; + } static { Index: java/net/sf/l2j/Config.java =================================================================== --- java/net/sf/l2j/Config.java (revision 3492) +++ java/net/sf/l2j/Config.java (working copy) @@ -29,6 +29,7 @@ import javolution.util.FastList; import javolution.util.FastMap; +import gnu.trove.TIntIntHashMap; import net.sf.l2j.gameserver.util.FloodProtectorConfig; import net.sf.l2j.gameserver.util.StringUtil; @@ -38,7 +39,6 @@ //-------------------------------------------------- // L2J Property File Definitions - //-------------------------------------------------- public static final String CHARACTER_CONFIG_FILE = "./config/Character.properties"; public static final String EXTENSIONS_CONFIG_FILE = "./config/extensions.properties"; public static final String FEATURE_CONFIG_FILE = "./config/Feature.properties"; @@ -800,9 +800,17 @@ public static int ENCHANT_CHANCE_WEAPON; public static int ENCHANT_CHANCE_ARMOR; public static int ENCHANT_CHANCE_JEWELRY; + public static TIntIntHashMap ENCHANT_CHANCE_WEAPON_LIST; + public static TIntIntHashMap ENCHANT_CHANCE_ARMOR_LIST; + public static TIntIntHashMap ENCHANT_CHANCE_JEWELRY_LIST; public static int BLESSED_ENCHANT_CHANCE_WEAPON; public static int BLESSED_ENCHANT_CHANCE_ARMOR; public static int BLESSED_ENCHANT_CHANCE_JEWELRY; + public static TIntIntHashMap BLESSED_ENCHANT_CHANCE_WEAPON_LIST; + public static TIntIntHashMap BLESSED_ENCHANT_CHANCE_ARMOR_LIST; + public static TIntIntHashMap BLESSED_ENCHANT_CHANCE_JEWELRY_LIST; + public static String ENCHANT_CHANCE_LISTS_RESTRICTION; + public static List<Integer> LIST_ENCHANT_CHANCE_LISTS_RESTRICTION = new FastList<Integer>(); public static int ENCHANT_MAX_WEAPON; public static int ENCHANT_MAX_ARMOR; public static int ENCHANT_MAX_JEWELRY; @@ -1221,9 +1229,93 @@ ENCHANT_CHANCE_WEAPON = Integer.parseInt(Character.getProperty("EnchantChanceWeapon", "66")); ENCHANT_CHANCE_ARMOR = Integer.parseInt(Character.getProperty("EnchantChanceArmor", "66")); ENCHANT_CHANCE_JEWELRY = Integer.parseInt(Character.getProperty("EnchantChanceJewelry", "66")); + String[] propertySplitWeapon = Character.getProperty("EnchantChanceWeaponList", "").split(";"); + String[] propertySplitArmor = Character.getProperty("EnchantChanceArmorList", "").split(";"); + String[] propertySplitJewelry = Character.getProperty("EnchantChanceJewelryList", "").split(";"); + String[] propertySplitBlessedWeapon = Character.getProperty("BlessedEnchantChanceWeaponList", "").split(";"); + String[] propertySplitBlessedArmor = Character.getProperty("BlessedEnchantChanceArmorList", "").split(";"); + String[] propertySplitBlessedJewelry = Character.getProperty("BlessedEnchantChanceJewelryList", "").split(";"); + ENCHANT_CHANCE_WEAPON_LIST = new TIntIntHashMap(propertySplitWeapon.length); + ENCHANT_CHANCE_ARMOR_LIST = new TIntIntHashMap(propertySplitArmor.length); + ENCHANT_CHANCE_JEWELRY_LIST = new TIntIntHashMap(propertySplitJewelry.length); + BLESSED_ENCHANT_CHANCE_WEAPON_LIST = new TIntIntHashMap(propertySplitBlessedWeapon.length); + BLESSED_ENCHANT_CHANCE_ARMOR_LIST = new TIntIntHashMap(propertySplitBlessedArmor.length); + BLESSED_ENCHANT_CHANCE_JEWELRY_LIST = new TIntIntHashMap(propertySplitBlessedJewelry.length); + for (String enchant : propertySplitWeapon) + { + String[] enchantSplit = enchant.split(","); + if (enchantSplit.length != 2)_log.warning(StringUtil.concat("[CustomEnchantSystem]: invalid config property -> EnchantList \"", enchant, "\"")); + else + { + try{ENCHANT_CHANCE_WEAPON_LIST.put(Integer.valueOf(enchantSplit[0]), Integer.valueOf(enchantSplit[1]));} + catch (NumberFormatException nfe){ + if (!enchant.isEmpty())_log.warning(StringUtil.concat("[CustomEnchantSystem]: invalid config property -> EnchantList \"", enchantSplit[0], "\"", enchantSplit[1]));} + } + } + for (String enchant : propertySplitArmor) + { + String[] enchantSplit = enchant.split(","); + if (enchantSplit.length != 2)_log.warning(StringUtil.concat("[CustomEnchantSystem]: invalid config property -> EnchantList \"", enchant, "\"")); + else + { + try{ENCHANT_CHANCE_ARMOR_LIST.put(Integer.valueOf(enchantSplit[0]), Integer.valueOf(enchantSplit[1]));} + catch (NumberFormatException nfe){ + if (!enchant.isEmpty())_log.warning(StringUtil.concat("[CustomEnchantSystem]: invalid config property -> EnchantList \"", enchantSplit[0], "\"", enchantSplit[1]));} + } + } + for (String enchant : propertySplitJewelry) + { + String[] enchantSplit = enchant.split(","); + if (enchantSplit.length != 2)_log.warning(StringUtil.concat("[CustomEnchantSystem]: invalid config property -> EnchantList \"", enchant, "\"")); + else + { + try{ENCHANT_CHANCE_JEWELRY_LIST.put(Integer.valueOf(enchantSplit[0]), Integer.valueOf(enchantSplit[1]));} + catch (NumberFormatException nfe){ + if (!enchant.isEmpty())_log.warning(StringUtil.concat("[CustomEnchantSystem]: invalid config property -> EnchantList \"", enchantSplit[0], "\"", enchantSplit[1]));} + } + } BLESSED_ENCHANT_CHANCE_WEAPON = Integer.parseInt(Character.getProperty("BlessedEnchantChanceWeapon", "66")); BLESSED_ENCHANT_CHANCE_ARMOR = Integer.parseInt(Character.getProperty("BlessedEnchantChanceArmor", "66")); BLESSED_ENCHANT_CHANCE_JEWELRY = Integer.parseInt(Character.getProperty("BlessedEnchantChanceJewelry", "66")); + for (String enchant : propertySplitBlessedWeapon) + { + String[] enchantSplit = enchant.split(","); + if (enchantSplit.length != 2)_log.warning(StringUtil.concat("[CustomEnchantSystem]: invalid config property -> EnchantList \"", enchant, "\"")); + else + { + try{BLESSED_ENCHANT_CHANCE_WEAPON_LIST.put(Integer.valueOf(enchantSplit[0]), Integer.valueOf(enchantSplit[1]));} + catch (NumberFormatException nfe){ + if (!enchant.isEmpty())_log.warning(StringUtil.concat("[CustomEnchantSystem]: invalid config property -> EnchantList \"", enchantSplit[0], "\"", enchantSplit[1]));} + } + } + for (String enchant : propertySplitBlessedArmor) + { + String[] enchantSplit = enchant.split(","); + if (enchantSplit.length != 2)_log.warning(StringUtil.concat("[CustomEnchantSystem]: invalid config property -> EnchantList \"", enchant, "\"")); + else + { + try{BLESSED_ENCHANT_CHANCE_ARMOR_LIST.put(Integer.valueOf(enchantSplit[0]), Integer.valueOf(enchantSplit[1]));} + catch (NumberFormatException nfe){ + if (!enchant.isEmpty())_log.warning(StringUtil.concat("[CustomEnchantSystem]: invalid config property -> EnchantList \"", enchantSplit[0], "\"", enchantSplit[1]));} + } + } + for (String enchant : propertySplitBlessedJewelry) + { + String[] enchantSplit = enchant.split(","); + if (enchantSplit.length != 2)_log.warning(StringUtil.concat("[CustomEnchantSystem]: invalid config property -> EnchantList \"", enchant, "\"")); + else + { + try{BLESSED_ENCHANT_CHANCE_JEWELRY_LIST.put(Integer.valueOf(enchantSplit[0]), Integer.valueOf(enchantSplit[1]));} + catch (NumberFormatException nfe){ + if (!enchant.isEmpty())_log.warning(StringUtil.concat("[CustomEnchantSystem]: invalid config property -> EnchantList \"", enchantSplit[0], "\"", enchantSplit[1]));} + } + } + ENCHANT_CHANCE_LISTS_RESTRICTION = Character.getProperty("EnchantChanceListsRestriction", "0"); + LIST_ENCHANT_CHANCE_LISTS_RESTRICTION = new FastList<Integer>(); + for (String id : ENCHANT_CHANCE_LISTS_RESTRICTION.split(",")) + { + LIST_ENCHANT_CHANCE_LISTS_RESTRICTION.add(Integer.parseInt(id)); + } ENCHANT_MAX_WEAPON = Integer.parseInt(Character.getProperty("EnchantMaxWeapon", "0")); ENCHANT_MAX_ARMOR = Integer.parseInt(Character.getProperty("EnchantMaxArmor", "0")); ENCHANT_MAX_JEWELRY = Integer.parseInt(Character.getProperty("EnchantMaxJewelry", "0")); how can i make case L2Item.TYPE2_WEAPON: activeChar.sendMessage("Success rate: " + Config.ENCHANT_CHANCE_WEAPON + "%"); to get the chance from the enchant chance list and show different enchant rate in message for every enchant level?
  5. http://maxcheaters.com/forum/index.php?topic=260982.new#new
  6. it is in AbstractEnchantPacket.java it was like that if (_isWeapon) chance = Config.ENCHANT_CHANCE_WEAPON; and i added these if (((L2ItemInstance) item).getEnchantLevel() == 10) chance = 60; if (((L2ItemInstance) item).getEnchantLevel() == 11) chance = 50; if (((L2ItemInstance) item).getEnchantLevel() == 12) chance = 40;
  7. i want add different enchant rates i try this one if (_isWeapon) chance = Config.ENCHANT_CHANCE_WEAPON; if (((L2ItemInstance) item).getEnchantLevel() == 10) chance = 60; if (((L2ItemInstance) item).getEnchantLevel() == 11) chance = 50; if (((L2ItemInstance) item).getEnchantLevel() == 12) chance = 40; but when i press the enchant button it stucks there
  8. http://maxcheaters.com/forum/index.php?topic=261005.0
  9. take your stupidity out of here please...i don't even know about client mod.
  10. http://maxcheaters.com/forum/index.php?topic=247370.msg2420358#msg2420358
×
×
  • Create New...