Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: java/com/l2jserver/gameserver/model/L2Skill.java
- ===================================================================
- --- java/com/l2jserver/gameserver/model/L2Skill.java (revision 402)
- +++ java/com/l2jserver/gameserver/model/L2Skill.java (working copy)
- @@ -17,10 +17,12 @@
- import java.util.ArrayList;
- import java.util.Collection;
- import java.util.List;
- +import java.util.Map;
- import java.util.StringTokenizer;
- import java.util.logging.Logger;
- import javolution.util.FastList;
- +import javolution.util.FastMap;
- import com.l2jserver.Config;
- import com.l2jserver.gameserver.GeoData;
- @@ -173,6 +175,7 @@
- private final int _negateLvl; // abnormalLvl is negated with negateLvl
- private final int[] _negateId; // cancels the effect of skill ID
- private final L2SkillType[] _negateStats; // lists the effect types that are canceled
- + private final Map<String, Byte> _negateAbnormals; // lists the effect abnormal types with order below the presented that are canceled
- private final int _maxNegatedEffects; // maximum number of effects to negate
- private final boolean _stayAfterDeath; // skill should stay after death
- @@ -352,6 +355,34 @@
- _negateStats = array;
- }
- + String negateAbnormals = set.getString("negateAbnormals", null);
- + if (negateAbnormals != null && negateAbnormals != "")
- + {
- + _negateAbnormals = new FastMap<String, Byte>();
- + for (String ngtStack : negateAbnormals.split(";"))
- + {
- + String[] ngt = ngtStack.split(",");
- + if (ngt.length == 1) // Only abnormalType is present, without abnormalLvl
- + {
- + _negateAbnormals.put(ngt[0], Byte.MAX_VALUE);
- + }
- + else if (ngt.length == 2) // Both abnormalType and abnormalLvl are present
- + {
- + try
- + {
- + _negateAbnormals.put(ngt[0], Byte.parseByte(ngt[1]));
- + }
- + catch (Exception e)
- + {
- + throw new IllegalArgumentException("SkillId: "+_id+" Byte value required, but found: "+ngt[1]);
- + }
- + }
- + else // If not both from above, then smth is messed up... throw an error.
- + throw new IllegalArgumentException("SkillId: "+_id+": Incorrect negate Abnormals for "+ngtStack+". Lvl: abnormalType1,abnormalLvl1;abnormalType2,abnormalLvl2;abnormalType3,abnormalLvl3... or abnormalType1;abnormalType2;abnormalType3...");
- + }
- + }
- + else
- + _negateAbnormals = null;
- String negateId = set.getString("negateId", null);
- if (negateId != null)
- @@ -647,6 +678,11 @@
- return _negateStats;
- }
- + public final Map<String, Byte> getNegateAbnormals()
- + {
- + return _negateAbnormals;
- + }
- +
- public final int getAbnormalLvl()
- {
- return _abnormalLvl;
- Index: java/com/l2jserver/gameserver/skills/effects/EffectNegate.java
- ===================================================================
- --- java/com/l2jserver/gameserver/skills/effects/EffectNegate.java (revision 402)
- +++ java/com/l2jserver/gameserver/skills/effects/EffectNegate.java (working copy)
- @@ -52,6 +52,20 @@
- {
- getEffected().stopSkillEffects(negateSkillType, skill.getNegateLvl());
- }
- + if (skill.getNegateAbnormals() != null)
- + {
- + for (L2Effect effect : getEffected().getAllEffects())
- + {
- + if (effect == null)
- + continue;
- +
- + for (String negateAbnormalType : skill.getNegateAbnormals().keySet())
- + {
- + if (negateAbnormalType.equalsIgnoreCase(effect.getAbnormalType()) && skill.getNegateAbnormals().get(negateAbnormalType) >= effect.getAbnormalLvl())
- + effect.exit();
- + }
- + }
- + }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment