Blessed soulshot fixes and adjustments.

This commit is contained in:
MobiusDevelopment 2020-06-01 13:14:16 +00:00
parent c3524035b2
commit 9b8f27f819
46 changed files with 286 additions and 135 deletions

View File

@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef1 += npcPdef1; pdef1 += npcPdef1;
if (!calcMiss1) 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; dmg1 += calcDmg1;
npc1.abortAttack(); npc1.abortAttack();
} }
@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef2 += npcPdef2; pdef2 += npcPdef2;
if (!calcMiss2) 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; dmg2 += calcDmg2;
npc2.abortAttack(); npc2.abortAttack();
} }

View File

@ -1086,7 +1086,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
setHeading(Util.calculateHeadingFrom(this, target)); setHeading(Util.calculateHeadingFrom(this, target));
// Always try to charge soulshots. // Always try to charge soulshots.
if (!isChargedShot(ShotType.SOULSHOTS)) if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS))
{ {
rechargeShots(true, false, false); rechargeShots(true, false, false);
} }
@ -1261,11 +1261,20 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
byte shld = 0; byte shld = 0;
boolean crit = false; boolean crit = false;
boolean shotConsumed = shotConsumedValue; boolean shotConsumed = shotConsumedValue;
boolean shotBlessed = false;
final boolean miss = Formulas.calcHitMiss(this, target); final boolean miss = Formulas.calcHitMiss(this, target);
if (!shotConsumed) if (!shotConsumed)
{
if (isChargedShot(ShotType.BLESSED_SOULSHOTS))
{
shotBlessed = true;
shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS);
}
else
{ {
shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS);
} }
}
final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; 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); shld = Formulas.calcShldUse(this, target);
crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); 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) if (halfDamage)
{ {
damage /= 2; damage /= 2;

View File

@ -1395,9 +1395,10 @@ public class Formulas
* @param shld * @param shld
* @param crit if the ATTACK have critical success * @param crit if the ATTACK have critical success
* @param ss if weapon item was charged by soulshot * @param ss if weapon item was charged by soulshot
* @param ssBlessed if shot was blessed
* @return * @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) // DEFENCE CALCULATION (pDef + sDef)
double defence = target.getPDef(); double defence = target.getPDef();
@ -1422,10 +1423,10 @@ public class Formulas
final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1;
final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0;
final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0;
final double ssBonus = ss ? 2 * shotsBonus : 1; final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1;
final double random_damage = attacker.getRandomDamageMultiplier(); final double randomDamage = attacker.getRandomDamageMultiplier();
final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); 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______ // ....................______________Critical Section___________________...._______Non-Critical Section______
// ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod)

View File

@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef1 += npcPdef1; pdef1 += npcPdef1;
if (!calcMiss1) 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; dmg1 += calcDmg1;
npc1.abortAttack(); npc1.abortAttack();
} }
@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef2 += npcPdef2; pdef2 += npcPdef2;
if (!calcMiss2) 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; dmg2 += calcDmg2;
npc2.abortAttack(); npc2.abortAttack();
} }

View File

@ -1086,7 +1086,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
setHeading(Util.calculateHeadingFrom(this, target)); setHeading(Util.calculateHeadingFrom(this, target));
// Always try to charge soulshots. // Always try to charge soulshots.
if (!isChargedShot(ShotType.SOULSHOTS)) if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS))
{ {
rechargeShots(true, false, false); rechargeShots(true, false, false);
} }
@ -1261,11 +1261,20 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
byte shld = 0; byte shld = 0;
boolean crit = false; boolean crit = false;
boolean shotConsumed = shotConsumedValue; boolean shotConsumed = shotConsumedValue;
boolean shotBlessed = false;
final boolean miss = Formulas.calcHitMiss(this, target); final boolean miss = Formulas.calcHitMiss(this, target);
if (!shotConsumed) if (!shotConsumed)
{
if (isChargedShot(ShotType.BLESSED_SOULSHOTS))
{
shotBlessed = true;
shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS);
}
else
{ {
shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS);
} }
}
final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; 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); shld = Formulas.calcShldUse(this, target);
crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); 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) if (halfDamage)
{ {
damage /= 2; damage /= 2;

View File

@ -1395,9 +1395,10 @@ public class Formulas
* @param shld * @param shld
* @param crit if the ATTACK have critical success * @param crit if the ATTACK have critical success
* @param ss if weapon item was charged by soulshot * @param ss if weapon item was charged by soulshot
* @param ssBlessed if shot was blessed
* @return * @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) // DEFENCE CALCULATION (pDef + sDef)
double defence = target.getPDef(); double defence = target.getPDef();
@ -1422,10 +1423,10 @@ public class Formulas
final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1;
final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0;
final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0;
final double ssBonus = ss ? 2 * shotsBonus : 1; final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1;
final double random_damage = attacker.getRandomDamageMultiplier(); final double randomDamage = attacker.getRandomDamageMultiplier();
final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); 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______ // ....................______________Critical Section___________________...._______Non-Critical Section______
// ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod)

