浏览代码

BETA: Fixed '''debuffImmunity''' stat it wasn't being used in calcEffectSuccess formula.

Reported by: facheme
Tested by: St3et
Reviewed by: St3et
Nos 11 年之前
父节点
当前提交
8a0dd234e4
共有 1 个文件被更改,包括 12 次插入2 次删除
  1. 12 2
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/stats/Formulas.java

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

@@ -1305,6 +1305,16 @@ public final class Formulas
 		final L2Character attacker = env.getCharacter();
 		final L2Character target = env.getTarget();
 		final L2Skill skill = env.getSkill();
+		
+		if (skill.isDebuff() && (target.calcStat(Stats.DEBUFF_IMMUNITY, 0, attacker, skill) > 0))
+		{
+			final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_RESISTED_YOUR_S2);
+			sm.addCharName(target);
+			sm.addSkillName(skill);
+			attacker.sendPacket(sm);
+			return false;
+		}
+		
 		final int activateRate = skill.getActivateRate();
 		if ((activateRate == -1) || (skill.getBasicProperty() == BaseStats.NONE))
 		{
@@ -1378,8 +1388,8 @@ public final class Formulas
 		if (finalRate <= Rnd.get(100))
 		{
 			final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_RESISTED_YOUR_S2);
-			sm.addCharName(env.getTarget());
-			sm.addSkillName(env.getSkill());
+			sm.addCharName(target);
+			sm.addSkillName(skill);
 			attacker.sendPacket(sm);
 			return false;
 		}