And where to put it because i am new and i don't know how to put it so please can someone help me and adapt?
-import java.util.Vector;
+import javolution.util.FastMap;
import net.sf.l2j.Config;
import net.sf.l2j.gameserver.ThreadPoolManager;
@@ -52,7 +52,7 @@
// Get skill power (which is used as baseRate).
final double skillPower = skill.getPower();
- Vector<L2Skill> cancelledBuffs = new Vector<>();
+ FastMap<L2Skill, int[]> cancelledBuffs = new FastMap<>();
for (L2Object obj : targets)
{
@@ -108,9 +108,9 @@
// Stores the last canceled skill for further use.
lastCanceledSkillId = effect.getSkill().getId();
- if (!cancelledBuffs.contains(effect.getSkill()))
+ if (!cancelledBuffs.containsKey(effect.getSkill()))
{
- cancelledBuffs.add(effect.getSkill());
+ cancelledBuffs.put(effect.getSkill(), new int[] { effect.getCount(), effect.getTime() });
}
// Exit the effect.
and
package net.sf.l2j.gameserver.model.entity.custom;
-import java.util.Vector;
+import javolution.util.FastMap;
+import net.sf.l2j.gameserver.model.L2Effect;
import net.sf.l2j.gameserver.model.L2Skill;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+import net.sf.l2j.gameserver.skills.Env;
+import net.sf.l2j.gameserver.skills.effects.EffectTemplate;
/**
* @author Anarchy
@@ -26,9 +29,9 @@
public class CustomCancelTask implements Runnable
{
private L2PcInstance _player = null;
- private Vector<L2Skill> _buffs = null;
+ private FastMap<L2Skill, int[]> _buffs = null;
- public CustomCancelTask(L2PcInstance _player, Vector<L2Skill> _buffs)
+ public CustomCancelTask(L2PcInstance _player, FastMap<L2Skill, int[]> _buffs)
{
this._player = _player;
this._buffs = _buffs;
@@ -42,7 +45,7 @@
return;
}
- for (L2Skill s : _buffs)
+ for (L2Skill s : _buffs.keySet())
{
if (s == null)
{
@@ -49,7 +52,21 @@
continue;
}
- s.getEffects(_player, _player);
+ Env env = new Env();
+ env.player = _player;
+ env.target = _player;
+ env.skill = s;
+ L2Effect ef;
+ for (EffectTemplate et : s.getEffectTemplates())
+ {
+ ef = et.getEffect(env);
+ if (ef != null)
+ {
+ ef.setCount(_buffs.get(s)[0]);
+ ef.setFirstTime(_buffs.get(s)[1]);
+ ef.scheduleEffect();
+ }
+ }
}
}
}
\ No newline at end of file
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Dear players,
19.04 at 06:00 server time, the Airin server will be updated to Chronicle 2.
- The x2 updater will be disabled on April 18, 2025, at 23:59 and will become available again during the update.
- Server rates will be increased to x2.25;
- The siege of Innadril will take place on April 27 at 16:00 server time;
- Bonus Start will begin after the restart! Characters created after April 16, 00:00 will receive rewards.
You can download the full client for Airin C2 from the following link. Do not run the updater until tomorrow's update.
Be careful who you're buying interfaces from. Always do your research especially if someone randomly DMs you trying to sell shared stuff. You'll thank me later.
Question
`Sapphire
Can someone adapt this code for l2reunion?
And where to put it because i am new and i don't know how to put it so please can someone help me and adapt?
and
or check the topic
here the link
http://www.maxcheate...r-cancellation/
and i am sorry for my bad english
and i can't speak english im using google translate
please help
thanks.
10 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.