فهرست منبع

BETA: Removing duplicated code at L2CubicInstance.

Zoey76 13 سال پیش
والد
کامیت
406519c118
1فایلهای تغییر یافته به همراه5 افزوده شده و 69 حذف شده
  1. 5 69
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2CubicInstance.java

+ 5 - 69
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2CubicInstance.java

@@ -46,7 +46,7 @@ import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse;
 import com.l2jserver.gameserver.taskmanager.AttackStanceTaskManager;
 import com.l2jserver.util.Rnd;
 
-public class L2CubicInstance
+public final class L2CubicInstance
 {
 	protected static final Logger _log = Logger.getLogger(L2CubicInstance.class.getName());
 	
@@ -470,10 +470,9 @@ public class L2CubicInstance
 	{
 		private final int _chance;
 		
-		Action(int chance)
+		protected Action(int chance)
 		{
 			_chance = chance;
-			// run task
 		}
 		
 		@Override
@@ -727,65 +726,6 @@ public class L2CubicInstance
 			
 			switch (type)
 			{
-				case STUN:
-				{
-					if (Formulas.calcCubicSkillSuccess(activeCubic, target, skill, shld))
-					{
-						// if this is a debuff let the duel manager know about it
-						// so the debuff can be removed after the duel
-						// (player & target must be in the same duel)
-						if (target instanceof L2PcInstance
-								&& ((L2PcInstance) target).isInDuel()
-								&& skill.getSkillType() == L2SkillType.DEBUFF
-								&& activeCubic.getOwner().getDuelId() == ((L2PcInstance) target).getDuelId())
-						{
-							DuelManager dm = DuelManager.getInstance();
-							for (L2Effect debuff : skill.getEffects(activeCubic.getOwner(), target))
-								if (debuff != null)
-									dm.onBuff(((L2PcInstance) target), debuff);
-						}
-						else
-							skill.getEffects(activeCubic, target, null);
-						if (Config.DEBUG)
-							_log.info("Disablers: useCubicSkill() -> success");
-					}
-					else
-					{
-						if (Config.DEBUG)
-							_log.info("Disablers: useCubicSkill() -> failed");
-					}
-					break;
-				}
-				case PARALYZE: // use same as root for now
-				{
-					if (Formulas.calcCubicSkillSuccess(activeCubic, target, skill, shld))
-					{
-						// if this is a debuff let the duel manager know about it
-						// so the debuff can be removed after the duel
-						// (player & target must be in the same duel)
-						if (target instanceof L2PcInstance
-								&& ((L2PcInstance) target).isInDuel()
-								&& skill.getSkillType() == L2SkillType.DEBUFF
-								&& activeCubic.getOwner().getDuelId() == ((L2PcInstance) target).getDuelId())
-						{
-							DuelManager dm = DuelManager.getInstance();
-							for (L2Effect debuff : skill.getEffects(activeCubic.getOwner(), target))
-								if (debuff != null)
-									dm.onBuff(((L2PcInstance) target), debuff);
-						}
-						else
-							skill.getEffects(activeCubic, target, null);
-						
-						if (Config.DEBUG)
-							_log.info("Disablers: useCubicSkill() -> success");
-					}
-					else
-					{
-						if (Config.DEBUG)
-							_log.info("Disablers: useCubicSkill() -> failed");
-					}
-					break;
-				}
 				case CANCEL_DEBUFF:
 				{
 					L2Effect[] effects = target.getAllEffects();
@@ -811,6 +751,8 @@ public class L2CubicInstance
 					
 					break;
 				}
+				case STUN:
+				case PARALYZE:
 				case ROOT:
 				{
 					if (Formulas.calcCubicSkillSuccess(activeCubic, target, skill, shld))
@@ -968,14 +910,8 @@ public class L2CubicInstance
 		return _givenByOther;
 	}
 	
-	private class Heal implements Runnable
+	protected class Heal implements Runnable
 	{
-		
-		Heal()
-		{
-			// run task
-		}
-		
 		@Override
 		public void run()
 		{