Fixed blow rate chances.

This commit is contained in:
MobiusDev 2017-12-09 18:47:45 +00:00
parent 247a5bc9f5
commit 683ae0ef52
137 changed files with 808 additions and 637 deletions

View File

@ -33,14 +33,14 @@ import com.l2jmobius.gameserver.model.stats.Formulas;
public final class Backstab extends AbstractEffect
{
private final double _power;
private final double _chance;
private final double _chanceBoost;
private final double _criticalChance;
private final boolean _overHit;
public Backstab(StatsSet params)
{
_power = params.getDouble("power", 0);
_chance = params.getDouble("chance", 0);
_power = params.getDouble("power");
_chanceBoost = params.getDouble("chanceBoost");
_criticalChance = params.getDouble("criticalChance", 0);
_overHit = params.getBoolean("overHit", false);
}
@ -48,7 +48,7 @@ public final class Backstab extends AbstractEffect
@Override
public boolean calcSuccess(L2Character effector, L2Character effected, Skill skill)
{
return !effector.isInFrontOf(effected) && !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chance);
return !effector.isInFrontOf(effected) && !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chanceBoost);
}
@Override

View File

@ -22,7 +22,6 @@ import java.util.Set;
import com.l2jmobius.gameserver.enums.ShotType;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Attackable;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
import com.l2jmobius.gameserver.model.effects.L2EffectType;
@ -38,27 +37,24 @@ import com.l2jmobius.gameserver.model.stats.Formulas;
public final class FatalBlow extends AbstractEffect
{
private final double _power;
private final double _chance;
private final double _chanceBoost;
private final double _criticalChance;
private final boolean _overHit;
private final Set<AbnormalType> _abnormals;
private final double _abnormalPower;
public FatalBlow(StatsSet params)
{
_power = params.getDouble("power", 0);
_chance = params.getDouble("chance", 0);
_power = params.getDouble("power");
_chanceBoost = params.getDouble("chanceBoost");
_criticalChance = params.getDouble("criticalChance", 0);
_overHit = params.getBoolean("overHit", false);
final String abnormals = params.getString("abnormalType", null);
String abnormals = params.getString("abnormalType", null);
if ((abnormals != null) && !abnormals.isEmpty())
{
_abnormals = new HashSet<>();
for (String slot : abnormals.split(";"))
{
_abnormals.add(AbnormalType.getAbnormalType(slot));
_abnormals.add(Enum.valueOf(AbnormalType.class, slot));
}
}
else
@ -71,7 +67,7 @@ public final class FatalBlow extends AbstractEffect
@Override
public boolean calcSuccess(L2Character effector, L2Character effected, Skill skill)
{
return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chance);
return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chanceBoost);
}
@Override
@ -94,11 +90,6 @@ public final class FatalBlow extends AbstractEffect
return;
}
if (_overHit && effected.isAttackable())
{
((L2Attackable) effected).overhitEnabled(true);
}
double power = _power;
// Check if we apply an abnormal modifier

View File

@ -33,13 +33,13 @@ import com.l2jmobius.gameserver.model.stats.Formulas;
public final class SoulBlow extends AbstractEffect
{
private final double _power;
private final double _chance;
private final double _chanceBoost;
private final boolean _overHit;
public SoulBlow(StatsSet params)
{
_power = params.getDouble("power", 0);
_chance = params.getDouble("chance", 0);
_power = params.getDouble("power");
_chanceBoost = params.getDouble("chanceBoost");
_overHit = params.getBoolean("overHit", false);
}
@ -52,7 +52,7 @@ public final class SoulBlow extends AbstractEffect
@Override
public boolean calcSuccess(L2Character effector, L2Character effected, Skill skill)
{
return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chance);
return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chanceBoost);
}
@Override

View File

@ -1784,7 +1784,7 @@
<value level="24">977</value>
</power>
<overHit>true</overHit>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
</effects>
</skill>
@ -3290,7 +3290,7 @@
<value level="36">15</value>
<value level="37">15</value>
</criticalChance>
<chance>40</chance>
<chanceBoost>400</chanceBoost>
<overHit>true</overHit>
</effect>
<effect name="Lethal">

View File

@ -4526,9 +4526,10 @@
<value level="37">5479</value>
</power>
<overHit>true</overHit>
<chance>30</chance>
<chanceBoost>300</chanceBoost>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>10</halfLethal>
</effect>
</effects>

View File

@ -1079,12 +1079,13 @@
<value level="10">3653</value>
</power>
<overHit>true</overHit>
<chance>25</chance>
<chanceBoost>250</chanceBoost>
</effect>
<effect name="Bluff">
<chance>80</chance>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>5</halfLethal>
</effect>
</effects>
@ -1715,10 +1716,11 @@
<effect name="FatalBlow">
<power>5773</power>
<criticalChance>20</criticalChance>
<chance>30</chance>
<chanceBoost>300</chanceBoost>
<overHit>true</overHit>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>15</halfLethal>
</effect>
</effects>

View File

@ -1204,9 +1204,10 @@
<value level="10">3653</value>
</power>
<overHit>true</overHit>
<chance>25</chance>
<chanceBoost>250</chanceBoost>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>5</halfLethal>
</effect>
</effects>

View File

@ -525,7 +525,7 @@
<value level="28">5479</value>
</power>
<overHit>true</overHit>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
</effects>
</skill>
@ -4198,9 +4198,10 @@
<value level="4">5199</value>
</power>
<overHit>true</overHit>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>10</halfLethal>
</effect>
</effects>

View File

@ -2634,9 +2634,10 @@
<effect name="FatalBlow">
<power>6969</power>
<overHit>true</overHit>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>10</halfLethal>
</effect>
</effects>

View File

@ -1604,7 +1604,7 @@
<effect name="FatalBlow">
<power>11234</power>
<criticalChance>30</criticalChance>
<chance>60</chance>
<chanceBoost>600</chanceBoost>
<overHit>true</overHit>
</effect>
<effect name="Lethal">

View File

@ -3668,7 +3668,7 @@
<effect name="FatalBlow">
<power>11234</power>
<criticalChance>30</criticalChance>
<chance>60</chance>
<chanceBoost>600</chanceBoost>
<overHit>true</overHit>
</effect>
<effect name="Lethal">

View File

@ -2431,7 +2431,7 @@
<value level="11">7461</value>
<value level="12">7850</value>
</power>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
</effects>
</skill>

View File

@ -3417,7 +3417,7 @@
<value level="11">44350</value>
<value level="12">49193</value>
</power>
<chance>115</chance>
<chanceBoost>1150</chanceBoost>
</effect>
</effects>
</skill>
@ -4046,7 +4046,7 @@
<value level="11">73917</value>
<value level="12">81989</value>
</power>
<chance>67</chance>
<chanceBoost>670</chanceBoost>
</effect>
</effects>
</skill>

View File

@ -2542,7 +2542,7 @@
<value level="11">7461</value>
<value level="12">7850</value>
</power>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
<effect name="DamOverTime">
<power>

View File

@ -1082,8 +1082,8 @@
<value level="16">9648</value>
<value level="17">9830</value>
</power>
<criticalChance>30</criticalChance>
<chance>50</chance>
<criticalChance>10</criticalChance>
<chanceBoost>200</chanceBoost>
</effect>
</effects>
</skill>
@ -2305,7 +2305,7 @@
<value level="11">44350</value>
<value level="12">49193</value>
</power>
<chance>115</chance>
<chanceBoost>1150</chanceBoost>
</effect>
</effects>
</skill>
@ -2365,7 +2365,7 @@
<value level="11">38806</value>
<value level="12">43290</value>
</power>
<chance>115</chance>
<chanceBoost>1150</chanceBoost>
</effect>
</effects>
</skill>
@ -2425,7 +2425,7 @@
<value level="11">20667</value>
<value level="12">23023</value>
</power>
<chance>115</chance>
<chanceBoost>1150</chanceBoost>
</effect>
</effects>
</skill>
@ -2485,7 +2485,7 @@
<value level="11">19381</value>
<value level="12">21645</value>
</power>
<chance>115</chance>
<chanceBoost>1150</chanceBoost>
</effect>
</effects>
</skill>
@ -2545,7 +2545,7 @@
<value level="11">18140</value>
<value level="12">20268</value>
</power>
<chance>115</chance>
<chanceBoost>1150</chanceBoost>
</effect>
</effects>
</skill>
@ -3600,7 +3600,7 @@
<value level="11">73917</value>
<value level="12">81989</value>
</power>
<chance>67</chance>
<chanceBoost>670</chanceBoost>
</effect>
</effects>
</skill>
@ -3660,7 +3660,7 @@
<value level="11">64677</value>
<value level="12">72150</value>
</power>
<chance>67</chance>
<chanceBoost>670</chanceBoost>
</effect>
</effects>
</skill>
@ -3720,7 +3720,7 @@
<value level="11">34445</value>
<value level="12">38371</value>
</power>
<chance>67</chance>
<chanceBoost>670</chanceBoost>
</effect>
</effects>
</skill>
@ -3780,7 +3780,7 @@
<value level="11">32302</value>
<value level="12">36075</value>
</power>
<chance>67</chance>
<chanceBoost>670</chanceBoost>
</effect>
</effects>
</skill>
@ -3840,7 +3840,7 @@
<value level="11">30232</value>
<value level="12">33780</value>
</power>
<chance>67</chance>
<chanceBoost>670</chanceBoost>
</effect>
</effects>
</skill>

View File

@ -2817,7 +2817,7 @@
<value level="3">7306</value>
<value level="4">8602</value>
</power>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
<effect name="PhysicalMute" />
</effects>
@ -2916,15 +2916,13 @@
<effects>
<effect name="FatalBlow">
<power>6335</power>
<chance>15</chance>
<chanceBoost>150</chanceBoost>
</effect>
<effect name="Speed">
<amount>40</amount>
<mode>DIFF</mode>
</effect>
</effects>
<selfEffects>
</selfEffects>
</skill>
<skill id="5085" toLevel="1" name="Anesthesia">
<!-- Confirmed CT2.5 -->

View File

