Browse Source

No more shield block without a shield

Gigiikun 15 years ago
parent
commit
ed4cc22cc2
1 changed files with 5 additions and 2 deletions
  1. 5 2
      L2_GameServer/java/com/l2jserver/gameserver/skills/Formulas.java

+ 5 - 2
L2_GameServer/java/com/l2jserver/gameserver/skills/Formulas.java

@@ -2006,15 +2006,18 @@ public final class Formulas
 		if (skill != null && skill.ignoreShield())
 			return 0;
 
+		L2Weapon shld = target.getSecondaryWeaponItem();
+		if (shld == null || shld.getShieldDefRate() <= 0)
+			return 0;
+
 		double shldRate = target.calcStat(Stats.SHIELD_RATE, 0, attacker, null)
 			* DEXbonus[target.getDEX()];
 		if (shldRate == 0.0)
 			return 0;
+
 		int degreeside = (int) target.calcStat(Stats.SHIELD_DEFENCE_ANGLE, 0, null, null) + 120;
 		if (degreeside < 360 && (!target.isFacing(attacker, degreeside)))
-		{
 			return 0;
-		}
 
 		byte shldSuccess = SHIELD_DEFENSE_FAILED;
 		// if attacker