View File

@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef1 += npcPdef1; pdef1 += npcPdef1;
if (!calcMiss1) 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; dmg1 += calcDmg1;
npc1.abortAttack(); npc1.abortAttack();
} }
@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef2 += npcPdef2; pdef2 += npcPdef2;
if (!calcMiss2) 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; dmg2 += calcDmg2;
npc2.abortAttack(); npc2.abortAttack();
} }

View File

@ -1086,7 +1086,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
setHeading(Util.calculateHeadingFrom(this, target)); setHeading(Util.calculateHeadingFrom(this, target));
// Always try to charge soulshots. // Always try to charge soulshots.
if (!isChargedShot(ShotType.SOULSHOTS)) if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS))
{ {
rechargeShots(true, false, false); rechargeShots(true, false, false);
} }
@ -1261,11 +1261,20 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
byte shld = 0; byte shld = 0;
boolean crit = false; boolean crit = false;
boolean shotConsumed = shotConsumedValue; boolean shotConsumed = shotConsumedValue;
boolean shotBlessed = false;
final boolean miss = Formulas.calcHitMiss(this, target); final boolean miss = Formulas.calcHitMiss(this, target);
if (!shotConsumed) if (!shotConsumed)
{
if (isChargedShot(ShotType.BLESSED_SOULSHOTS))
{
shotBlessed = true;
shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS);
}
else
{ {
shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS);
} }
}
final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; 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); shld = Formulas.calcShldUse(this, target);
crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); 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) if (halfDamage)
{ {
damage /= 2; damage /= 2;

View File

@ -1395,9 +1395,10 @@ public class Formulas
* @param shld * @param shld
* @param crit if the ATTACK have critical success * @param crit if the ATTACK have critical success
* @param ss if weapon item was charged by soulshot * @param ss if weapon item was charged by soulshot
* @param ssBlessed if shot was blessed
* @return * @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) // DEFENCE CALCULATION (pDef + sDef)
double defence = target.getPDef(); double defence = target.getPDef();
@ -1422,10 +1423,10 @@ public class Formulas
final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1;
final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0;
final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0;
final double ssBonus = ss ? 2 * shotsBonus : 1; final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1;
final double random_damage = attacker.getRandomDamageMultiplier(); final double randomDamage = attacker.getRandomDamageMultiplier();
final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); 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______ // ....................______________Critical Section___________________...._______Non-Critical Section______
// ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod)

View File

@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef1 += npcPdef1; pdef1 += npcPdef1;
if (!calcMiss1) 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; dmg1 += calcDmg1;
npc1.abortAttack(); npc1.abortAttack();
} }
@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef2 += npcPdef2; pdef2 += npcPdef2;
if (!calcMiss2) 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; dmg2 += calcDmg2;
npc2.abortAttack(); npc2.abortAttack();
} }

View File

@ -1086,7 +1086,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
setHeading(Util.calculateHeadingFrom(this, target)); setHeading(Util.calculateHeadingFrom(this, target));
// Always try to charge soulshots. // Always try to charge soulshots.
if (!isChargedShot(ShotType.SOULSHOTS)) if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS))
{ {
rechargeShots(true, false, false); rechargeShots(true, false, false);
} }
@ -1261,11 +1261,20 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
byte shld = 0; byte shld = 0;
boolean crit = false; boolean crit = false;
boolean shotConsumed = shotConsumedValue; boolean shotConsumed = shotConsumedValue;
boolean shotBlessed = false;
final boolean miss = Formulas.calcHitMiss(this, target); final boolean miss = Formulas.calcHitMiss(this, target);
if (!shotConsumed) if (!shotConsumed)
{
if (isChargedShot(ShotType.BLESSED_SOULSHOTS))
{
shotBlessed = true;
shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS);
}
else
{ {
shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS);
} }
}
final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; 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); shld = Formulas.calcShldUse(this, target);
crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); 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) if (halfDamage)
{ {
damage /= 2; damage /= 2;

View File

@ -1395,9 +1395,10 @@ public class Formulas
* @param shld * @param shld
* @param crit if the ATTACK have critical success * @param crit if the ATTACK have critical success
* @param ss if weapon item was charged by soulshot * @param ss if weapon item was charged by soulshot
* @param ssBlessed if shot was blessed
* @return * @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) // DEFENCE CALCULATION (pDef + sDef)
double defence = target.getPDef(); double defence = target.getPDef();
@ -1422,10 +1423,10 @@ public class Formulas
final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1;
final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0;
final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0;
final double ssBonus = ss ? 2 * shotsBonus : 1; final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1;
final double random_damage = attacker.getRandomDamageMultiplier(); final double randomDamage = attacker.getRandomDamageMultiplier();
final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); 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______ // ....................______________Critical Section___________________...._______Non-Critical Section______
// ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod)