@ -1309,7 +1309,7 @@
<effects>
<effect name="FatalBlow">
<power>39544</power>
<chance>115</chance>
<chanceBoost>1150</chanceBoost>
</effect>
</effects>
</skill>

View File

@ -1861,7 +1861,7 @@
<value level="12">6844</value>
<value level="13">6960</value>
</power>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
</effects>
</skill>

View File

@ -1536,10 +1536,11 @@
<effect name="FatalBlow">
<power>5773</power>
<criticalChance>20</criticalChance>
<chance>30</chance>
<chanceBoost>300</chanceBoost>
<overHit>true</overHit>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>15</halfLethal>
</effect>
</effects>

View File

@ -494,7 +494,7 @@
<value fromLevel="7" toLevel="11" fromSubLevel="1001" toSubLevel="1030">{base + base / 100 * subIndex}</value>
</power>
<criticalChance>30</criticalChance>
<chance>40</chance>
<chanceBoost>400</chanceBoost>
<overHit>true</overHit>
</effect>
</pveEffects>
@ -516,7 +516,7 @@
<value fromLevel="7" toLevel="11" fromSubLevel="2001" toSubLevel="2030">{base + base / 100 * (5 + subIndex)}</value>
</power>
<criticalChance>30</criticalChance>
<chance>40</chance>
<chanceBoost>400</chanceBoost>
<overHit>true</overHit>
</effect>
</pvpEffects>
@ -610,7 +610,7 @@
<value fromLevel="7" toLevel="11" fromSubLevel="1001" toSubLevel="1030">{base + base / 100 * subIndex}</value>
</power>
<criticalChance>15</criticalChance>
<chance>36.5</chance>
<chanceBoost>365</chanceBoost>
<overHit>true</overHit>
</effect>
</pveEffects>
@ -632,7 +632,7 @@
<value fromLevel="7" toLevel="11" fromSubLevel="2001" toSubLevel="2030">{base + base / 100 * (5 + subIndex)}</value>
</power>
<criticalChance>15</criticalChance>
<chance>36.5</chance>
<chanceBoost>365</chanceBoost>
<overHit>true</overHit>
</effect>
</pvpEffects>
@ -739,7 +739,7 @@
<criticalChance>20</criticalChance>
<abnormalType>BLEEDING</abnormalType>
<abnormalPower>4130</abnormalPower>
<chance>36.5</chance>
<chanceBoost>365</chanceBoost>
<overHit>true</overHit>
</effect>
</pveEffects>
@ -762,8 +762,8 @@
</power>
<criticalChance>20</criticalChance>
<abnormalType>BLEEDING</abnormalType>
<abnormalPower>4130</abnormalPower>
<chance>36.5</chance>
<abnormalPower>4130</abnormalPower> <!-- TODO: Must have different values per level. -->
<chanceBoost>365</chanceBoost>
<overHit>true</overHit>
</effect>
</pvpEffects>
@ -838,7 +838,7 @@
<value fromLevel="3" toLevel="7" fromSubLevel="1001" toSubLevel="1030">{base + base / 100 * subIndex}</value>
</power>
<criticalChance>20</criticalChance>
<chance>36.5</chance>
<chanceBoost>365</chanceBoost>
<overHit>true</overHit>
</effect>
</pveEffects>
@ -856,7 +856,7 @@
<value fromLevel="3" toLevel="7" fromSubLevel="2001" toSubLevel="2030">{base + base / 100 * (5 + subIndex)}</value>
</power>
<criticalChance>20</criticalChance>
<chance>36.5</chance>
<chanceBoost>365</chanceBoost>
<overHit>true</overHit>
</effect>
</pvpEffects>
@ -2929,7 +2929,7 @@
</effect>
<effect name="FatalBlow">
<power>8875</power>
<chance>30</chance>
<chanceBoost>300</chanceBoost>
</effect>
</effects>
</skill>
@ -3117,7 +3117,7 @@
<value level="6">27993</value>
<value level="7">29472</value>
</power>
<chance>30</chance>
<chanceBoost>300</chanceBoost>
</effect>
<effect name="Speed">
<amount>-23</amount>

View File

@ -327,11 +327,12 @@
<allowedSkills>10279;10517;10025;10776;11770;1904;11264;11093;13314;1912</allowedSkills>
</effect>
<effect name="FatalBlow">
<chance>30</chance>
<chanceBoost>300</chanceBoost>
<power>8875</power>
<overHit>true</overHit>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>15</halfLethal>
</effect>
</effects>

View File

@ -3613,7 +3613,7 @@
<effects>
<effect name="FatalBlow">
<!-- Guessed -->
<chance>30</chance>
<chanceBoost>300</chanceBoost>
<power>
<value level="1">45696</value>
<value level="2">47772</value>
@ -3621,7 +3621,7 @@
</power>
</effect>
<effect name="Lethal">
<!-- Guessed -->
<fullLethal>0</fullLethal>
<halfLethal>10</halfLethal>
</effect>
</effects>
@ -3647,7 +3647,7 @@
<effects>
<effect name="FatalBlow">
<!-- Guessed -->
<chance>30</chance>
<chanceBoost>300</chanceBoost>
<power>
<value level="1">51411</value>
<value level="2">53747</value>
@ -3655,7 +3655,7 @@
</power>
</effect>
<effect name="Lethal">
<!-- Guessed -->
<fullLethal>0</fullLethal>
<halfLethal>10</halfLethal>
</effect>
</effects>

View File

@ -2857,7 +2857,7 @@
<value level="6">5029</value>
<value level="7">5479</value>
</power>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
<effect name="DamOverTime">
<power>100</power>

View File

@ -2872,9 +2872,10 @@
<effects>
<effect name="FatalBlow">
<power>7127</power>
<chance>30</chance>
<chanceBoost>300</chanceBoost>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>5</halfLethal>
</effect>
<effect name="DispelBySlot">

View File

@ -2238,9 +2238,10 @@
<effects>
<effect name="FatalBlow">
<power>1700</power>
<chance>30</chance>
<chanceBoost>300</chanceBoost>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>5</halfLethal>
</effect>
</effects>

View File

@ -1546,7 +1546,7 @@
</effect>
<effect name="FatalBlow">
<power>3000</power>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
</effects>
</skill>
@ -1674,7 +1674,7 @@
</effect>
<effect name="FatalBlow">
<power>3000</power>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
</effects>
</skill>

View File

@ -64,7 +64,7 @@
<effect name="FatalBlow">
<power>3420</power>
<overHit>true</overHit>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
</effects>
</skill>

View File

@ -830,6 +830,7 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="chanceBoost" type="xs:unsignedShort" />
<xs:element name="dispel">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
@ -895,8 +896,8 @@
</xs:complexType>
</xs:element>
<xs:element name="weaponType">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="weaponType">
<xs:complexType>
<xs:sequence>
@ -1158,6 +1159,21 @@
</xs:complexType>
</xs:element>
<xs:element name="side" type="xs:string" />
<xs:element name="fullLethal">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element maxOccurs="unbounded" name="value">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:unsignedByte">
<xs:attribute name="level" type="xs:unsignedByte" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="PARALYZE">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
@ -1499,21 +1515,6 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="fullLethal">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element maxOccurs="unbounded" name="value">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:unsignedByte">
<xs:attribute name="level" type="xs:unsignedByte" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="itemId">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
@ -1986,6 +1987,7 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="pAtkMod" type="xs:unsignedByte" />
<xs:element name="isSummonSpawn" type="xs:boolean" />
<xs:element name="randomOffset" type="xs:unsignedByte" />
<xs:element name="debuffModifier" type="xs:decimal" />
@ -2021,7 +2023,6 @@
</xs:element>
<xs:element name="damageModifier" type="xs:decimal" />
<xs:element name="animationSpeed" type="xs:unsignedShort" />
<xs:element name="pAtkMod" type="xs:unsignedByte" />
</xs:choice>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required" />
@ -2347,22 +2348,6 @@
<xs:element name="effect">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="amount">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="value">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:unsignedByte">
<xs:attribute name="level" type="xs:unsignedByte" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="attribute" type="xs:string" />
<xs:element minOccurs="0" name="ON_MAGIC_SKILL" />
<xs:element minOccurs="0" name="ON_CRITICAL_SKILL" />
<xs:element minOccurs="0" name="ON_EQUIP" />
@ -2490,7 +2475,7 @@
<xs:element minOccurs="0" name="criticalChance" type="xs:unsignedByte" />
<xs:element minOccurs="0" name="abnormalType" type="xs:string" />
<xs:element minOccurs="0" name="abnormalPower" type="xs:unsignedShort" />
<xs:element minOccurs="0" name="chance" type="xs:decimal" />
<xs:element minOccurs="0" name="chanceBoost" type="xs:unsignedShort" />
<xs:element minOccurs="0" name="overHit" type="xs:boolean" />
<xs:element minOccurs="0" name="ticks" type="xs:unsignedByte" />
</xs:sequence>
@ -2536,7 +2521,7 @@
<xs:element minOccurs="0" name="criticalChance" type="xs:unsignedByte" />
<xs:element minOccurs="0" name="abnormalType" type="xs:string" />
<xs:element minOccurs="0" name="abnormalPower" type="xs:unsignedShort" />
<xs:element minOccurs="0" name="chance" type="xs:decimal" />
<xs:element minOccurs="0" name="chanceBoost" type="xs:unsignedShort" />
<xs:element minOccurs="0" name="overHit" type="xs:boolean" />
<xs:element minOccurs="0" name="ticks" type="xs:unsignedByte" />
</xs:sequence>

View File

