Преглед на файлове

BETA: Replaced '''self''' parameter of effects with '''selfEffects''' effect scope.
* Changed `L2Skill.hasEffectType(L2EffectType... types)` to `L2Skill.hasEffectType(L2EffectType effectType, L2EffectType... effectTypes)`
* This was done to force at least 1 effect type to be specified.
* `L2Skill.hasEffectType(L2EffectType effectType, L2EffectType... effectTypes)` now supports all effect scopes.
* Enchanted skill conditions now support '''msgId'''.

Nos преди 11 години
родител
ревизия
2d48ea7a42

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

@@ -332,10 +332,6 @@ public abstract class DocumentBase
 			{
 				skill.addEffect(effectScope, effect);
 			}
-			else if (set.getInt("self", 0) == 1)
-			{
-				skill.addEffect(EffectScope.SELF, effect);
-			}
 			else if (skill.isPassive())
 			{
 				skill.addEffect(EffectScope.PASSIVE, effect);

+ 252 - 16
L2J_Server_BETA/java/com/l2jserver/gameserver/engines/skills/DocumentSkill.java

@@ -519,13 +519,17 @@ public class DocumentSkill extends DocumentBase
 				{
 					parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
 				}
+				else if ("selfEffects".equalsIgnoreCase(n.getNodeName()))
+				{
+					parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
+				}
 			}
 		}
 		
 		for (int i = lastLvl; i < (lastLvl + enchantLevels1); i++)
 		{
 			_currentSkill.currentLevel = i - lastLvl;
-			boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false;
+			boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false, foundSelfEffects = false;
 			for (n = first; n != null; n = n.getNextSibling())
 			{
 				if ("enchant1cond".equalsIgnoreCase(n.getNodeName()))
@@ -533,10 +537,20 @@ public class DocumentSkill extends DocumentBase
 					foundCond = true;
 					Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
 					Node msg = n.getAttributes().getNamedItem("msg");
+					Node msgId = n.getAttributes().getNamedItem("msgId");
 					if ((condition != null) && (msg != null))
 					{
 						condition.setMessage(msg.getNodeValue());
 					}
+					else if ((condition != null) && (msgId != null))
+					{
+						condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
+						Node addName = n.getAttributes().getNamedItem("addName");
+						if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
+						{
+							condition.addName();
+						}
+					}
 					_currentSkill.currentSkills.get(i).attach(condition, false);
 				}
 				else if ("enchant1for".equalsIgnoreCase(n.getNodeName()))
@@ -564,9 +578,14 @@ public class DocumentSkill extends DocumentBase
 					foundEndEffects = true;
 					parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
 				}
+				else if ("enchant1selfEffects".equalsIgnoreCase(n.getNodeName()))
+				{
+					foundSelfEffects = true;
+					parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
+				}
 			}
 			// If none found, the enchanted skill will take effects from maxLvL of norm skill
