Jump to content

Recommended Posts

Posted

Indeed, that's why I was telling not to take only the raw code and apply it, it needs some adapting also.

 

Infact it must be tested anyway

Guest Elfocrash
Posted

raw code?

raw code means FCA4 8CB8 48A8 4ACE 8488 9D48 94C9 464C

Lol raw code means just the code not a patch simple as that.

Sad to see people talking poor English and trying to be smartasses :(

Posted

Hey guys, as i already said in the main topic it can be exploitable, for example, you join a clan and a hero puts valor on you, then you can have it forever, just cancel your character with a bot or something and you get the buff with 1h delay again.

 

But its easy to avoid it, just some modifications(save the buffs in a map, for example, where the key would be the buff and the value would be the time left to be over).

Posted

Lol raw code means just the code not a patch simple as that.

Sad to see people talking poor English and trying to be smartasses :(

 

raw code, binary, octal or hexademical, a code which human brain cant process/understand

 

Raw code, smth which needs process to understood by humans

 

some kind of codes

 

raw codes, readable code

 

I think that java belongs to readable code dont you agree ?

  • 1 month later...
  • 1 month later...
  • 2 months later...
Posted

Getting this error:

    [javac] C:\Users\Domantas\Desktop\eclipse\aCis_300\aCis_gameserver\java\net\sf\l2j\gameserver\handler\skillhandlers\Cancel.java:133: error: cannot find symbol
    [javac]             ThreadPoolManager.getInstance().scheduleGeneral(new CustomCancelTask((L2PcInstance)target, cancelledBuffs), 8*1000);
    [javac]                                                                                                ^
    [javac]   symbol:   variable target
    [javac]   location: class Cancel
    [javac] 1 error

 

What should I do ?

  • 4 weeks later...
  • 2 weeks later...
  • 2 weeks later...
Posted

error on acis.

 

ubercancel.png

 

File CustomCancelTask.java

/*
 * 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 <http://www.gnu.org/licenses/>.
 */
package net.sf.l2j.gameserver.model.entity.custom;

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
 *
 */
public class CustomCancelTask implements Runnable
{
	private L2PcInstance _player = null;
	private FastMap<L2Skill, int[]> _buffs = null;
	
	public CustomCancelTask(L2PcInstance _player, FastMap<L2Skill, int[]> _buffs)
	{
		this._player = _player;
		this._buffs = _buffs;
	}
	
	@Override
	public void run()
	{
		if (_player == null || !_player.isOnline())
		{
			return;
		}
		for (L2Skill s : _buffs.keySet())
		{
			if (s == null)
			{
				continue;
			}
			
             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();
                 }
             }
		}
	}
}

Cancel.java

/*
 * 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 <http://www.gnu.org/licenses/>.
 */
package net.sf.l2j.gameserver.handler.skillhandlers;

import javolution.util.FastMap;
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.model.entity.custom.CustomCancelTask;
import net.sf.l2j.gameserver.skills.Formulas;
import net.sf.l2j.gameserver.templates.skills.L2SkillType;
import net.sf.l2j.util.Rnd;

/**
 * @author DS
 */
public class Cancel implements ISkillHandler
{
	private static final L2SkillType[] SKILL_IDS =
	{
		L2SkillType.CANCEL,
		L2SkillType.MAGE_BANE,
		L2SkillType.WARRIOR_BANE
	};
	
	@Override
	public void useSkill(L2Character activeChar, L2Skill skill, L2Object[] targets)
	{
		// Delimit min/max % success.
		final int minRate = (skill.getSkillType() == L2SkillType.CANCEL) ? 25 : 40;
		final int maxRate = (skill.getSkillType() == L2SkillType.CANCEL) ? 75 : 95;
		
		// Get skill power (which is used as baseRate).
		final double skillPower = skill.getPower();
		
		for (L2Object obj : targets)
		{
			if (!(obj instanceof L2Character))
				continue;
			
			final L2Character target = (L2Character) obj;
			if (target.isDead())
				continue;
			
			FastMap<L2Skill, int[]> cancelledBuffs = new FastMap<>();
			
			int lastCanceledSkillId = 0;
			int count = skill.getMaxNegatedEffects();
			
			if (!cancelledBuffs.containsKey(effect.getSkill()))
			{
				cancelledBuffs.put(effect.getSkill(), new int[] { effect.getCount(), effect.getTime() });
			}
			
			// Calculate the difference of level between skill level and victim, and retrieve the vuln/prof.
			final int diffLevel = skill.getMagicLevel() - target.getLevel();
			final double skillVuln = Formulas.calcSkillVulnerability(activeChar, target, skill, skill.getSkillType());
			
			for (L2Effect effect : target.getAllEffects())
			{
				// Don't cancel null effects or toggles.
				if (effect == null || effect.getSkill().isToggle())
					continue;
				
				// Mage && Warrior Bane drop only particular stacktypes.
				switch (skill.getSkillType())
				{
					case MAGE_BANE:
						if ("casting_time_down".equalsIgnoreCase(effect.getStackType()))
							break;
						
						if ("ma_up".equalsIgnoreCase(effect.getStackType()))
							break;
						
						continue;
						
					case WARRIOR_BANE:
						if ("attack_time_down".equalsIgnoreCase(effect.getStackType()))
							break;
						
						if ("speed_up".equalsIgnoreCase(effect.getStackType()))
							break;
						
						continue;
				}
				
				// If that skill effect was already canceled, continue.
				if (effect.getSkill().getId() == lastCanceledSkillId)
					continue;
				
				// Calculate the success chance following previous variables.
				if (calcCancelSuccess(effect.getPeriod(), diffLevel, skillPower, skillVuln, minRate, maxRate))
				{
					// Stores the last canceled skill for further use.
					lastCanceledSkillId = effect.getSkill().getId();
					
					if (cancelledBuffs.size() > 0)
					{
						ThreadPoolManager.getInstance().scheduleGeneral(new CustomCancelTask((L2PcInstance)target, cancelledBuffs), 5*1000);
					}
					
					// Exit the effect.
					effect.exit();
				}
				
				// Remove 1 to the stack of buffs to remove.
				count--;
				
				// If the stack goes to 0, then break the loop.
				if (count == 0)
					break;
			}
			
			// Possibility of a lethal strike
			Formulas.calcLethalHit(activeChar, target, skill);
		}
		
		if (skill.hasSelfEffects())
		{
			final L2Effect effect = activeChar.getFirstEffect(skill.getId());
			if (effect != null && effect.isSelfEffect())
				effect.exit();
			
			skill.getEffectsSelf(activeChar);
		}
		activeChar.setChargedShot(activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOT) ? ShotType.BLESSED_SPIRITSHOT : ShotType.SPIRITSHOT, skill.isStaticReuse());
	}
	
	private static boolean calcCancelSuccess(int effectPeriod, int diffLevel, double baseRate, double vuln, int minRate, int maxRate)
	{
		double rate = (2 * diffLevel + baseRate + effectPeriod / 120) * vuln;
		
		if (Config.DEVELOPER)
			_log.info("calcCancelSuccess(): diffLevel:" + diffLevel + ", baseRate:" + baseRate + ", vuln:" + vuln + ", total:" + rate);
		
		if (rate < minRate)
			rate = minRate;
		else if (rate > maxRate)
			rate = maxRate;
		
		return Rnd.get(100) < rate;
	}
	
	@Override
	public L2SkillType[] getSkillIds()
	{
		return SKILL_IDS;
	}
}
  • 5 months later...
  • 3 months later...

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..