@ -36,6 +36,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2StaticObjectInstance;
import com.l2jmobius.gameserver.model.cubic.CubicInstance;
import com.l2jmobius.gameserver.model.effects.EffectFlag;
import com.l2jmobius.gameserver.model.effects.L2EffectType;
import com.l2jmobius.gameserver.model.interfaces.ILocational;
import com.l2jmobius.gameserver.model.items.L2Armor;
import com.l2jmobius.gameserver.model.items.L2Item;
import com.l2jmobius.gameserver.model.items.L2Weapon;
@ -264,6 +265,37 @@ public final class Formulas
return finalRate > Rnd.get(1000);
}
/**
* Gets the default (10% for side, 30% for back) positional critical rate bonus and multiplies it by any buffs that give positional critical rate bonus.
* @param activeChar the attacker.
* @param target the target.
* @return a multiplier representing the positional critical rate bonus. Autoattacks for example get this bonus on top of the already capped critical rate of 500.
*/
public static double calcCriticalPositionBonus(L2Character activeChar, L2Character target)
{
// final Position position = activeChar.getStat().has(Stats.ATTACK_BEHIND) ? Position.BACK : Position.getPosition(activeChar, target);
switch (Position.getPosition(activeChar, target))
{
case SIDE: // 10% Critical Chance bonus when attacking from side.
{
return 1.1 * activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, Position.SIDE);
}
case BACK: // 30% Critical Chance bonus when attacking from back.
{
return 1.3 * activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, Position.BACK);
}
default: // No Critical Chance bonus when attacking from front.
{
return activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, Position.FRONT);
}
}
}
public static double calcCriticalHeightBonus(ILocational from, ILocational target)
{
return ((((CommonUtil.constrain(from.getZ() - target.getZ(), -25, 25) * 4) / 5) + 10) / 100) + 1;
}
/**
* @param attacker
* @param target
@ -1018,21 +1050,37 @@ public final class Formulas
return cha.getStat().getValue(Stats.FALL, (fallHeight * cha.getMaxHp()) / 1000.0);
}
public static boolean calcBlowSuccess(L2Character activeChar, L2Character target, Skill skill, double blowChance)
/**
* Basic chance formula:<br>
* <ul>
* <li>chance = weapon_critical * dex_bonus * crit_height_bonus * crit_pos_bonus * effect_bonus * fatal_blow_rate</li>
* <li>weapon_critical = (12 for daggers)</li>
* <li>dex_bonus = dex modifier bonus for current dex (Seems unused in GOD, so its not used in formula).</li>
* <li>crit_height_bonus = (z_diff * 4 / 5 + 10) / 100 + 1 or alternatively (z_diff * 0.008) + 1.1. Be aware of z_diff constraint of -25 to 25.</li>
* <li>crit_pos_bonus = crit_pos(front = 1, side = 1.1, back = 1.3) * p_critical_rate_position_bonus</li>
* <li>effect_bonus = (p2 + 100) / 100, p2 - 2nd param of effect. Blow chance of effect.</li>
* </ul>
* Chance cannot be higher than 80%.
* @param activeChar
* @param target
* @param skill
* @param chanceBoost
* @return
*/
public static boolean calcBlowSuccess(L2Character activeChar, L2Character target, Skill skill, double chanceBoost)
{
final double weaponCritical = 12; // Dagger weapon critical mod is 12... TODO: Make it work for other weapons.
final L2Weapon weapon = activeChar.getActiveWeaponItem();
final double weaponCritical = weapon != null ? weapon.getStats(Stats.CRITICAL_RATE, activeChar.getTemplate().getBaseCritRate()) : activeChar.getTemplate().getBaseCritRate();
// double dexBonus = BaseStats.DEX.calcBonus(activeChar); Not used in GOD
final double critHeightBonus = ((((CommonUtil.constrain(activeChar.getZ() - target.getZ(), -25, 25) * 4) / 5) + 10) / 100) + 1;
final Position position = Position.getPosition(activeChar, target);
final double criticalPosition = position == Position.BACK ? 1.3 : position == Position.SIDE ? 1.1 : 1; // 30% chance from back, 10% chance from side.
final double criticalPositionMod = criticalPosition * activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, position);
final double critHeightBonus = calcCriticalHeightBonus(activeChar, target);
final double criticalPosition = calcCriticalPositionBonus(activeChar, target); // 30% chance from back, 10% chance from side. Include buffs that give positional crit rate.
final double chanceBoostMod = (100 + chanceBoost) / 100;
final double blowRateMod = activeChar.getStat().getValue(Stats.BLOW_RATE, 1);
blowChance = (weaponCritical + blowChance) * 10;
final double rate = blowChance * critHeightBonus * criticalPositionMod * blowRateMod;
final double rate = criticalPosition * critHeightBonus * weaponCritical * chanceBoostMod * blowRateMod;
// Blow rate is capped at 80%
return Rnd.get(1000) < Math.min(rate, 800);
return Rnd.get(100) < Math.min(rate, 80);
}
public static List<BuffInfo> calcCancelStealEffects(L2Character activeChar, L2Character target, Skill skill, DispelSlotType slot, int rate, int max)

View File

@ -33,14 +33,14 @@ import com.l2jmobius.gameserver.model.stats.Formulas;
public final class Backstab extends AbstractEffect
{
private final double _power;
private final double _chance;
private final double _chanceBoost;
private final double _criticalChance;
private final boolean _overHit;
public Backstab(StatsSet params)
{
_power = params.getDouble("power", 0);
_chance = params.getDouble("chance", 0);
_power = params.getDouble("power");
_chanceBoost = params.getDouble("chanceBoost");
_criticalChance = params.getDouble("criticalChance", 0);
_overHit = params.getBoolean("overHit", false);
}
@ -48,7 +48,7 @@ public final class Backstab extends AbstractEffect
@Override
public boolean calcSuccess(L2Character effector, L2Character effected, Skill skill)
{
return !effector.isInFrontOf(effected) && !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chance);
return !effector.isInFrontOf(effected) && !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chanceBoost);
}
@Override

View File

@ -22,7 +22,6 @@ import java.util.Set;
import com.l2jmobius.gameserver.enums.ShotType;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Attackable;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
import com.l2jmobius.gameserver.model.effects.L2EffectType;
@ -38,27 +37,24 @@ import com.l2jmobius.gameserver.model.stats.Formulas;
public final class FatalBlow extends AbstractEffect
{
private final double _power;
private final double _chance;
private final double _chanceBoost;
private final double _criticalChance;
private final boolean _overHit;
private final Set<AbnormalType> _abnormals;
private final double _abnormalPower;
public FatalBlow(StatsSet params)
{
_power = params.getDouble("power", 0);
_chance = params.getDouble("chance", 0);
_power = params.getDouble("power");
_chanceBoost = params.getDouble("chanceBoost");
_criticalChance = params.getDouble("criticalChance", 0);
_overHit = params.getBoolean("overHit", false);
final String abnormals = params.getString("abnormalType", null);
String abnormals = params.getString("abnormalType", null);
if ((abnormals != null) && !abnormals.isEmpty())
{
_abnormals = new HashSet<>();
for (String slot : abnormals.split(";"))
{
_abnormals.add(AbnormalType.getAbnormalType(slot));
_abnormals.add(Enum.valueOf(AbnormalType.class, slot));
}
}
else
@ -71,7 +67,7 @@ public final class FatalBlow extends AbstractEffect
@Override
public boolean calcSuccess(L2Character effector, L2Character effected, Skill skill)
{
return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chance);
return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chanceBoost);
}
@Override
@ -94,11 +90,6 @@ public final class FatalBlow extends AbstractEffect
return;
}
if (_overHit && effected.isAttackable())
{
((L2Attackable) effected).overhitEnabled(true);
}
double power = _power;
// Check if we apply an abnormal modifier

View File

@ -33,13 +33,13 @@ import com.l2jmobius.gameserver.model.stats.Formulas;
public final class SoulBlow extends AbstractEffect
{
private final double _power;
private final double _chance;
private final double _chanceBoost;
private final boolean _overHit;
public SoulBlow(StatsSet params)
{
_power = params.getDouble("power", 0);
_chance = params.getDouble("chance", 0);
_power = params.getDouble("power");
_chanceBoost = params.getDouble("chanceBoost");
_overHit = params.getBoolean("overHit", false);
}
@ -52,7 +52,7 @@ public final class SoulBlow extends AbstractEffect
@Override
public boolean calcSuccess(L2Character effector, L2Character effected, Skill skill)
{
return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chance);
return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chanceBoost);
}
@Override

View File

@ -1784,7 +1784,7 @@
<value level="24">977</value>
</power>
<overHit>true</overHit>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
</effects>
</skill>
@ -3290,7 +3290,7 @@
<value level="36">15</value>
<value level="37">15</value>
</criticalChance>
<chance>40</chance>
<chanceBoost>400</chanceBoost>
<overHit>true</overHit>
</effect>
<effect name="Lethal">

View File

@ -4526,9 +4526,10 @@
<value level="37">5479</value>
</power>
<overHit>true</overHit>
<chance>30</chance>
<chanceBoost>300</chanceBoost>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>10</halfLethal>
</effect>
</effects>

View File

@ -1079,12 +1079,13 @@
<value level="10">3653</value>
</power>
<overHit>true</overHit>
<chance>25</chance>
<chanceBoost>250</chanceBoost>
</effect>
<effect name="Bluff">
<chance>80</chance>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>5</halfLethal>
</effect>
</effects>
@ -1715,10 +1716,11 @@
<effect name="FatalBlow">
<power>5773</power>
<criticalChance>20</criticalChance>
<chance>30</chance>
<chanceBoost>300</chanceBoost>
<overHit>true</overHit>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>15</halfLethal>
</effect>
</effects>

View File

@ -1210,9 +1210,10 @@
<value level="10">3653</value>
</power>
<overHit>true</overHit>
<chance>25</chance>
<chanceBoost>250</chanceBoost>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>5</halfLethal>
</effect>
</effects>

View File

@ -525,7 +525,7 @@
<value level="28">5479</value>
</power>
<overHit>true</overHit>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
</effects>
</skill>
@ -4201,9 +4201,10 @@
<value level="4">5199</value>
</power>
<overHit>true</overHit>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>10</halfLethal>
</effect>
</effects>

View File

@ -2634,9 +2634,10 @@
<effect name="FatalBlow">
<power>6969</power>
<overHit>true</overHit>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>10</halfLethal>
</effect>
</effects>

View File

@ -1604,7 +1604,7 @@
<effect name="FatalBlow">
<power>11234</power>
<criticalChance>30</criticalChance>
<chance>60</chance>
<chanceBoost>600</chanceBoost>
<overHit>true</overHit>
</effect>
<effect name="Lethal">