-			if (!foundCond || !foundFor || !foundChannelingEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects)
+			if (!foundCond || !foundFor || !foundChannelingEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects || !foundSelfEffects)
 			{
 				_currentSkill.currentLevel = lastLvl - 1;
 				for (n = first; n != null; n = n.getNextSibling())
@@ -575,10 +594,20 @@ public class DocumentSkill extends DocumentBase
 					{
 						Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
 						Node msg = n.getAttributes().getNamedItem("msg");
+						Node msgId = n.getAttributes().getNamedItem("msgId");
 						if ((condition != null) && (msg != null))
 						{
 							condition.setMessage(msg.getNodeValue());
 						}
+						else if ((condition != null) && (msgId != null))
+						{
+							condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
+							Node addName = n.getAttributes().getNamedItem("addName");
+							if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
+							{
+								condition.addName();
+							}
+						}
 						_currentSkill.currentSkills.get(i).attach(condition, false);
 					}
 					else if (!foundFor && "for".equalsIgnoreCase(n.getNodeName()))
@@ -601,12 +630,16 @@ public class DocumentSkill extends DocumentBase
 					{
 						parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
 					}
+					else if (!foundSelfEffects && "selfEffects".equalsIgnoreCase(n.getNodeName()))
+					{
+						parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
+					}
 				}
 			}
 		}
 		for (int i = lastLvl + enchantLevels1; i < (lastLvl + enchantLevels1 + enchantLevels2); i++)
 		{
-			boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false;
+			boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false, foundSelfEffects = false;
 			_currentSkill.currentLevel = i - lastLvl - enchantLevels1;
 			for (n = first; n != null; n = n.getNextSibling())
 			{
@@ -615,10 +648,20 @@ public class DocumentSkill extends DocumentBase
 					foundCond = true;
 					Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
 					Node msg = n.getAttributes().getNamedItem("msg");
+					Node msgId = n.getAttributes().getNamedItem("msgId");
 					if ((condition != null) && (msg != null))
 					{
 						condition.setMessage(msg.getNodeValue());
 					}
+					else if ((condition != null) && (msgId != null))
+					{
+						condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
+						Node addName = n.getAttributes().getNamedItem("addName");
+						if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
+						{
+							condition.addName();
+						}
+					}
 					_currentSkill.currentSkills.get(i).attach(condition, false);
 				}
 				else if ("enchant2for".equalsIgnoreCase(n.getNodeName()))
@@ -646,9 +689,14 @@ public class DocumentSkill extends DocumentBase
 					foundEndEffects = true;
 					parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
 				}
+				else if ("enchant2selfEffects".equalsIgnoreCase(n.getNodeName()))
+				{
+					foundSelfEffects = true;
+					parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
+				}
 			}
 			// If none found, the enchanted skill will take effects from maxLvL of norm skill
-			if (!foundCond || !foundFor || !foundChannelingEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects)
+			if (!foundCond || !foundFor || !foundChannelingEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects || !foundSelfEffects)
 			{
 				_currentSkill.currentLevel = lastLvl - 1;
 				for (n = first; n != null; n = n.getNextSibling())
@@ -657,10 +705,20 @@ public class DocumentSkill extends DocumentBase
 					{
 						Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
 						Node msg = n.getAttributes().getNamedItem("msg");
+						Node msgId = n.getAttributes().getNamedItem("msgId");
 						if ((condition != null) && (msg != null))
 						{
 							condition.setMessage(msg.getNodeValue());
 						}
+						else if ((condition != null) && (msgId != null))
+						{
+							condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
+							Node addName = n.getAttributes().getNamedItem("addName");
+							if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
+							{
+								condition.addName();
+							}
+						}
 						_currentSkill.currentSkills.get(i).attach(condition, false);
 					}
 					else if (!foundFor && "for".equalsIgnoreCase(n.getNodeName()))
@@ -683,12 +741,16 @@ public class DocumentSkill extends DocumentBase
 					{
 						parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
 					}
+					else if (!foundSelfEffects && "selfEffects".equalsIgnoreCase(n.getNodeName()))
+					{
+						parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
+					}
 				}
 			}
 		}
 		for (int i = lastLvl + enchantLevels1 + enchantLevels2; i < (lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3); i++)
 		{
-			boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false;
+			boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false, foundSelfEffects = false;
 			_currentSkill.currentLevel = i - lastLvl - enchantLevels1 - enchantLevels2;
 			for (n = first; n != null; n = n.getNextSibling())
 			{
@@ -697,10 +759,20 @@ public class DocumentSkill extends DocumentBase
 					foundCond = true;
 					Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
 					Node msg = n.getAttributes().getNamedItem("msg");
+					Node msgId = n.getAttributes().getNamedItem("msgId");
 					if ((condition != null) && (msg != null))
 					{
 						condition.setMessage(msg.getNodeValue());
 					}
+					else if ((condition != null) && (msgId != null))
+					{
+						condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
+						Node addName = n.getAttributes().getNamedItem("addName");
+						if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
+						{
+							condition.addName();
+						}
+					}
 					_currentSkill.currentSkills.get(i).attach(condition, false);
 				}
 				else if ("enchant3for".equalsIgnoreCase(n.getNodeName()))
@@ -728,9 +800,14 @@ public class DocumentSkill extends DocumentBase
 					foundEndEffects = true;
 					parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
 				}
