Explorar el Código

Abnormal and special effect cleaning. Requires [DP6685]

DrHouse hace 15 años
padre
commit
95d6dad9d5

+ 7 - 6
L2_GameServer/java/net/sf/l2j/gameserver/model/L2Effect.java

@@ -34,6 +34,7 @@ import net.sf.l2j.gameserver.network.serverpackets.MagicSkillLaunched;
 import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUse;
 import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUse;
 import net.sf.l2j.gameserver.network.serverpackets.PartySpelled;
 import net.sf.l2j.gameserver.network.serverpackets.PartySpelled;
 import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
 import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
+import net.sf.l2j.gameserver.skills.AbnormalEffect;
 import net.sf.l2j.gameserver.skills.Env;
 import net.sf.l2j.gameserver.skills.Env;
 import net.sf.l2j.gameserver.skills.funcs.Func;
 import net.sf.l2j.gameserver.skills.funcs.Func;
 import net.sf.l2j.gameserver.skills.funcs.FuncTemplate;
 import net.sf.l2j.gameserver.skills.funcs.FuncTemplate;
@@ -98,9 +99,9 @@ public abstract class L2Effect
 	private int _count;
 	private int _count;
 	
 	
 	// abnormal effect mask
 	// abnormal effect mask
-	private int _abnormalEffect;
+	private AbnormalEffect _abnormalEffect;
 	// special effect mask
 	// special effect mask
-	private int _specialEffect;
+	private AbnormalEffect _specialEffect;
 	// show icon
 	// show icon
 	private boolean _icon;
 	private boolean _icon;
 	
 	
@@ -431,9 +432,9 @@ public abstract class L2Effect
 	/** Notify started */
 	/** Notify started */
 	public boolean onStart()
 	public boolean onStart()
 	{
 	{
-		if (_abnormalEffect != 0)
+		if (_abnormalEffect != AbnormalEffect.NULL)
 			getEffected().startAbnormalEffect(_abnormalEffect);
 			getEffected().startAbnormalEffect(_abnormalEffect);
-		if (_specialEffect != 0)
+		if (_specialEffect != AbnormalEffect.NULL)
 			getEffected().startSpecialEffect(_specialEffect);
 			getEffected().startSpecialEffect(_specialEffect);
 		return true;
 		return true;
 	}
 	}
@@ -443,9 +444,9 @@ public abstract class L2Effect
 	 */
 	 */
 	public void onExit()
 	public void onExit()
 	{
 	{
-		if (_abnormalEffect != 0)
+		if (_abnormalEffect != AbnormalEffect.NULL)
 			getEffected().stopAbnormalEffect(_abnormalEffect);
 			getEffected().stopAbnormalEffect(_abnormalEffect);
-		if (_specialEffect != 0)
+		if (_specialEffect != AbnormalEffect.NULL)
 			getEffected().stopSpecialEffect(_specialEffect);
 			getEffected().stopSpecialEffect(_specialEffect);
 	}
 	}
 	
 	

+ 38 - 59
L2_GameServer/java/net/sf/l2j/gameserver/model/actor/L2Character.java

@@ -97,6 +97,7 @@ import net.sf.l2j.gameserver.network.serverpackets.ValidateLocation;
 import net.sf.l2j.gameserver.network.serverpackets.FlyToLocation.FlyType;
 import net.sf.l2j.gameserver.network.serverpackets.FlyToLocation.FlyType;
 import net.sf.l2j.gameserver.pathfinding.AbstractNodeLoc;
 import net.sf.l2j.gameserver.pathfinding.AbstractNodeLoc;
 import net.sf.l2j.gameserver.pathfinding.PathFinding;
 import net.sf.l2j.gameserver.pathfinding.PathFinding;
+import net.sf.l2j.gameserver.skills.AbnormalEffect;
 import net.sf.l2j.gameserver.skills.Calculator;
 import net.sf.l2j.gameserver.skills.Calculator;
 import net.sf.l2j.gameserver.skills.Formulas;
 import net.sf.l2j.gameserver.skills.Formulas;
 import net.sf.l2j.gameserver.skills.Stats;
 import net.sf.l2j.gameserver.skills.Stats;