View File

@ -3668,7 +3668,7 @@
<effect name="FatalBlow">
<power>11234</power>
<criticalChance>30</criticalChance>
<chance>60</chance>
<chanceBoost>600</chanceBoost>
<overHit>true</overHit>
</effect>
<effect name="Lethal">

View File

@ -2431,7 +2431,7 @@
<value level="11">7461</value>
<value level="12">7850</value>
</power>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
</effects>
</skill>

View File

@ -3417,7 +3417,7 @@
<value level="11">44350</value>
<value level="12">49193</value>
</power>
<chance>115</chance>
<chanceBoost>1150</chanceBoost>
</effect>
</effects>
</skill>
@ -4046,7 +4046,7 @@
<value level="11">73917</value>
<value level="12">81989</value>
</power>
<chance>67</chance>
<chanceBoost>670</chanceBoost>
</effect>
</effects>
</skill>

View File

@ -2542,7 +2542,7 @@
<value level="11">7461</value>
<value level="12">7850</value>
</power>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
<effect name="DamOverTime">
<power>

View File

@ -1082,8 +1082,8 @@
<value level="16">9648</value>
<value level="17">9830</value>
</power>
<criticalChance>30</criticalChance>
<chance>50</chance>
<criticalChance>10</criticalChance>
<chanceBoost>200</chanceBoost>
</effect>
</effects>
</skill>
@ -2305,7 +2305,7 @@
<value level="11">44350</value>
<value level="12">49193</value>
</power>
<chance>115</chance>
<chanceBoost>1150</chanceBoost>
</effect>
</effects>
</skill>
@ -2365,7 +2365,7 @@
<value level="11">38806</value>
<value level="12">43290</value>
</power>
<chance>115</chance>
<chanceBoost>1150</chanceBoost>
</effect>
</effects>
</skill>
@ -2425,7 +2425,7 @@
<value level="11">20667</value>
<value level="12">23023</value>
</power>
<chance>115</chance>
<chanceBoost>1150</chanceBoost>
</effect>
</effects>
</skill>
@ -2485,7 +2485,7 @@
<value level="11">19381</value>
<value level="12">21645</value>
</power>
<chance>115</chance>
<chanceBoost>1150</chanceBoost>
</effect>
</effects>
</skill>
@ -2545,7 +2545,7 @@
<value level="11">18140</value>
<value level="12">20268</value>
</power>
<chance>115</chance>
<chanceBoost>1150</chanceBoost>
</effect>
</effects>
</skill>
@ -3600,7 +3600,7 @@
<value level="11">73917</value>
<value level="12">81989</value>
</power>
<chance>67</chance>
<chanceBoost>670</chanceBoost>
</effect>
</effects>
</skill>
@ -3660,7 +3660,7 @@
<value level="11">64677</value>
<value level="12">72150</value>
</power>
<chance>67</chance>
<chanceBoost>670</chanceBoost>
</effect>
</effects>
</skill>
@ -3720,7 +3720,7 @@
<value level="11">34445</value>
<value level="12">38371</value>
</power>
<chance>67</chance>
<chanceBoost>670</chanceBoost>
</effect>
</effects>
</skill>
@ -3780,7 +3780,7 @@
<value level="11">32302</value>
<value level="12">36075</value>
</power>
<chance>67</chance>
<chanceBoost>670</chanceBoost>
</effect>
</effects>
</skill>
@ -3840,7 +3840,7 @@
<value level="11">30232</value>
<value level="12">33780</value>
</power>
<chance>67</chance>
<chanceBoost>670</chanceBoost>
</effect>
</effects>
</skill>

View File

@ -2817,7 +2817,7 @@
<value level="3">7306</value>
<value level="4">8602</value>
</power>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
<effect name="PhysicalMute" />
</effects>
@ -2916,15 +2916,13 @@
<effects>
<effect name="FatalBlow">
<power>6335</power>
<chance>15</chance>
<chanceBoost>150</chanceBoost>
</effect>
<effect name="Speed">
<amount>40</amount>
<mode>DIFF</mode>
</effect>
</effects>
<selfEffects>
</selfEffects>
</skill>
<skill id="5085" toLevel="1" name="Anesthesia">
<!-- Confirmed CT2.5 -->

View File

@ -1309,7 +1309,7 @@
<effects>
<effect name="FatalBlow">
<power>39544</power>
<chance>115</chance>
<chanceBoost>1150</chanceBoost>
</effect>
</effects>
</skill>

View File

@ -1861,7 +1861,7 @@
<value level="12">6844</value>
<value level="13">6960</value>
</power>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
</effects>
</skill>

View File

@ -1536,10 +1536,11 @@
<effect name="FatalBlow">
<power>5773</power>
<criticalChance>20</criticalChance>
<chance>30</chance>
<chanceBoost>300</chanceBoost>
<overHit>true</overHit>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>15</halfLethal>
</effect>
</effects>

View File

@ -494,7 +494,7 @@
<value fromLevel="7" toLevel="11" fromSubLevel="1001" toSubLevel="1030">{base + base / 100 * subIndex}</value>
</power>
<criticalChance>30</criticalChance>
<chance>40</chance>
<chanceBoost>400</chanceBoost>
<overHit>true</overHit>
</effect>
</pveEffects>
@ -516,7 +516,7 @@
<value fromLevel="7" toLevel="11" fromSubLevel="2001" toSubLevel="2030">{base + base / 100 * (5 + subIndex)}</value>
</power>
<criticalChance>30</criticalChance>
<chance>40</chance>
<chanceBoost>400</chanceBoost>
<overHit>true</overHit>
</effect>
</pvpEffects>
@ -610,7 +610,7 @@
<value fromLevel="7" toLevel="11" fromSubLevel="1001" toSubLevel="1030">{base + base / 100 * subIndex}</value>
</power>
<criticalChance>15</criticalChance>
<chance>36.5</chance>
<chanceBoost>365</chanceBoost>
<overHit>true</overHit>
</effect>
</pveEffects>
@ -632,7 +632,7 @@
<value fromLevel="7" toLevel="11" fromSubLevel="2001" toSubLevel="2030">{base + base / 100 * (5 + subIndex)}</value>
</power>
<criticalChance>15</criticalChance>
<chance>36.5</chance>
<chanceBoost>365</chanceBoost>
<overHit>true</overHit>
</effect>
</pvpEffects>
@ -739,7 +739,7 @@
<criticalChance>20</criticalChance>
<abnormalType>BLEEDING</abnormalType>
<abnormalPower>4130</abnormalPower>
<chance>36.5</chance>
<chanceBoost>365</chanceBoost>
<overHit>true</overHit>
</effect>
</pveEffects>
@ -762,8 +762,8 @@
</power>
<criticalChance>20</criticalChance>
<abnormalType>BLEEDING</abnormalType>
<abnormalPower>4130</abnormalPower>
<chance>36.5</chance>
<abnormalPower>4130</abnormalPower> <!-- TODO: Must have different values per level. -->
<chanceBoost>365</chanceBoost>
<overHit>true</overHit>
</effect>
</pvpEffects>
@ -838,7 +838,7 @@
<value fromLevel="3" toLevel="7" fromSubLevel="1001" toSubLevel="1030">{base + base / 100 * subIndex}</value>
</power>
<criticalChance>20</criticalChance>
<chance>36.5</chance>
<chanceBoost>365</chanceBoost>
<overHit>true</overHit>
</effect>
</pveEffects>
@ -856,7 +856,7 @@
<value fromLevel="3" toLevel="7" fromSubLevel="2001" toSubLevel="2030">{base + base / 100 * (5 + subIndex)}</value>
</power>
<criticalChance>20</criticalChance>
<chance>36.5</chance>
<chanceBoost>365</chanceBoost>
<overHit>true</overHit>
</effect>
</pvpEffects>
@ -2935,7 +2935,7 @@
</effect>
<effect name="FatalBlow">
<power>8875</power>
<chance>30</chance>
<chanceBoost>300</chanceBoost>
</effect>
</effects>
</skill>
@ -3123,7 +3123,7 @@
<value level="6">27993</value>
<value level="7">29472</value>
</power>
<chance>30</chance>
<chanceBoost>300</chanceBoost>
</effect>
<effect name="Speed">
<amount>-23</amount>

View File

@ -337,11 +337,12 @@
<allowedSkills>10279;10517;10025;10776;11770;1904;11264;11093;13314;1912</allowedSkills>
</effect>
<effect name="FatalBlow">
<chance>30</chance>
<chanceBoost>300</chanceBoost>
<power>8875</power>
<overHit>true</overHit>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>15</halfLethal>
</effect>
</effects>

View File

@ -3618,7 +3618,7 @@
<effects>
<effect name="FatalBlow">
<!-- Guessed -->
<chance>30</chance>
<chanceBoost>300</chanceBoost>
<power>
<value level="1">45696</value>
<value level="2">47772</value>
@ -3626,7 +3626,7 @@
</power>
</effect>
<effect name="Lethal">
<!-- Guessed -->
<fullLethal>0</fullLethal>
<halfLethal>10</halfLethal>
</effect>
</effects>
@ -3652,7 +3652,7 @@
<effects>
<effect name="FatalBlow">
<!-- Guessed -->
<chance>30</chance>
<chanceBoost>300</chanceBoost>
<power>
<value level="1">51411</value>
<value level="2">53747</value>
@ -3660,7 +3660,7 @@
</power>
</effect>
<effect name="Lethal">
<!-- Guessed -->
<fullLethal>0</fullLethal>
<halfLethal>10</halfLethal>
</effect>
</effects>

View File

@ -2857,7 +2857,7 @@
<value level="6">5029</value>
<value level="7">5479</value>
</power>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
<effect name="DamOverTime">
<power>100</power>

View File

@ -2872,9 +2872,10 @@
<effects>
<effect name="FatalBlow">
<power>7127</power>
<chance>30</chance>
<chanceBoost>300</chanceBoost>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>5</halfLethal>
</effect>
<effect name="DispelBySlot">

View File

@ -2238,9 +2238,10 @@
<effects>
<effect name="FatalBlow">
<power>1700</power>
<chance>30</chance>
<chanceBoost>300</chanceBoost>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>5</halfLethal>
</effect>
</effects>

