Przeglądaj źródła

Fix for CharmOfCourage indefinitely BuffTime

nBd 17 lat temu
rodzic
commit
5415a184e4

+ 0 - 1
L2_GameServer_T1/java/net/sf/l2j/gameserver/handler/itemhandlers/Scrolls.java

@@ -127,7 +127,6 @@ public class Scrolls implements IItemHandler
 	   				return;
       		 	activeChar.broadcastPacket(new MagicSkillUse(playable, playable, 5041, 1, 1, 0));
       		  	useScroll(activeChar, 5041, 1);
-      		  	activeChar.setCharmOfCourage(true);
        	  	}
 	   		else
 	   			activeChar.sendPacket(new SystemMessage(SystemMessageId.INCOMPATIBLE_ITEM_GRADE));

+ 2 - 1
L2_GameServer_T1/java/net/sf/l2j/gameserver/model/L2Effect.java

@@ -83,7 +83,8 @@ public abstract class L2Effect
         INVINCIBLE,
         TRANSFORMATION,
         IMMOBILEUNTILATTACKED,
-        DISARM
+        DISARM,
+        CHARMOFCOURAGE
     }
 
     private static final Func[] _emptyFunctionSet = new Func[0];

+ 69 - 0
L2_GameServer_T1/java/net/sf/l2j/gameserver/skills/effects/EffectCharmOfCourage.java

@@ -0,0 +1,69 @@
+/* This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+package net.sf.l2j.gameserver.skills.effects;
+
+import net.sf.l2j.gameserver.model.L2Effect;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+import net.sf.l2j.gameserver.skills.Env;
+
+/**
+ *
+ * @author nBd
+ */
+public class EffectCharmOfCourage extends L2Effect
+{
+	public EffectCharmOfCourage(Env env, EffectTemplate template)
+	{
+		super(env, template);
+	}
+
+	/**
+	 * @see net.sf.l2j.gameserver.model.L2Effect#getEffectType()
+	 */
+	@Override
+	public EffectType getEffectType()
+	{
+		return EffectType.CHARMOFCOURAGE;
+	}
+	
+	/** Notify started */
+    @Override
+    public void onStart()
+    {
+           if (getEffected() instanceof L2PcInstance)
+                  ((L2PcInstance)getEffected()).setCharmOfCourage(true);
+    }
+    
+    /** Notify exited */
+    @Override
+    public void onExit()
+    {
+    	if (getEffected() instanceof L2PcInstance)
+    		((L2PcInstance)getEffected()).setCharmOfCourage(false);
+    }
+
+	/**
+	 * @see net.sf.l2j.gameserver.model.L2Effect#onActionTime()
+	 */
+	@Override
+	public boolean onActionTime()
+	{
+		return false;
+	}
+	
+}