"Add" == "Addition" == +

"Mul" == "Multiplication" == *

For example if we got :

Code: Select all

`Base stat : (10)Add (+30)Mul (* 30)`

Code: Select all

`10 * 30 + 30 = 330`

Code: Select all

`(10 + 30 ) * 30 = 1200`

For see example how orders can be used in L2J and what effect they will have lets do some calculations with characters Critical Rate (Crit. Rate).

Before we look in formulas and order need to understand what is DEX bonus and how to see proper value.

See file game\data\stats\statBonus.xml

Code: Select all

` <DEX> <!-- 1.009^(DEX-19.360) --> <stat value="20" bonus="1.01" /> <stat value="21" bonus="1.01" /> <stat value="22" bonus="1.02" /> <stat value="23" bonus="1.03" /> <stat value="24" bonus="1.04" /> <stat value="25" bonus="1.05" /> <stat value="26" bonus="1.06" /> <stat value="27" bonus="1.07" /> <stat value="28" bonus="1.08" /> <stat value="29" bonus="1.09" /> </DEX></list>`

Code: Select all

`<stat value="23" bonus="1.03" />`

Mul = 20

Add = 30

Or Mul will be calculate before Add if order is not set to different values in DP.

For see default values for all stats look java.com.l2jserver.gameserver.enums.StatFunction.java

Code: Select all

` ADD("Add", 30), DIV("Div", 20), ENCHANT("Enchant", 0), ENCHANTHP("EnchantHp", 40), MUL("Mul", 20), SET("Set", 0), SHARE("Share", 30), SUB("Sub", 30);`

=======================================

For that example will use:

Class : Maestro

Level : 85

Equip : None

For calculate proper critical rate we need to look inside char template.

game\data\stats\chars\baseStats\Maestro.xml

Look the line

Code: Select all

`<baseCritRate>4</baseCritRate>`

Then we need the formula for critical rate so we look inside

Code: Select all

`com.l2jserver.gameserver.model.stats.functions.formulas.FuncAtkCritical.java`

Code: Select all

`initVal * BaseStats.DEX.calcBonus(effector) * 10`

Is time for replace "val" and "dex" bonus.

Maestro got 29 dex what give us 1.09 bonus, and we got 4 base when replace in formula we be

Code: Select all

`4 * 1.09 * 10 = 43.6 = 44`

For that example will use 2 skills one give "Add 15 critical (15 static)" and second one give "Mul 1.3 critical(30%)"

Code: Select all

`<skill id="22160" name="Vesper Critical Power"> <for> <effect name="Buff"> <add stat="rCrit" val="15" /> </effect> </for></skill>`

Code: Select all

`<skill id="1077" name="Focus"> <for> <effect name="Buff"> <mul stat="rCrit" val="1.3" /> </effect> </for></skill>`

FROM

Code: Select all

`4 * 1.09 * 10 = 43.6 = 44 // Critical Rate`

Code: Select all

`(4 * 1.09 * 10) + 15= 58.6 = 59 // Critical Rate`

FROM

Code: Select all

`4 * 1.09 * 10 = 43.6 = 44 // Critical Rate`

Code: Select all

`(4 * 1.09 * 10) * 1.3 = 56.68 = 57 // Critical Rate`

FROM

Code: Select all

`4 * 1.09 * 10 = 43.6 = 44 // Critical Rate`

TO

Code: Select all

`(4 * 1.09 * 10 * 1.3) + 15 = 71.68 = 72 // Critical Rate`

Mul got order 20. So we change skill "22160"

FROM

Code: Select all

`<add stat="rCrit" val="15" />`

Code: Select all

`<add order="19" stat="rCrit" val="15" />`

FROM

Code: Select all

`(4 * 1.09 * 10 * 1.3) + 15 = 71.68 = 72 // Critical Rate`

Code: Select all

`((4 * 1.09 * 10 ) + 15) * 1.3 = 76.18 = 76 // Critical Rate`

For weapon will use "(233) Dark Screamer"

That weapon got

Code: Select all

`<set stat="rCrit" val="12" />`

FROM

Code: Select all

`4 * 1.09 * 10 = 43.6 = 44 // Critical Rate`

TO

Code: Select all

`12 * 1.09 * 10 = 130.8 = 131`

That weapon got "<set stat="rCrit" val="12" />"

But also give skill "3011" and that skill got

Code: Select all

`<add stat="rCrit" val="81.2" />`

Code: Select all

`(12 * 1.09 * 10) + 81.2 = 212`

|_______________________________|

Q : In com.l2jserver.gameserver.mode.stats.functions.formulas.* each formula got "Order" called in constructor super for what that is used?

A :

**Spoiler:**show

For example order inside FuncAtkAccuracy effect in some way FuncAtkCritical?

A : No

Q : Why there is some items what not use default orders and they got custom one like Jewels and Armors

A :

**Spoiler:**show