2
0
Эх сурвалжийг харах

remove some strange stuff.

JIV 15 жил өмнө
parent
commit
55c1f97abb

+ 1 - 3
L2_GameServer/java/com/l2jserver/gameserver/handler/ISkillHandler.java

@@ -14,7 +14,6 @@
  */
 package com.l2jserver.gameserver.handler;
 
-import java.io.IOException;
 import java.util.logging.Logger;
 
 import com.l2jserver.gameserver.model.L2Object;
@@ -38,9 +37,8 @@ public interface ISkillHandler
 	 * @param item
 	 * @param target
 	 * @return count reduction after usage
-	 * @throws IOException
 	 */
-	public void useSkill(L2Character activeChar, L2Skill skill, L2Object[] targets) throws IOException;
+	public void useSkill(L2Character activeChar, L2Skill skill, L2Object[] targets);
 	
 	/**
 	 * this method is called at initialization to register all the item ids automatically

+ 26 - 34
L2_GameServer/java/com/l2jserver/gameserver/templates/item/L2Weapon.java

@@ -14,11 +14,12 @@
  */
 package com.l2jserver.gameserver.templates.item;
 
-import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
+import javolution.util.FastList;
+
 import com.l2jserver.gameserver.datatables.SkillTable;
 import com.l2jserver.gameserver.handler.ISkillHandler;
 import com.l2jserver.gameserver.handler.SkillHandler;
@@ -41,8 +42,6 @@ import com.l2jserver.gameserver.templates.StatsSet;
 import com.l2jserver.gameserver.templates.skills.L2SkillType;
 import com.l2jserver.util.StringUtil;
 
-import javolution.util.FastList;
-
 /**
  * This class is dedicated to the management of weapons.
  *
@@ -419,45 +418,38 @@ public final class L2Weapon extends L2Item
 		if (_skillsOnCast.isOffensive() && !Formulas.calcSkillSuccess(caster, target, _skillsOnCast, shld, false, false, false))
 			return _emptyEffectSet;
 		
-		try
+		// Get the skill handler corresponding to the skill type
+		ISkillHandler handler = SkillHandler.getInstance().getSkillHandler(_skillsOnCast.getSkillType());
+		
+		L2Character[] targets = new L2Character[1];
+		targets[0] = target;
+		
+		// Launch the magic skill and calculate its effects
+		if (handler != null)
+			handler.useSkill(caster, _skillsOnCast, targets);
+		else
+			_skillsOnCast.useSkill(caster, targets);
+		
+		// notify quests of a skill use
+		if (caster instanceof L2PcInstance)
 		{
-			// Get the skill handler corresponding to the skill type
-			ISkillHandler handler = SkillHandler.getInstance().getSkillHandler(_skillsOnCast.getSkillType());
-			
-			L2Character[] targets = new L2Character[1];
-			targets[0] = target;
-			
-			// Launch the magic skill and calculate its effects
-			if (handler != null)
-				handler.useSkill(caster, _skillsOnCast, targets);
-			else
-				_skillsOnCast.useSkill(caster, targets);
-			
-			// notify quests of a skill use
-			if (caster instanceof L2PcInstance)
+			// Mobs in range 1000 see spell
+			Collection<L2Object> objs = caster.getKnownList().getKnownObjects().values();
+			//synchronized (caster.getKnownList().getKnownObjects())
 			{
-				// Mobs in range 1000 see spell
-				Collection<L2Object> objs = caster.getKnownList().getKnownObjects().values();
-				//synchronized (caster.getKnownList().getKnownObjects())
+				for (L2Object spMob : objs)
 				{
-					for (L2Object spMob : objs)
+					if (spMob instanceof L2Npc)
 					{
-						if (spMob instanceof L2Npc)
-						{
-							L2Npc npcMob = (L2Npc) spMob;
-							
-							if (npcMob.getTemplate().getEventQuests(Quest.QuestEventType.ON_SKILL_SEE) != null)
-								for (Quest quest : npcMob.getTemplate().getEventQuests(Quest.QuestEventType.ON_SKILL_SEE))
-									quest.notifySkillSee(npcMob, (L2PcInstance) caster, _skillsOnCast, targets, false);
-						}
+						L2Npc npcMob = (L2Npc) spMob;
+						
+						if (npcMob.getTemplate().getEventQuests(Quest.QuestEventType.ON_SKILL_SEE) != null)
+							for (Quest quest : npcMob.getTemplate().getEventQuests(Quest.QuestEventType.ON_SKILL_SEE))
+								quest.notifySkillSee(npcMob, (L2PcInstance) caster, _skillsOnCast, targets, false);
 					}
 				}
 			}
 		}
-		catch (IOException e)
-		{
-			e.printStackTrace(); // IO ?!
-		}
 		return _emptyEffectSet;
 	}