+				else if ("enchant3selfEffects".equalsIgnoreCase(n.getNodeName()))
+				{
+					foundSelfEffects = true;
+					parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
+				}
 			}
 			// If none found, the enchanted skill will take effects from maxLvL of norm skill
-			if (!foundCond || !foundFor || !foundChannelingEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects)
+			if (!foundCond || !foundFor || !foundChannelingEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects || !foundSelfEffects)
 			{
 				_currentSkill.currentLevel = lastLvl - 1;
 				for (n = first; n != null; n = n.getNextSibling())
@@ -739,10 +816,20 @@ public class DocumentSkill extends DocumentBase
 					{
 						Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
 						Node msg = n.getAttributes().getNamedItem("msg");
+						Node msgId = n.getAttributes().getNamedItem("msgId");
 						if ((condition != null) && (msg != null))
 						{
 							condition.setMessage(msg.getNodeValue());
 						}
+						else if ((condition != null) && (msgId != null))
+						{
+							condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
+							Node addName = n.getAttributes().getNamedItem("addName");
+							if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
+							{
+								condition.addName();
+							}
+						}
 						_currentSkill.currentSkills.get(i).attach(condition, false);
 					}
 					else if (!foundFor && "for".equalsIgnoreCase(n.getNodeName()))
@@ -765,12 +852,16 @@ public class DocumentSkill extends DocumentBase
 					{
 						parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
 					}
+					else if (!foundSelfEffects && "selfEffects".equalsIgnoreCase(n.getNodeName()))
+					{
+						parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
+					}
 				}
 			}
 		}
 		for (int i = lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3; i < (lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3 + enchantLevels4); i++)
 		{
-			boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false;
+			boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false, foundSelfEffects = false;
 			_currentSkill.currentLevel = i - lastLvl - enchantLevels1 - enchantLevels2 - enchantLevels3;
 			for (n = first; n != null; n = n.getNextSibling())
 			{
@@ -779,10 +870,20 @@ public class DocumentSkill extends DocumentBase
 					foundCond = true;
 					Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
 					Node msg = n.getAttributes().getNamedItem("msg");
+					Node msgId = n.getAttributes().getNamedItem("msgId");
 					if ((condition != null) && (msg != null))
 					{
 						condition.setMessage(msg.getNodeValue());
 					}
+					else if ((condition != null) && (msgId != null))
+					{
+						condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
+						Node addName = n.getAttributes().getNamedItem("addName");
+						if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
+						{
+							condition.addName();
+						}
+					}
 					_currentSkill.currentSkills.get(i).attach(condition, false);
 				}
 				else if ("enchant4for".equalsIgnoreCase(n.getNodeName()))
@@ -810,9 +911,14 @@ public class DocumentSkill extends DocumentBase
 					foundEndEffects = true;
 					parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
 				}
+				else if ("enchant4selfEffects".equalsIgnoreCase(n.getNodeName()))
+				{
+					foundSelfEffects = true;
+					parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
+				}
 			}
 			// If none found, the enchanted skill will take effects from maxLvL of norm skill
