Blessed soulshot fixes and adjustments.
This commit is contained in:
		@@ -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();
 | 
			
		||||
			}
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -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)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user