Browse Source

BETA: Fixed a bug where skills vs `L2DoorInstance` and `L2SiegeFlagInstance` were doing nothing while only continuous skills should not be applied on them.

Nos 11 years ago
parent
commit
1cd84eca3c

+ 2 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/L2Skill.java

@@ -47,7 +47,6 @@ import com.l2jserver.gameserver.model.actor.L2Playable;
 import com.l2jserver.gameserver.model.actor.L2Summon;
 import com.l2jserver.gameserver.model.actor.L2Summon;
 import com.l2jserver.gameserver.model.actor.instance.L2CubicInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2CubicInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.model.actor.instance.L2SiegeFlagInstance;
 import com.l2jserver.gameserver.model.conditions.Condition;
 import com.l2jserver.gameserver.model.conditions.Condition;
 import com.l2jserver.gameserver.model.effects.AbstractEffect;
 import com.l2jserver.gameserver.model.effects.AbstractEffect;
 import com.l2jserver.gameserver.model.effects.L2EffectType;
 import com.l2jserver.gameserver.model.effects.L2EffectType;
@@ -1361,8 +1360,8 @@ public abstract class L2Skill implements IChanceSkillTrigger, IIdentifiable
 	 */
 	 */
 	public void applyEffects(L2Character effector, L2CubicInstance cubic, L2Character effected, boolean self, boolean passive, boolean instant, int abnormalTime)
 	public void applyEffects(L2Character effector, L2CubicInstance cubic, L2Character effected, boolean self, boolean passive, boolean instant, int abnormalTime)
 	{
 	{
-		// Null targets, doors and siege flags cannot receive any effects.
-		if ((effected == null) || effected.isDoor() || (effected instanceof L2SiegeFlagInstance))
+		// null targets cannot receive any effects.
+		if (effected == null)
 		{
 		{
 			return;
 			return;
 		}
 		}

+ 10 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/model/stats/Formulas.java

@@ -39,6 +39,8 @@ import com.l2jserver.gameserver.model.actor.L2Character;
 import com.l2jserver.gameserver.model.actor.instance.L2CubicInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2CubicInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2PetInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2PetInstance;
+import com.l2jserver.gameserver.model.actor.instance.L2SiegeFlagInstance;
+import com.l2jserver.gameserver.model.actor.instance.L2StaticObjectInstance;
 import com.l2jserver.gameserver.model.effects.L2EffectType;
 import com.l2jserver.gameserver.model.effects.L2EffectType;
 import com.l2jserver.gameserver.model.entity.Castle;
 import com.l2jserver.gameserver.model.entity.Castle;
 import com.l2jserver.gameserver.model.entity.ClanHall;
 import com.l2jserver.gameserver.model.entity.ClanHall;
@@ -1302,10 +1304,16 @@ public final class Formulas
 	 */
 	 */
 	public static boolean calcEffectSuccess(Env env)
 	public static boolean calcEffectSuccess(Env env)
 	{
 	{
-		final L2Character attacker = env.getCharacter();
 		final L2Character target = env.getTarget();
 		final L2Character target = env.getTarget();
-		final L2Skill skill = env.getSkill();
 		
 		
+		// StaticObjects can not receive continuous effects.
+		if (target.isDoor() || (target instanceof L2SiegeFlagInstance) || (target instanceof L2StaticObjectInstance))
+		{
+			return false;
+		}
+		
+		final L2Character attacker = env.getCharacter();
+		final L2Skill skill = env.getSkill();
 		if (skill.isDebuff() && (target.calcStat(Stats.DEBUFF_IMMUNITY, 0, attacker, skill) > 0))
 		if (skill.isDebuff() && (target.calcStat(Stats.DEBUFF_IMMUNITY, 0, attacker, skill) > 0))
 		{
 		{
 			final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_RESISTED_YOUR_S2);
 			final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_RESISTED_YOUR_S2);