View File

@ -1546,7 +1546,7 @@
</effect>
<effect name="FatalBlow">
<power>3000</power>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
</effects>
</skill>
@ -1674,7 +1674,7 @@
</effect>
<effect name="FatalBlow">
<power>3000</power>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
</effects>
</skill>

View File

@ -64,7 +64,7 @@
<effect name="FatalBlow">
<power>3420</power>
<overHit>true</overHit>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
</effects>
</skill>

View File

@ -834,6 +834,7 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="chanceBoost" type="xs:unsignedShort" />
<xs:element name="dispel">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
@ -899,8 +900,8 @@
</xs:complexType>
</xs:element>
<xs:element name="weaponType">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="weaponType">
<xs:complexType>
<xs:sequence>
@ -1162,6 +1163,21 @@
</xs:complexType>
</xs:element>
<xs:element name="side" type="xs:string" />
<xs:element name="fullLethal">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element maxOccurs="unbounded" name="value">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:unsignedByte">
<xs:attribute name="level" type="xs:unsignedByte" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="PARALYZE">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
@ -1503,21 +1519,6 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="fullLethal">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element maxOccurs="unbounded" name="value">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:unsignedByte">
<xs:attribute name="level" type="xs:unsignedByte" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="itemId">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
@ -2074,6 +2075,7 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="pAtkMod" type="xs:unsignedByte" />
<xs:element name="isSummonSpawn" type="xs:boolean" />
<xs:element name="randomOffset" type="xs:unsignedByte" />
<xs:element name="HATE">
@ -2109,7 +2111,6 @@
<xs:element name="debuffModifier" type="xs:decimal" />
<xs:element name="damageModifier" type="xs:decimal" />
<xs:element name="animationSpeed" type="xs:unsignedShort" />
<xs:element name="pAtkMod" type="xs:unsignedByte" />
</xs:choice>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required" />
@ -2470,22 +2471,6 @@
<xs:element name="effect">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="amount">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="value">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:unsignedByte">
<xs:attribute name="level" type="xs:unsignedByte" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="attribute" type="xs:string" />
<xs:element minOccurs="0" name="ON_MAGIC_SKILL" />
<xs:element minOccurs="0" name="ON_CRITICAL_SKILL" />
<xs:element minOccurs="0" name="ON_EQUIP" />
@ -2613,7 +2598,7 @@
<xs:element minOccurs="0" name="criticalChance" type="xs:unsignedByte" />
<xs:element minOccurs="0" name="abnormalType" type="xs:string" />
<xs:element minOccurs="0" name="abnormalPower" type="xs:unsignedShort" />
<xs:element minOccurs="0" name="chance" type="xs:decimal" />
<xs:element minOccurs="0" name="chanceBoost" type="xs:unsignedShort" />
<xs:element minOccurs="0" name="overHit" type="xs:boolean" />
<xs:element minOccurs="0" name="ticks" type="xs:unsignedByte" />
</xs:sequence>
@ -2659,7 +2644,7 @@
<xs:element minOccurs="0" name="criticalChance" type="xs:unsignedByte" />
<xs:element minOccurs="0" name="abnormalType" type="xs:string" />
<xs:element minOccurs="0" name="abnormalPower" type="xs:unsignedShort" />
<xs:element minOccurs="0" name="chance" type="xs:decimal" />
<xs:element minOccurs="0" name="chanceBoost" type="xs:unsignedShort" />
<xs:element minOccurs="0" name="overHit" type="xs:boolean" />
<xs:element minOccurs="0" name="ticks" type="xs:unsignedByte" />
</xs:sequence>

View File

@ -36,6 +36,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2StaticObjectInstance;
import com.l2jmobius.gameserver.model.cubic.CubicInstance;
import com.l2jmobius.gameserver.model.effects.EffectFlag;
import com.l2jmobius.gameserver.model.effects.L2EffectType;
import com.l2jmobius.gameserver.model.interfaces.ILocational;
import com.l2jmobius.gameserver.model.items.L2Armor;
import com.l2jmobius.gameserver.model.items.L2Item;
import com.l2jmobius.gameserver.model.items.L2Weapon;
@ -264,6 +265,37 @@ public final class Formulas
return finalRate > Rnd.get(1000);
}
/**
* Gets the default (10% for side, 30% for back) positional critical rate bonus and multiplies it by any buffs that give positional critical rate bonus.
* @param activeChar the attacker.
* @param target the target.
* @return a multiplier representing the positional critical rate bonus. Autoattacks for example get this bonus on top of the already capped critical rate of 500.
*/
public static double calcCriticalPositionBonus(L2Character activeChar, L2Character target)
{
// final Position position = activeChar.getStat().has(Stats.ATTACK_BEHIND) ? Position.BACK : Position.getPosition(activeChar, target);
switch (Position.getPosition(activeChar, target))
{
case SIDE: // 10% Critical Chance bonus when attacking from side.
{
return 1.1 * activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, Position.SIDE);
}
case BACK: // 30% Critical Chance bonus when attacking from back.
{
return 1.3 * activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, Position.BACK);
}
default: // No Critical Chance bonus when attacking from front.
{
return activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, Position.FRONT);
}
}
}
public static double calcCriticalHeightBonus(ILocational from, ILocational target)
{
return ((((CommonUtil.constrain(from.getZ() - target.getZ(), -25, 25) * 4) / 5) + 10) / 100) + 1;
}
/**
* @param attacker
* @param target
@ -1018,21 +1050,37 @@ public final class Formulas
return cha.getStat().getValue(Stats.FALL, (fallHeight * cha.getMaxHp()) / 1000.0);
}
public static boolean calcBlowSuccess(L2Character activeChar, L2Character target, Skill skill, double blowChance)
/**
* Basic chance formula:<br>
* <ul>
* <li>chance = weapon_critical * dex_bonus * crit_height_bonus * crit_pos_bonus * effect_bonus * fatal_blow_rate</li>
* <li>weapon_critical = (12 for daggers)</li>
* <li>dex_bonus = dex modifier bonus for current dex (Seems unused in GOD, so its not used in formula).</li>
* <li>crit_height_bonus = (z_diff * 4 / 5 + 10) / 100 + 1 or alternatively (z_diff * 0.008) + 1.1. Be aware of z_diff constraint of -25 to 25.</li>
* <li>crit_pos_bonus = crit_pos(front = 1, side = 1.1, back = 1.3) * p_critical_rate_position_bonus</li>
* <li>effect_bonus = (p2 + 100) / 100, p2 - 2nd param of effect. Blow chance of effect.</li>
* </ul>
* Chance cannot be higher than 80%.
* @param activeChar
* @param target
* @param skill
* @param chanceBoost
* @return
*/
public static boolean calcBlowSuccess(L2Character activeChar, L2Character target, Skill skill, double chanceBoost)
{
final double weaponCritical = 12; // Dagger weapon critical mod is 12... TODO: Make it work for other weapons.
final L2Weapon weapon = activeChar.getActiveWeaponItem();
final double weaponCritical = weapon != null ? weapon.getStats(Stats.CRITICAL_RATE, activeChar.getTemplate().getBaseCritRate()) : activeChar.getTemplate().getBaseCritRate();
// double dexBonus = BaseStats.DEX.calcBonus(activeChar); Not used in GOD
final double critHeightBonus = ((((CommonUtil.constrain(activeChar.getZ() - target.getZ(), -25, 25) * 4) / 5) + 10) / 100) + 1;
final Position position = Position.getPosition(activeChar, target);
final double criticalPosition = position == Position.BACK ? 1.3 : position == Position.SIDE ? 1.1 : 1; // 30% chance from back, 10% chance from side.
final double criticalPositionMod = criticalPosition * activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, position);
final double critHeightBonus = calcCriticalHeightBonus(activeChar, target);
final double criticalPosition = calcCriticalPositionBonus(activeChar, target); // 30% chance from back, 10% chance from side. Include buffs that give positional crit rate.
final double chanceBoostMod = (100 + chanceBoost) / 100;
final double blowRateMod = activeChar.getStat().getValue(Stats.BLOW_RATE, 1);
blowChance = (weaponCritical + blowChance) * 10;
final double rate = blowChance * critHeightBonus * criticalPositionMod * blowRateMod;
final double rate = criticalPosition * critHeightBonus * weaponCritical * chanceBoostMod * blowRateMod;
// Blow rate is capped at 80%
return Rnd.get(1000) < Math.min(rate, 800);
return Rnd.get(100) < Math.min(rate, 80);
}
public static List<BuffInfo> calcCancelStealEffects(L2Character activeChar, L2Character target, Skill skill, DispelSlotType slot, int rate, int max)

View File

@ -33,14 +33,14 @@ import com.l2jmobius.gameserver.model.stats.Formulas;
public final class Backstab extends AbstractEffect
{
private final double _power;
private final double _chance;
private final double _chanceBoost;
private final double _criticalChance;
private final boolean _overHit;
public Backstab(StatsSet params)
{
_power = params.getDouble("power", 0);
_chance = params.getDouble("chance", 0);
_power = params.getDouble("power");
_chanceBoost = params.getDouble("chanceBoost");
_criticalChance = params.getDouble("criticalChance", 0);
_overHit = params.getBoolean("overHit", false);
}
@ -48,7 +48,7 @@ public final class Backstab extends AbstractEffect
@Override
public boolean calcSuccess(L2Character effector, L2Character effected, Skill skill)
{
return !effector.isInFrontOf(effected) && !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chance);
return !effector.isInFrontOf(effected) && !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chanceBoost);
}
@Override

View File

