Browse Source

BETA: Unhardcoded ssBoost inside skill xml and reworked a bit physical and blow formulas when you use soulshots.
Reviewed by: UnAfraid

Adry_85 12 years ago
parent
commit
2748a82663

+ 0 - 7
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/L2Skill.java

@@ -209,7 +209,6 @@ public abstract class L2Skill implements IChanceSkillTrigger
 	private final int _lethalStrikeRate;
 	private final boolean _directHpDmg; // If true then damage is being make directly
 	private final boolean _isTriggeredSkill; // If true the skill will take activation buff slot instead of a normal buff slot
-	private final float _sSBoost; // If true skill will have SoulShot boost (power*2)
 	private final int _aggroPoints;
 	// Condition lists
 	private List<Condition> _preCondition;
@@ -421,7 +420,6 @@ public abstract class L2Skill implements IChanceSkillTrigger
 		
 		_directHpDmg = set.getBool("dmgDirectlyToHp", false);
 		_isTriggeredSkill = set.getBool("isTriggeredSkill", false);
-		_sSBoost = set.getFloat("SSBoost", 0.f);
 		_aggroPoints = set.getInteger("aggroPoints", 0);
 		
 		_flyType = set.getString("flyType", null);
@@ -878,11 +876,6 @@ public abstract class L2Skill implements IChanceSkillTrigger
 		return _isTriggeredSkill;
 	}
 	
-	public final float getSSBoost()
-	{
-		return _sSBoost;
-	}
-	
 	public final int getAggroPoints()
 	{
 		return _aggroPoints;

+ 5 - 38
L2J_Server_BETA/java/com/l2jserver/gameserver/model/stats/Formulas.java

@@ -605,7 +605,7 @@ public final class Formulas
 		double damage = 0;
 		double proximityBonus = 1;
 		double graciaPhysSkillBonus = skill.isMagic() ? 1 : 1.10113; // Gracia final physical skill bonus 10.113%
-		double ssboost = ss ? (skill.getSSBoost() > 0 ? skill.getSSBoost() : 2.04) : 1; // 104% bonus with SS
+		double ssboost = ss ? 2.04 : 1; // 104% bonus with SS
 		double pvpBonus = 1;
 		
 		if (attacker.isPlayable() && target.isPlayable())
@@ -622,18 +622,8 @@ public final class Formulas
 		damage *= calcValakasTrait(attacker, target, skill);
 		double element = calcElemental(attacker, target, skill);
 		
-		// SSBoost > 0 have different calculation
-		if (skill.getSSBoost() > 0)
-		{
-			damage += (((70. * graciaPhysSkillBonus * (attacker.getPAtk(target) + power)) / defence) * (attacker.calcStat(Stats.CRITICAL_DAMAGE, 1, target, skill)) * (target.calcStat(Stats.CRIT_VULN, 1, target, skill)) * ssboost * proximityBonus * element * pvpBonus) + (((attacker.calcStat(Stats.CRITICAL_DAMAGE_ADD, 0, target, skill) * 6.1 * 70) / defence) * graciaPhysSkillBonus);
-		}
-		else
-		{
-			damage += (((70. * graciaPhysSkillBonus * (power + (attacker.getPAtk(target) * ssboost))) / defence) * (attacker.calcStat(Stats.CRITICAL_DAMAGE, 1, target, skill)) * (target.calcStat(Stats.CRIT_VULN, 1, target, skill)) * proximityBonus * element * pvpBonus) + (((attacker.calcStat(Stats.CRITICAL_DAMAGE_ADD, 0, target, skill) * 6.1 * 70) / defence) * graciaPhysSkillBonus);
-		}
-		
+		damage += (((70. * graciaPhysSkillBonus * (power + (attacker.getPAtk(target) * ssboost))) / defence) * (attacker.calcStat(Stats.CRITICAL_DAMAGE, 1, target, skill)) * (target.calcStat(Stats.CRIT_VULN, 1, target, skill)) * proximityBonus * element * pvpBonus) + (((attacker.calcStat(Stats.CRITICAL_DAMAGE_ADD, 0, target, skill) * 6.1 * 70) / defence) * graciaPhysSkillBonus);
 		damage += target.calcStat(Stats.CRIT_ADD_VULN, 0, target, skill) * 6.1;
-		
 		// get the vulnerability for the instance due to skills (buffs, passives, toggles, etc)
 		damage = target.calcStat(Stats.DAGGER_WPN_VULN, damage, target, null);
 		// Random weapon damage
@@ -654,7 +644,6 @@ public final class Formulas
 		}
 		
 		// TODO: Formulas.calcStunBreak(target, damage);
-		
 		return damage < 1 ? 1. : damage;
 	}
 	
@@ -698,31 +687,9 @@ public final class Formulas
 			}
 		}
 		
-		if (ss)
-		{
-			damage *= 2;
-		}
-		if (skill != null)
-		{
-			double skillpower = skill.getPower(attacker, target, isPvP, isPvE);
-			float ssboost = skill.getSSBoost();
-			if (ssboost <= 0)
-			{
-				damage += skillpower;
-			}
-			else if (ssboost > 0)
-			{
-				if (ss)
-				{
-					skillpower *= ssboost;
-					damage += skillpower;
-				}
-				else
-				{
-					damage += skillpower;
-				}
-			}
-		}
+		// Add soulshot boost.
+		int ssBoost = ss ? 2 : 1;
+		damage = (skill != null) ? ((damage * ssBoost) + skill.getPower(attacker, target, isPvP, isPvE)) : (damage * ssBoost);
 		
 		// Defense modifier depending of the attacker weapon
 		L2Weapon weapon = attacker.getActiveWeaponItem();