How to create your own grades, edit crystals and modify enchant bonuses

In this topic, we will discuss how to work with crystal grades, create new grades, and modify player stat bonuses after enchanting.

Format: XML
Path: gameserver/data/crystal_grades.xml

Grade Parameters​

Example:
XML:
<grade id="S" crystal="1462" crystalMod="250" externalOrdinal="5">
  • id="S" - grade name. For new grades, it can be anything: S80, S84, R99, R999, etc.
  • crystal="1462" - crystals received when the item is crystallized.
  • crystalMod="250" - modifier for bonuses when crystallizing.
    • Formula for weapons: crystalMod / 10 * enchant_level
    • Formula for armor: crystalMod / 5 * enchant_level
    • If the level is greater than 3: crystalMod / 5
  • externalOrdinal="5" - used to determine the parent grade. For example, S80 and S84 have a parent grade of S.

Stat Bonuses for Enchanting​

Initially, the stats are taken from the items: data/items
XML:
<weapon id="7575" name="Draconic Bow">
    <!-- [draconic_bow] -->
    <set name="atk_reuse" value="1500"/>
    <set name="crystal_count" value="2440"/>
    <set name="crystal_type" value="S"/>
    <set name="crystallizable" value="true"/>
    <set name="icon" value="icon.weapon_draconic_bow_i00"/>
    <set name="mp_consume" value="6"/>
    <set name="price" value="48800000"/>
    <set name="rnd_dam" value="5"/>
    <set name="soulshots" value="1"/>
    <set name="spiritshots" value="1"/>
    <set name="type" value="BOW"/>
    <set name="weight" value="1650"/>
    <equip>
        <slot id="LEFT_RIGHT_HAND"/>
    </equip>
    <for>
        <add stat="pAtk" order="0x10" value="581"/>
        <add stat="mAtk" order="0x10" value="132"/>
        <set stat="baseCrit" order="0x08" value="120"/>
        <set stat="atkBaseSpeed" order="0x08" value="293"/>
        <add stat="accCombat" order="0x10" value="-4.0000"/>
        <enchant stat="pAtk" order="0x0C" value="0"/>
        <enchant stat="mAtk" order="0x0C" value="0"/>
    </for>
</weapon>

We are interested in the grade of the weapon. In this example:
XML:
<set name="crystal_type" value="S"/>

We are also interested in the stats modified by enchanting:
XML:
<enchant stat="pAtk" order="0x0C" value="0"/>
<enchant stat="mAtk" order="0x0C" value="0"/>

Now, check the modifiers for the S grade in data/crystal_grades.xml:

XML:
<grade id="S" crystal="1462" crystalMod="250" externalOrdinal="5">
    <enchant_mod stat="mAtk" multiplier="4"/>
    <enchant_mod stat="sDef" multiplier="2"/>
    <enchant_mod stat="mDef" multiplier="2"/>
    <enchant_mod stat="pDef" multiplier="2"/>
    <enchant_mod stat="pAtkBow" multiplier="10"/>
    <enchant_mod stat="pAtkDoubleSword" multiplier="6"/>
    <enchant_mod stat="pAtk" multiplier="5"/>
    <enchant_mod stat="pAtkSpd" multiplier="1.5"/>
    <enchant_mod stat="mAtkSpd" multiplier="1.5"/>
    <enchant_mod stat="maxHp" multiplier="1.5"/>
    <enchant_mod stat="maxMp" multiplier="1.5"/>
    <enchant_mod stat="maxCp" multiplier="1.5"/>
</grade>

For our bow, the modifier is:
XML:
<enchant_mod stat="pAtkBow" multiplier="10"/>

Calculation formula:
XML:
overEnchant = Math.max(0, enchantLevel - 3);
grade.getPhysicAttackBow * (enchantLevel + overEnchant)

Adding New Grades​

