From 9b8f27f81927aa537f617866380c403e70c59d45 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Mon, 1 Jun 2020 13:14:16 +0000 Subject: [PATCH] Blessed soulshot fixes and adjustments. --- .../AdminFightCalculator.java | 4 ++-- .../gameserver/model/actor/Creature.java | 15 ++++++++++++--- .../gameserver/model/stats/Formulas.java | 9 +++++---- .../AdminFightCalculator.java | 4 ++-- .../gameserver/model/actor/Creature.java | 15 ++++++++++++--- .../gameserver/model/stats/Formulas.java | 9 +++++---- .../AdminFightCalculator.java | 4 ++-- .../gameserver/model/actor/Creature.java | 15 ++++++++++++--- .../gameserver/model/stats/Formulas.java | 9 +++++---- .../AdminFightCalculator.java | 4 ++-- .../gameserver/model/actor/Creature.java | 15 ++++++++++++--- .../gameserver/model/stats/Formulas.java | 9 +++++---- .../AdminFightCalculator.java | 4 ++-- .../gameserver/model/actor/Creature.java | 15 ++++++++++++--- .../gameserver/model/stats/Formulas.java | 9 +++++---- .../AdminFightCalculator.java | 4 ++-- .../gameserver/model/actor/Creature.java | 15 ++++++++++++--- .../gameserver/model/stats/Formulas.java | 9 +++++---- .../AdminFightCalculator.java | 4 ++-- .../gameserver/model/actor/Creature.java | 15 ++++++++++++--- .../gameserver/model/stats/Formulas.java | 9 +++++---- .../AdminFightCalculator.java | 4 ++-- .../gameserver/model/actor/Creature.java | 15 ++++++++++++--- .../gameserver/model/stats/Formulas.java | 9 +++++---- .../AdminFightCalculator.java | 4 ++-- .../gameserver/model/actor/Creature.java | 15 ++++++++++++--- .../gameserver/model/stats/Formulas.java | 9 +++++---- .../AdminFightCalculator.java | 4 ++-- .../gameserver/model/actor/Creature.java | 15 ++++++++++++--- .../gameserver/model/stats/Formulas.java | 9 +++++---- .../AdminFightCalculator.java | 4 ++-- .../gameserver/model/actor/Creature.java | 15 ++++++++++++--- .../gameserver/model/stats/Formulas.java | 9 +++++---- .../AdminFightCalculator.java | 4 ++-- .../gameserver/model/actor/Creature.java | 15 ++++++++++++--- .../gameserver/model/stats/Formulas.java | 9 +++++---- .../AdminFightCalculator.java | 4 ++-- .../gameserver/model/actor/Creature.java | 15 ++++++++++++--- .../gameserver/model/stats/Formulas.java | 9 +++++---- .../AdminFightCalculator.java | 4 ++-- .../dist/game/data/stats/items/91900-91999.xml | 1 + .../gameserver/model/actor/Creature.java | 15 ++++++++++++--- .../gameserver/model/stats/Formulas.java | 9 +++++---- .../AdminFightCalculator.java | 4 ++-- .../gameserver/model/actor/Creature.java | 15 ++++++++++++--- .../gameserver/model/stats/Formulas.java | 9 +++++---- 46 files changed, 286 insertions(+), 135 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java index b9d446d586..4e80a6378e 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java @@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef1 += npcPdef1; if (!calcMiss1) { - final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false); + final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false, false); dmg1 += calcDmg1; npc1.abortAttack(); } @@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef2 += npcPdef2; if (!calcMiss2) { - final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false); + final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false, false); dmg2 += calcDmg2; npc2.abortAttack(); } diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java index 23d99651d4..df10e795df 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1086,7 +1086,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe setHeading(Util.calculateHeadingFrom(this, target)); // Always try to charge soulshots. - if (!isChargedShot(ShotType.SOULSHOTS)) + if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS)) { rechargeShots(true, false, false); } @@ -1261,10 +1261,19 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe byte shld = 0; boolean crit = false; boolean shotConsumed = shotConsumedValue; + boolean shotBlessed = false; final boolean miss = Formulas.calcHitMiss(this, target); if (!shotConsumed) { - shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + if (isChargedShot(ShotType.BLESSED_SOULSHOTS)) + { + shotBlessed = true; + shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS); + } + else + { + shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + } } final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; @@ -1274,7 +1283,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe { shld = Formulas.calcShldUse(this, target); crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); - damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed); + damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed, shotBlessed); if (halfDamage) { damage /= 2; diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/Formulas.java index efa368987c..97c658cee4 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -1395,9 +1395,10 @@ public class Formulas * @param shld * @param crit if the ATTACK have critical success * @param ss if weapon item was charged by soulshot + * @param ssBlessed if shot was blessed * @return */ - public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss) + public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss, boolean ssBlessed) { // DEFENCE CALCULATION (pDef + sDef) double defence = target.getPDef(); @@ -1422,10 +1423,10 @@ public class Formulas final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; - final double ssBonus = ss ? 2 * shotsBonus : 1; - final double random_damage = attacker.getRandomDamageMultiplier(); + final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1; + final double randomDamage = attacker.getRandomDamageMultiplier(); final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); - double attack = (attacker.getPAtk() * random_damage) + proxBonus; + double attack = (attacker.getPAtk() * randomDamage) + proxBonus; // ....................______________Critical Section___________________...._______Non-Critical Section______ // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java index b9d446d586..4e80a6378e 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java @@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef1 += npcPdef1; if (!calcMiss1) { - final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false); + final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false, false); dmg1 += calcDmg1; npc1.abortAttack(); } @@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef2 += npcPdef2; if (!calcMiss2) { - final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false); + final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false, false); dmg2 += calcDmg2; npc2.abortAttack(); } diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java index 23d99651d4..df10e795df 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1086,7 +1086,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe setHeading(Util.calculateHeadingFrom(this, target)); // Always try to charge soulshots. - if (!isChargedShot(ShotType.SOULSHOTS)) + if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS)) { rechargeShots(true, false, false); } @@ -1261,10 +1261,19 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe byte shld = 0; boolean crit = false; boolean shotConsumed = shotConsumedValue; + boolean shotBlessed = false; final boolean miss = Formulas.calcHitMiss(this, target); if (!shotConsumed) { - shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + if (isChargedShot(ShotType.BLESSED_SOULSHOTS)) + { + shotBlessed = true; + shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS); + } + else + { + shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + } } final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; @@ -1274,7 +1283,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe { shld = Formulas.calcShldUse(this, target); crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); - damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed); + damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed, shotBlessed); if (halfDamage) { damage /= 2; diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/stats/Formulas.java index efa368987c..97c658cee4 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -1395,9 +1395,10 @@ public class Formulas * @param shld * @param crit if the ATTACK have critical success * @param ss if weapon item was charged by soulshot + * @param ssBlessed if shot was blessed * @return */ - public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss) + public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss, boolean ssBlessed) { // DEFENCE CALCULATION (pDef + sDef) double defence = target.getPDef(); @@ -1422,10 +1423,10 @@ public class Formulas final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; - final double ssBonus = ss ? 2 * shotsBonus : 1; - final double random_damage = attacker.getRandomDamageMultiplier(); + final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1; + final double randomDamage = attacker.getRandomDamageMultiplier(); final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); - double attack = (attacker.getPAtk() * random_damage) + proxBonus; + double attack = (attacker.getPAtk() * randomDamage) + proxBonus; // ....................______________Critical Section___________________...._______Non-Critical Section______ // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java index b9d446d586..4e80a6378e 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java @@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef1 += npcPdef1; if (!calcMiss1) { - final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false); + final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false, false); dmg1 += calcDmg1; npc1.abortAttack(); } @@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef2 += npcPdef2; if (!calcMiss2) { - final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false); + final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false, false); dmg2 += calcDmg2; npc2.abortAttack(); } diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java index d1ece63ade..bccd0ee26a 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1086,7 +1086,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe setHeading(Util.calculateHeadingFrom(this, target)); // Always try to charge soulshots. - if (!isChargedShot(ShotType.SOULSHOTS)) + if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS)) { rechargeShots(true, false, false); } @@ -1261,10 +1261,19 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe byte shld = 0; boolean crit = false; boolean shotConsumed = shotConsumedValue; + boolean shotBlessed = false; final boolean miss = Formulas.calcHitMiss(this, target); if (!shotConsumed) { - shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + if (isChargedShot(ShotType.BLESSED_SOULSHOTS)) + { + shotBlessed = true; + shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS); + } + else + { + shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + } } final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; @@ -1274,7 +1283,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe { shld = Formulas.calcShldUse(this, target); crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); - damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed); + damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed, shotBlessed); if (halfDamage) { damage /= 2; diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/stats/Formulas.java index efa368987c..97c658cee4 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -1395,9 +1395,10 @@ public class Formulas * @param shld * @param crit if the ATTACK have critical success * @param ss if weapon item was charged by soulshot + * @param ssBlessed if shot was blessed * @return */ - public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss) + public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss, boolean ssBlessed) { // DEFENCE CALCULATION (pDef + sDef) double defence = target.getPDef(); @@ -1422,10 +1423,10 @@ public class Formulas final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; - final double ssBonus = ss ? 2 * shotsBonus : 1; - final double random_damage = attacker.getRandomDamageMultiplier(); + final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1; + final double randomDamage = attacker.getRandomDamageMultiplier(); final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); - double attack = (attacker.getPAtk() * random_damage) + proxBonus; + double attack = (attacker.getPAtk() * randomDamage) + proxBonus; // ....................______________Critical Section___________________...._______Non-Critical Section______ // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java index b9d446d586..4e80a6378e 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java @@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef1 += npcPdef1; if (!calcMiss1) { - final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false); + final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false, false); dmg1 += calcDmg1; npc1.abortAttack(); } @@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef2 += npcPdef2; if (!calcMiss2) { - final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false); + final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false, false); dmg2 += calcDmg2; npc2.abortAttack(); } diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java index d1ece63ade..bccd0ee26a 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1086,7 +1086,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe setHeading(Util.calculateHeadingFrom(this, target)); // Always try to charge soulshots. - if (!isChargedShot(ShotType.SOULSHOTS)) + if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS)) { rechargeShots(true, false, false); } @@ -1261,10 +1261,19 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe byte shld = 0; boolean crit = false; boolean shotConsumed = shotConsumedValue; + boolean shotBlessed = false; final boolean miss = Formulas.calcHitMiss(this, target); if (!shotConsumed) { - shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + if (isChargedShot(ShotType.BLESSED_SOULSHOTS)) + { + shotBlessed = true; + shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS); + } + else + { + shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + } } final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; @@ -1274,7 +1283,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe { shld = Formulas.calcShldUse(this, target); crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); - damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed); + damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed, shotBlessed); if (halfDamage) { damage /= 2; diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/Formulas.java index efa368987c..97c658cee4 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -1395,9 +1395,10 @@ public class Formulas * @param shld * @param crit if the ATTACK have critical success * @param ss if weapon item was charged by soulshot + * @param ssBlessed if shot was blessed * @return */ - public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss) + public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss, boolean ssBlessed) { // DEFENCE CALCULATION (pDef + sDef) double defence = target.getPDef(); @@ -1422,10 +1423,10 @@ public class Formulas final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; - final double ssBonus = ss ? 2 * shotsBonus : 1; - final double random_damage = attacker.getRandomDamageMultiplier(); + final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1; + final double randomDamage = attacker.getRandomDamageMultiplier(); final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); - double attack = (attacker.getPAtk() * random_damage) + proxBonus; + double attack = (attacker.getPAtk() * randomDamage) + proxBonus; // ....................______________Critical Section___________________...._______Non-Critical Section______ // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java index b9d446d586..4e80a6378e 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java @@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef1 += npcPdef1; if (!calcMiss1) { - final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false); + final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false, false); dmg1 += calcDmg1; npc1.abortAttack(); } @@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef2 += npcPdef2; if (!calcMiss2) { - final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false); + final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false, false); dmg2 += calcDmg2; npc2.abortAttack(); } diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java index 686bc950eb..f3121ae90e 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1086,7 +1086,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe setHeading(Util.calculateHeadingFrom(this, target)); // Always try to charge soulshots. - if (!isChargedShot(ShotType.SOULSHOTS)) + if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS)) { rechargeShots(true, false, false); } @@ -1261,10 +1261,19 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe byte shld = 0; boolean crit = false; boolean shotConsumed = shotConsumedValue; + boolean shotBlessed = false; final boolean miss = Formulas.calcHitMiss(this, target); if (!shotConsumed) { - shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + if (isChargedShot(ShotType.BLESSED_SOULSHOTS)) + { + shotBlessed = true; + shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS); + } + else + { + shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + } } final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; @@ -1274,7 +1283,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe { shld = Formulas.calcShldUse(this, target); crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); - damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed); + damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed, shotBlessed); if (halfDamage) { damage /= 2; diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/stats/Formulas.java index efa368987c..97c658cee4 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -1395,9 +1395,10 @@ public class Formulas * @param shld * @param crit if the ATTACK have critical success * @param ss if weapon item was charged by soulshot + * @param ssBlessed if shot was blessed * @return */ - public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss) + public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss, boolean ssBlessed) { // DEFENCE CALCULATION (pDef + sDef) double defence = target.getPDef(); @@ -1422,10 +1423,10 @@ public class Formulas final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; - final double ssBonus = ss ? 2 * shotsBonus : 1; - final double random_damage = attacker.getRandomDamageMultiplier(); + final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1; + final double randomDamage = attacker.getRandomDamageMultiplier(); final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); - double attack = (attacker.getPAtk() * random_damage) + proxBonus; + double attack = (attacker.getPAtk() * randomDamage) + proxBonus; // ....................______________Critical Section___________________...._______Non-Critical Section______ // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java index b9d446d586..4e80a6378e 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java @@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef1 += npcPdef1; if (!calcMiss1) { - final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false); + final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false, false); dmg1 += calcDmg1; npc1.abortAttack(); } @@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef2 += npcPdef2; if (!calcMiss2) { - final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false); + final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false, false); dmg2 += calcDmg2; npc2.abortAttack(); } diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java index 686bc950eb..f3121ae90e 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1086,7 +1086,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe setHeading(Util.calculateHeadingFrom(this, target)); // Always try to charge soulshots. - if (!isChargedShot(ShotType.SOULSHOTS)) + if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS)) { rechargeShots(true, false, false); } @@ -1261,10 +1261,19 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe byte shld = 0; boolean crit = false; boolean shotConsumed = shotConsumedValue; + boolean shotBlessed = false; final boolean miss = Formulas.calcHitMiss(this, target); if (!shotConsumed) { - shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + if (isChargedShot(ShotType.BLESSED_SOULSHOTS)) + { + shotBlessed = true; + shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS); + } + else + { + shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + } } final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; @@ -1274,7 +1283,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe { shld = Formulas.calcShldUse(this, target); crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); - damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed); + damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed, shotBlessed); if (halfDamage) { damage /= 2; diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/Formulas.java index efa368987c..97c658cee4 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -1395,9 +1395,10 @@ public class Formulas * @param shld * @param crit if the ATTACK have critical success * @param ss if weapon item was charged by soulshot + * @param ssBlessed if shot was blessed * @return */ - public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss) + public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss, boolean ssBlessed) { // DEFENCE CALCULATION (pDef + sDef) double defence = target.getPDef(); @@ -1422,10 +1423,10 @@ public class Formulas final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; - final double ssBonus = ss ? 2 * shotsBonus : 1; - final double random_damage = attacker.getRandomDamageMultiplier(); + final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1; + final double randomDamage = attacker.getRandomDamageMultiplier(); final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); - double attack = (attacker.getPAtk() * random_damage) + proxBonus; + double attack = (attacker.getPAtk() * randomDamage) + proxBonus; // ....................______________Critical Section___________________...._______Non-Critical Section______ // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java index b9d446d586..4e80a6378e 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java @@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef1 += npcPdef1; if (!calcMiss1) { - final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false); + final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false, false); dmg1 += calcDmg1; npc1.abortAttack(); } @@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef2 += npcPdef2; if (!calcMiss2) { - final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false); + final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false, false); dmg2 += calcDmg2; npc2.abortAttack(); } diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java index 686bc950eb..f3121ae90e 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1086,7 +1086,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe setHeading(Util.calculateHeadingFrom(this, target)); // Always try to charge soulshots. - if (!isChargedShot(ShotType.SOULSHOTS)) + if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS)) { rechargeShots(true, false, false); } @@ -1261,10 +1261,19 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe byte shld = 0; boolean crit = false; boolean shotConsumed = shotConsumedValue; + boolean shotBlessed = false; final boolean miss = Formulas.calcHitMiss(this, target); if (!shotConsumed) { - shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + if (isChargedShot(ShotType.BLESSED_SOULSHOTS)) + { + shotBlessed = true; + shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS); + } + else + { + shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + } } final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; @@ -1274,7 +1283,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe { shld = Formulas.calcShldUse(this, target); crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); - damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed); + damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed, shotBlessed); if (halfDamage) { damage /= 2; diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/Formulas.java index efa368987c..97c658cee4 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -1395,9 +1395,10 @@ public class Formulas * @param shld * @param crit if the ATTACK have critical success * @param ss if weapon item was charged by soulshot + * @param ssBlessed if shot was blessed * @return */ - public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss) + public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss, boolean ssBlessed) { // DEFENCE CALCULATION (pDef + sDef) double defence = target.getPDef(); @@ -1422,10 +1423,10 @@ public class Formulas final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; - final double ssBonus = ss ? 2 * shotsBonus : 1; - final double random_damage = attacker.getRandomDamageMultiplier(); + final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1; + final double randomDamage = attacker.getRandomDamageMultiplier(); final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); - double attack = (attacker.getPAtk() * random_damage) + proxBonus; + double attack = (attacker.getPAtk() * randomDamage) + proxBonus; // ....................______________Critical Section___________________...._______Non-Critical Section______ // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java index b9d446d586..4e80a6378e 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java @@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef1 += npcPdef1; if (!calcMiss1) { - final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false); + final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false, false); dmg1 += calcDmg1; npc1.abortAttack(); } @@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef2 += npcPdef2; if (!calcMiss2) { - final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false); + final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false, false); dmg2 += calcDmg2; npc2.abortAttack(); } diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java index 30d8f679d1..27eec3f571 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1086,7 +1086,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe setHeading(Util.calculateHeadingFrom(this, target)); // Always try to charge soulshots. - if (!isChargedShot(ShotType.SOULSHOTS)) + if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS)) { rechargeShots(true, false, false); } @@ -1261,10 +1261,19 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe byte shld = 0; boolean crit = false; boolean shotConsumed = shotConsumedValue; + boolean shotBlessed = false; final boolean miss = Formulas.calcHitMiss(this, target); if (!shotConsumed) { - shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + if (isChargedShot(ShotType.BLESSED_SOULSHOTS)) + { + shotBlessed = true; + shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS); + } + else + { + shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + } } final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; @@ -1274,7 +1283,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe { shld = Formulas.calcShldUse(this, target); crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); - damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed); + damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed, shotBlessed); if (halfDamage) { damage /= 2; diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/Formulas.java index c533cfb56d..79fb85d155 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -1395,9 +1395,10 @@ public class Formulas * @param shld * @param crit if the ATTACK have critical success * @param ss if weapon item was charged by soulshot + * @param ssBlessed if shot was blessed * @return */ - public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss) + public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss, boolean ssBlessed) { // DEFENCE CALCULATION (pDef + sDef) double defence = target.getPDef(); @@ -1422,10 +1423,10 @@ public class Formulas final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; - final double ssBonus = ss ? 2 * shotsBonus : 1; - final double random_damage = attacker.getRandomDamageMultiplier(); + final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1; + final double randomDamage = attacker.getRandomDamageMultiplier(); final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); - double attack = (attacker.getPAtk() * random_damage) + proxBonus; + double attack = (attacker.getPAtk() * randomDamage) + proxBonus; // ....................______________Critical Section___________________...._______Non-Critical Section______ // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java index b9d446d586..4e80a6378e 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java @@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef1 += npcPdef1; if (!calcMiss1) { - final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false); + final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false, false); dmg1 += calcDmg1; npc1.abortAttack(); } @@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef2 += npcPdef2; if (!calcMiss2) { - final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false); + final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false, false); dmg2 += calcDmg2; npc2.abortAttack(); } diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java index 1676afdd9f..df59cc0e16 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1086,7 +1086,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe setHeading(Util.calculateHeadingFrom(this, target)); // Always try to charge soulshots. - if (!isChargedShot(ShotType.SOULSHOTS)) + if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS)) { rechargeShots(true, false, false); } @@ -1261,10 +1261,19 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe byte shld = 0; boolean crit = false; boolean shotConsumed = shotConsumedValue; + boolean shotBlessed = false; final boolean miss = Formulas.calcHitMiss(this, target); if (!shotConsumed) { - shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + if (isChargedShot(ShotType.BLESSED_SOULSHOTS)) + { + shotBlessed = true; + shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS); + } + else + { + shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + } } final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; @@ -1274,7 +1283,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe { shld = Formulas.calcShldUse(this, target); crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); - damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed); + damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed, shotBlessed); if (halfDamage) { damage /= 2; diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/stats/Formulas.java index c533cfb56d..79fb85d155 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -1395,9 +1395,10 @@ public class Formulas * @param shld * @param crit if the ATTACK have critical success * @param ss if weapon item was charged by soulshot + * @param ssBlessed if shot was blessed * @return */ - public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss) + public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss, boolean ssBlessed) { // DEFENCE CALCULATION (pDef + sDef) double defence = target.getPDef(); @@ -1422,10 +1423,10 @@ public class Formulas final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; - final double ssBonus = ss ? 2 * shotsBonus : 1; - final double random_damage = attacker.getRandomDamageMultiplier(); + final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1; + final double randomDamage = attacker.getRandomDamageMultiplier(); final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); - double attack = (attacker.getPAtk() * random_damage) + proxBonus; + double attack = (attacker.getPAtk() * randomDamage) + proxBonus; // ....................______________Critical Section___________________...._______Non-Critical Section______ // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java index b9d446d586..4e80a6378e 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java @@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef1 += npcPdef1; if (!calcMiss1) { - final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false); + final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false, false); dmg1 += calcDmg1; npc1.abortAttack(); } @@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef2 += npcPdef2; if (!calcMiss2) { - final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false); + final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false, false); dmg2 += calcDmg2; npc2.abortAttack(); } diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java index 1676afdd9f..df59cc0e16 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1086,7 +1086,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe setHeading(Util.calculateHeadingFrom(this, target)); // Always try to charge soulshots. - if (!isChargedShot(ShotType.SOULSHOTS)) + if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS)) { rechargeShots(true, false, false); } @@ -1261,10 +1261,19 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe byte shld = 0; boolean crit = false; boolean shotConsumed = shotConsumedValue; + boolean shotBlessed = false; final boolean miss = Formulas.calcHitMiss(this, target); if (!shotConsumed) { - shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + if (isChargedShot(ShotType.BLESSED_SOULSHOTS)) + { + shotBlessed = true; + shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS); + } + else + { + shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + } } final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; @@ -1274,7 +1283,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe { shld = Formulas.calcShldUse(this, target); crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); - damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed); + damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed, shotBlessed); if (halfDamage) { damage /= 2; diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/stats/Formulas.java index c533cfb56d..79fb85d155 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -1395,9 +1395,10 @@ public class Formulas * @param shld * @param crit if the ATTACK have critical success * @param ss if weapon item was charged by soulshot + * @param ssBlessed if shot was blessed * @return */ - public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss) + public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss, boolean ssBlessed) { // DEFENCE CALCULATION (pDef + sDef) double defence = target.getPDef(); @@ -1422,10 +1423,10 @@ public class Formulas final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; - final double ssBonus = ss ? 2 * shotsBonus : 1; - final double random_damage = attacker.getRandomDamageMultiplier(); + final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1; + final double randomDamage = attacker.getRandomDamageMultiplier(); final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); - double attack = (attacker.getPAtk() * random_damage) + proxBonus; + double attack = (attacker.getPAtk() * randomDamage) + proxBonus; // ....................______________Critical Section___________________...._______Non-Critical Section______ // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java index b9d446d586..4e80a6378e 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java @@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef1 += npcPdef1; if (!calcMiss1) { - final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false); + final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false, false); dmg1 += calcDmg1; npc1.abortAttack(); } @@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef2 += npcPdef2; if (!calcMiss2) { - final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false); + final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false, false); dmg2 += calcDmg2; npc2.abortAttack(); } diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java index ba5a86bd9b..5864083392 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1086,7 +1086,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe setHeading(Util.calculateHeadingFrom(this, target)); // Always try to charge soulshots. - if (!isChargedShot(ShotType.SOULSHOTS)) + if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS)) { rechargeShots(true, false, false); } @@ -1261,10 +1261,19 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe byte shld = 0; boolean crit = false; boolean shotConsumed = shotConsumedValue; + boolean shotBlessed = false; final boolean miss = Formulas.calcHitMiss(this, target); if (!shotConsumed) { - shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + if (isChargedShot(ShotType.BLESSED_SOULSHOTS)) + { + shotBlessed = true; + shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS); + } + else + { + shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + } } final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; @@ -1274,7 +1283,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe { shld = Formulas.calcShldUse(this, target); crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); - damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed); + damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed, shotBlessed); if (halfDamage) { damage /= 2; diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/stats/Formulas.java index c533cfb56d..79fb85d155 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -1395,9 +1395,10 @@ public class Formulas * @param shld * @param crit if the ATTACK have critical success * @param ss if weapon item was charged by soulshot + * @param ssBlessed if shot was blessed * @return */ - public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss) + public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss, boolean ssBlessed) { // DEFENCE CALCULATION (pDef + sDef) double defence = target.getPDef(); @@ -1422,10 +1423,10 @@ public class Formulas final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; - final double ssBonus = ss ? 2 * shotsBonus : 1; - final double random_damage = attacker.getRandomDamageMultiplier(); + final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1; + final double randomDamage = attacker.getRandomDamageMultiplier(); final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); - double attack = (attacker.getPAtk() * random_damage) + proxBonus; + double attack = (attacker.getPAtk() * randomDamage) + proxBonus; // ....................______________Critical Section___________________...._______Non-Critical Section______ // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java index b9d446d586..4e80a6378e 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java @@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef1 += npcPdef1; if (!calcMiss1) { - final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false); + final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false, false); dmg1 += calcDmg1; npc1.abortAttack(); } @@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef2 += npcPdef2; if (!calcMiss2) { - final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false); + final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false, false); dmg2 += calcDmg2; npc2.abortAttack(); } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java index 506048f5be..ead360ec88 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1087,7 +1087,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe setHeading(Util.calculateHeadingFrom(this, target)); // Always try to charge soulshots. - if (!isChargedShot(ShotType.SOULSHOTS)) + if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS)) { rechargeShots(true, false, false); } @@ -1262,10 +1262,19 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe byte shld = 0; boolean crit = false; boolean shotConsumed = shotConsumedValue; + boolean shotBlessed = false; final boolean miss = Formulas.calcHitMiss(this, target); if (!shotConsumed) { - shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + if (isChargedShot(ShotType.BLESSED_SOULSHOTS)) + { + shotBlessed = true; + shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS); + } + else + { + shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + } } final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; @@ -1275,7 +1284,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe { shld = Formulas.calcShldUse(this, target); crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); - damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed); + damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed, shotBlessed); if (halfDamage) { damage /= 2; diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/stats/Formulas.java index 84324f0bee..69fae41d52 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -1396,9 +1396,10 @@ public class Formulas * @param shld * @param crit if the ATTACK have critical success * @param ss if weapon item was charged by soulshot + * @param ssBlessed if shot was blessed * @return */ - public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss) + public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss, boolean ssBlessed) { // DEFENCE CALCULATION (pDef + sDef) double defence = target.getPDef(); @@ -1423,10 +1424,10 @@ public class Formulas final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; - final double ssBonus = ss ? 2 * shotsBonus : 1; - final double random_damage = attacker.getRandomDamageMultiplier(); + final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1; + final double randomDamage = attacker.getRandomDamageMultiplier(); final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); - double attack = (attacker.getPAtk() * random_damage) + proxBonus; + double attack = (attacker.getPAtk() * randomDamage) + proxBonus; // ....................______________Critical Section___________________...._______Non-Critical Section______ // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java index b9d446d586..4e80a6378e 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java @@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef1 += npcPdef1; if (!calcMiss1) { - final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false); + final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false, false); dmg1 += calcDmg1; npc1.abortAttack(); } @@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef2 += npcPdef2; if (!calcMiss2) { - final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false); + final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false, false); dmg2 += calcDmg2; npc2.abortAttack(); } diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java index 506048f5be..ead360ec88 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1087,7 +1087,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe setHeading(Util.calculateHeadingFrom(this, target)); // Always try to charge soulshots. - if (!isChargedShot(ShotType.SOULSHOTS)) + if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS)) { rechargeShots(true, false, false); } @@ -1262,10 +1262,19 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe byte shld = 0; boolean crit = false; boolean shotConsumed = shotConsumedValue; + boolean shotBlessed = false; final boolean miss = Formulas.calcHitMiss(this, target); if (!shotConsumed) { - shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + if (isChargedShot(ShotType.BLESSED_SOULSHOTS)) + { + shotBlessed = true; + shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS); + } + else + { + shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + } } final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; @@ -1275,7 +1284,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe { shld = Formulas.calcShldUse(this, target); crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); - damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed); + damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed, shotBlessed); if (halfDamage) { damage /= 2; diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/stats/Formulas.java index 84324f0bee..69fae41d52 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -1396,9 +1396,10 @@ public class Formulas * @param shld * @param crit if the ATTACK have critical success * @param ss if weapon item was charged by soulshot + * @param ssBlessed if shot was blessed * @return */ - public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss) + public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss, boolean ssBlessed) { // DEFENCE CALCULATION (pDef + sDef) double defence = target.getPDef(); @@ -1423,10 +1424,10 @@ public class Formulas final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; - final double ssBonus = ss ? 2 * shotsBonus : 1; - final double random_damage = attacker.getRandomDamageMultiplier(); + final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1; + final double randomDamage = attacker.getRandomDamageMultiplier(); final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); - double attack = (attacker.getPAtk() * random_damage) + proxBonus; + double attack = (attacker.getPAtk() * randomDamage) + proxBonus; // ....................______________Critical Section___________________...._______Non-Critical Section______ // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java index b9d446d586..4e80a6378e 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java @@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef1 += npcPdef1; if (!calcMiss1) { - final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false); + final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false, false); dmg1 += calcDmg1; npc1.abortAttack(); } @@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef2 += npcPdef2; if (!calcMiss2) { - final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false); + final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false, false); dmg2 += calcDmg2; npc2.abortAttack(); } diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/91900-91999.xml b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/91900-91999.xml index 265d871a62..6560ec8a9a 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/91900-91999.xml +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/91900-91999.xml @@ -413,6 +413,7 @@ + diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Creature.java index dc2a2afb37..73613c9cbc 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1087,7 +1087,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe setHeading(Util.calculateHeadingFrom(this, target)); // Always try to charge soulshots. - if (!isChargedShot(ShotType.SOULSHOTS)) + if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS)) { rechargeShots(true, false, false); } @@ -1262,10 +1262,19 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe byte shld = 0; boolean crit = false; boolean shotConsumed = shotConsumedValue; + boolean shotBlessed = false; final boolean miss = Formulas.calcHitMiss(this, target); if (!shotConsumed) { - shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + if (isChargedShot(ShotType.BLESSED_SOULSHOTS)) + { + shotBlessed = true; + shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS); + } + else + { + shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + } } final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; @@ -1275,7 +1284,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe { shld = Formulas.calcShldUse(this, target); crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); - damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed); + damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed, shotBlessed); if (halfDamage) { damage /= 2; diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/stats/Formulas.java index 84324f0bee..69fae41d52 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -1396,9 +1396,10 @@ public class Formulas * @param shld * @param crit if the ATTACK have critical success * @param ss if weapon item was charged by soulshot + * @param ssBlessed if shot was blessed * @return */ - public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss) + public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss, boolean ssBlessed) { // DEFENCE CALCULATION (pDef + sDef) double defence = target.getPDef(); @@ -1423,10 +1424,10 @@ public class Formulas final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; - final double ssBonus = ss ? 2 * shotsBonus : 1; - final double random_damage = attacker.getRandomDamageMultiplier(); + final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1; + final double randomDamage = attacker.getRandomDamageMultiplier(); final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); - double attack = (attacker.getPAtk() * random_damage) + proxBonus; + double attack = (attacker.getPAtk() * randomDamage) + proxBonus; // ....................______________Critical Section___________________...._______Non-Critical Section______ // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java index b9d446d586..4e80a6378e 100644 --- a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java +++ b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/admincommandhandlers/AdminFightCalculator.java @@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef1 += npcPdef1; if (!calcMiss1) { - final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false); + final double calcDmg1 = Formulas.calcAutoAttackDamage(npc1, npc2, calcShld1, calcCrit1, false, false); dmg1 += calcDmg1; npc1.abortAttack(); } @@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler pdef2 += npcPdef2; if (!calcMiss2) { - final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false); + final double calcDmg2 = Formulas.calcAutoAttackDamage(npc2, npc1, calcShld2, calcCrit2, false, false); dmg2 += calcDmg2; npc2.abortAttack(); } diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java index 1676afdd9f..df59cc0e16 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1086,7 +1086,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe setHeading(Util.calculateHeadingFrom(this, target)); // Always try to charge soulshots. - if (!isChargedShot(ShotType.SOULSHOTS)) + if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS)) { rechargeShots(true, false, false); } @@ -1261,10 +1261,19 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe byte shld = 0; boolean crit = false; boolean shotConsumed = shotConsumedValue; + boolean shotBlessed = false; final boolean miss = Formulas.calcHitMiss(this, target); if (!shotConsumed) { - shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + if (isChargedShot(ShotType.BLESSED_SOULSHOTS)) + { + shotBlessed = true; + shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS); + } + else + { + shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); + } } final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; @@ -1274,7 +1283,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe { shld = Formulas.calcShldUse(this, target); crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); - damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed); + damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed, shotBlessed); if (halfDamage) { damage /= 2; diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/stats/Formulas.java index c533cfb56d..79fb85d155 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -1395,9 +1395,10 @@ public class Formulas * @param shld * @param crit if the ATTACK have critical success * @param ss if weapon item was charged by soulshot + * @param ssBlessed if shot was blessed * @return */ - public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss) + public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss, boolean ssBlessed) { // DEFENCE CALCULATION (pDef + sDef) double defence = target.getPDef(); @@ -1422,10 +1423,10 @@ public class Formulas final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; - final double ssBonus = ss ? 2 * shotsBonus : 1; - final double random_damage = attacker.getRandomDamageMultiplier(); + final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1; + final double randomDamage = attacker.getRandomDamageMultiplier(); final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); - double attack = (attacker.getPAtk() * random_damage) + proxBonus; + double attack = (attacker.getPAtk() * randomDamage) + proxBonus; // ....................______________Critical Section___________________...._______Non-Critical Section______ // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod)