Browse Source

Fix TriggerSkillByAttack NPE and proper weapon check

Reported by: St3eT
Zealar 10 years ago
parent
commit
05c163252a

+ 6 - 3
L2J_DataPack/dist/game/data/scripts/handlers/effecthandlers/TriggerSkillByAttack.java

@@ -74,7 +74,7 @@ public final class TriggerSkillByAttack extends AbstractEffect
 		
 		
 		if (params.getString("allowWeapons").equalsIgnoreCase("ALL"))
 		if (params.getString("allowWeapons").equalsIgnoreCase("ALL"))
 		{
 		{
-			_allowWeapons = 2097151;
+			_allowWeapons = 0;
 		}
 		}
 		else
 		else
 		{
 		{
@@ -119,9 +119,12 @@ public final class TriggerSkillByAttack extends AbstractEffect
 			return;
 			return;
 		}
 		}
 		
 		
-		if ((event.getAttacker().getActiveWeaponItem().getItemType().mask() & _allowWeapons) == 0)
+		if (_allowWeapons > 0)
 		{
 		{
-			return;
+			if ((event.getAttacker().getActiveWeaponItem() == null) || ((event.getAttacker().getActiveWeaponItem().getItemType().mask() & _allowWeapons) == 0))
+			{
+				return;
+			}
 		}
 		}
 		
 		
 		final Skill triggerSkill = _skill.getSkill();
 		final Skill triggerSkill = _skill.getSkill();