Hello, good afternoon, here I will leave you a small guide on how to modify the enchantment probability of objects on a server, related to EnchantItemData.xml and EnchantItemGroups.xml
First we must locate the file related to Item Enchantments​ which controls the probabilities they have on our server.
Example: git/l2j_mobius/L2J_Mobius_CT_0_Interlude/dist/game/data/ dist\game\data\EnchantItemData.xml
Example: git/l2j_mobius/L2J_Mobius_CT_0_Interlude/dist/game/data/ dist\game\data\EnchantItemGroups.xml
Original Code - EnchantItemData
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/enchantItemData.xsd">
<!-- Scrolls: Enchant Weapon -->
<enchant id="729" targetGrade="A" maxEnchant="16" /> //maximum enchantment allowed +16
<enchant id="947" targetGrade="B" maxEnchant="16" /> //maximum enchantment allowed +16
<enchant id="951" targetGrade="C" maxEnchant="16" /> //maximum enchantment allowed +16
<enchant id="955" targetGrade="D" maxEnchant="16" /> //maximum enchantment allowed +16
<enchant id="959" targetGrade="S" maxEnchant="16" /> //maximum enchantment allowed +16
<!-- Scrolls: Enchant Armor -->
<enchant id="730" targetGrade="A" maxEnchant="16" /> //maximum enchantment allowed +16
<enchant id="948" targetGrade="B" maxEnchant="16" /> //maximum enchantment allowed +16
<enchant id="952" targetGrade="C" maxEnchant="16" /> //maximum enchantment allowed +16
<enchant id="956" targetGrade="D" maxEnchant="16" scrollGroupId="0" /> <!-- Default scroll groups binding. -->
<enchant id="960" targetGrade="S" maxEnchant="16" /> //maximum enchantment allowed +16
<!-- Blessed Scrolls: Enchant Weapon --> example + bonus extra
<enchant id="6569" targetGrade="A" bonusRate="10" maxEnchant="16" /> //maximum enchantment allowed +16 +10% bonus
<enchant id="6571" targetGrade="B" bonusRate="10" maxEnchant="16" /> //maximum enchantment allowed +16 +10% bonus
<enchant id="6573" targetGrade="C" bonusRate="10" maxEnchant="16" /> //maximum enchantment allowed +16 +10% bonus
<enchant id="6575" targetGrade="D" bonusRate="10" maxEnchant="16" /> //maximum enchantment allowed +16 +10% bonus
<enchant id="6577" targetGrade="S" bonusRate="10" maxEnchant="16" /> //maximum enchantment allowed +16 +10% bonus
<!-- Blessed Scrolls: Enchant Armor --> example + bonus extra
Extra bonus to the configured probability, with no chance of breaking the weapon if it fails.
<enchant id="6570" targetGrade="A" bonusRate="10" maxEnchant="16" /> //maximum enchantment allowed +16 +10% bonus
<enchant id="6572" targetGrade="B" bonusRate="10" maxEnchant="16" /> //maximum enchantment allowed +16 +10% bonus
<enchant id="6574" targetGrade="C" bonusRate="10" maxEnchant="16" /> //maximum enchantment allowed +16 +10% bonus
<enchant id="6576" targetGrade="D" bonusRate="10" maxEnchant="16" /> //maximum enchantment allowed +16 +10% bonus
<enchant id="6578" targetGrade="S" bonusRate="10" maxEnchant="16" /> //maximum enchantment allowed +16 +10% bonus
<!-- Crystal Scrolls: Enchant Weapon -->
<enchant id="731" targetGrade="A" bonusRate="100" /> //bonus rate in relation to the default rate, 100% success
<enchant id="949" targetGrade="B" bonusRate="100" /> //bonus rate in relation to the default rate, 100% success
<enchant id="953" targetGrade="C" bonusRate="100" /> //bonus rate in relation to the default rate, 100% success
<enchant id="957" targetGrade="D" bonusRate="100" /> //bonus rate in relation to the default rate, 100% success
<enchant id="961" targetGrade="S" bonusRate="100" /> //bonus rate in relation to the default rate, 100% success
<!-- Crystal Scrolls: Enchant Armor -->
<enchant id="732" targetGrade="A" bonusRate="100" /> //bonus rate in relation to the default rate, 100% success
<enchant id="950" targetGrade="B" bonusRate="100" /> //bonus rate in relation to the default rate, 100% success
<enchant id="954" targetGrade="C" bonusRate="100" /> //bonus rate in relation to the default rate, 100% success
<enchant id="958" targetGrade="D" bonusRate="100" /> //bonus rate in relation to the default rate, 100% success
<enchant id="962" targetGrade="S" bonusRate="100" /> //bonus rate in relation to the default rate, 100% success
</list>
Here we will configure the maximum enchantment allowed for weapons and armor, in normal enchantment, blessed enchantment and crystal enchantment. in all its grades D, C, B, A and S.
Code Original - EnchantItemGroups
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/enchantItemGroups.xsd">
<!-- General armor enchant group. -->
<enchantRateGroup name="ARMOR_GROUP">
<current enchant="0-2" chance="100" />
<current enchant="3-15" chance="66" /> //Each enchantment has a default chance of 66% retail, from +3 to +16
<current enchant="16-65535" chance="0" /> // 0% Chance more+16
</enchantRateGroup>
<!-- General full armor enchant group. -->
<enchantRateGroup name="FULL_ARMOR_GROUP">
<current enchant="0-3" chance="100" />
<current enchant="4-15" chance="66" /> //Each enchantment has a default chance of 66% retail, from +4 to +16
<current enchant="16-65535" chance="0" /> // 0% Chance more+16
</enchantRateGroup>
<!-- General fighter weapon enchant group. -->
<enchantRateGroup name="FIGHTER_WEAPON_GROUP">
<current enchant="0-2" chance="100" />
<current enchant="3-15" chance="66" /> //Each enchantment has a default chance of 66% retail, from +3 to +16
<current enchant="16-65535" chance="0" /> 0% Chance more +16
</enchantRateGroup>
<!-- General mage weapon enchant group. -->
<enchantRateGroup name="MAGE_WEAPON_GROUP">
<current enchant="0-2" chance="100" />
<current enchant="3-15" chance="66" /> //Each enchantment has a default chance of 66% retail, from +3 to +16
<current enchant="16-65535" chance="0" /> 0% chance more+16
</enchantRateGroup>
<!-- Default scrolls enchanting route line. -->
<enchantScrollGroup id="0">
<!-- Bind armor group to all item slots except full armor. -->
<enchantRate group="ARMOR_GROUP">
<item slot="lhand" /> <!-- Left hand: Shields, Sigils -->
<item slot="head" /> <!-- Head: Helmet -->
<item slot="chest" /> <!-- Chest: Armor upper body. -->
<item slot="legs" /> <!-- Legs: Armor lower body. -->
<item slot="feet" /> <!-- Feet: Boots -->
<item slot="gloves" /> <!-- Gloves: Gloves -->
<item slot="neck" /> <!-- Neck: Necklaces -->
<item slot="rear;lear" /> <!-- Right ear, Left ear: Earrings -->
<item slot="rfinger;lfinger" /> <!-- Right finger, Left finger: Rings -->
<item slot="shirt" /> <!-- Shirt: Shirts -->
</enchantRate>
<!-- Bind only full armor group to to full armor slot items. -->
<enchantRate group="FULL_ARMOR_GROUP">
<item slot="fullarmor" /> <!-- Full Armor: Full armor pants are included. -->
</enchantRate>
<!-- Bind only fighter weapon group to all fighter weapons. -->
<enchantRate group="FIGHTER_WEAPON_GROUP">
<item slot="rhand" magicWeapon="false" /> <!-- Right hand: Weapons, Non magic weapon -->
<item slot="lrhand" magicWeapon="false" /> <!-- Two hands: Weapons, Non magic weapon -->
</enchantRate>
<!-- Bind only mage weapon group to all magic weapons. -->
<enchantRate group="MAGE_WEAPON_GROUP">
<item slot="rhand" magicWeapon="true" /> <!-- Right hand: Weapons, Magic weapon -->
<item slot="lrhand" magicWeapon="true" /> <!-- Two hands: Weapons, Magic weapon -->
</enchantRate>
</enchantScrollGroup>
</list>
Example : EnchantItemData
Here we can decide what the maximum enchant will be for the armor or weapon grade, they can be configured independently. example D+100, C+75,B+50,A+25,S+16.
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/enchantItemData.xsd">
<!-- Scrolls: Enchant Weapon -->
<enchant id="729" targetGrade="A" maxEnchant="25" /> //maximum enchantment allowed +25
<enchant id="947" targetGrade="B" maxEnchant="50" /> //maximum enchantment allowed +50
<enchant id="951" targetGrade="C" maxEnchant="75" /> //maximum enchantment allowed +75
<enchant id="955" targetGrade="D" maxEnchant="100" /> //maximum enchantment allowed +100
<enchant id="959" targetGrade="S" maxEnchant="16" /> //maximum enchantment allowed +16
<!-- Scrolls: Enchant Armor -->
<enchant id="730" targetGrade="A" maxEnchant="25" /> //maximum enchantment allowed +25
<enchant id="948" targetGrade="B" maxEnchant="50" /> //maximum enchantment allowed +50
<enchant id="952" targetGrade="C" maxEnchant="75" /> //maximum enchantment allowed +75
<enchant id="956" targetGrade="D" maxEnchant="100" scrollGroupId="0" /> <!-- Default scroll groups binding. -->
<enchant id="960" targetGrade="S" maxEnchant="16" /> //maximum enchantment allowed +16
<!-- Blessed Scrolls: Enchant Weapon --> example + bonus extra
<enchant id="6569" targetGrade="A" bonusRate="10" maxEnchant="25" /> //maximum enchantment allowed +25 +10% bonus
<enchant id="6571" targetGrade="B" bonusRate="10" maxEnchant="50" /> //maximum enchantment allowed +50 +10% bonus
<enchant id="6573" targetGrade="C" bonusRate="10" maxEnchant="75" /> //maximum enchantment allowed +75 +10% bonus
<enchant id="6575" targetGrade="D" bonusRate="10" maxEnchant="100" /> //maximum enchantment allowed +100 +10% bonus
<enchant id="6577" targetGrade="S" bonusRate="10" maxEnchant="16" /> //maximum enchantment allowed +16 +10% bonus
<!-- Blessed Scrolls: Enchant Armor --> example + bonus extra
<enchant id="6570" targetGrade="A" bonusRate="10" maxEnchant="25" /> //maximum enchantment allowed +25 +10% bonus
<enchant id="6572" targetGrade="B" bonusRate="10" maxEnchant="50" /> //maximum enchantment allowed +50 +10% bonus
<enchant id="6574" targetGrade="C" bonusRate="10" maxEnchant="75" /> //maximum enchantment allowed +75 +10% bonus
<enchant id="6576" targetGrade="D" bonusRate="10" maxEnchant="100" /> //maximum enchantment allowed +100 +10% bonus
<enchant id="6578" targetGrade="S" bonusRate="10" maxEnchant="16" /> //maximum enchantment allowed +16 +10% bonus
<!-- Crystal Scrolls: Enchant Weapon -->
<enchant id="731" targetGrade="A" bonusRate="100" /> //bonus rate in relation to the default rate, 100% success
<enchant id="949" targetGrade="B" bonusRate="100" /> //bonus rate in relation to the default rate, 100% success
<enchant id="953" targetGrade="C" bonusRate="100" /> //bonus rate in relation to the default rate, 100% success
<enchant id="957" targetGrade="D" bonusRate="100" /> //bonus rate in relation to the default rate, 100% success
<enchant id="961" targetGrade="S" bonusRate="100" /> //bonus rate in relation to the default rate, 100% success
<!-- Crystal Scrolls: Enchant Armor -->
<enchant id="732" targetGrade="A" bonusRate="100" /> //bonus rate in relation to the default rate, 100% success
<enchant id="950" targetGrade="B" bonusRate="100" /> //bonus rate in relation to the default rate, 100% success
<enchant id="954" targetGrade="C" bonusRate="100" /> //bonus rate in relation to the default rate, 100% success
<enchant id="958" targetGrade="D" bonusRate="100" /> //bonus rate in relation to the default rate, 100% success
<enchant id="962" targetGrade="S" bonusRate="100" /> //bonus rate in relation to the default rate, 100% success
</list>
Note that if you increase the chance of a higher enchantment, you must enable the chance to raise a higher enchantment. either adding lines progressively separately, or adding one line with the maximum.
Method 1 - Example - fixed percentage probability
<current enchant="16-100" chance="20" />. chance 20%</enchantRateGroup>
<current enchant="100-65535" chance="0" />. chance 0%
</enchantRateGroup>
Method 2 - Example - variable percentage probability
<current enchant="16-30" chance="20" />. chance 50%</enchantRateGroup>
<current enchant="31-50" chance="20" />. chance 40%</enchantRateGroup>
<current enchant="51-60" chance="20" />. chance 30%</enchantRateGroup>
<current enchant="61-70" chance="20" />. chance 20%</enchantRateGroup>
<current enchant="71-80" chance="20" />. chance 20%</enchantRateGroup>
<current enchant="81-90" chance="20" />. chance 20%</enchantRateGroup>
<current enchant="91-100" chance="20" />. chance 20%</enchantRateGroup>
<current enchant="100-65535" chance="0" />. chance 0%</enchantRateGroup>
If you wish, you can make the probability finer, instead of tens, you can make them in units, you just add more lines and refine each enchantment by its number.
Example : Enchant Items Groups
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/enchantItemGroups.xsd">
<!-- General armor enchant group. -->
<enchantRateGroup name="ARMOR_GROUP">
<current enchant="0-3" chance="100"/>
<current enchant="4-5" chance="96"/>
<current enchant="6-7" chance="86"/>
<current enchant="8-9" chance="76"/>
<current enchant="10-11" chance="66"/>
<current enchant="12-13" chance="56"/>
<current enchant="14-15" chance="46"/>
<current enchant="16-17" chance="36"/>
<current enchant="18-19" chance="26"/>
<current enchant="20-65535" chance="00"/>
</enchantRateGroup>
<!-- General full armor enchant group. -->
<enchantRateGroup name="FULL_ARMOR_GROUP">
<current enchant="0-3" chance="100"/>
<current enchant="4-5" chance="96"/>
<current enchant="6-7" chance="86"/>
<current enchant="8-9" chance="76"/>
<current enchant="10-11" chance="66"/>
<current enchant="12-13" chance="56"/>
<current enchant="14-15" chance="46"/>
<current enchant="16-17" chance="36"/>
<current enchant="18-19" chance="26"/>
<current enchant="20-65535" chance="00"/>
</enchantRateGroup>
<!-- General fighter weapon enchant group. -->
<enchantRateGroup name="FIGHTER_WEAPON_GROUP">
<current enchant="0-3" chance="100"/>
<current enchant="4-5" chance="96"/>
<current enchant="6-7" chance="86"/>
<current enchant="8-9" chance="76"/>
<current enchant="10-11" chance="66"/>
<current enchant="12-13" chance="56"/>
<current enchant="14-15" chance="46"/>
<current enchant="16-17" chance="36"/>
<current enchant="18-19" chance="26"/>
<current enchant="20-65535" chance="00"/>
</enchantRateGroup>
<!-- General mage weapon enchant group. -->
<enchantRateGroup name="MAGE_WEAPON_GROUP">
<current enchant="0-3" chance="100"/>
<current enchant="4-5" chance="96"/>
<current enchant="6-7" chance="86"/>
<current enchant="8-9" chance="76"/>
<current enchant="10-11" chance="66"/>
<current enchant="12-13" chance="56"/>
<current enchant="14-15" chance="46"/>
<current enchant="16-17" chance="36"/>
<current enchant="18-19" chance="26"/>
<current enchant="20-65535" chance="00"/>
</enchantRateGroup>
Each group has a series of rules that determine the probability of success (%) for each enchantment rank: From 20 onwards: 0% (Unable to enchant beyond +19)
Now we can configure as we want, seeking the best possible balance.
Atte Bazooka