Переглянути джерело

BETA: Fixing skills like Blinding blow activating their self effects over your target (And all skills that has A3 Operate Type they are self continuous effects!).
* Also fixing wrong animation with trigger skills (Showing that skill is trigger over your target but it was activated on you)
* Reported by: St3eT, Sdw, janiko

Rumen Nikiforov 10 роки тому
батько
коміт
72476671c6

+ 9 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/L2Character.java

@@ -6913,6 +6913,15 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
 					return;
 				}
 				
+				for (L2Object obj : targets)
+				{
+					if ((obj != null) && obj.isCharacter())
+					{
+						target = (L2Character) obj;
+						break;
+					}
+				}
+				
 				if (Config.ALT_VALIDATE_TRIGGER_SKILLS && isPlayable() && (target != null) && target.isPlayable())
 				{
 					final L2PcInstance player = getActingPlayer();

+ 12 - 5
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/Skill.java

@@ -855,7 +855,12 @@ public final class Skill implements IChanceSkillTrigger, IIdentifiable
 	
 	public boolean isContinuous()
 	{
-		return (_operateType != null) && _operateType.isContinuous();
+		return ((_operateType != null) && _operateType.isContinuous()) || isSelfContinuous();
+	}
+	
+	public boolean isSelfContinuous()
+	{
+		return (_operateType != null) && _operateType.isSelfContinuous();
 	}
 	
 	public boolean isChance()
@@ -1363,7 +1368,7 @@ public final class Skill implements IChanceSkillTrigger, IIdentifiable
 		env.setCubic(cubic);
 		env.setTarget(effected);
 		env.setSkill(this);
-		final boolean addContinuousEffects = !passive && (_operateType.isToggle() || (_operateType.isContinuous() && Formulas.calcEffectSuccess(env)));
+		boolean addContinuousEffects = !passive && (_operateType.isToggle() || (_operateType.isContinuous() && Formulas.calcEffectSuccess(env)));
 		if (!self && !passive)
 		{
 			final BuffInfo info = new BuffInfo(env);
@@ -1393,6 +1398,8 @@ public final class Skill implements IChanceSkillTrigger, IIdentifiable
 		
 		if (self)
 		{
+			addContinuousEffects = !passive && (_operateType.isToggle() || ((_operateType.isContinuous() || _operateType.isSelfContinuous()) && Formulas.calcEffectSuccess(env)));
+			
 			env.setTarget(effector);
 			final BuffInfo info = new BuffInfo(env);
 			if (addContinuousEffects && (abnormalTime > 0))
@@ -1404,14 +1411,14 @@ public final class Skill implements IChanceSkillTrigger, IIdentifiable
 			
 			if (addContinuousEffects)
 			{
-				effector.getEffectList().add(info);
+				info.getEffector().getEffectList().add(info);
 			}
 			
 			// Support for buff sharing feature.
 			// Avoiding Servitor Share since it's implementation already "shares" the effect.
-			if (addContinuousEffects && effected.isPlayer() && effected.hasServitor() && isContinuous() && !isDebuff() && (getId() != CommonSkill.SERVITOR_SHARE.getId()))
+			if (addContinuousEffects && info.getEffected().isPlayer() && info.getEffected().hasServitor() && isContinuous() && !isDebuff() && (getId() != CommonSkill.SERVITOR_SHARE.getId()))
 			{
-				applyEffects(effector, effected.getSummon(), false, 0);
+				applyEffects(effector, info.getEffected().getSummon(), false, 0);
 			}
 		}
 		

+ 9 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/SkillOperateType.java

@@ -117,7 +117,6 @@ public enum SkillOperateType
 		switch (this)
 		{
 			case A2:
-			case A3:
 			case A4:
 			case DA2:
 				return true;
@@ -126,6 +125,15 @@ public enum SkillOperateType
 		}
 	}
 	
+	/**
+	 * Verifies if the operative type correspond to a continuous skill.
+	 * @return {@code true} if the operative skill type is continuous, {@code false} otherwise
+	 */
+	public boolean isSelfContinuous()
+	{
+		return (this == A3);
+	}
+	
 	/**
 	 * Verifies if the operative type correspond to a passive skill.
 	 * @return {@code true} if the operative skill type is passive, {@code false} otherwise