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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




  • Posts

    • 🍂 The cost on Vibe-sms is dropping, like autumn leaves falling from the trees.     It’s a little sad to watch the last days of summer fade away with its warmth, but that’s how the world works  every season has its own rules. The same goes for our prices: they are gradually but steadily going down, opening up new opportunities and great deals. 💸   🌍 USA is already at the minimum, and Europe, Asia, and dozens of other countries will follow soon. Don’t miss out  fresh rates are waiting for you!   Website link — https://vibe-sms.net/ Our Telegram channel — https://t.me/vibe_sms
    • You didn't tell me anywhere that you wanted core.jar as proof, I have everything ready for an independent developer to review. All the conversations, all your edits. I won't settle anything with you, so you can threaten me again and damage my name.
    • So what? Did i say anything wrong? You have no idea what source/compile is. I still wait for your .jar or source to be posted since you say i destroyed the compiled version of yours. Why you don't post it? Are you afraid that people will just see few addon lines and you did not even know that your source and compiled had different things? I should not even waste 2 minute to fix your raidboss_spawnlist thing.    Your mentally ill. What you posted is our primary deal nothing against me.  Because all he does is post whatever i write as if i hide and i did not say any mod to join and check my discord. i want him actual post something against me or any offenses i did. I also requested him several hours ago to post his .jar where my code "HACKED" his server but he wont post.    Nobody should allow open a random topic and cause issues to other's life without proofs. I demand punishment and soon unless he post evidence that i hurt his server or left him or did not make what he asked. 
    • guys it is probably a misunderstanding if it was windows he would have solve it since its not windows and from the paraphrasing of the developer who eventually fixed the server   the problem was from guessing the login server was not properly opening or already crashed, so the gameserver probably loaded because he was generating logs, and then stopped, my guess is still there was no login to connect and made exits, still this is a guess because i have only saw some logs and images   in one side nobody would destroy a server for this amount of money in the other side he had no experience with the operating system, and i find this logical, i am also still giving some tutorials in the topic owner so he can learn how to compile and not need the help of others, i still believe this can be solved for both parties if they behave   in the end nobody wants to cause bad to another so as i say in my starting point, it is probably a misunderstanding
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock