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

    • Greetings, MaxCheaters community! We are the development team behind projects like AdenLand, Classic GvE, TinyEssence, PvPEssence, and several others. Over the years of managing high-traffic servers, we’ve built our own ecosystem of tools for datapack and client editing, simply because standard software often failed to meet our production needs or was too slow. Today, we are opening access to these professional solutions for our colleagues in the dev scene. You can explore our suite of editors and utilities here: 👉 https://la2.tools/ Why choose our tools? Battle-Tested: This software is used daily to maintain and update our own live projects. Efficiency: Designed to automate routine tasks that usually take hours or even days. Stability: Built to handle complex client/server structures where generic tools often crash. We are ready to provide consultations on integrating these tools into your development workflow to make your process faster and more secure.  
    • There is such a topics based on java html services!
    • L2Elixir – Patch 9 Is Live! Since November 28, when L2Elixir officially opened, we’ve been here consistently and with dedication. We sincerely thank everyone who continues to support this major effort to bring back the true legacy of L2Elixir, even after 18+ years. It truly makes us happy to see many old players reunite, just like in the old days, and enjoy the game the way it was meant to be played: without RMT, without bug abusers, and without “paid” clans/CPs that disappear after a month. We continue with vision, stability, and respect for the community. Wishing everyone to Have fun! Changelogs: 🏆 Olympiad Olympiad every Monday & Friday (last day: Friday). Fixed an issue with wrong Class ID caused by the Class Change service. ⚔️ Territory Wars Territory Wars will now be held every Tuesday to increase PvP activity. 🛡️ Antibot General updates and additional security improvements implemented. 🔧 Items Augmentation & Attribute are now allowed on PvP weapons. Implemented Premium Coupon (15 Days) (currently not available). 🎉 Events An Auto Event will begin early morning (05:00) for NA players. 💻 Client Added EXP zones to the Map → Hunting Zones section. Renamed them to “XP Bonus” so they appear at the top of the list.   Website: https://l2elixir.org/ Discord: https://discord.gg/5ydPHvhbxs
    • I haven't work in Essence but I have transformed mobius projects into fully stable projects, reach out to me in Discord @cerus0130
  • 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..