-			if (!foundCond || !foundFor || !foundChannelingEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects)
+			if (!foundCond || !foundFor || !foundChannelingEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects || !foundSelfEffects)
 			{
 				_currentSkill.currentLevel = lastLvl - 1;
 				for (n = first; n != null; n = n.getNextSibling())
@@ -821,10 +927,20 @@ public class DocumentSkill extends DocumentBase
 					{
 						Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
 						Node msg = n.getAttributes().getNamedItem("msg");
+						Node msgId = n.getAttributes().getNamedItem("msgId");
 						if ((condition != null) && (msg != null))
 						{
 							condition.setMessage(msg.getNodeValue());
 						}
+						else if ((condition != null) && (msgId != null))
+						{
+							condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
+							Node addName = n.getAttributes().getNamedItem("addName");
+							if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
+							{
+								condition.addName();
+							}
+						}
 						_currentSkill.currentSkills.get(i).attach(condition, false);
 					}
 					else if (!foundFor && "for".equalsIgnoreCase(n.getNodeName()))
@@ -847,12 +963,16 @@ public class DocumentSkill extends DocumentBase
 					{
 						parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
 					}
+					else if (!foundSelfEffects && "selfEffects".equalsIgnoreCase(n.getNodeName()))
+					{
+						parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
+					}
 				}
 			}
 		}
 		for (int i = lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3 + enchantLevels4; i < (lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3 + enchantLevels4 + enchantLevels5); i++)
 		{
-			boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false;
+			boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false, foundSelfEffects = false;
 			_currentSkill.currentLevel = i - lastLvl - enchantLevels1 - enchantLevels2 - enchantLevels3 - enchantLevels4;
 			for (n = first; n != null; n = n.getNextSibling())
 			{
@@ -861,10 +981,20 @@ public class DocumentSkill extends DocumentBase
 					foundCond = true;
 					Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
 					Node msg = n.getAttributes().getNamedItem("msg");
+					Node msgId = n.getAttributes().getNamedItem("msgId");
 					if ((condition != null) && (msg != null))
 					{
 						condition.setMessage(msg.getNodeValue());
 					}
+					else if ((condition != null) && (msgId != null))
+					{
+						condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
+						Node addName = n.getAttributes().getNamedItem("addName");
+						if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
+						{
+							condition.addName();
+						}
+					}
 					_currentSkill.currentSkills.get(i).attach(condition, false);
 				}
 				else if ("enchant5for".equalsIgnoreCase(n.getNodeName()))
@@ -892,9 +1022,14 @@ public class DocumentSkill extends DocumentBase
 					foundEndEffects = true;
 					parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
 				}
+				else if ("enchant5selfEffects".equalsIgnoreCase(n.getNodeName()))
+				{
+					foundSelfEffects = true;
+					parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
+				}
 			}
 			// If none found, the enchanted skill will take effects from maxLvL of norm skill
-			if (!foundCond || !foundFor || !foundChannelingEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects)
+			if (!foundCond || !foundFor || !foundChannelingEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects || !foundSelfEffects)
 			{
 				_currentSkill.currentLevel = lastLvl - 1;
 				for (n = first; n != null; n = n.getNextSibling())
@@ -903,10 +1038,20 @@ public class DocumentSkill extends DocumentBase
 					{
 						Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
 						Node msg = n.getAttributes().getNamedItem("msg");
+						Node msgId = n.getAttributes().getNamedItem("msgId");
 						if ((condition != null) && (msg != null))
 						{
 							condition.setMessage(msg.getNodeValue());
 						}
+						else if ((condition != null) && (msgId != null))
+						{
+							condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
+							Node addName = n.getAttributes().getNamedItem("addName");
+							if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
+							{
+								condition.addName();
+							}
+						}
 						_currentSkill.currentSkills.get(i).attach(condition, false);
 					}
 					else if (!foundFor && "for".equalsIgnoreCase(n.getNodeName()))
@@ -929,12 +1074,16 @@ public class DocumentSkill extends DocumentBase
 					{
 						parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
 					}
+					else if (!foundSelfEffects && "selfEffects".equalsIgnoreCase(n.getNodeName()))
+					{
+						parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
+					}
 				}
 			}
 		}
 		for (int i = lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3 + enchantLevels4 + enchantLevels5; i < (lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3 + enchantLevels4 + enchantLevels5 + enchantLevels6); i++)
 		{
-			boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false;
+			boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false, foundSelfEffects = false;
 			_currentSkill.currentLevel = i - lastLvl - enchantLevels1 - enchantLevels2 - enchantLevels3 - enchantLevels4 - enchantLevels5;
 			for (n = first; n != null; n = n.getNextSibling())
 			{
@@ -943,10 +1092,20 @@ public class DocumentSkill extends DocumentBase
 					foundCond = true;
 					Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
 					Node msg = n.getAttributes().getNamedItem("msg");
+					Node msgId = n.getAttributes().getNamedItem("msgId");
 					if ((condition != null) && (msg != null))
 					{
 						condition.setMessage(msg.getNodeValue());
 					}
+					else if ((condition != null) && (msgId != null))
+					{
+						condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
+						Node addName = n.getAttributes().getNamedItem("addName");
+						if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
+						{
+							condition.addName();
+						}
+					}
 					_currentSkill.currentSkills.get(i).attach(condition, false);
 				}
 				else if ("enchant6for".equalsIgnoreCase(n.getNodeName()))
@@ -974,9 +1133,14 @@ public class DocumentSkill extends DocumentBase
 					foundEndEffects = true;
 					parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
 				}