Example of a new grade S80 in data/crystal_grades.xml:
Code:
<grade id="S80" crystal="1462" crystalMod="250" externalOrdinal="5">
    <enchant_mod stat="mAtk" multiplier="4"/>
    <enchant_mod stat="sDef" multiplier="2"/>
    <enchant_mod stat="mDef" multiplier="2"/>
    <enchant_mod stat="pDef" multiplier="2"/>
    <enchant_mod stat="pAtkBow" multiplier="10"/>
    <enchant_mod stat="pAtkDoubleSword" multiplier="6"/>
    <enchant_mod stat="pAtk" multiplier="5"/>
    <enchant_mod stat="pAtkSpd" multiplier="1.5"/>
    <enchant_mod stat="mAtkSpd" multiplier="1.5"/>
    <enchant_mod stat="maxHp" multiplier="1.5"/>
    <enchant_mod stat="maxMp" multiplier="1.5"/>
    <enchant_mod stat="maxCp" multiplier="1.5"/>
</grade>

Add the new grade to the player's skill in data/stats/skills:
XML:
<skill id="239" levels="7" name="Expertise D">
    <table name="#magicLevel">20 40 52 61 76 76 76</table>
    <set name="icon" val="icon.skill0239"/>
    <set name="magicLevel" val="#magicLevel"/>
    <set name="target" val="TARGET_SELF"/>
    <set name="skillType" val="HARDCODED"/>
    <set name="operateType" val="OP_PASSIVE"/>
    <set name="canLearn" val=""/>
    <set name="isCommon" val="true"/>
</skill>

If you need to add new levels:
XML:
<table name="#magicLevel">20 40 52 61 76 80 84</table>

Creating Your Own Grade​

Example of a new grade R:
XML:
<grade id="R" crystal="17371" crystalMod="255" externalOrdinal="6">
    <enchant_mod stat="mAtk" multiplier="4"/>
    <enchant_mod stat="sDef" multiplier="2"/>
    <enchant_mod stat="mDef" multiplier="2"/>
    <enchant_mod stat="pDef" multiplier="2"/>
    <enchant_mod stat="pAtkBow" multiplier="10"/>
    <enchant_mod stat="pAtkDoubleSword" multiplier="6"/>
    <enchant_mod stat="pAtk" multiplier="5"/>
    <enchant_mod stat="pAtkSpd" multiplier="1.5"/>
    <enchant_mod stat="mAtkSpd" multiplier="1.5"/>
    <enchant_mod stat="maxHp" multiplier="1.5"/>
    <enchant_mod stat="maxMp" multiplier="1.5"/>
    <enchant_mod stat="maxCp" multiplier="1.5"/>
</grade>

Creating a new skill level:
XML:
<skill id="239" levels="8" name="Expertise D">
    <table name="#magicLevel">20 40 52 61 76 80 84 86</table>
    <set name="icon" val="icon.skill0239"/>
    <set name="magicLevel" val="#magicLevel"/>
    <set name="target" val="TARGET_SELF"/>
    <set name="skillType" val="HARDCODED"/>
    <set name="operateType" val="OP_PASSIVE"/>
    <set name="canLearn" val=""/>
    <set name="isCommon" val="true"/>
</skill>

Creating an enchant scroll:
XML:
<scroll id="88888" infallible="false" reset_lvl="0" on_fail="RESET" chance_bonus="0" grade="R">
    <levels min="0" max="20"/>
    <items_restrict type="WEAPON"/>
    <chances type="WEAPON">
        <chance val="100"/>
        <chance val="100"/>
        <chance val="100"/>
        <chance val="50"/>
        <chance val="50"/>
        <chance val="33"/>
        <chance val="25"/>
        <chance val="20"/>
        <chance val="14"/>
        <chance val="11"/>
        <chance val="8"/>
        <chance val="6"/>
        <chance val="5"/>
        <chance val="4"/>
        <chance val="3"/>
        <chance val="2"/>
        <chance val="2"/>
        <chance val="1"/>
        <chance val="1"/>
        <chance val="1"/>
    </chances>
</scroll>

Creating a Soulshot:
XML:
<etcitem id="88889" name="Soulshot: R-grade">
    <!-- [soulshot_s] -->
    <set name="class" value="CONSUMABLE"/>
    <set name="crystal_type" value="R"/>
    <set name="icon" value="icon.etc_spirit_bullet_gold_i00"/>
    <set name="price" value="100"/>
    <set name="stackable" value="true"/>
    <set name="type" value="SHOT"/>
    <set name="weight" value="2"/>
    <skills>
        <skill id="2154" level="1"/>
    </skills>
</etcitem>

in this example creating a grade or working with old grades
If you have any questions or suggestions, please post them in this topic.
 
Last edited:
Back
Top