浏览代码

BETA: Fixed mReuse and pReuse formulas.

Adry_85 13 年之前
父节点
当前提交
b3a9e9ba8f

+ 9 - 13
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/L2Character.java

@@ -1897,8 +1897,8 @@ public abstract class L2Character extends L2Object
 		{
 			if (((L2Npc) this).useSpiritShot())
 			{
-				hitTime = (int) (0.70 * hitTime);
-				coolTime = (int) (0.70 * coolTime);
+				hitTime = (int) (0.60 * hitTime);
+				coolTime = (int) (0.60 * coolTime);
 			}
 		}
 		
@@ -1933,25 +1933,21 @@ public abstract class L2Character extends L2Object
 		else
 			setLastSimultaneousSkillCast(skill);
 		
-		// Init the reuse time of the skill
+		// Calculate the Reuse Time of the Skill
 		int reuseDelay;
-		
 		if (skill.isStaticReuse() || skill.isStatic())
 		{
 			reuseDelay = (skill.getReuseDelay());
 		}
+		else if (skill.isMagic())
+		{
+			reuseDelay = (int) (skill.getReuseDelay() * calcStat(Stats.MAGIC_REUSE_RATE, 1, null, null));
+		}
 		else
 		{
-			if (skill.isMagic())
-			{
-				reuseDelay = (int) (skill.getReuseDelay() * getStat().getMReuseRate(skill));
-			}
-			else
-			{
-				reuseDelay = (int) (skill.getReuseDelay() * getStat().getPReuseRate(skill));
-			}
+			reuseDelay = (int) (skill.getReuseDelay() * calcStat(Stats.P_REUSE, 1, null, null));
 		}
-		
+				
 		boolean skillMastery = Formulas.calcSkillMastery(this, skill);
 		
 		// Skill reuse check

+ 0 - 12
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/stat/CharStat.java

@@ -487,18 +487,6 @@ public class CharStat
 		return calcStat(Stats.MAGIC_REUSE_RATE, _activeChar.getTemplate().getBaseMReuseRate(), null, skill);
 	}
 	
-	/**
-	 * @param skill 
-	 * @return the PReuse rate (base+modifier) of the L2Character.
-	 */
-	public final double getPReuseRate(L2Skill skill)
-	{
-		if (_activeChar == null)
-			return 1;
-		
-		return calcStat(Stats.P_REUSE, _activeChar.getTemplate().getBaseMReuseRate(), null, skill);
-	}
-	
 	/**
 	 * @param target 
 	 * @return the PAtk (base+modifier) of the L2Character.

+ 10 - 9
L2J_Server_BETA/java/com/l2jserver/gameserver/model/stats/Stats.java

@@ -18,7 +18,6 @@ import java.util.NoSuchElementException;
 
 /**
  * Enum of basic stats.
- *
  * @author mkizub
  */
 public enum Stats
@@ -48,10 +47,10 @@ public enum Stats
 	MAGIC_ATTACK("mAtk"),
 	PHYSICAL_SKILL_POWER("physicalSkillPower"),
 	POWER_ATTACK_SPEED("pAtkSpd"),
-	MAGIC_ATTACK_SPEED("mAtkSpd"), // how fast a magic spell is casted (including animation)
-	ATK_REUSE("atkReuse"), // make bows hit simple hits way slower and will not affect skills
-	P_REUSE("pReuse"),
-	MAGIC_REUSE_RATE("mReuse"), // how fast a magic spell becomes ready to reuse
+	MAGIC_ATTACK_SPEED("mAtkSpd"), // Magic Skill Casting Time Rate
+	ATK_REUSE("atkReuse"), // Bows Hits Reuse Rate
+	P_REUSE("pReuse"), // Physical Skill Reuse Rate
+	MAGIC_REUSE_RATE("mReuse"), // Magic Skill Reuse Rate
 	SHIELD_DEFENCE("sDef"),
 	CRITICAL_DAMAGE("cAtk"),
 	CRITICAL_DAMAGE_ADD("cAtkAdd"), // this is another type for special critical damage mods - vicious stance, crit power and crit damage SA
@@ -86,7 +85,7 @@ public enum Stats
 	BONUS_EXP("bonusExp"),
 	BONUS_SP("bonusSp"),
 	ATTACK_CANCEL("cancel"),
-	MAGIC_FAILURE_RATE("magicFailureRate"),	
+	MAGIC_FAILURE_RATE("magicFailureRate"),
 	
 	// ACCURACY & RANGE
 	ACCURACY_COMBAT("accCombat"),
@@ -119,7 +118,7 @@ public enum Stats
 	MOVEMENT("movement"), // slowdown movement, debuff
 	CONFUSION("confusion"), // mob changes target, opposite to aggression/hate
 	SLEEP("sleep"), // sleep (don't move/ATTACK) until attacked
-
+	
 	// VULNERABILITIES
 	AGGRESSION_VULN("aggressionVuln"),
 	BLEED_VULN("bleedVuln"),
@@ -150,7 +149,7 @@ public enum Stats
 	HOLY_RES("holyRes"),
 	DARK_RES("darkRes"),
 	MAGIC_SUCCESS_RES("magicSuccRes"),
-	//BUFF_IMMUNITY("buffImmunity"), //TODO: Implement me
+	// BUFF_IMMUNITY("buffImmunity"), //TODO: Implement me
 	DEBUFF_IMMUNITY("debuffImmunity"),
 	
 	// ELEMENT POWER
@@ -160,7 +159,7 @@ public enum Stats
 	EARTH_POWER("earthPower"),
 	HOLY_POWER("holyPower"),
 	DARK_POWER("darkPower"),
-
+	
 	// PROFICIENCY
 	AGGRESSION_PROF("aggressionProf"),
 	BLEED_PROF("bleedProf"),
@@ -276,7 +275,9 @@ public enum Stats
 		for (Stats s : values())
 		{
 			if (s.getValue().equals(name))
+			{
 				return s;
+			}
 		}
 		
 		throw new NoSuchElementException("Unknown name '" + name + "' for enum BaseStats");