+				else if ("enchant6selfEffects".equalsIgnoreCase(n.getNodeName()))
+				{
+					foundSelfEffects = true;
+					parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
+				}
 			}
 			// If none found, the enchanted skill will take effects from maxLvL of norm skill
-			if (!foundCond || !foundFor || !foundChannelingEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects)
+			if (!foundCond || !foundFor || !foundChannelingEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects || !foundSelfEffects)
 			{
 				_currentSkill.currentLevel = lastLvl - 1;
 				for (n = first; n != null; n = n.getNextSibling())
@@ -985,10 +1149,20 @@ public class DocumentSkill extends DocumentBase
 					{
 						Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
 						Node msg = n.getAttributes().getNamedItem("msg");
+						Node msgId = n.getAttributes().getNamedItem("msgId");
 						if ((condition != null) && (msg != null))
 						{
 							condition.setMessage(msg.getNodeValue());
 						}
+						else if ((condition != null) && (msgId != null))
+						{
+							condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
+							Node addName = n.getAttributes().getNamedItem("addName");
+							if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
+							{
+								condition.addName();
+							}
+						}
 						_currentSkill.currentSkills.get(i).attach(condition, false);
 					}
 					else if (!foundFor && "for".equalsIgnoreCase(n.getNodeName()))
@@ -1011,12 +1185,16 @@ public class DocumentSkill extends DocumentBase
 					{
 						parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
 					}
+					else if (!foundSelfEffects && "selfEffects".equalsIgnoreCase(n.getNodeName()))
+					{
+						parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
+					}
 				}
 			}
 		}
 		for (int i = lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3 + enchantLevels4 + enchantLevels5 + enchantLevels6; i < (lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3 + enchantLevels4 + enchantLevels5 + enchantLevels6 + enchantLevels7); i++)
 		{
-			boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false;
+			boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false, foundSelfEffects = false;
 			_currentSkill.currentLevel = i - lastLvl - enchantLevels1 - enchantLevels2 - enchantLevels3 - enchantLevels4 - enchantLevels5 - enchantLevels6;
 			for (n = first; n != null; n = n.getNextSibling())
 			{
@@ -1025,10 +1203,20 @@ public class DocumentSkill extends DocumentBase
 					foundCond = true;
 					Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
 					Node msg = n.getAttributes().getNamedItem("msg");
+					Node msgId = n.getAttributes().getNamedItem("msgId");
 					if ((condition != null) && (msg != null))
 					{
 						condition.setMessage(msg.getNodeValue());
 					}
+					else if ((condition != null) && (msgId != null))
+					{
+						condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
+						Node addName = n.getAttributes().getNamedItem("addName");
+						if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
+						{
+							condition.addName();
+						}
+					}
 					_currentSkill.currentSkills.get(i).attach(condition, false);
 				}
 				else if ("enchant7for".equalsIgnoreCase(n.getNodeName()))
@@ -1056,9 +1244,14 @@ public class DocumentSkill extends DocumentBase
 					foundEndEffects = true;
 					parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
 				}