@@ -2648,8 +2649,7 @@ public abstract class L2Character extends L2Object
 	/** Task lauching the magic skill phases */
 	/** Task lauching the magic skill phases */
 	class FlyToLocationTask implements Runnable
 	class FlyToLocationTask implements Runnable
 	{
 	{
-		@SuppressWarnings("hiding")
-        L2Object _target;
+		L2Object _target;
 		L2Character _actor;
 		L2Character _actor;
 		L2Skill _skill;
 		L2Skill _skill;
 
 
@@ -2691,52 +2691,7 @@ public abstract class L2Character extends L2Object
 
 
 	protected CharEffectList _effects = new CharEffectList(this);
 	protected CharEffectList _effects = new CharEffectList(this);
 
 
-	public static final int ABNORMAL_EFFECT_BLEEDING		= 0x000001;
-	public static final int ABNORMAL_EFFECT_POISON 			= 0x000002;
-	public static final int ABNORMAL_EFFECT_REDCIRCLE		= 0x000004;
-	public static final int ABNORMAL_EFFECT_ICE				= 0x000008;
-	public static final int ABNORMAL_EFFECT_WIND			= 0x000010;
-	public static final int ABNORMAL_EFFECT_FEAR			= 0x000020;
-	public static final int ABNORMAL_EFFECT_STUN			= 0x000040;
-	public static final int ABNORMAL_EFFECT_SLEEP			= 0x000080;
-	public static final int ABNORMAL_EFFECT_MUTED			= 0x000100;
-	public static final int ABNORMAL_EFFECT_ROOT			= 0x000200;
-	public static final int ABNORMAL_EFFECT_HOLD_1			= 0x000400;
-	public static final int ABNORMAL_EFFECT_HOLD_2			= 0x000800;
-	public static final int ABNORMAL_EFFECT_UNKNOWN_13		= 0x001000;
-	public static final int ABNORMAL_EFFECT_BIG_HEAD		= 0x002000;
-	public static final int ABNORMAL_EFFECT_FLAME			= 0x004000;
-	public static final int ABNORMAL_EFFECT_UNKNOWN_16		= 0x008000;
-	public static final int ABNORMAL_EFFECT_GROW			= 0x010000;
-	public static final int ABNORMAL_EFFECT_FLOATING_ROOT	= 0x020000;
-	public static final int ABNORMAL_EFFECT_DANCE_STUNNED	= 0x040000;
-	public static final int ABNORMAL_EFFECT_FIREROOT_STUN	= 0x080000;
-	public static final int ABNORMAL_EFFECT_STEALTH			= 0x100000;
-	public static final int ABNORMAL_EFFECT_IMPRISIONING_1	= 0x200000;
-	public static final int ABNORMAL_EFFECT_IMPRISIONING_2	= 0x400000;
-	public static final int ABNORMAL_EFFECT_MAGIC_CIRCLE	= 0x800000;
-	public static final int ABNORMAL_EFFECT_ICE2			= 0x1000000;
-	public static final int ABNORMAL_EFFECT_EARTHQUAKE		= 0x2000000;
-	public static final int ABNORMAL_EFFECT_UNKNOWN_27		= 0x4000000;
-	public static final int ABNORMAL_EFFECT_INVULNERABLE	= 0x8000000;
-	public static final int ABNORMAL_EFFECT_VITALITY		= 0x10000000;
-	public static final int ABNORMAL_EFFECT_UNKNOWN_30		= 0x20000000;
-	public static final int ABNORMAL_EFFECT_DEATH_MARK		= 0x40000000;
-	public static final int ABNORMAL_EFFECT_UNKNOWN_32		= 0x80000000;
-
-	// XXX TEMP HACKS (get the proper mask for these effects)
-	public static final int ABNORMAL_EFFECT_CONFUSED   = 0x0020;
-
 	private int _SpecialEffects;
 	private int _SpecialEffects;
-	public static final int SPECIAL_EFFECT_INVULNERABLE		= 0x000001;
-	public static final int SPECIAL_EFFECT_AIR_STUN			= 0x000002;
-	public static final int SPECIAL_EFFECT_AIR_ROOT			= 0x000004;
-	public static final int SPECIAL_EFFECT_BAGUETTE_SWORD	= 0x000008;
-	public static final int SPECIAL_EFFECT_YELLOW_AFFRO		= 0x000010;
-	public static final int SPECIAL_EFFECT_PINK_AFFRO		= 0x000020;
-	public static final int SPECIAL_EFFECT_BLACK_AFFRO		= 0x000040;
-	public static final int SPECIAL_EFFECT_UNKNOWN8			= 0x000080;
-	public static final int SPECIAL_EFFECT_UNKNOWN9			= 0x000100;
 	// Method - Public
 	// Method - Public
 	/**
 	/**
 	 * Launch and add L2Effect (including Stack Group management) to L2Character and update client magic icon.<BR><BR>
 	 * Launch and add L2Effect (including Stack Group management) to L2Character and update client magic icon.<BR><BR>
@@ -2790,15 +2745,27 @@ public abstract class L2Character extends L2Object
 	/**
 	/**
 	 * Active abnormal effects flags in the binary mask and send Server->Client UserInfo/CharInfo packet.<BR><BR>
 	 * Active abnormal effects flags in the binary mask and send Server->Client UserInfo/CharInfo packet.<BR><BR>
 	 */
 	 */
-	public final void startAbnormalEffect(int mask)
+	public final void startAbnormalEffect(AbnormalEffect mask)
 	{
 	{
-		_AbnormalEffects |= mask;
+		_AbnormalEffects |= mask.getMask();
 		updateAbnormalEffect();
 		updateAbnormalEffect();
 	}
 	}
 
 
 	/**
 	/**
 	 * Active special effects flags in the binary mask and send Server->Client UserInfo/CharInfo packet.<BR><BR>
 	 * Active special effects flags in the binary mask and send Server->Client UserInfo/CharInfo packet.<BR><BR>
 	 */
 	 */
+	public final void startSpecialEffect(AbnormalEffect mask)
+	{
+		_SpecialEffects |= mask.getMask();
+		updateAbnormalEffect();
+	}
+	
+	public final void startAbnormalEffect(int mask)
+	{
+		_AbnormalEffects |= mask;
+		updateAbnormalEffect();
+	}
+	
 	public final void startSpecialEffect(int mask)
 	public final void startSpecialEffect(int mask)
 	{
 	{
 		_SpecialEffects |= mask;
 		_SpecialEffects |= mask;
@@ -2949,15 +2916,27 @@ public abstract class L2Character extends L2Object
 	/**
 	/**
 	 * Modify the abnormal effect map according to the mask.<BR><BR>
 	 * Modify the abnormal effect map according to the mask.<BR><BR>
 	 */
 	 */
-	public final void stopAbnormalEffect(int mask)
+	public final void stopAbnormalEffect(AbnormalEffect mask)
 	{
 	{
-		_AbnormalEffects &= ~mask;
+		_AbnormalEffects &= ~mask.getMask();
 		updateAbnormalEffect();
 		updateAbnormalEffect();
 	}
 	}
 
 
 	/**
 	/**
 	 * Modify the special effect map according to the mask.<BR><BR>
 	 * Modify the special effect map according to the mask.<BR><BR>
 	 */
 	 */
+	public final void stopSpecialEffect(AbnormalEffect mask)
+	{
+		_SpecialEffects &= ~mask.getMask();
+		updateAbnormalEffect();
+	}
+	
+	public final void stopAbnormalEffect(int mask)
+	{
+		_AbnormalEffects &= ~mask;
+		updateAbnormalEffect();
+	}
+
 	public final void stopSpecialEffect(int mask)
 	public final void stopSpecialEffect(int mask)
 	{
 	{
 		_SpecialEffects &= ~mask;
 		_SpecialEffects &= ~mask;
@@ -3314,12 +3293,12 @@ public abstract class L2Character extends L2Object
 	public int getAbnormalEffect()
 	public int getAbnormalEffect()
 	{
 	{
 		int ae = _AbnormalEffects;
 		int ae = _AbnormalEffects;
-		if (!isFlying() && isStunned())  ae |= ABNORMAL_EFFECT_STUN;
-		if (!isFlying() && isRooted())   ae |= ABNORMAL_EFFECT_ROOT;
-		if (isSleeping()) ae |= ABNORMAL_EFFECT_SLEEP;
-		if (isConfused()) ae |= ABNORMAL_EFFECT_CONFUSED;
-		if (isMuted())    ae |= ABNORMAL_EFFECT_MUTED;
-		if (isPhysicalMuted()) ae |= ABNORMAL_EFFECT_MUTED;
+		if (!isFlying() && isStunned())  ae |= AbnormalEffect.STUN.getMask();
+		if (!isFlying() && isRooted())   ae |= AbnormalEffect.ROOT.getMask();
+		if (isSleeping()) ae |= AbnormalEffect.SLEEP.getMask();
+		if (isConfused()) ae |= AbnormalEffect.CONFUSED.getMask();
+		if (isMuted())    ae |= AbnormalEffect.MUTED.getMask();
+		if (isPhysicalMuted()) ae |= AbnormalEffect.MUTED.getMask();
 		return ae;
 		return ae;
 	}
 	}
 
 
@@ -3336,8 +3315,8 @@ public abstract class L2Character extends L2Object
 	public int getSpecialEffect()
 	public int getSpecialEffect()
 	{
 	{
 		int se = _SpecialEffects;
 		int se = _SpecialEffects;
-		if (isFlying() && isStunned())  se |= SPECIAL_EFFECT_AIR_STUN;
-		if (isFlying() && isRooted())   se |= SPECIAL_EFFECT_AIR_ROOT;
+		if (isFlying() && isStunned())  se |= AbnormalEffect.S_AIR_STUN.getMask();
+		if (isFlying() && isRooted())   se |= AbnormalEffect.S_AIR_ROOT.getMask();
 		return se;
 		return se;
 	}
 	}
 	/**
 	/**

+ 3 - 2
L2_GameServer/java/net/sf/l2j/gameserver/model/zone/type/L2BigheadZone.java

@@ -17,6 +17,7 @@ package net.sf.l2j.gameserver.model.zone.type;
 import net.sf.l2j.gameserver.model.actor.L2Character;
 import net.sf.l2j.gameserver.model.actor.L2Character;
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
 import net.sf.l2j.gameserver.model.zone.L2ZoneType;
 import net.sf.l2j.gameserver.model.zone.L2ZoneType;
+import net.sf.l2j.gameserver.skills.AbnormalEffect;
 
 
 /**
 /**
  * Bighead zones give entering players big heads
  * Bighead zones give entering players big heads
@@ -35,7 +36,7 @@ public class L2BigheadZone extends L2ZoneType
 	{
 	{
 		if (character instanceof L2PcInstance)
 		if (character instanceof L2PcInstance)
 		{
 		{
-			character.startAbnormalEffect(0x2000);
+			character.startAbnormalEffect(AbnormalEffect.BIG_HEAD);
 		}
 		}
 	}
 	}
 	
 	
@@ -44,7 +45,7 @@ public class L2BigheadZone extends L2ZoneType
 	{
 	{
 		if (character instanceof L2PcInstance)
 		if (character instanceof L2PcInstance)
 		{
 		{
-			character.stopAbnormalEffect((short) 0x2000);
+			character.stopAbnormalEffect(AbnormalEffect.BIG_HEAD);
 		}
 		}
 	}
 	}
 	
 	

+ 2 - 1
L2_GameServer/java/net/sf/l2j/gameserver/network/serverpackets/AbstractNpcInfo.java

@@ -25,6 +25,7 @@ import net.sf.l2j.gameserver.model.actor.L2Trap;
 import net.sf.l2j.gameserver.model.actor.instance.L2MonsterInstance;
 import net.sf.l2j.gameserver.model.actor.instance.L2MonsterInstance;
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
 import net.sf.l2j.gameserver.model.itemcontainer.Inventory;
 import net.sf.l2j.gameserver.model.itemcontainer.Inventory;
+import net.sf.l2j.gameserver.skills.AbnormalEffect;
 /**
 /**
  * This class ...
  * This class ...
  *
  *
@@ -588,7 +589,7 @@ public abstract class AbstractNpcInfo extends L2GameServerPacket
 			writeD(_summon.getKarma());
 			writeD(_summon.getKarma());
 
 
 			if (gmSeeInvis)
 			if (gmSeeInvis)
-				writeD(_summon.getAbnormalEffect() | L2Character.ABNORMAL_EFFECT_STEALTH);
+				writeD(_summon.getAbnormalEffect() |AbnormalEffect.STEALTH.getMask());
 			else
 			else
 				writeD(_summon.getAbnormalEffect());  // C2
 				writeD(_summon.getAbnormalEffect());  // C2
 			writeD(0x00); //clan id
 			writeD(0x00); //clan id

+ 3 - 3
L2_GameServer/java/net/sf/l2j/gameserver/network/serverpackets/CharInfo.java

@@ -19,9 +19,9 @@ import java.util.logging.Logger;
 import net.sf.l2j.Config;
 import net.sf.l2j.Config;
 import net.sf.l2j.gameserver.datatables.NpcTable;
 import net.sf.l2j.gameserver.datatables.NpcTable;
 import net.sf.l2j.gameserver.instancemanager.CursedWeaponsManager;
 import net.sf.l2j.gameserver.instancemanager.CursedWeaponsManager;
-import net.sf.l2j.gameserver.model.actor.L2Character;
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
 import net.sf.l2j.gameserver.model.itemcontainer.Inventory;
 import net.sf.l2j.gameserver.model.itemcontainer.Inventory;
+import net.sf.l2j.gameserver.skills.AbnormalEffect;
 import net.sf.l2j.gameserver.templates.chars.L2NpcTemplate;
 import net.sf.l2j.gameserver.templates.chars.L2NpcTemplate;
 
 
 /**
 /**
@@ -162,7 +162,7 @@ public class CharInfo extends L2GameServerPacket
 
 
 				if (gmSeeInvis)
 				if (gmSeeInvis)
 				{
 				{
-					writeD( (_activeChar.getAbnormalEffect() | L2Character.ABNORMAL_EFFECT_STEALTH) );
+					writeD( (_activeChar.getAbnormalEffect() | AbnormalEffect.STEALTH.getMask()) );
 				}
 				}
 				else
 				else
 				{
 				{
@@ -341,7 +341,7 @@ public class CharInfo extends L2GameServerPacket
 
 
 			if (gmSeeInvis)
 			if (gmSeeInvis)
 			{
 			{
-				writeD( (_activeChar.getAbnormalEffect() | L2Character.ABNORMAL_EFFECT_STEALTH) );
+				writeD( (_activeChar.getAbnormalEffect() | AbnormalEffect.STEALTH.getMask()) );
 			}
 			}
 			else
 			else
 			{
 			{

+ 100 - 0
L2_GameServer/java/net/sf/l2j/gameserver/skills/AbnormalEffect.java

@@ -0,0 +1,100 @@
+/*
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
+ * 
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ * 
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package net.sf.l2j.gameserver.skills;
+
+import java.util.NoSuchElementException;
+
+/**
+ *
+ * @author  DrHouse
+ */
+public enum AbnormalEffect
+{
+	NULL("null", 0x0),
+	BLEEDING("bleed", 0x000001),
+	POISON("poison", 0x000002),
+	REDCIRCLE("redcircle", 0x000004),
+	ICE("ice", 0x000008),
+	WIND("wind", 0x000010),
+	FEAR("fear", 0x000020),
+	STUN("stun", 0x000040),
+	SLEEP("sleep", 0x000080),
+	MUTED("mute", 0x000100),
+	ROOT("root", 0x000200),
+	HOLD_1("hold1", 0x000400),
+	HOLD_2("hold2", 0x000800),
+	UNKNOWN_13("unknown13", 0x001000),
+	BIG_HEAD("bighead", 0x002000),
+	FLAME("flame", 0x004000),
+	UNKNOWN_16("unknown16", 0x008000),
+	GROW("grow", 0x010000),
+	FLOATING_ROOT("floatroot", 0x020000),
+	DANCE_STUNNED("dancestun", 0x040000),
+	FIREROOT_STUN("firerootstun", 0x080000),
+	STEALTH("stealth", 0x100000),
+	IMPRISIONING_1("imprison1", 0x200000),
+	IMPRISIONING_2("imprison2", 0x400000),
+	MAGIC_CIRCLE("magiccircle", 0x800000),
+	ICE2("ice2", 0x1000000),
+	EARTHQUAKE("earthquake", 0x2000000),
+	UNKNOWN_27("unknown27", 0x4000000),
+	INVULNERABLE("invulnerable", 0x8000000),
+	VITALITY("vitality", 0x10000000),
+	UNKNOWN_30("unknown30", 0x20000000),
+	DEATH_MARK("deathmark", 0x40000000),
+	UNKNOWN_32("unknown32", 0x80000000),
+	CONFUSED("confused", 0x0020),
+	
+	// special effects
+	S_INVULNERABLE("invulnerable", 0x000001),
+	S_AIR_STUN("redglow", 0x000002),
+	S_AIR_ROOT("redglow2", 0x000004),
+	S_BAGUETTE_SWORD("baguettesword", 0x000008),
+	S_YELLOW_AFFRO("yellowafro", 0x000010),
+	S_PINK_AFFRO("pinkafro", 0x000020),
+	S_BLACK_AFFRO("blackafro", 0x000040),
+	S_UNKNOWN8("unknown8", 0x000080),
+	S_UNKNOWN9("unknown9", 0x000100);
+	
+	private final int _mask;
+	private final String _name;
+	
+	private AbnormalEffect(String name, int mask)
+	{
+		_name = name;
+		_mask = mask;
+	}
+	
+	public final int getMask()
+	{
+		return _mask;
+	}
+	
+	public final String getName()
+	{
+		return _name;
+	}
+	
+	public static AbnormalEffect getByName(String name)
+	{
+		for (AbnormalEffect eff : AbnormalEffect.values())
+		{
+			if (eff.getName().equals(name))
+				return eff;
+		}
+		
+		throw new NoSuchElementException("AbnormalEffect not found for name: '"+name+ "'.\n Please check "+AbnormalEffect.class.getCanonicalName());
+	}
+}

+ 6 - 46
L2_GameServer/java/net/sf/l2j/gameserver/skills/DocumentBase.java

@@ -31,7 +31,6 @@ import net.sf.l2j.Config;
 import net.sf.l2j.gameserver.datatables.SkillTable;
 import net.sf.l2j.gameserver.datatables.SkillTable;
 import net.sf.l2j.gameserver.model.ChanceCondition;
 import net.sf.l2j.gameserver.model.ChanceCondition;
 import net.sf.l2j.gameserver.model.L2Skill;
 import net.sf.l2j.gameserver.model.L2Skill;
-import net.sf.l2j.gameserver.model.actor.L2Character;
 import net.sf.l2j.gameserver.model.base.PlayerState;
 import net.sf.l2j.gameserver.model.base.PlayerState;
 import net.sf.l2j.gameserver.model.base.Race;
 import net.sf.l2j.gameserver.model.base.Race;
 import net.sf.l2j.gameserver.skills.conditions.*;
 import net.sf.l2j.gameserver.skills.conditions.*;
@@ -232,56 +231,17 @@ abstract class DocumentBase
         }
         }
         Lambda lambda = getLambda(n, template);
         Lambda lambda = getLambda(n, template);
         Condition applayCond = parseCondition(n.getFirstChild(), template);
         Condition applayCond = parseCondition(n.getFirstChild(), template);
-        int abnormal = 0;
+        AbnormalEffect abnormal = AbnormalEffect.NULL;
         if (attrs.getNamedItem("abnormal") != null)
         if (attrs.getNamedItem("abnormal") != null)
         {
         {
-            String abn = attrs.getNamedItem("abnormal").getNodeValue();
-            if (abn.equals("bleed")) abnormal = L2Character.ABNORMAL_EFFECT_BLEEDING;
-            else if (abn.equals("poison")) abnormal = L2Character.ABNORMAL_EFFECT_POISON;
-            else if (abn.equals("redcircle")) abnormal = L2Character.ABNORMAL_EFFECT_REDCIRCLE;
-            else if (abn.equals("ice")) abnormal = L2Character.ABNORMAL_EFFECT_ICE;
-            else if (abn.equals("wind")) abnormal = L2Character.ABNORMAL_EFFECT_WIND;
-            else if (abn.equals("fear")) abnormal = L2Character.ABNORMAL_EFFECT_FEAR;
-            else if (abn.equals("stun")) abnormal = L2Character.ABNORMAL_EFFECT_STUN;
-            else if (abn.equals("sleep")) abnormal = L2Character.ABNORMAL_EFFECT_SLEEP;
-            else if (abn.equals("mute")) abnormal = L2Character.ABNORMAL_EFFECT_MUTED;
-            else if (abn.equals("root")) abnormal = L2Character.ABNORMAL_EFFECT_ROOT;
-            else if (abn.equals("hold1")) abnormal = L2Character.ABNORMAL_EFFECT_HOLD_1;
-            else if (abn.equals("hold2")) abnormal = L2Character.ABNORMAL_EFFECT_HOLD_2;
-            else if (abn.equals("unknown13")) abnormal = L2Character.ABNORMAL_EFFECT_UNKNOWN_13;
-            else if (abn.equals("bighead")) abnormal = L2Character.ABNORMAL_EFFECT_BIG_HEAD;
-            else if (abn.equals("flame")) abnormal = L2Character.ABNORMAL_EFFECT_FLAME;
-            else if (abn.equals("unknown16")) abnormal = L2Character.ABNORMAL_EFFECT_UNKNOWN_16;
-            else if (abn.equals("grow")) abnormal = L2Character.ABNORMAL_EFFECT_GROW;
-            else if (abn.equals("floatroot")) abnormal = L2Character.ABNORMAL_EFFECT_FLOATING_ROOT;
-            else if (abn.equals("dancestun")) abnormal = L2Character.ABNORMAL_EFFECT_DANCE_STUNNED;
-            else if (abn.equals("firerootstun")) abnormal = L2Character.ABNORMAL_EFFECT_FIREROOT_STUN;
-            else if (abn.equals("stealth")) abnormal = L2Character.ABNORMAL_EFFECT_STEALTH;
-            else if (abn.equals("imprison1")) abnormal = L2Character.ABNORMAL_EFFECT_IMPRISIONING_1;
-            else if (abn.equals("imprison2")) abnormal = L2Character.ABNORMAL_EFFECT_IMPRISIONING_2;
-            else if (abn.equals("magiccircle")) abnormal = L2Character.ABNORMAL_EFFECT_MAGIC_CIRCLE;
-            else if (abn.equals("ice2")) abnormal = L2Character.ABNORMAL_EFFECT_ICE2;
-            else if (abn.equals("earthquake")) abnormal = L2Character.ABNORMAL_EFFECT_EARTHQUAKE;
-            else if (abn.equals("unknown27")) abnormal = L2Character.ABNORMAL_EFFECT_UNKNOWN_27;
-            else if (abn.equals("invulnerable")) abnormal = L2Character.ABNORMAL_EFFECT_INVULNERABLE;
-            else if (abn.equals("vitality")) abnormal = L2Character.ABNORMAL_EFFECT_VITALITY;
-            else if (abn.equals("unknown30")) abnormal = L2Character.ABNORMAL_EFFECT_UNKNOWN_30;
-            else if (abn.equals("deathmark")) abnormal = L2Character.ABNORMAL_EFFECT_DEATH_MARK;
-            else if (abn.equals("unknown32")) abnormal = L2Character.ABNORMAL_EFFECT_UNKNOWN_32;
-        }
-        int special = 0;
+            String abn = attrs.getNamedItem("abnormal").getNodeValue();            
+            abnormal = AbnormalEffect.getByName(abn);
+        }
+        AbnormalEffect special = AbnormalEffect.NULL;
         if (attrs.getNamedItem("special") != null)
         if (attrs.getNamedItem("special") != null)
         {
         {
             String spc = attrs.getNamedItem("special").getNodeValue();
             String spc = attrs.getNamedItem("special").getNodeValue();
-            if (spc.equals("invulnerable")) special = L2Character.SPECIAL_EFFECT_INVULNERABLE;
-            else if (spc.equals("redglow")) special = L2Character.SPECIAL_EFFECT_AIR_STUN;
-            else if (spc.equals("redglow2")) special = L2Character.SPECIAL_EFFECT_AIR_ROOT;
-            else if (spc.equals("baguettesword")) special = L2Character.SPECIAL_EFFECT_BAGUETTE_SWORD;
-            else if (spc.equals("yellowafro")) special = L2Character.SPECIAL_EFFECT_YELLOW_AFFRO;
-            else if (spc.equals("pinkafro")) special = L2Character.SPECIAL_EFFECT_PINK_AFFRO;
-            else if (spc.equals("blackafro")) special = L2Character.SPECIAL_EFFECT_BLACK_AFFRO;
-            else if (spc.equals("unknown8")) special = L2Character.SPECIAL_EFFECT_UNKNOWN8;
-            else if (spc.equals("unknown9")) special = L2Character.SPECIAL_EFFECT_UNKNOWN9;
+            special = AbnormalEffect.getByName(spc);
         }
         }
         float stackOrder = 0;
         float stackOrder = 0;
         String stackType = "none";
         String stackType = "none";

+ 3 - 2
L2_GameServer/java/net/sf/l2j/gameserver/skills/effects/EffectBigHead.java

@@ -15,6 +15,7 @@
 package net.sf.l2j.gameserver.skills.effects;
 package net.sf.l2j.gameserver.skills.effects;
 
 
 import net.sf.l2j.gameserver.model.L2Effect;
 import net.sf.l2j.gameserver.model.L2Effect;
+import net.sf.l2j.gameserver.skills.AbnormalEffect;
 import net.sf.l2j.gameserver.skills.Env;
 import net.sf.l2j.gameserver.skills.Env;
 import net.sf.l2j.gameserver.templates.effects.EffectTemplate;
 import net.sf.l2j.gameserver.templates.effects.EffectTemplate;
 import net.sf.l2j.gameserver.templates.skills.L2EffectType;
 import net.sf.l2j.gameserver.templates.skills.L2EffectType;
@@ -48,7 +49,7 @@ public class EffectBigHead extends L2Effect
 	@Override
 	@Override
 	public boolean onStart()
 	public boolean onStart()
 	{
 	{
-		getEffected().startAbnormalEffect(0x02000);
+		getEffected().startAbnormalEffect(AbnormalEffect.BIG_HEAD);
 		return true;
 		return true;
 	}
 	}
 	
 	
@@ -59,7 +60,7 @@ public class EffectBigHead extends L2Effect
 	@Override
 	@Override
 	public void onExit()
 	public void onExit()
 	{
 	{
-		getEffected().stopAbnormalEffect(0x02000);
+		getEffected().stopAbnormalEffect(AbnormalEffect.BIG_HEAD);
 	}
 	}
 	
 	
 	/**
 	/**

+ 3 - 3
L2_GameServer/java/net/sf/l2j/gameserver/skills/effects/EffectClanGate.java

@@ -16,8 +16,8 @@ package net.sf.l2j.gameserver.skills.effects;
 
 
 import net.sf.l2j.gameserver.model.L2Clan;
 import net.sf.l2j.gameserver.model.L2Clan;
 import net.sf.l2j.gameserver.model.L2Effect;
 import net.sf.l2j.gameserver.model.L2Effect;
-import net.sf.l2j.gameserver.model.actor.L2Character;
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+import net.sf.l2j.gameserver.skills.AbnormalEffect;
 import net.sf.l2j.gameserver.skills.Env;
 import net.sf.l2j.gameserver.skills.Env;
 import net.sf.l2j.gameserver.templates.effects.EffectTemplate;
 import net.sf.l2j.gameserver.templates.effects.EffectTemplate;
 import net.sf.l2j.gameserver.templates.skills.L2EffectType;
 import net.sf.l2j.gameserver.templates.skills.L2EffectType;
@@ -42,7 +42,7 @@ public class EffectClanGate extends L2Effect
 	@Override
 	@Override
 	public boolean onStart()
 	public boolean onStart()
 	{
 	{
-		getEffected().startAbnormalEffect(L2Character.ABNORMAL_EFFECT_MAGIC_CIRCLE);
+		getEffected().startAbnormalEffect(AbnormalEffect.MAGIC_CIRCLE);
 		if (getEffected() instanceof L2PcInstance)
 		if (getEffected() instanceof L2PcInstance)
 		{
 		{
 			L2Clan clan = ((L2PcInstance) getEffected()).getClan();
 			L2Clan clan = ((L2PcInstance) getEffected()).getClan();
@@ -73,7 +73,7 @@ public class EffectClanGate extends L2Effect
 	@Override
 	@Override
 	public void onExit()
 	public void onExit()
 	{
 	{
-		getEffected().stopAbnormalEffect(L2Character.ABNORMAL_EFFECT_MAGIC_CIRCLE);
+		getEffected().stopAbnormalEffect(AbnormalEffect.MAGIC_CIRCLE);
 	}
 	}
 
 
 	/**
 	/**

+ 3 - 3
L2_GameServer/java/net/sf/l2j/gameserver/skills/effects/EffectGrow.java

@@ -15,8 +15,8 @@
 package net.sf.l2j.gameserver.skills.effects;
 package net.sf.l2j.gameserver.skills.effects;
 
 
 import net.sf.l2j.gameserver.model.L2Effect;
 import net.sf.l2j.gameserver.model.L2Effect;
-import net.sf.l2j.gameserver.model.actor.L2Character;
 import net.sf.l2j.gameserver.model.actor.L2Npc;
 import net.sf.l2j.gameserver.model.actor.L2Npc;
+import net.sf.l2j.gameserver.skills.AbnormalEffect;
 import net.sf.l2j.gameserver.skills.Env;
 import net.sf.l2j.gameserver.skills.Env;
 import net.sf.l2j.gameserver.templates.effects.EffectTemplate;
 import net.sf.l2j.gameserver.templates.effects.EffectTemplate;
 import net.sf.l2j.gameserver.templates.skills.L2EffectType;
 import net.sf.l2j.gameserver.templates.skills.L2EffectType;
@@ -53,7 +53,7 @@ public class EffectGrow extends L2Effect
 			//npc.setCollisionHeight((int) (npc.getCollisionHeight() * 1.24));
 			//npc.setCollisionHeight((int) (npc.getCollisionHeight() * 1.24));
 			npc.setCollisionRadius((int) (npc.getCollisionRadius() * 1.19));
 			npc.setCollisionRadius((int) (npc.getCollisionRadius() * 1.19));
 			
 			
-			getEffected().startAbnormalEffect(L2Character.ABNORMAL_EFFECT_GROW);
+			getEffected().startAbnormalEffect(AbnormalEffect.GROW);
 			return true;
 			return true;
 		}
 		}
 		return false;
 		return false;
@@ -83,7 +83,7 @@ public class EffectGrow extends L2Effect
 			//npc.setCollisionHeight(npc.getTemplate().collisionHeight);
 			//npc.setCollisionHeight(npc.getTemplate().collisionHeight);
 			npc.setCollisionRadius(npc.getTemplate().collisionRadius);
 			npc.setCollisionRadius(npc.getTemplate().collisionRadius);
 			
 			
-			getEffected().stopAbnormalEffect(L2Character.ABNORMAL_EFFECT_GROW);
+			getEffected().stopAbnormalEffect(AbnormalEffect.GROW);
 		}
 		}
 	}
 	}
 }
 }

+ 3 - 2
L2_GameServer/java/net/sf/l2j/gameserver/skills/effects/EffectHide.java

@@ -20,6 +20,7 @@ import net.sf.l2j.gameserver.model.actor.L2Character;
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
 import net.sf.l2j.gameserver.network.serverpackets.DeleteObject;
 import net.sf.l2j.gameserver.network.serverpackets.DeleteObject;
 import net.sf.l2j.gameserver.network.serverpackets.L2GameServerPacket;
 import net.sf.l2j.gameserver.network.serverpackets.L2GameServerPacket;
+import net.sf.l2j.gameserver.skills.AbnormalEffect;
 import net.sf.l2j.gameserver.skills.Env;
 import net.sf.l2j.gameserver.skills.Env;
 import net.sf.l2j.gameserver.templates.effects.EffectTemplate;
 import net.sf.l2j.gameserver.templates.effects.EffectTemplate;
 import net.sf.l2j.gameserver.templates.skills.L2EffectType;
 import net.sf.l2j.gameserver.templates.skills.L2EffectType;
@@ -62,7 +63,7 @@ public class EffectHide extends L2Effect
 		{
 		{
 			L2PcInstance activeChar = ((L2PcInstance) getEffected());
 			L2PcInstance activeChar = ((L2PcInstance) getEffected());
 			activeChar.getAppearance().setInvisible();
 			activeChar.getAppearance().setInvisible();
-			activeChar.startAbnormalEffect(L2Character.ABNORMAL_EFFECT_STEALTH);
+			activeChar.startAbnormalEffect(AbnormalEffect.STEALTH);
 
 
 			if (activeChar.getAI().getNextIntention() != null
 			if (activeChar.getAI().getNextIntention() != null
 					&& activeChar.getAI().getNextIntention().getCtrlIntention() == CtrlIntention.AI_INTENTION_ATTACK)
 					&& activeChar.getAI().getNextIntention().getCtrlIntention() == CtrlIntention.AI_INTENTION_ATTACK)
@@ -103,7 +104,7 @@ public class EffectHide extends L2Effect
 		{
 		{
 			L2PcInstance activeChar = ((L2PcInstance) getEffected());
 			L2PcInstance activeChar = ((L2PcInstance) getEffected());
 			activeChar.getAppearance().setVisible();
 			activeChar.getAppearance().setVisible();
-			activeChar.stopAbnormalEffect(L2Character.ABNORMAL_EFFECT_STEALTH);
+			activeChar.stopAbnormalEffect(AbnormalEffect.STEALTH);
 		}
 		}
 	}
 	}
 
 

+ 3 - 3
L2_GameServer/java/net/sf/l2j/gameserver/skills/effects/EffectParalyze.java

@@ -15,7 +15,7 @@
 package net.sf.l2j.gameserver.skills.effects;
 package net.sf.l2j.gameserver.skills.effects;
 
 
 import net.sf.l2j.gameserver.model.L2Effect;
 import net.sf.l2j.gameserver.model.L2Effect;
-import net.sf.l2j.gameserver.model.actor.L2Character;
+import net.sf.l2j.gameserver.skills.AbnormalEffect;
 import net.sf.l2j.gameserver.skills.Env;
 import net.sf.l2j.gameserver.skills.Env;
 import net.sf.l2j.gameserver.templates.effects.EffectTemplate;
 import net.sf.l2j.gameserver.templates.effects.EffectTemplate;
 import net.sf.l2j.gameserver.templates.skills.L2EffectType;
 import net.sf.l2j.gameserver.templates.skills.L2EffectType;
@@ -44,7 +44,7 @@ public class EffectParalyze extends L2Effect
 	@Override
 	@Override
 	public boolean onStart()
 	public boolean onStart()
 	{
 	{
-		getEffected().startAbnormalEffect(L2Character.ABNORMAL_EFFECT_HOLD_1);
+		getEffected().startAbnormalEffect(AbnormalEffect.HOLD_1);
 		getEffected().startParalyze();
 		getEffected().startParalyze();
 		return true;
 		return true;
 	}
 	}
@@ -56,7 +56,7 @@ public class EffectParalyze extends L2Effect
 	@Override
 	@Override
 	public void onExit()
 	public void onExit()
 	{
 	{
-		getEffected().stopAbnormalEffect(L2Character.ABNORMAL_EFFECT_HOLD_1);
+		getEffected().stopAbnormalEffect(AbnormalEffect.HOLD_1);
 		getEffected().stopParalyze(this);
 		getEffected().stopParalyze(this);
 	}
 	}
 	
 	

+ 3 - 3
L2_GameServer/java/net/sf/l2j/gameserver/skills/effects/EffectPetrification.java

@@ -16,7 +16,7 @@
 package net.sf.l2j.gameserver.skills.effects;
 package net.sf.l2j.gameserver.skills.effects;
 
 
 import net.sf.l2j.gameserver.model.L2Effect;
 import net.sf.l2j.gameserver.model.L2Effect;
-import net.sf.l2j.gameserver.model.actor.L2Character;
+import net.sf.l2j.gameserver.skills.AbnormalEffect;
 import net.sf.l2j.gameserver.skills.Env;
 import net.sf.l2j.gameserver.skills.Env;
 import net.sf.l2j.gameserver.templates.effects.EffectTemplate;
 import net.sf.l2j.gameserver.templates.effects.EffectTemplate;
 import net.sf.l2j.gameserver.templates.skills.L2EffectType;
 import net.sf.l2j.gameserver.templates.skills.L2EffectType;
@@ -45,7 +45,7 @@ public class EffectPetrification extends L2Effect
 	@Override
 	@Override
 	public boolean onStart()
 	public boolean onStart()
 	{
 	{
-		getEffected().startAbnormalEffect(L2Character.ABNORMAL_EFFECT_HOLD_2);
+		getEffected().startAbnormalEffect(AbnormalEffect.HOLD_2);
 		getEffected().startParalyze();
 		getEffected().startParalyze();
 		getEffected().setIsInvul(true);
 		getEffected().setIsInvul(true);
 		return true;
 		return true;
@@ -58,7 +58,7 @@ public class EffectPetrification extends L2Effect
 	@Override
 	@Override
 	public void onExit()
 	public void onExit()
 	{
 	{
-		getEffected().stopAbnormalEffect(L2Character.ABNORMAL_EFFECT_HOLD_2);
+		getEffected().stopAbnormalEffect(AbnormalEffect.HOLD_2);
 		getEffected().stopParalyze(this);
 		getEffected().stopParalyze(this);
 		getEffected().setIsInvul(false);
 		getEffected().setIsInvul(false);
 	}
 	}

+ 4 - 3
L2_GameServer/java/net/sf/l2j/gameserver/templates/effects/EffectTemplate.java

@@ -20,6 +20,7 @@ import java.util.logging.Logger;
 
 
 import net.sf.l2j.gameserver.model.ChanceCondition;
 import net.sf.l2j.gameserver.model.ChanceCondition;
 import net.sf.l2j.gameserver.model.L2Effect;
 import net.sf.l2j.gameserver.model.L2Effect;
+import net.sf.l2j.gameserver.skills.AbnormalEffect;
 import net.sf.l2j.gameserver.skills.Env;
 import net.sf.l2j.gameserver.skills.Env;
 import net.sf.l2j.gameserver.skills.conditions.Condition;
 import net.sf.l2j.gameserver.skills.conditions.Condition;
 import net.sf.l2j.gameserver.skills.funcs.FuncTemplate;
 import net.sf.l2j.gameserver.skills.funcs.FuncTemplate;
@@ -42,8 +43,8 @@ public class EffectTemplate
 	public final Lambda lambda;
 	public final Lambda lambda;
 	public final int counter;
 	public final int counter;
 	public final int period; // in seconds
 	public final int period; // in seconds
-	public final int abnormalEffect;
-	public final int specialEffect;
+	public final AbnormalEffect abnormalEffect;
+	public final AbnormalEffect specialEffect;
 	public FuncTemplate[] funcTemplates;
 	public FuncTemplate[] funcTemplates;
 	public final String stackType;
 	public final String stackType;
 	public final float stackOrder;
 	public final float stackOrder;
@@ -57,7 +58,7 @@ public class EffectTemplate
     public final ChanceCondition chanceCondition;
     public final ChanceCondition chanceCondition;
 	
 	
 	public EffectTemplate(Condition pAttachCond, Condition pApplayCond, String func, Lambda pLambda, 
 	public EffectTemplate(Condition pAttachCond, Condition pApplayCond, String func, Lambda pLambda, 
-			int pCounter, int pPeriod, int pAbnormalEffect, int pSpecialEffect, String pStackType, float pStackOrder, boolean showicon,
+			int pCounter, int pPeriod, AbnormalEffect pAbnormalEffect, AbnormalEffect pSpecialEffect, String pStackType, float pStackOrder, boolean showicon,
 			double ePower, L2SkillType eType, int trigId, int trigLvl, ChanceCondition chanceCond)
 			double ePower, L2SkillType eType, int trigId, int trigLvl, ChanceCondition chanceCond)
 	{
 	{
 		attachCond = pAttachCond;
 		attachCond = pAttachCond;