@ -22,7 +22,6 @@ import java.util.Set;
import com.l2jmobius.gameserver.enums.ShotType;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Attackable;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
import com.l2jmobius.gameserver.model.effects.L2EffectType;
@ -38,27 +37,24 @@ import com.l2jmobius.gameserver.model.stats.Formulas;
public final class FatalBlow extends AbstractEffect
{
private final double _power;
private final double _chance;
private final double _chanceBoost;
private final double _criticalChance;
private final boolean _overHit;
private final Set<AbnormalType> _abnormals;
private final double _abnormalPower;
public FatalBlow(StatsSet params)
{
_power = params.getDouble("power", 0);
_chance = params.getDouble("chance", 0);
_power = params.getDouble("power");
_chanceBoost = params.getDouble("chanceBoost");
_criticalChance = params.getDouble("criticalChance", 0);
_overHit = params.getBoolean("overHit", false);
final String abnormals = params.getString("abnormalType", null);
String abnormals = params.getString("abnormalType", null);
if ((abnormals != null) && !abnormals.isEmpty())
{
_abnormals = new HashSet<>();
for (String slot : abnormals.split(";"))
{
_abnormals.add(AbnormalType.getAbnormalType(slot));
_abnormals.add(Enum.valueOf(AbnormalType.class, slot));
}
}
else
@ -71,7 +67,7 @@ public final class FatalBlow extends AbstractEffect
@Override
public boolean calcSuccess(L2Character effector, L2Character effected, Skill skill)
{
return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chance);
return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chanceBoost);
}
@Override
@ -94,11 +90,6 @@ public final class FatalBlow extends AbstractEffect
return;
}
if (_overHit && effected.isAttackable())
{
((L2Attackable) effected).overhitEnabled(true);
}
double power = _power;
// Check if we apply an abnormal modifier

View File

@ -33,13 +33,13 @@ import com.l2jmobius.gameserver.model.stats.Formulas;
public final class SoulBlow extends AbstractEffect
{
private final double _power;
private final double _chance;
private final double _chanceBoost;
private final boolean _overHit;
public SoulBlow(StatsSet params)
{
_power = params.getDouble("power", 0);
_chance = params.getDouble("chance", 0);
_power = params.getDouble("power");
_chanceBoost = params.getDouble("chanceBoost");
_overHit = params.getBoolean("overHit", false);
}
@ -52,7 +52,7 @@ public final class SoulBlow extends AbstractEffect
@Override
public boolean calcSuccess(L2Character effector, L2Character effected, Skill skill)
{
return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chance);
return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chanceBoost);
}
@Override

View File

@ -1784,7 +1784,7 @@
<value level="24">977</value>
</power>
<overHit>true</overHit>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
</effects>
</skill>
@ -3290,7 +3290,7 @@
<value level="36">15</value>
<value level="37">15</value>
</criticalChance>
<chance>40</chance>
<chanceBoost>400</chanceBoost>
<overHit>true</overHit>
</effect>
<effect name="Lethal">

View File

@ -4526,9 +4526,10 @@
<value level="37">5479</value>
</power>
<overHit>true</overHit>
<chance>30</chance>
<chanceBoost>300</chanceBoost>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>10</halfLethal>
</effect>
</effects>

View File

@ -1079,12 +1079,13 @@
<value level="10">3653</value>
</power>
<overHit>true</overHit>
<chance>25</chance>
<chanceBoost>250</chanceBoost>
</effect>
<effect name="Bluff">
<chance>80</chance>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>5</halfLethal>
</effect>
</effects>
@ -1715,10 +1716,11 @@
<effect name="FatalBlow">
<power>5773</power>
<criticalChance>20</criticalChance>
<chance>30</chance>
<chanceBoost>300</chanceBoost>
<overHit>true</overHit>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>15</halfLethal>
</effect>
</effects>

View File

@ -1210,9 +1210,10 @@
<value level="10">3653</value>
</power>
<overHit>true</overHit>
<chance>25</chance>
<chanceBoost>250</chanceBoost>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>5</halfLethal>
</effect>
</effects>

View File

@ -525,7 +525,7 @@
<value level="28">5479</value>
</power>
<overHit>true</overHit>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
</effects>
</skill>
@ -4201,9 +4201,10 @@
<value level="4">5199</value>
</power>
<overHit>true</overHit>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>10</halfLethal>
</effect>
</effects>

View File

@ -2634,9 +2634,10 @@
<effect name="FatalBlow">
<power>6969</power>
<overHit>true</overHit>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>10</halfLethal>
</effect>
</effects>

View File

@ -1604,7 +1604,7 @@
<effect name="FatalBlow">
<power>11234</power>
<criticalChance>30</criticalChance>
<chance>60</chance>
<chanceBoost>600</chanceBoost>
<overHit>true</overHit>
</effect>
<effect name="Lethal">

View File

@ -3668,7 +3668,7 @@
<effect name="FatalBlow">
<power>11234</power>
<criticalChance>30</criticalChance>
<chance>60</chance>
<chanceBoost>600</chanceBoost>
<overHit>true</overHit>
</effect>
<effect name="Lethal">

View File

@ -2431,7 +2431,7 @@
<value level="11">7461</value>
<value level="12">7850</value>
</power>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
</effects>
</skill>

View File

@ -3417,7 +3417,7 @@
<value level="11">44350</value>
<value level="12">49193</value>
</power>
<chance>115</chance>
<chanceBoost>1150</chanceBoost>
</effect>
</effects>
</skill>
@ -4046,7 +4046,7 @@
<value level="11">73917</value>
<value level="12">81989</value>
</power>
<chance>67</chance>
<chanceBoost>670</chanceBoost>
</effect>
</effects>
</skill>

View File

@ -2542,7 +2542,7 @@
<value level="11">7461</value>
<value level="12">7850</value>
</power>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
<effect name="DamOverTime">
<power>

View File

@ -1082,8 +1082,8 @@
<value level="16">9648</value>
<value level="17">9830</value>
</power>
<criticalChance>30</criticalChance>
<chance>50</chance>
<criticalChance>10</criticalChance>
<chanceBoost>200</chanceBoost>
</effect>
</effects>
</skill>
@ -2305,7 +2305,7 @@
<value level="11">44350</value>
<value level="12">49193</value>
</power>
<chance>115</chance>
<chanceBoost>1150</chanceBoost>
</effect>
</effects>
</skill>
@ -2365,7 +2365,7 @@
<value level="11">38806</value>
<value level="12">43290</value>
</power>
<chance>115</chance>
<chanceBoost>1150</chanceBoost>
</effect>
</effects>
</skill>
@ -2425,7 +2425,7 @@
<value level="11">20667</value>
<value level="12">23023</value>
</power>
<chance>115</chance>
<chanceBoost>1150</chanceBoost>
</effect>
</effects>
</skill>
@ -2485,7 +2485,7 @@
<value level="11">19381</value>
<value level="12">21645</value>
</power>
<chance>115</chance>
<chanceBoost>1150</chanceBoost>
</effect>
</effects>
</skill>
@ -2545,7 +2545,7 @@
<value level="11">18140</value>
<value level="12">20268</value>
</power>
<chance>115</chance>
<chanceBoost>1150</chanceBoost>
</effect>
</effects>
</skill>
@ -3600,7 +3600,7 @@
<value level="11">73917</value>
<value level="12">81989</value>
</power>
<chance>67</chance>
<chanceBoost>670</chanceBoost>
</effect>
</effects>
</skill>
@ -3660,7 +3660,7 @@
<value level="11">64677</value>
<value level="12">72150</value>
</power>
<chance>67</chance>
<chanceBoost>670</chanceBoost>
</effect>
</effects>
</skill>
@ -3720,7 +3720,7 @@
<value level="11">34445</value>
<value level="12">38371</value>
</power>
<chance>67</chance>
<chanceBoost>670</chanceBoost>
</effect>
</effects>
</skill>
@ -3780,7 +3780,7 @@
<value level="11">32302</value>
<value level="12">36075</value>
</power>
<chance>67</chance>
<chanceBoost>670</chanceBoost>
</effect>
</effects>
</skill>
@ -3840,7 +3840,7 @@
<value level="11">30232</value>
<value level="12">33780</value>
</power>
<chance>67</chance>
<chanceBoost>670</chanceBoost>
</effect>
</effects>
</skill>

View File

@ -2817,7 +2817,7 @@
<value level="3">7306</value>
<value level="4">8602</value>
</power>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
<effect name="PhysicalMute" />
</effects>
@ -2916,15 +2916,13 @@
<effects>
<effect name="FatalBlow">
<power>6335</power>
<chance>15</chance>
<chanceBoost>150</chanceBoost>
</effect>
<effect name="Speed">
<amount>40</amount>
<mode>DIFF</mode>
</effect>
</effects>
<selfEffects>
</selfEffects>
</skill>
<skill id="5085" toLevel="1" name="Anesthesia">
<!-- Confirmed CT2.5 -->

View File

@ -1309,7 +1309,7 @@
<effects>
<effect name="FatalBlow">
<power>39544</power>
<chance>115</chance>
<chanceBoost>1150</chanceBoost>
</effect>
</effects>
</skill>

View File

@ -1861,7 +1861,7 @@
<value level="12">6844</value>
<value level="13">6960</value>
</power>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
</effects>
</skill>

View File

@ -1536,10 +1536,11 @@
<effect name="FatalBlow">
<power>5773</power>
<criticalChance>20</criticalChance>
<chance>30</chance>
<chanceBoost>300</chanceBoost>
<overHit>true</overHit>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>15</halfLethal>
</effect>
</effects>

View File

@ -494,7 +494,7 @@
<value fromLevel="7" toLevel="11" fromSubLevel="1001" toSubLevel="1030">{base + base / 100 * subIndex}</value>
</power>
<criticalChance>30</criticalChance>
<chance>40</chance>
<chanceBoost>400</chanceBoost>
<overHit>true</overHit>
</effect>
</pveEffects>
@ -516,7 +516,7 @@
<value fromLevel="7" toLevel="11" fromSubLevel="2001" toSubLevel="2030">{base + base / 100 * (5 + subIndex)}</value>
</power>
<criticalChance>30</criticalChance>
<chance>40</chance>
<chanceBoost>400</chanceBoost>
<overHit>true</overHit>
</effect>
</pvpEffects>
@ -610,7 +610,7 @@
<value fromLevel="7" toLevel="11" fromSubLevel="1001" toSubLevel="1030">{base + base / 100 * subIndex}</value>
</power>
<criticalChance>15</criticalChance>
<chance>36.5</chance>
<chanceBoost>365</chanceBoost>
<overHit>true</overHit>
</effect>
</pveEffects>
@ -632,7 +632,7 @@
<value fromLevel="7" toLevel="11" fromSubLevel="2001" toSubLevel="2030">{base + base / 100 * (5 + subIndex)}</value>
</power>
<criticalChance>15</criticalChance>
<chance>36.5</chance>
<chanceBoost>365</chanceBoost>
<overHit>true</overHit>
</effect>
</pvpEffects>
@ -739,7 +739,7 @@
<criticalChance>20</criticalChance>
<abnormalType>BLEEDING</abnormalType>
<abnormalPower>4130</abnormalPower>
<chance>36.5</chance>
<chanceBoost>365</chanceBoost>
<overHit>true</overHit>
</effect>
</pveEffects>
@ -762,8 +762,8 @@
</power>
<criticalChance>20</criticalChance>
<abnormalType>BLEEDING</abnormalType>
<abnormalPower>4130</abnormalPower>
<chance>36.5</chance>
<abnormalPower>4130</abnormalPower> <!-- TODO: Must have different values per level. -->
<chanceBoost>365</chanceBoost>
<overHit>true</overHit>
</effect>
</pvpEffects>
@ -838,7 +838,7 @@
<value fromLevel="3" toLevel="7" fromSubLevel="1001" toSubLevel="1030">{base + base / 100 * subIndex}</value>
</power>
<criticalChance>20</criticalChance>
<chance>36.5</chance>
<chanceBoost>365</chanceBoost>
<overHit>true</overHit>
</effect>
</pveEffects>
@ -856,7 +856,7 @@
<value fromLevel="3" toLevel="7" fromSubLevel="2001" toSubLevel="2030">{base + base / 100 * (5 + subIndex)}</value>
</power>
<criticalChance>20</criticalChance>
<chance>36.5</chance>
<chanceBoost>365</chanceBoost>
<overHit>true</overHit>
</effect>
</pvpEffects>
@ -2928,7 +2928,7 @@
</effect>
<effect name="FatalBlow">
<power>8875</power>
<chance>30</chance>
<chanceBoost>300</chanceBoost>
</effect>
</effects>
</skill>
@ -3116,7 +3116,7 @@
<value level="6">27993</value>
<value level="7">29472</value>
</power>
<chance>30</chance>
<chanceBoost>300</chanceBoost>
</effect>
<effect name="Speed">
<amount>-23</amount>

View File

@ -337,11 +337,12 @@
<allowedSkills>10279;10517;10025;10776;11770;1904;11264;11093;13314;1912</allowedSkills>
</effect>
<effect name="FatalBlow">
<chance>30</chance>
<chanceBoost>300</chanceBoost>
<power>8875</power>
<overHit>true</overHit>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>15</halfLethal>
</effect>
</effects>

View File

@ -3787,7 +3787,7 @@
<effects>
<effect name="FatalBlow">
<!-- Guessed -->
<chance>30</chance>
<chanceBoost>300</chanceBoost>
<power>
<value level="1">45696</value>
<value level="2">47772</value>
@ -3795,7 +3795,7 @@
</power>
</effect>
<effect name="Lethal">
<!-- Guessed -->
<fullLethal>0</fullLethal>
<halfLethal>10</halfLethal>
</effect>
</effects>
@ -3821,7 +3821,7 @@
<effects>
<effect name="FatalBlow">
<!-- Guessed -->
<chance>30</chance>
<chanceBoost>300</chanceBoost>
<power>
<value level="1">51411</value>
<value level="2">53747</value>
@ -3829,7 +3829,7 @@
</power>
</effect>
<effect name="Lethal">
<!-- Guessed -->
<fullLethal>0</fullLethal>
<halfLethal>10</halfLethal>
</effect>
</effects>

View File

@ -2857,7 +2857,7 @@
<value level="6">5029</value>
<value level="7">5479</value>
</power>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
<effect name="DamOverTime">
<power>100</power>

View File

@ -2872,9 +2872,10 @@
<effects>
<effect name="FatalBlow">
<power>7127</power>
<chance>30</chance>
<chanceBoost>300</chanceBoost>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>5</halfLethal>
</effect>
<effect name="DispelBySlot">

View File

@ -2238,9 +2238,10 @@
<effects>
<effect name="FatalBlow">
<power>1700</power>
<chance>30</chance>
<chanceBoost>300</chanceBoost>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>5</halfLethal>
</effect>
</effects>

View File

@ -1546,7 +1546,7 @@
</effect>
<effect name="FatalBlow">
<power>3000</power>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
</effects>
</skill>
@ -1674,7 +1674,7 @@
</effect>
<effect name="FatalBlow">
<power>3000</power>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
</effects>
</skill>

View File

@ -64,7 +64,7 @@
<effect name="FatalBlow">
<power>3420</power>
<overHit>true</overHit>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
</effects>
</skill>

View File

@ -866,6 +866,7 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="chanceBoost" type="xs:unsignedShort" />
<xs:element name="dispel">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
@ -931,8 +932,8 @@
</xs:complexType>
</xs:element>
<xs:element name="weaponType">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="weaponType">
<xs:complexType>
<xs:sequence>
@ -1194,6 +1195,21 @@
</xs:complexType>
</xs:element>
<xs:element name="side" type="xs:string" />
<xs:element name="fullLethal">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element maxOccurs="unbounded" name="value">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:unsignedByte">
<xs:attribute name="level" type="xs:unsignedByte" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="PARALYZE">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
@ -1535,21 +1551,6 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="fullLethal">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element maxOccurs="unbounded" name="value">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:unsignedByte">
<xs:attribute name="level" type="xs:unsignedByte" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="itemId">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
@ -2105,6 +2106,7 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="pAtkMod" type="xs:unsignedByte" />
<xs:element name="isSummonSpawn" type="xs:boolean" />
<xs:element name="randomOffset" type="xs:unsignedByte" />
<xs:element name="HATE">
@ -2140,7 +2142,6 @@
<xs:element name="debuffModifier" type="xs:decimal" />
<xs:element name="damageModifier" type="xs:decimal" />
<xs:element name="animationSpeed" type="xs:unsignedShort" />
<xs:element name="pAtkMod" type="xs:unsignedByte" />
</xs:choice>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required" />
@ -2502,22 +2503,6 @@
<xs:element name="effect">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="amount">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="value">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:unsignedByte">
<xs:attribute name="level" type="xs:unsignedByte" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="attribute" type="xs:string" />
<xs:element minOccurs="0" name="ON_MAGIC_SKILL" />
<xs:element minOccurs="0" name="ON_CRITICAL_SKILL" />
<xs:element minOccurs="0" name="ON_EQUIP" />
@ -2645,7 +2630,7 @@
<xs:element minOccurs="0" name="criticalChance" type="xs:unsignedByte" />
<xs:element minOccurs="0" name="abnormalType" type="xs:string" />
<xs:element minOccurs="0" name="abnormalPower" type="xs:unsignedShort" />
<xs:element minOccurs="0" name="chance" type="xs:decimal" />
<xs:element minOccurs="0" name="chanceBoost" type="xs:unsignedShort" />
<xs:element minOccurs="0" name="overHit" type="xs:boolean" />
<xs:element minOccurs="0" name="ticks" type="xs:unsignedByte" />
</xs:sequence>
@ -2666,6 +2651,8 @@
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="fullLethal" type="xs:unsignedByte" />
<xs:element minOccurs="0" name="chance" type="xs:unsignedByte" />
<xs:element minOccurs="0" name="staticChance" type="xs:boolean" />
<xs:element minOccurs="0" name="magicTypes" type="xs:string" />
<xs:element minOccurs="0" name="skillId" type="xs:unsignedShort" />
<xs:element minOccurs="0" name="skillLevel" type="xs:unsignedByte" />
@ -2693,8 +2680,7 @@
<xs:element minOccurs="0" name="criticalChance" type="xs:unsignedByte" />
<xs:element minOccurs="0" name="abnormalType" type="xs:string" />
<xs:element minOccurs="0" name="abnormalPower" type="xs:unsignedShort" />
<xs:element minOccurs="0" name="chance" type="xs:decimal" />
<xs:element minOccurs="0" name="staticChance" type="xs:boolean" />
<xs:element minOccurs="0" name="chanceBoost" type="xs:unsignedShort" />
<xs:element minOccurs="0" name="overHit" type="xs:boolean" />
<xs:element minOccurs="0" name="ticks" type="xs:unsignedByte" />
</xs:sequence>

View File