+				else if ("enchant7selfEffects".equalsIgnoreCase(n.getNodeName()))
+				{
+					foundSelfEffects = true;
+					parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
+				}
 			}
 			// If none found, the enchanted skill will take effects from maxLvL of norm skill
-			if (!foundCond || !foundFor || !foundChannelingEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects)
+			if (!foundCond || !foundFor || !foundChannelingEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects || !foundSelfEffects)
 			{
 				_currentSkill.currentLevel = lastLvl - 1;
 				for (n = first; n != null; n = n.getNextSibling())
@@ -1067,10 +1260,20 @@ public class DocumentSkill extends DocumentBase
 					{
 						Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
 						Node msg = n.getAttributes().getNamedItem("msg");
+						Node msgId = n.getAttributes().getNamedItem("msgId");
 						if ((condition != null) && (msg != null))
 						{
 							condition.setMessage(msg.getNodeValue());
 						}
+						else if ((condition != null) && (msgId != null))
+						{
+							condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
+							Node addName = n.getAttributes().getNamedItem("addName");
+							if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
+							{
+								condition.addName();
+							}
+						}
 						_currentSkill.currentSkills.get(i).attach(condition, false);
 					}
 					else if (!foundFor && "for".equalsIgnoreCase(n.getNodeName()))
@@ -1093,12 +1296,16 @@ public class DocumentSkill extends DocumentBase
 					{
 						parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
 					}
+					else if (!foundSelfEffects && "selfEffects".equalsIgnoreCase(n.getNodeName()))
+					{
+						parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
+					}
 				}
 			}
 		}
 		for (int i = lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3 + enchantLevels4 + enchantLevels5 + enchantLevels6 + enchantLevels7; i < (lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3 + enchantLevels4 + enchantLevels5 + enchantLevels6 + enchantLevels7 + enchantLevels8); i++)
 		{
-			boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false;
+			boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false, foundSelfEffects = false;
 			_currentSkill.currentLevel = i - lastLvl - enchantLevels1 - enchantLevels2 - enchantLevels3 - enchantLevels4 - enchantLevels5 - enchantLevels6 - enchantLevels7;
 			for (n = first; n != null; n = n.getNextSibling())
 			{
@@ -1107,10 +1314,20 @@ public class DocumentSkill extends DocumentBase
 					foundCond = true;
 					Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
 					Node msg = n.getAttributes().getNamedItem("msg");
+					Node msgId = n.getAttributes().getNamedItem("msgId");
 					if ((condition != null) && (msg != null))
 					{
 						condition.setMessage(msg.getNodeValue());
 					}
+					else if ((condition != null) && (msgId != null))
+					{
+						condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
+						Node addName = n.getAttributes().getNamedItem("addName");
+						if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
+						{
+							condition.addName();
+						}
+					}
 					_currentSkill.currentSkills.get(i).attach(condition, false);
 				}
 				else if ("enchant8for".equalsIgnoreCase(n.getNodeName()))
@@ -1138,9 +1355,14 @@ public class DocumentSkill extends DocumentBase
 					foundEndEffects = true;
 					parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
 				}
+				else if ("enchant8selfEffects".equalsIgnoreCase(n.getNodeName()))
+				{
+					foundSelfEffects = true;
+					parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
+				}
 			}
 			// If none found, the enchanted skill will take effects from maxLvL of norm skill
