Explorar el Código

BETA: Fixing custom config for skills abnormal time. Since last rework it stopped, working because skill time from skills is used not from effects.
* Reported by: lucan, badboy29, nBd
* Reviewed by: Zoey76

Rumen Nikiforov hace 12 años
padre
commit
93c46a8f0a

+ 0 - 23
L2J_Server_BETA/java/com/l2jserver/gameserver/engines/DocumentBase.java

@@ -35,7 +35,6 @@ import org.w3c.dom.Document;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 
-import com.l2jserver.Config;
 import com.l2jserver.gameserver.datatables.ItemTable;
 import com.l2jserver.gameserver.model.ChanceCondition;
 import com.l2jserver.gameserver.model.L2Object.InstanceType;
@@ -302,28 +301,6 @@ public abstract class DocumentBase
 		if (attrs.getNamedItem("abnormalTime") != null)
 		{
 			abnormalTime = Integer.decode(getValue(attrs.getNamedItem("abnormalTime").getNodeValue(), template));
-			if (Config.ENABLE_MODIFY_SKILL_DURATION)
-			{
-				if (Config.SKILL_DURATION_LIST.containsKey(((L2Skill) template).getId()))
-				{
-					if (((L2Skill) template).getLevel() < 100)
-					{
-						abnormalTime = Config.SKILL_DURATION_LIST.get(((L2Skill) template).getId());
-					}
-					else if ((((L2Skill) template).getLevel() >= 100) && (((L2Skill) template).getLevel() < 140))
-					{
-						abnormalTime += Config.SKILL_DURATION_LIST.get(((L2Skill) template).getId());
-					}
-					else if (((L2Skill) template).getLevel() > 140)
-					{
-						abnormalTime = Config.SKILL_DURATION_LIST.get(((L2Skill) template).getId());
-					}
-					if (Config.DEBUG)
-					{
-						_log.info("*** Skill " + ((L2Skill) template).getName() + " (" + ((L2Skill) template).getLevel() + ") changed duration to " + abnormalTime + " seconds.");
-					}
-				}
-			}
 		}
 		
 		boolean self = false;

+ 14 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/L2Skill.java

@@ -289,8 +289,21 @@ public abstract class L2Skill implements IChanceSkillTrigger
 		_effectRange = set.getInteger("effectRange", -1);
 		_abnormalLvl = set.getInteger("abnormalLvl", 0);
 		_abnormalType = set.getEnum("abnormalType", AbnormalType.class, AbnormalType.NONE);
-		_abnormalTime = set.getInteger("abnormalTime", 1); // TODO: Should be 0, but instant effects need it until implementation is done.
 		
+		int abnormalTime = set.getInteger("abnormalTime", 1); // TODO: Should be 0, but instant effects need it until implementation is done.
+		if (Config.ENABLE_MODIFY_SKILL_DURATION && Config.SKILL_DURATION_LIST.containsKey(getId()))
+		{
+			if ((getLevel() < 100) || (getLevel() > 140))
+			{
+				abnormalTime = Config.SKILL_DURATION_LIST.get(getId());
+			}
+			else if ((getLevel() >= 100) && (getLevel() < 140))
+			{
+				abnormalTime += Config.SKILL_DURATION_LIST.get(getId());
+			}
+		}
+		
+		_abnormalTime = abnormalTime;
 		_attribute = set.getString("attribute", "");
 		String negateAbnormals = set.getString("negateAbnormals", null);
 		if ((negateAbnormals != null) && !negateAbnormals.isEmpty())