2
0
Эх сурвалжийг харах

New customizable stat for L2Skill, thanks GodKratos.
This one will avoid reuse delay modifications when true.
Example:

<set name="staticReuse" val="true"/>

Please, check this thread for further information http://www.l2jserver.com/forum/thread.php?threadid=30745

DrHouse 16 жил өмнө
parent
commit
ecf41553a7

+ 12 - 5
L2_GameServer/java/net/sf/l2j/gameserver/model/L2Character.java

@@ -1616,7 +1616,7 @@ public abstract class L2Character extends L2Object
 
 		// Calculate the casting time of the skill (base + modifier of MAtkSpd)
 		// Don't modify the skill time for FORCE_BUFF skills. The skill time for those skills represent the buff time.
-		if(!effectWhileCasting)
+		if(!effectWhileCasting  && !skill.isStaticReuse())
 		{
 			hitTime = Formulas.getInstance().calcMAtkSpd(this, skill, hitTime);
 			if (coolTime > 0) 
@@ -1665,15 +1665,22 @@ public abstract class L2Character extends L2Object
 		// Init the reuse time of the skill
 		int reuseDelay;
 		
-		if(skill.isMagic())
+		if (skill.isStaticReuse())
 		{
-			reuseDelay = (int)(skill.getReuseDelay() * getStat().getMReuseRate(skill));
+			reuseDelay = (skill.getReuseDelay());
 		}
 		else
 		{
-			reuseDelay = (int)(skill.getReuseDelay() * getStat().getPReuseRate(skill));
+			if(skill.isMagic())
+			{
+				reuseDelay = (int)(skill.getReuseDelay() * getStat().getMReuseRate(skill));
+			}
+			else
+			{
+				reuseDelay = (int)(skill.getReuseDelay() * getStat().getPReuseRate(skill));
+			}
+			reuseDelay *= 333.0 / (skill.isMagic() ? getMAtkSpd() : getPAtkSpd());
 		}
-        reuseDelay *= 333.0 / (skill.isMagic() ? getMAtkSpd() : getPAtkSpd());
 
 		// Skill reuse check
 		if (reuseDelay > 30000) addTimeStamp(skill.getId(),reuseDelay);

+ 10 - 0
L2_GameServer/java/net/sf/l2j/gameserver/model/L2Skill.java

@@ -233,6 +233,7 @@ public abstract class L2Skill
     private final String _name;
     private final SkillOpType _operateType;
     private final boolean _magic;
+    private final boolean _staticReuse;
     private final int _mpConsume;
     private final int _mpInitialConsume;
     private final int _hpConsume;
@@ -376,6 +377,7 @@ public abstract class L2Skill
         _name = set.getString("name");
         _operateType = set.getEnum("operateType", SkillOpType.class);
         _magic = set.getBool("isMagic", false);
+        _staticReuse = set.getBool("staticReuse", false);
         _ispotion = set.getBool("isPotion", false);
         _mpConsume = set.getInteger("mpConsume", 0);
         _mpInitialConsume = set.getInteger("mpInitialConsume", 0);
@@ -889,6 +891,14 @@ public abstract class L2Skill
         return _magic;
     }
 
+    /**
+     * @return Returns true to to set static reuse/hittime.
+     */
+    public final boolean isStaticReuse()
+    {
+        return _staticReuse;
+    }
+
     /**
      * @return Returns the mpConsume.
      */