-			if (!foundCond || !foundFor || !foundChannelingEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects)
+			if (!foundCond || !foundFor || !foundChannelingEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects || !foundSelfEffects)
 			{
 				_currentSkill.currentLevel = lastLvl - 1;
 				for (n = first; n != null; n = n.getNextSibling())
@@ -1149,10 +1371,20 @@ public class DocumentSkill extends DocumentBase
 					{
 						Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
 						Node msg = n.getAttributes().getNamedItem("msg");
+						Node msgId = n.getAttributes().getNamedItem("msgId");
 						if ((condition != null) && (msg != null))
 						{
 							condition.setMessage(msg.getNodeValue());
 						}
+						else if ((condition != null) && (msgId != null))
+						{
+							condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
+							Node addName = n.getAttributes().getNamedItem("addName");
+							if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
+							{
+								condition.addName();
+							}
+						}
 						_currentSkill.currentSkills.get(i).attach(condition, false);
 					}
 					else if (!foundFor && "for".equalsIgnoreCase(n.getNodeName()))
@@ -1175,6 +1407,10 @@ public class DocumentSkill extends DocumentBase
 					{
 						parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
 					}
+					else if (!foundSelfEffects && "selfEffects".equalsIgnoreCase(n.getNodeName()))
+					{
+						parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
+					}
 				}
 			}
 		}

+ 38 - 23
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/L2Skill.java

@@ -22,7 +22,9 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.EnumMap;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -223,7 +225,7 @@ public abstract class L2Skill implements IChanceSkillTrigger, IIdentifiable
 	
 	private final String _icon;
 	
-	private byte[] _effectTypes;
+	private Byte[] _effectTypes;
 	
 	// Channeling data
 	private final int _channelingSkillId;
@@ -1700,38 +1702,51 @@ public abstract class L2Skill implements IChanceSkillTrigger, IIdentifiable
 	}
 	
 	/**
-	 * @param types
-	 * @return {@code true} if at least one of specified {@link L2EffectType} types present on the current skill's effects, {@code false} otherwise.
+	 * @param effectType Effect type to check if its present on this skill effects.
+	 * @param effectTypes Effect types to check if are present on this skill effects.
+	 * @return {@code true} if at least one of specified {@link L2EffectType} types is present on this skill effects, {@code false} otherwise.
 	 */
-	public boolean hasEffectType(L2EffectType... types)
+	public boolean hasEffectType(L2EffectType effectType, L2EffectType... effectTypes)
 	{
-		if (hasEffects(EffectScope.GENERAL) && (types != null) && (types.length > 0))
+		if (_effectTypes == null)
 		{
-			if (_effectTypes == null)
+			synchronized (this)
 			{
-				_effectTypes = new byte[getEffects(EffectScope.GENERAL).size()];
-				
-				final Env env = new Env();
-				env.setSkill(this);
-				
-				int i = 0;
-				for (AbstractEffect effect : getEffects(EffectScope.GENERAL))
+				if (_effectTypes == null)
 				{
-					if (effect == null)
+					Set<Byte> effectTypesSet = new HashSet<>();
+					for (List<AbstractEffect> effectList : _effectLists.values())
 					{
-						continue;
+						if (effectList != null)
+						{
+							for (AbstractEffect effect : effectList)
+							{
+								if (effect == null)
+								{
+									continue;
+								}
+								effectTypesSet.add((byte) effect.getEffectType().ordinal());
+							}
+						}
 					}
-					_effectTypes[i++] = (byte) effect.getEffectType().ordinal();
+					
+					Byte[] effectTypesArray = effectTypesSet.toArray(new Byte[effectTypesSet.size()]);
+					Arrays.sort(effectTypesArray);
+					_effectTypes = effectTypesArray;
 				}
-				Arrays.sort(_effectTypes);
 			}
-			
-			for (L2EffectType type : types)
+		}
+		
+		if (Arrays.binarySearch(_effectTypes, (byte) effectType.ordinal()) >= 0)
+		{
+			return true;
+		}
+		
+		for (L2EffectType type : effectTypes)
+		{
+			if (Arrays.binarySearch(_effectTypes, (byte) type.ordinal()) >= 0)
 			{
-				if (Arrays.binarySearch(_effectTypes, (byte) type.ordinal()) >= 0)
-				{
-					return true;
-				}
+				return true;
 			}
 		}
 		return false;