blem,gali būt,kad neregistruotiems nerodo..sorry,my fault :) va kodas:
### Eclipse Workspace Patch 1.0
Index: java/net/sf/l2j/gameserver/handler/skillhandlers/Cancel.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/skillhandlers/Cancel.java (revision 1)
+++ java/net/sf/l2j/gameserver/handler/skillhandlers/Cancel.java (working copy)
@@ -14,14 +14,19 @@
*/
package net.sf.l2j.gameserver.handler.skillhandlers;
+import java.util.Vector;
+
import net.sf.l2j.Config;
+import net.sf.l2j.gameserver.ThreadPoolManager;
import net.sf.l2j.gameserver.handler.ISkillHandler;
import net.sf.l2j.gameserver.model.L2Effect;
import net.sf.l2j.gameserver.model.L2Object;
import net.sf.l2j.gameserver.model.L2Skill;
import net.sf.l2j.gameserver.model.ShotType;
import net.sf.l2j.gameserver.model.actor.L2Character;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.skills.Formulas;
+import net.sf.l2j.gameserver.taskmanager.CustomCancelTaskManager;
import net.sf.l2j.gameserver.templates.skills.L2SkillType;
import net.sf.l2j.util.Rnd;
@@ -56,6 +61,8 @@
if (target.isDead())
continue;
+ Vector cancelledBuffs = new Vector<>();
+
int lastCanceledSkillId = 0;
int count = skill.getMaxNegatedEffects();
@@ -98,6 +105,9 @@
// Calculate the success chance following previous variables.
if (calcCancelSuccess(effect.getPeriod(), diffLevel, skillPower, skillVuln, minRate, maxRate))
{
+ if (!cancelledBuffs.contains(effect.getSkill()) && !((L2PcInstance)activeChar).isInOlympiadMode())
+ cancelledBuffs.add(effect.getSkill());
+
// Stores the last canceled skill for further use.
lastCanceledSkillId = effect.getSkill().getId();
@@ -105,6 +115,9 @@
effect.exit();
}
+ if (cancelledBuffs.size() > 0)
+ ThreadPoolManager.getInstance().scheduleGeneral(new CustomCancelTaskManager((L2PcInstance)target, cancelledBuffs), 10*1000);
+
// Remove 1 to the stack of buffs to remove.
count--;
Index: java/net/sf/l2j/gameserver/taskmanager/CustomCancelTaskManager.java
===================================================================
--- java/net/sf/l2j/gameserver/taskmanager/CustomCancelTaskManager.java (revision 0)
+++ java/net/sf/l2j/gameserver/taskmanager/CustomCancelTaskManager.java (working copy)
@@ -0,0 +1,51 @@
+/*
+ * 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 3 of the License, 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, see .
+ */
+package net.sf.l2j.gameserver.taskmanager;
+
+import java.util.Vector;
+
+import net.sf.l2j.gameserver.model.L2Skill;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+
+ /**
+ * @author Anarchy, Bluur
+ *
+ */
+public class CustomCancelTaskManager implements Runnable
+{
+ private L2PcInstance player = null;
+ private Vector buffsCanceled = null;
+
+ public CustomCancelTaskManager(L2PcInstance p, Vector skill)
+ {
+ player = p;
+ buffsCanceled = skill;
+ }
+
+ @Override
+ public void run()
+ {
+ if (player == null)
+ return;
+
+ for (L2Skill skill : buffsCanceled)
+ {
+ if (skill == null)
+ continue;
+
+ skill.getEffects(player, player);
+ }
+ }
+}
\ No newline at end of file
Paskutinį kartą redagavo: 4 Sausio 2015 - 16:48