All pastes #63582 Raw Edit

Starfleet-01

public text v1 · immutable
#63582 ·published 2006-06-10 08:55 UTC
rendered paste body
Index: C:/Documents and Settings/Rob/workspace/L2J_Core/L2_Gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- C:/Documents and Settings/Rob/workspace/L2J_Core/L2_Gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(revision 12)
+++ C:/Documents and Settings/Rob/workspace/L2J_Core/L2_Gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(working copy)
@@ -5807,7 +5807,17 @@
 				}
 			}
 		}
-		
+        // Check if the skill is defensive
+		if (!skill.isOffensive())
+		{
+			// check if the target is a monster and if force attack is set.. if not then we don't want to cast.
+			if ((target instanceof L2MonsterInstance) && !forceUse)
+			{
+				// send the action failed so that the skill doens't go off.
+				sendPacket (new ActionFailed());
+				return;
+			}
+		}
 		// Check if the skill is Spoil type and if the target isn't already spoiled
 		if (skill.getSkillType() == SkillType.SPOIL)
 		{