@ -36,6 +36,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2StaticObjectInstance;
import com.l2jmobius.gameserver.model.cubic.CubicInstance;
import com.l2jmobius.gameserver.model.effects.EffectFlag;
import com.l2jmobius.gameserver.model.effects.L2EffectType;
import com.l2jmobius.gameserver.model.interfaces.ILocational;
import com.l2jmobius.gameserver.model.items.L2Armor;
import com.l2jmobius.gameserver.model.items.L2Item;
import com.l2jmobius.gameserver.model.items.L2Weapon;
@ -264,6 +265,37 @@ public final class Formulas
return finalRate > Rnd.get(1000);
}
/**
* Gets the default (10% for side, 30% for back) positional critical rate bonus and multiplies it by any buffs that give positional critical rate bonus.
* @param activeChar the attacker.
* @param target the target.
* @return a multiplier representing the positional critical rate bonus. Autoattacks for example get this bonus on top of the already capped critical rate of 500.
*/
public static double calcCriticalPositionBonus(L2Character activeChar, L2Character target)
{
// final Position position = activeChar.getStat().has(Stats.ATTACK_BEHIND) ? Position.BACK : Position.getPosition(activeChar, target);
switch (Position.getPosition(activeChar, target))
{
case SIDE: // 10% Critical Chance bonus when attacking from side.
{
return 1.1 * activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, Position.SIDE);
}
case BACK: // 30% Critical Chance bonus when attacking from back.
{
return 1.3 * activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, Position.BACK);
}
default: // No Critical Chance bonus when attacking from front.
{
return activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, Position.FRONT);
}
}
}
public static double calcCriticalHeightBonus(ILocational from, ILocational target)
{
return ((((CommonUtil.constrain(from.getZ() - target.getZ(), -25, 25) * 4) / 5) + 10) / 100) + 1;
}
/**
* @param attacker
* @param target
@ -1018,21 +1050,37 @@ public final class Formulas
return cha.getStat().getValue(Stats.FALL, (fallHeight * cha.getMaxHp()) / 1000.0);
}
public static boolean calcBlowSuccess(L2Character activeChar, L2Character target, Skill skill, double blowChance)
/**
* Basic chance formula:<br>
* <ul>
* <li>chance = weapon_critical * dex_bonus * crit_height_bonus * crit_pos_bonus * effect_bonus * fatal_blow_rate</li>
* <li>weapon_critical = (12 for daggers)</li>
* <li>dex_bonus = dex modifier bonus for current dex (Seems unused in GOD, so its not used in formula).</li>
* <li>crit_height_bonus = (z_diff * 4 / 5 + 10) / 100 + 1 or alternatively (z_diff * 0.008) + 1.1. Be aware of z_diff constraint of -25 to 25.</li>
* <li>crit_pos_bonus = crit_pos(front = 1, side = 1.1, back = 1.3) * p_critical_rate_position_bonus</li>
* <li>effect_bonus = (p2 + 100) / 100, p2 - 2nd param of effect. Blow chance of effect.</li>
* </ul>
* Chance cannot be higher than 80%.
* @param activeChar
* @param target
* @param skill
* @param chanceBoost
* @return
*/
public static boolean calcBlowSuccess(L2Character activeChar, L2Character target, Skill skill, double chanceBoost)
{
final double weaponCritical = 12; // Dagger weapon critical mod is 12... TODO: Make it work for other weapons.
final L2Weapon weapon = activeChar.getActiveWeaponItem();
final double weaponCritical = weapon != null ? weapon.getStats(Stats.CRITICAL_RATE, activeChar.getTemplate().getBaseCritRate()) : activeChar.getTemplate().getBaseCritRate();
// double dexBonus = BaseStats.DEX.calcBonus(activeChar); Not used in GOD
final double critHeightBonus = ((((CommonUtil.constrain(activeChar.getZ() - target.getZ(), -25, 25) * 4) / 5) + 10) / 100) + 1;
final Position position = Position.getPosition(activeChar, target);
final double criticalPosition = position == Position.BACK ? 1.3 : position == Position.SIDE ? 1.1 : 1; // 30% chance from back, 10% chance from side.
final double criticalPositionMod = criticalPosition * activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, position);
final double critHeightBonus = calcCriticalHeightBonus(activeChar, target);
final double criticalPosition = calcCriticalPositionBonus(activeChar, target); // 30% chance from back, 10% chance from side. Include buffs that give positional crit rate.
final double chanceBoostMod = (100 + chanceBoost) / 100;
final double blowRateMod = activeChar.getStat().getValue(Stats.BLOW_RATE, 1);
blowChance = (weaponCritical + blowChance) * 10;
final double rate = blowChance * critHeightBonus * criticalPositionMod * blowRateMod;
final double rate = criticalPosition * critHeightBonus * weaponCritical * chanceBoostMod * blowRateMod;
// Blow rate is capped at 80%
return Rnd.get(1000) < Math.min(rate, 800);
return Rnd.get(100) < Math.min(rate, 80);
}
public static List<BuffInfo> calcCancelStealEffects(L2Character activeChar, L2Character target, Skill skill, DispelSlotType slot, int rate, int max)

View File

@ -33,14 +33,14 @@ import com.l2jmobius.gameserver.model.stats.Formulas;
public final class Backstab extends AbstractEffect
{
private final double _power;
private final double _chance;
private final double _chanceBoost;
private final double _criticalChance;
private final boolean _overHit;
public Backstab(StatsSet params)
{
_power = params.getDouble("power", 0);
_chance = params.getDouble("chance", 0);
_power = params.getDouble("power");
_chanceBoost = params.getDouble("chanceBoost");
_criticalChance = params.getDouble("criticalChance", 0);
_overHit = params.getBoolean("overHit", false);
}
@ -48,7 +48,7 @@ public final class Backstab extends AbstractEffect
@Override
public boolean calcSuccess(L2Character effector, L2Character effected, Skill skill)
{
return !effector.isInFrontOf(effected) && !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chance);
return !effector.isInFrontOf(effected) && !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chanceBoost);
}
@Override

View File

@ -22,7 +22,6 @@ import java.util.Set;
import com.l2jmobius.gameserver.enums.ShotType;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Attackable;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
import com.l2jmobius.gameserver.model.effects.L2EffectType;
@ -38,27 +37,24 @@ import com.l2jmobius.gameserver.model.stats.Formulas;
public final class FatalBlow extends AbstractEffect
{
private final double _power;
private final double _chance;
private final double _chanceBoost;
private final double _criticalChance;
private final boolean _overHit;
private final Set<AbnormalType> _abnormals;
private final double _abnormalPower;
public FatalBlow(StatsSet params)
{
_power = params.getDouble("power", 0);
_chance = params.getDouble("chance", 0);
_power = params.getDouble("power");
_chanceBoost = params.getDouble("chanceBoost");
_criticalChance = params.getDouble("criticalChance", 0);
_overHit = params.getBoolean("overHit", false);
final String abnormals = params.getString("abnormalType", null);
String abnormals = params.getString("abnormalType", null);
if ((abnormals != null) && !abnormals.isEmpty())
{
_abnormals = new HashSet<>();
for (String slot : abnormals.split(";"))
{
_abnormals.add(AbnormalType.getAbnormalType(slot));
_abnormals.add(Enum.valueOf(AbnormalType.class, slot));
}
}
else
@ -71,7 +67,7 @@ public final class FatalBlow extends AbstractEffect
@Override
public boolean calcSuccess(L2Character effector, L2Character effected, Skill skill)
{
return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chance);
return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chanceBoost);
}
@Override
@ -94,11 +90,6 @@ public final class FatalBlow extends AbstractEffect
return;
}
if (_overHit && effected.isAttackable())
{
((L2Attackable) effected).overhitEnabled(true);
}
double power = _power;
// Check if we apply an abnormal modifier

View File

@ -33,13 +33,13 @@ import com.l2jmobius.gameserver.model.stats.Formulas;
public final class SoulBlow extends AbstractEffect
{
private final double _power;
private final double _chance;
private final double _chanceBoost;
private final boolean _overHit;
public SoulBlow(StatsSet params)
{
_power = params.getDouble("power", 0);
_chance = params.getDouble("chance", 0);
_power = params.getDouble("power");
_chanceBoost = params.getDouble("chanceBoost");
_overHit = params.getBoolean("overHit", false);
}
@ -52,7 +52,7 @@ public final class SoulBlow extends AbstractEffect
@Override
public boolean calcSuccess(L2Character effector, L2Character effected, Skill skill)
{
return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chance);
return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chanceBoost);
}
@Override

View File

@ -1784,7 +1784,7 @@
<value level="24">977</value>
</power>
<overHit>true</overHit>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
</effects>
</skill>
@ -3290,7 +3290,7 @@
<value level="36">15</value>
<value level="37">15</value>
</criticalChance>
<chance>40</chance>
<chanceBoost>400</chanceBoost>
<overHit>true</overHit>
</effect>
<effect name="Lethal">

View File

@ -4554,9 +4554,10 @@
<value level="37">5479</value>
</power>
<overHit>true</overHit>
<chance>30</chance>
<chanceBoost>300</chanceBoost>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>10</halfLethal>
</effect>
</effects>

View File

@ -1079,12 +1079,13 @@
<value level="10">3653</value>
</power>
<overHit>true</overHit>
<chance>25</chance>
<chanceBoost>250</chanceBoost>
</effect>
<effect name="Bluff">
<chance>80</chance>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>5</halfLethal>
</effect>
</effects>
@ -1715,10 +1716,11 @@
<effect name="FatalBlow">
<power>5773</power>
<criticalChance>20</criticalChance>
<chance>30</chance>
<chanceBoost>300</chanceBoost>
<overHit>true</overHit>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>15</halfLethal>
</effect>
</effects>

View File

@ -1210,9 +1210,10 @@
<value level="10">3653</value>
</power>
<overHit>true</overHit>
<chance>25</chance>
<chanceBoost>250</chanceBoost>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>5</halfLethal>
</effect>
</effects>

View File

@ -525,7 +525,7 @@
<value level="28">5479</value>
</power>
<overHit>true</overHit>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
</effects>
</skill>
@ -4201,9 +4201,10 @@
<value level="4">5199</value>
</power>
<overHit>true</overHit>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>10</halfLethal>
</effect>
</effects>

View File

@ -2634,9 +2634,10 @@
<effect name="FatalBlow">
<power>6969</power>
<overHit>true</overHit>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
<effect name="Lethal">
<fullLethal>0</fullLethal>
<halfLethal>10</halfLethal>
</effect>
</effects>

View File

@ -1604,7 +1604,7 @@
<effect name="FatalBlow">
<power>11234</power>
<criticalChance>30</criticalChance>
<chance>60</chance>
<chanceBoost>600</chanceBoost>
<overHit>true</overHit>
</effect>
<effect name="Lethal">

View File

@ -3668,7 +3668,7 @@
<effect name="FatalBlow">
<power>11234</power>
<criticalChance>30</criticalChance>
<chance>60</chance>
<chanceBoost>600</chanceBoost>
<overHit>true</overHit>
</effect>
<effect name="Lethal">

View File

@ -2431,7 +2431,7 @@
<value level="11">7461</value>
<value level="12">7850</value>
</power>
<chance>20</chance>
<chanceBoost>200</chanceBoost>
</effect>
</effects>
</skill>

View File

@ -3417,7 +3417,7 @@
<value level="11">44350</value>
<value level="12">49193</value>
</power>
<chance>115</chance>
<chanceBoost>1150</chanceBoost>
</effect>
</effects>
</skill>
@ -4046,7 +4046,7 @@
<value level="11">73917</value>
<value level="12">81989</value>
</power>
<chance>67</chance>
<chanceBoost>670</chanceBoost>
</effect>
</effects>
</skill>

Some files were not shown because too many files have changed in this diff Show More