Jump to content
  • 0

Question

Posted

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?

-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

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

  • 0
Posted

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?

-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

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.

with this code buffs give back and in olympiad not only in pvp i have tested

  • 0
Posted

bump

for adapt correct 1 code must have the pack of you want to adapt. and havent all the l2jreunion pack for help you. so add the code, change the imports and if you have errors post here.

  • 0
Posted

for adapt correct 1 code must have the pack of you want to adapt. and havent all the l2jreunion pack for help you. so add the code, change the imports and if you have errors post here.

i don't know how to change the imports and adapt :( i'm so new and n00b

 

if you want to download the l2r pack you can download it here

 

 

DOWNLOAD LINK

Rar Password : www.l2reunion.eu

 

or go there and download it IF YOU WANT :(

 

and thank you for your reply

  • 0
Posted

i don't know how to change the imports and adapt :( i'm so new and n00b

 

if you want to download the l2r pack you can download it here

 

 

or go there and download it IF YOU WANT :(

 

and thank you for your reply

ok listen me. 1st of all you must learn how add java codes.read any guide for uderstund how it works. 2nd  the import is this:  

 

import net.sf.l2j.gameserver.model.L2Effect . (interlude)

 

 

import com.l2jserver.gameserver. blabla  (l2jfreya)

 

so if you want to adapt the imports from interlude to freya you must change to this:

 

import com.l2jserver.gameserver.model.L2Effect

 

so read guides how add java codes, if you read guides you understund me what i say before. so if you uderstund me you can adapt the code. i cant give you the code adapted cuz i must download the pack and bla bla...and i havent the time. after you must learn how add java codes. good luck from me :)

  • 0
Posted

Will i tried to adapt the imports and i failed, i told you i don't know how to adapt

 

JzjtFnK.png

man listen me. with these errors in console you have alot of errors in eclipse. you have forgot alot of ; and } go to fix this and read guides about coding. i havent the time for download pack import in eclipse and alot of work and i havent the time. read guides how add java codes and check your errors in eclipse i think you have alot of errors

  • 0
Posted

Can someone adapt it or give me tutorials how to adapt i searched everywhere and i didn't find any thing!

 

my request is it hard or what? just give the tutorial how to adapt  or the easy way: adapt it for me xD

 

please :((

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • "I recently purchased the account panel from this developer and wanted to leave a positive review.   The transaction was smooth, and the developer demonstrated exceptional professionalism throughout the process.   What truly sets them apart is their outstanding post-sale support. They are responsive, patient, and genuinely helpful when addressing questions or issues. It's clear they care about their customers' experience beyond just the initial sale.   I am thoroughly satisfied and grateful for the service. This is a trustworthy seller who provides real value through both a quality product and reliable support. 100% recommended."
    • Server owners, Top.MaxCheaters.com is now live and accepting Lineage 2 server listings. There is no voting, no rankings manipulation, and no paid advantages. Visibility is clean and equal, and early listings naturally appear at the top while the platform grows. If your server is active, it should already be listed. Submit here https://Top.MaxCheaters.com This platform is part of the MaxCheaters.com network and is being built as a long-term reference point for the Lineage 2 community. — MaxCheaters.com Team
    • ⚙️ General Changed “No Carrier” title to “Disconnected” to avoid confusion after abnormal DC. On-screen Clan War kill notifications will no longer appear during Sieges, Epics, or Events. Bladedancer or SwordSinger classes can now log in even when Max Clients (2) is reached, you cannot have both at the same time. The max is 3 clients. Duels will now be aborted if a monster aggros players during a duel (retail-like behavior). Players can no longer send party requests to blocked players (retail-like). Fixed Researcher Euclie NPC dialogue HTML error. Changed Clan leave/kick penalty from 12 hours to 3 hours. 🧙 Skills Adjusted Decrease Atk. Spd. & Decrease Speed land rates in Varka & FoG. Fixed augmented weapons not getting cooldown when entering Olympiad. 🎉 Events New Team vs Team map added. New Save the King map added (old TvT map). Mounts disabled during Events. Letter Collector Event enabled Monsters drop letters until Feb. 13th Louie the Cat in Giran until Feb. 16th Inventory slots +10 during event period 📜 Quests Fixed “Possessor of a Precious Soul Part 1” rare stuck issue when exceeding max quest items. Fixed Seven Signs applying Strife buff/debuff every Monday until restart. 🏆 Milestones New milestone: “Defeat 700 Monsters in Varka” 🎁 Rewards: 200 Varka’s Mane + Daily Coin 🌍 NEW EXP Bonus Zones Hot Springs added Varka Silenos added (hidden spots excluded) As always, thank you for your support! L2Elixir keeps evolving, improving, and growing every day 💙   Website: https://l2elixir.org/ Discord: https://discord.gg/5ydPHvhbxs
    • https://sms.pro/ — we are an SMS activation platform  seeking partners  mobile number providers  mobile number owners  owners of GSM modems  SIM card owners We process 1,000,000 activations every day.  寻找合作伙伴  手机号码提供商  手机号码持有者  GSM调制解调器持有者  SIM卡持有者 我们每天处理1,000,000次激活。  Ищем партнеров  Владельцы сим карт  провайдеров  владельцев мобильных номеров  владельцев модемов  Обрабатываем от 1 000 000 активаций в день ⚡️ Fast. Reliable.   https://sms.pro/ Support: https://t.me/alismsorg_bot
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..