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.
DISCORD :
utchiha_market
telegram :
https://t.me/utchiha_market
SELLIX STORE :
https://utchihamkt.mysellix.io/
Join our server for more products :
https://discord.gg/hood-services
https://campsite.bio/utchihaamkt
Hello everyone!
I have a problem with editing mobs. I took some Mobs from here without sound and added them,
they looked good !!! BUT BUT !
When I hit him it does generate the effect, but when he hits it it doesn't.
Is this effect controlled from Npcgrp.dat?
PD_ I add capture of the event / effect I mention.
I await your answers, thank you!
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.