View File

@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef1 += npcPdef1; pdef1 += npcPdef1;
if (!calcMiss1) 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; dmg1 += calcDmg1;
npc1.abortAttack(); npc1.abortAttack();
} }
@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef2 += npcPdef2; pdef2 += npcPdef2;
if (!calcMiss2) 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; dmg2 += calcDmg2;
npc2.abortAttack(); npc2.abortAttack();
} }

View File

@ -1086,7 +1086,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
setHeading(Util.calculateHeadingFrom(this, target)); setHeading(Util.calculateHeadingFrom(this, target));
// Always try to charge soulshots. // Always try to charge soulshots.
if (!isChargedShot(ShotType.SOULSHOTS)) if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS))
{ {
rechargeShots(true, false, false); rechargeShots(true, false, false);
} }
@ -1261,11 +1261,20 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
byte shld = 0; byte shld = 0;
boolean crit = false; boolean crit = false;
boolean shotConsumed = shotConsumedValue; boolean shotConsumed = shotConsumedValue;
boolean shotBlessed = false;
final boolean miss = Formulas.calcHitMiss(this, target); final boolean miss = Formulas.calcHitMiss(this, target);
if (!shotConsumed) if (!shotConsumed)
{
if (isChargedShot(ShotType.BLESSED_SOULSHOTS))
{
shotBlessed = true;
shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS);
}
else
{ {
shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS);
} }
}
final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; 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); shld = Formulas.calcShldUse(this, target);
crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); 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) if (halfDamage)
{ {
damage /= 2; damage /= 2;

View File

@ -1395,9 +1395,10 @@ public class Formulas
* @param shld * @param shld
* @param crit if the ATTACK have critical success * @param crit if the ATTACK have critical success
* @param ss if weapon item was charged by soulshot * @param ss if weapon item was charged by soulshot
* @param ssBlessed if shot was blessed
* @return * @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) // DEFENCE CALCULATION (pDef + sDef)
double defence = target.getPDef(); double defence = target.getPDef();
@ -1422,10 +1423,10 @@ public class Formulas
final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1;
final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0;
final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0;
final double ssBonus = ss ? 2 * shotsBonus : 1; final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1;
final double random_damage = attacker.getRandomDamageMultiplier(); final double randomDamage = attacker.getRandomDamageMultiplier();
final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); 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______ // ....................______________Critical Section___________________...._______Non-Critical Section______
// ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod)

View File

@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef1 += npcPdef1; pdef1 += npcPdef1;
if (!calcMiss1) 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; dmg1 += calcDmg1;
npc1.abortAttack(); npc1.abortAttack();
} }
@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef2 += npcPdef2; pdef2 += npcPdef2;
if (!calcMiss2) 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; dmg2 += calcDmg2;
npc2.abortAttack(); npc2.abortAttack();
} }

View File

@ -1086,7 +1086,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
setHeading(Util.calculateHeadingFrom(this, target)); setHeading(Util.calculateHeadingFrom(this, target));
// Always try to charge soulshots. // Always try to charge soulshots.
if (!isChargedShot(ShotType.SOULSHOTS)) if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS))
{ {
rechargeShots(true, false, false); rechargeShots(true, false, false);
} }
@ -1261,11 +1261,20 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
byte shld = 0; byte shld = 0;
boolean crit = false; boolean crit = false;
boolean shotConsumed = shotConsumedValue; boolean shotConsumed = shotConsumedValue;
boolean shotBlessed = false;
final boolean miss = Formulas.calcHitMiss(this, target); final boolean miss = Formulas.calcHitMiss(this, target);
if (!shotConsumed) if (!shotConsumed)
{
if (isChargedShot(ShotType.BLESSED_SOULSHOTS))
{
shotBlessed = true;
shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS);
}
else
{ {
shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS);
} }
}
final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; 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); shld = Formulas.calcShldUse(this, target);
crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); 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) if (halfDamage)
{ {
damage /= 2; damage /= 2;

View File

@ -1395,9 +1395,10 @@ public class Formulas
* @param shld * @param shld
* @param crit if the ATTACK have critical success * @param crit if the ATTACK have critical success
* @param ss if weapon item was charged by soulshot * @param ss if weapon item was charged by soulshot
* @param ssBlessed if shot was blessed
* @return * @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) // DEFENCE CALCULATION (pDef + sDef)
double defence = target.getPDef(); double defence = target.getPDef();
@ -1422,10 +1423,10 @@ public class Formulas
final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1;
final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0;
final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0;
final double ssBonus = ss ? 2 * shotsBonus : 1; final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1;
final double random_damage = attacker.getRandomDamageMultiplier(); final double randomDamage = attacker.getRandomDamageMultiplier();
final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); 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______ // ....................______________Critical Section___________________...._______Non-Critical Section______
// ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod)

