Jump to content

Question

Posted (edited)

Hello,

 

I am  using a l2j Freya version.

 

In order to balance, I would like to change my cancel formula to have the SPS/Sorcerer cancellation skill (ID 1056) lands for 100% chance, always. 

At this moment my cancellation skill from magos is failling too much  -> cancel 0 buff

100% land rate and keeping the 5 max negated buffs is my goal.

 

Editing the power, or the magicLvl in the skill.xml do not influence the land rate. (or not enough?) (Tested unsuccesfully with magicLvl 85 and Power 100)

 

I have searched, and i'm a bit confuse between the 2 java files "cancel.java" and "disablers.java"

 

I guess it's somewhere around the NEGATE case in disablers.java.

Have to put a static variable like "landrate = 100".

Not sure at all..

case NEGATE:
				{
					if (Formulas.calcSkillReflect(target, skill) == Formulas.SKILL_REFLECT_SUCCEED)
						target = activeChar;
					
					if (skill.getNegateId().length != 0)
					{
						for (int i = 0; i < skill.getNegateId().length; i++)
						{
							if (skill.getNegateId()[i] != 0)
								target.stopSkillEffects(skill.getNegateId()[i]);
						}
					}
					else if (skill.getNegateAbnormals() != null)
					{
						for (L2Effect effect : target.getAllEffects())
						{
							if (effect == null)
								continue;
							
							for (String negateAbnormalType : skill.getNegateAbnormals().keySet())
							{
								if (negateAbnormalType.equalsIgnoreCase(effect.getAbnormalType()) && skill.getNegateAbnormals().get(negateAbnormalType) >= effect.getAbnormalLvl())
									effect.exit();
							}
						}
					}
					else // all others negate type skills
					{
						int removedBuffs = (skill.getMaxNegatedEffects() > 0) ? 0 : -2;
						
						for (L2SkillType skillType : skill.getNegateStats())
						{
							if (removedBuffs > skill.getMaxNegatedEffects())
								break;
							
							switch(skillType)
							{
								case BUFF:
									int lvlmodifier = 52 + skill.getMagicLevel() * 2;
									if (skill.getMagicLevel() == 12)
										lvlmodifier = (Experience.MAX_LEVEL - 1);
									int landrate = 90;
									if ((target.getLevel() - lvlmodifier) > 0)
										landrate = 90 - 4 * (target.getLevel() - lvlmodifier);
									
									landrate = (int) activeChar.calcStat(Stats.CANCEL_VULN, landrate, target, null);
									
									if (Rnd.get(100) < landrate)
										removedBuffs += negateEffect(target, L2SkillType.BUFF, -1, skill.getMaxNegatedEffects());
									break;
								case HEAL:
									ISkillHandler Healhandler = SkillHandler.getInstance().getSkillHandler(L2SkillType.HEAL);
									if (Healhandler == null)
									{
										_log.severe("Couldn't find skill handler for HEAL.");
										continue;
									}
									L2Character tgts[] = new L2Character[]{target};
									Healhandler.useSkill(activeChar, skill, tgts);
									break;
								default:
									removedBuffs += negateEffect(target, skillType, skill.getNegateLvl(), skill.getMaxNegatedEffects());
									break;
							}//end switch
						}//end for
					}//end else
					
					if (Formulas.calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss))
					{
						skill.getEffects(activeChar, target, new Env(shld, ss, sps, bss));
					}
				}// end case

 

Actually i'm worried cause i dont want to change other cancel buff like Touch of Death or crusher. (physical ones)

 

I can put here the full disablers.java if needed.

 

 

Thx for helping me. 

 

 

EDIT:

Ive found how to do it :

 

 

In fact the cancel system is rly complex. There is loop browsing all your buff and applying the formula. It permits to give you the random buff cancel, not only the last one.

 

It's in handler Cancel.java

So i have added :

Line 92 :

			default:
				minRate = 20;
				maxRate = 50;
				break;

Line 262 :

		if (rate < minRate)
			rate = minRate;
		else if (rate > maxRate)
			rate = maxRate;
		
		
		return Rnd.get(100) < rate;

 

Also in the skill.xml i have change the magicLvl to '99'. This way, the skill land 100% always.

In result, my cancel now remove always the maxnegated, and in random position.

 

 

Edited by somamax

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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
Answer this question...

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

×
×
  • Create New...