View File

@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef1 += npcPdef1; pdef1 += npcPdef1;
if (!calcMiss1) 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; dmg1 += calcDmg1;
npc1.abortAttack(); npc1.abortAttack();
} }
@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef2 += npcPdef2; pdef2 += npcPdef2;
if (!calcMiss2) 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; dmg2 += calcDmg2;
npc2.abortAttack(); npc2.abortAttack();
} }

View File

@ -1086,7 +1086,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
setHeading(Util.calculateHeadingFrom(this, target)); setHeading(Util.calculateHeadingFrom(this, target));
// Always try to charge soulshots. // Always try to charge soulshots.
if (!isChargedShot(ShotType.SOULSHOTS)) if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS))
{ {
rechargeShots(true, false, false); rechargeShots(true, false, false);
} }
@ -1261,11 +1261,20 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
byte shld = 0; byte shld = 0;
boolean crit = false; boolean crit = false;
boolean shotConsumed = shotConsumedValue; boolean shotConsumed = shotConsumedValue;
boolean shotBlessed = false;
final boolean miss = Formulas.calcHitMiss(this, target); final boolean miss = Formulas.calcHitMiss(this, target);
if (!shotConsumed) if (!shotConsumed)
{
if (isChargedShot(ShotType.BLESSED_SOULSHOTS))
{
shotBlessed = true;
shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS);
}
else
{ {
shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS);
} }
}
final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; 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); shld = Formulas.calcShldUse(this, target);
crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); 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) if (halfDamage)
{ {
damage /= 2; damage /= 2;

View File

@ -1395,9 +1395,10 @@ public class Formulas
* @param shld * @param shld
* @param crit if the ATTACK have critical success * @param crit if the ATTACK have critical success
* @param ss if weapon item was charged by soulshot * @param ss if weapon item was charged by soulshot
* @param ssBlessed if shot was blessed
* @return * @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) // DEFENCE CALCULATION (pDef + sDef)
double defence = target.getPDef(); double defence = target.getPDef();
@ -1422,10 +1423,10 @@ public class Formulas
final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1;
final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0;
final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0;
final double ssBonus = ss ? 2 * shotsBonus : 1; final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1;
final double random_damage = attacker.getRandomDamageMultiplier(); final double randomDamage = attacker.getRandomDamageMultiplier();
final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); 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______ // ....................______________Critical Section___________________...._______Non-Critical Section______
// ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod)

View File

@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef1 += npcPdef1; pdef1 += npcPdef1;
if (!calcMiss1) 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; dmg1 += calcDmg1;
npc1.abortAttack(); npc1.abortAttack();
} }
@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef2 += npcPdef2; pdef2 += npcPdef2;
if (!calcMiss2) 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; dmg2 += calcDmg2;
npc2.abortAttack(); npc2.abortAttack();
} }

View File

@ -1086,7 +1086,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
setHeading(Util.calculateHeadingFrom(this, target)); setHeading(Util.calculateHeadingFrom(this, target));
// Always try to charge soulshots. // Always try to charge soulshots.
if (!isChargedShot(ShotType.SOULSHOTS)) if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS))
{ {
rechargeShots(true, false, false); rechargeShots(true, false, false);
} }
@ -1261,11 +1261,20 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
byte shld = 0; byte shld = 0;
boolean crit = false; boolean crit = false;
boolean shotConsumed = shotConsumedValue; boolean shotConsumed = shotConsumedValue;
boolean shotBlessed = false;
final boolean miss = Formulas.calcHitMiss(this, target); final boolean miss = Formulas.calcHitMiss(this, target);
if (!shotConsumed) if (!shotConsumed)
{
if (isChargedShot(ShotType.BLESSED_SOULSHOTS))
{
shotBlessed = true;
shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS);
}
else
{ {
shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS);
} }
}
final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; 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); shld = Formulas.calcShldUse(this, target);
crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); 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) if (halfDamage)
{ {
damage /= 2; damage /= 2;

View File

@ -1395,9 +1395,10 @@ public class Formulas
* @param shld * @param shld
* @param crit if the ATTACK have critical success * @param crit if the ATTACK have critical success
* @param ss if weapon item was charged by soulshot * @param ss if weapon item was charged by soulshot
* @param ssBlessed if shot was blessed
* @return * @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) // DEFENCE CALCULATION (pDef + sDef)
double defence = target.getPDef(); double defence = target.getPDef();
@ -1422,10 +1423,10 @@ public class Formulas
final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1;
final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0;
final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0;
final double ssBonus = ss ? 2 * shotsBonus : 1; final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1;
final double random_damage = attacker.getRandomDamageMultiplier(); final double randomDamage = attacker.getRandomDamageMultiplier();
final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); 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______ // ....................______________Critical Section___________________...._______Non-Critical Section______
// ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod)

View File

@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef1 += npcPdef1; pdef1 += npcPdef1;
if (!calcMiss1) 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; dmg1 += calcDmg1;
npc1.abortAttack(); npc1.abortAttack();
} }
@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef2 += npcPdef2; pdef2 += npcPdef2;
if (!calcMiss2) 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; dmg2 += calcDmg2;
npc2.abortAttack(); npc2.abortAttack();
} }

View File

@ -1086,7 +1086,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
setHeading(Util.calculateHeadingFrom(this, target)); setHeading(Util.calculateHeadingFrom(this, target));
// Always try to charge soulshots. // Always try to charge soulshots.
if (!isChargedShot(ShotType.SOULSHOTS)) if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS))
{ {
rechargeShots(true, false, false); rechargeShots(true, false, false);
} }
@ -1261,11 +1261,20 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
byte shld = 0; byte shld = 0;
boolean crit = false; boolean crit = false;
boolean shotConsumed = shotConsumedValue; boolean shotConsumed = shotConsumedValue;
boolean shotBlessed = false;
final boolean miss = Formulas.calcHitMiss(this, target); final boolean miss = Formulas.calcHitMiss(this, target);
if (!shotConsumed) if (!shotConsumed)
{
if (isChargedShot(ShotType.BLESSED_SOULSHOTS))
{
shotBlessed = true;
shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS);
}
else
{ {
shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS);
} }
}
final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; 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); shld = Formulas.calcShldUse(this, target);
crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); 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) if (halfDamage)
{ {
damage /= 2; damage /= 2;

View File

@ -1395,9 +1395,10 @@ public class Formulas
* @param shld * @param shld
* @param crit if the ATTACK have critical success * @param crit if the ATTACK have critical success
* @param ss if weapon item was charged by soulshot * @param ss if weapon item was charged by soulshot
* @param ssBlessed if shot was blessed
* @return * @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) // DEFENCE CALCULATION (pDef + sDef)
double defence = target.getPDef(); double defence = target.getPDef();
@ -1422,10 +1423,10 @@ public class Formulas
final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1;
final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0;
final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0;
final double ssBonus = ss ? 2 * shotsBonus : 1; final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1;
final double random_damage = attacker.getRandomDamageMultiplier(); final double randomDamage = attacker.getRandomDamageMultiplier();
final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); 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______ // ....................______________Critical Section___________________...._______Non-Critical Section______
// ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod)

View File

@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef1 += npcPdef1; pdef1 += npcPdef1;
if (!calcMiss1) 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; dmg1 += calcDmg1;
npc1.abortAttack(); npc1.abortAttack();
} }
@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef2 += npcPdef2; pdef2 += npcPdef2;
if (!calcMiss2) 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; dmg2 += calcDmg2;
npc2.abortAttack(); npc2.abortAttack();
} }

View File

@ -1086,7 +1086,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
setHeading(Util.calculateHeadingFrom(this, target)); setHeading(Util.calculateHeadingFrom(this, target));
// Always try to charge soulshots. // Always try to charge soulshots.
if (!isChargedShot(ShotType.SOULSHOTS)) if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS))
{ {
rechargeShots(true, false, false); rechargeShots(true, false, false);
} }
@ -1261,11 +1261,20 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
byte shld = 0; byte shld = 0;
boolean crit = false; boolean crit = false;
boolean shotConsumed = shotConsumedValue; boolean shotConsumed = shotConsumedValue;
boolean shotBlessed = false;
final boolean miss = Formulas.calcHitMiss(this, target); final boolean miss = Formulas.calcHitMiss(this, target);
if (!shotConsumed) if (!shotConsumed)
{
if (isChargedShot(ShotType.BLESSED_SOULSHOTS))
{
shotBlessed = true;
shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS);
}
else
{ {
shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS);
} }
}
final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; 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); shld = Formulas.calcShldUse(this, target);
crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); 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) if (halfDamage)
{ {
damage /= 2; damage /= 2;

View File

@ -1395,9 +1395,10 @@ public class Formulas
* @param shld * @param shld
* @param crit if the ATTACK have critical success * @param crit if the ATTACK have critical success
* @param ss if weapon item was charged by soulshot * @param ss if weapon item was charged by soulshot
* @param ssBlessed if shot was blessed
* @return * @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) // DEFENCE CALCULATION (pDef + sDef)
double defence = target.getPDef(); double defence = target.getPDef();
@ -1422,10 +1423,10 @@ public class Formulas
final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1;
final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0;
final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0;
final double ssBonus = ss ? 2 * shotsBonus : 1; final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1;
final double random_damage = attacker.getRandomDamageMultiplier(); final double randomDamage = attacker.getRandomDamageMultiplier();
final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); 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______ // ....................______________Critical Section___________________...._______Non-Critical Section______
// ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod)

View File

@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef1 += npcPdef1; pdef1 += npcPdef1;
if (!calcMiss1) 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; dmg1 += calcDmg1;
npc1.abortAttack(); npc1.abortAttack();
} }
@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef2 += npcPdef2; pdef2 += npcPdef2;
if (!calcMiss2) 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; dmg2 += calcDmg2;
npc2.abortAttack(); npc2.abortAttack();
} }

View File

@ -1086,7 +1086,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
setHeading(Util.calculateHeadingFrom(this, target)); setHeading(Util.calculateHeadingFrom(this, target));
// Always try to charge soulshots. // Always try to charge soulshots.
if (!isChargedShot(ShotType.SOULSHOTS)) if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS))
{ {
rechargeShots(true, false, false); rechargeShots(true, false, false);
} }
@ -1261,11 +1261,20 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
byte shld = 0; byte shld = 0;
boolean crit = false; boolean crit = false;
boolean shotConsumed = shotConsumedValue; boolean shotConsumed = shotConsumedValue;
boolean shotBlessed = false;
final boolean miss = Formulas.calcHitMiss(this, target); final boolean miss = Formulas.calcHitMiss(this, target);
if (!shotConsumed) if (!shotConsumed)
{
if (isChargedShot(ShotType.BLESSED_SOULSHOTS))
{
shotBlessed = true;
shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS);
}
else
{ {
shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS);
} }
}
final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; 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); shld = Formulas.calcShldUse(this, target);
crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); 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) if (halfDamage)
{ {
damage /= 2; damage /= 2;

View File

@ -1395,9 +1395,10 @@ public class Formulas
* @param shld * @param shld
* @param crit if the ATTACK have critical success * @param crit if the ATTACK have critical success
* @param ss if weapon item was charged by soulshot * @param ss if weapon item was charged by soulshot
* @param ssBlessed if shot was blessed
* @return * @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) // DEFENCE CALCULATION (pDef + sDef)
double defence = target.getPDef(); double defence = target.getPDef();
@ -1422,10 +1423,10 @@ public class Formulas
final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1;
final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0;
final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0;
final double ssBonus = ss ? 2 * shotsBonus : 1; final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1;
final double random_damage = attacker.getRandomDamageMultiplier(); final double randomDamage = attacker.getRandomDamageMultiplier();
final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); 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______ // ....................______________Critical Section___________________...._______Non-Critical Section______
// ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod)

View File

@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef1 += npcPdef1; pdef1 += npcPdef1;
if (!calcMiss1) 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; dmg1 += calcDmg1;
npc1.abortAttack(); npc1.abortAttack();
} }
@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef2 += npcPdef2; pdef2 += npcPdef2;
if (!calcMiss2) 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; dmg2 += calcDmg2;
npc2.abortAttack(); npc2.abortAttack();
} }

View File

@ -1087,7 +1087,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
setHeading(Util.calculateHeadingFrom(this, target)); setHeading(Util.calculateHeadingFrom(this, target));
// Always try to charge soulshots. // Always try to charge soulshots.
if (!isChargedShot(ShotType.SOULSHOTS)) if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS))
{ {
rechargeShots(true, false, false); rechargeShots(true, false, false);
} }
@ -1262,11 +1262,20 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
byte shld = 0; byte shld = 0;
boolean crit = false; boolean crit = false;
boolean shotConsumed = shotConsumedValue; boolean shotConsumed = shotConsumedValue;
boolean shotBlessed = false;
final boolean miss = Formulas.calcHitMiss(this, target); final boolean miss = Formulas.calcHitMiss(this, target);
if (!shotConsumed) if (!shotConsumed)
{
if (isChargedShot(ShotType.BLESSED_SOULSHOTS))
{
shotBlessed = true;
shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS);
}
else
{ {
shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS);
} }
}
final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; 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); shld = Formulas.calcShldUse(this, target);
crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); 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) if (halfDamage)
{ {
damage /= 2; damage /= 2;

View File

@ -1396,9 +1396,10 @@ public class Formulas
* @param shld * @param shld
* @param crit if the ATTACK have critical success * @param crit if the ATTACK have critical success
* @param ss if weapon item was charged by soulshot * @param ss if weapon item was charged by soulshot
* @param ssBlessed if shot was blessed
* @return * @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) // DEFENCE CALCULATION (pDef + sDef)
double defence = target.getPDef(); double defence = target.getPDef();
@ -1423,10 +1424,10 @@ public class Formulas
final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1;
final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0;
final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0;
final double ssBonus = ss ? 2 * shotsBonus : 1; final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1;
final double random_damage = attacker.getRandomDamageMultiplier(); final double randomDamage = attacker.getRandomDamageMultiplier();
final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); 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______ // ....................______________Critical Section___________________...._______Non-Critical Section______
// ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod)

View File

@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef1 += npcPdef1; pdef1 += npcPdef1;
if (!calcMiss1) 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; dmg1 += calcDmg1;
npc1.abortAttack(); npc1.abortAttack();
} }
@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef2 += npcPdef2; pdef2 += npcPdef2;
if (!calcMiss2) 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; dmg2 += calcDmg2;
npc2.abortAttack(); npc2.abortAttack();
} }

View File

@ -1087,7 +1087,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
setHeading(Util.calculateHeadingFrom(this, target)); setHeading(Util.calculateHeadingFrom(this, target));
// Always try to charge soulshots. // Always try to charge soulshots.
if (!isChargedShot(ShotType.SOULSHOTS)) if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS))
{ {
rechargeShots(true, false, false); rechargeShots(true, false, false);
} }
@ -1262,11 +1262,20 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
byte shld = 0; byte shld = 0;
boolean crit = false; boolean crit = false;
boolean shotConsumed = shotConsumedValue; boolean shotConsumed = shotConsumedValue;
boolean shotBlessed = false;
final boolean miss = Formulas.calcHitMiss(this, target); final boolean miss = Formulas.calcHitMiss(this, target);
if (!shotConsumed) if (!shotConsumed)
{
if (isChargedShot(ShotType.BLESSED_SOULSHOTS))
{
shotBlessed = true;
shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS);
}
else
{ {
shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS);
} }
}
final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; 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); shld = Formulas.calcShldUse(this, target);
crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); 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) if (halfDamage)
{ {
damage /= 2; damage /= 2;

View File

@ -1396,9 +1396,10 @@ public class Formulas
* @param shld * @param shld
* @param crit if the ATTACK have critical success * @param crit if the ATTACK have critical success
* @param ss if weapon item was charged by soulshot * @param ss if weapon item was charged by soulshot
* @param ssBlessed if shot was blessed
* @return * @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) // DEFENCE CALCULATION (pDef + sDef)
double defence = target.getPDef(); double defence = target.getPDef();
@ -1423,10 +1424,10 @@ public class Formulas
final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1;
final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0;
final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0;
final double ssBonus = ss ? 2 * shotsBonus : 1; final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1;
final double random_damage = attacker.getRandomDamageMultiplier(); final double randomDamage = attacker.getRandomDamageMultiplier();
final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); 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______ // ....................______________Critical Section___________________...._______Non-Critical Section______
// ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod)

View File

@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef1 += npcPdef1; pdef1 += npcPdef1;
if (!calcMiss1) 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; dmg1 += calcDmg1;
npc1.abortAttack(); npc1.abortAttack();
} }
@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef2 += npcPdef2; pdef2 += npcPdef2;
if (!calcMiss2) 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; dmg2 += calcDmg2;
npc2.abortAttack(); npc2.abortAttack();
} }

View File

@ -413,6 +413,7 @@
<item id="91929" name="Blessed Soulshot" type="EtcItem"> <item id="91929" name="Blessed Soulshot" type="EtcItem">
<!-- Increases weapon's physical power. --> <!-- Increases weapon's physical power. -->
<set name="icon" val="icon.etc_bless_spirit_bullet_gold_i00" /> <set name="icon" val="icon.etc_bless_spirit_bullet_gold_i00" />
<set name="default_action" val="SOULSHOT" />
<set name="immediate_effect" val="true" /> <set name="immediate_effect" val="true" />
<set name="material" val="STEEL" /> <set name="material" val="STEEL" />
<set name="price" val="50" /> <set name="price" val="50" />

View File

@ -1087,7 +1087,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
setHeading(Util.calculateHeadingFrom(this, target)); setHeading(Util.calculateHeadingFrom(this, target));
// Always try to charge soulshots. // Always try to charge soulshots.
if (!isChargedShot(ShotType.SOULSHOTS)) if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS))
{ {
rechargeShots(true, false, false); rechargeShots(true, false, false);
} }
@ -1262,11 +1262,20 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
byte shld = 0; byte shld = 0;
boolean crit = false; boolean crit = false;
boolean shotConsumed = shotConsumedValue; boolean shotConsumed = shotConsumedValue;
boolean shotBlessed = false;
final boolean miss = Formulas.calcHitMiss(this, target); final boolean miss = Formulas.calcHitMiss(this, target);
if (!shotConsumed) if (!shotConsumed)
{
if (isChargedShot(ShotType.BLESSED_SOULSHOTS))
{
shotBlessed = true;
shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS);
}
else
{ {
shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS);
} }
}
final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; 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); shld = Formulas.calcShldUse(this, target);
crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); 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) if (halfDamage)
{ {
damage /= 2; damage /= 2;

View File

@ -1396,9 +1396,10 @@ public class Formulas
* @param shld * @param shld
* @param crit if the ATTACK have critical success * @param crit if the ATTACK have critical success
* @param ss if weapon item was charged by soulshot * @param ss if weapon item was charged by soulshot
* @param ssBlessed if shot was blessed
* @return * @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) // DEFENCE CALCULATION (pDef + sDef)
double defence = target.getPDef(); double defence = target.getPDef();
@ -1423,10 +1424,10 @@ public class Formulas
final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1;
final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0;
final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0;
final double ssBonus = ss ? 2 * shotsBonus : 1; final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1;
final double random_damage = attacker.getRandomDamageMultiplier(); final double randomDamage = attacker.getRandomDamageMultiplier();
final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); 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______ // ....................______________Critical Section___________________...._______Non-Critical Section______
// ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod)

View File

@ -229,7 +229,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef1 += npcPdef1; pdef1 += npcPdef1;
if (!calcMiss1) 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; dmg1 += calcDmg1;
npc1.abortAttack(); npc1.abortAttack();
} }
@ -261,7 +261,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
pdef2 += npcPdef2; pdef2 += npcPdef2;
if (!calcMiss2) 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; dmg2 += calcDmg2;
npc2.abortAttack(); npc2.abortAttack();
} }

View File

@ -1086,7 +1086,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
setHeading(Util.calculateHeadingFrom(this, target)); setHeading(Util.calculateHeadingFrom(this, target));
// Always try to charge soulshots. // Always try to charge soulshots.
if (!isChargedShot(ShotType.SOULSHOTS)) if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS))
{ {
rechargeShots(true, false, false); rechargeShots(true, false, false);
} }
@ -1261,11 +1261,20 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
byte shld = 0; byte shld = 0;
boolean crit = false; boolean crit = false;
boolean shotConsumed = shotConsumedValue; boolean shotConsumed = shotConsumedValue;
boolean shotBlessed = false;
final boolean miss = Formulas.calcHitMiss(this, target); final boolean miss = Formulas.calcHitMiss(this, target);
if (!shotConsumed) if (!shotConsumed)
{
if (isChargedShot(ShotType.BLESSED_SOULSHOTS))
{
shotBlessed = true;
shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS);
}
else
{ {
shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS); shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS);
} }
}
final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0; 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); shld = Formulas.calcShldUse(this, target);
crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null); 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) if (halfDamage)
{ {
damage /= 2; damage /= 2;

View File

@ -1395,9 +1395,10 @@ public class Formulas
* @param shld * @param shld
* @param crit if the ATTACK have critical success * @param crit if the ATTACK have critical success
* @param ss if weapon item was charged by soulshot * @param ss if weapon item was charged by soulshot
* @param ssBlessed if shot was blessed
* @return * @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) // DEFENCE CALCULATION (pDef + sDef)
double defence = target.getPDef(); double defence = target.getPDef();
@ -1422,10 +1423,10 @@ public class Formulas
final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1; final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1;
final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0; final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0;
final double critMod = crit ? (isRanged ? 0.5 : 1) : 0; final double critMod = crit ? (isRanged ? 0.5 : 1) : 0;
final double ssBonus = ss ? 2 * shotsBonus : 1; final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1;
final double random_damage = attacker.getRandomDamageMultiplier(); final double randomDamage = attacker.getRandomDamageMultiplier();
final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk(); 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______ // ....................______________Critical Section___________________...._______Non-Critical Section______
// ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod) // ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod)