I do some modifications on EffectCancelDebuff but can't make Cleanse don't remove malaria and flu.
I try to change skills from DeBuff to Buff, but still removing it.
/*
* 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.skills.effects;
import net.sf.l2j.gameserver.model.L2Effect;
import net.sf.l2j.gameserver.model.L2Skill;
import net.sf.l2j.gameserver.model.actor.L2Character;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.skills.Env;
import net.sf.l2j.gameserver.skills.Formulas;
import net.sf.l2j.gameserver.templates.skills.L2EffectType;
import net.sf.l2j.gameserver.templates.skills.L2SkillType;
import net.sf.l2j.util.Rnd;
/**
* @author UnAfraid
*/
public class EffectCancelDebuff extends L2Effect
{
public EffectCancelDebuff(Env env, EffectTemplate template)
{
super(env, template);
}
@Override
public L2EffectType getEffectType()
{
return L2EffectType.CANCEL_DEBUFF;
}
@Override
public boolean onStart()
{
return cancel(getEffector(), getEffected(), getSkill(), getEffectTemplate().effectType);
}
@Override
public boolean onActionTime()
{
return false;
}
private static boolean cancel(L2Character caster, L2Character target, L2Skill skill, L2SkillType effectType)
{
if (!(target instanceof L2PcInstance) || target.isDead())
return false;
final int cancelLvl = skill.getMagicLevel();
int count = skill.getMaxNegatedEffects();
double baseRate = Formulas.calcSkillVulnerability(caster, target, skill, effectType);
L2Effect effect;
int lastCanceledSkillId = 0;
final L2Effect[] effects = target.getAllEffects();
for (int i = effects.length; --i >= 0;)
{
effect = effects[i];
if (effect == null)
continue;
if (!effect.getSkill().isDebuff() || !effect.getSkill().canBeDispeled() || effect.getSkill().getId() != 4554 || effect.getSkill().getId() != 4553)
{
effects[i] = null;
continue;
}
if (effect.getSkill().getId() == lastCanceledSkillId)
{
effect.exit(); // this skill already canceled
continue;
}
if (!calcCancelSuccess(effect, cancelLvl, (int) baseRate))
continue;
lastCanceledSkillId = effect.getSkill().getId();
effect.exit();
count--;
if (count == 0)
break;
}
if (count != 0)
{
lastCanceledSkillId = 0;
for (int i = effects.length; --i >= 0;)
{
effect = effects[i];
if (effect == null)
continue;
if (!effect.getSkill().isDebuff() || !effect.getSkill().canBeDispeled() || effect.getSkill().getId() != 4554 || effect.getSkill().getId() != 4553)
{
effects[i] = null;
continue;
}
if (effect.getSkill().getId() == lastCanceledSkillId)
{
effect.exit(); // this skill already canceled
continue;
}
if (!calcCancelSuccess(effect, cancelLvl, (int) baseRate))
continue;
lastCanceledSkillId = effect.getSkill().getId();
effect.exit();
count--;
if (count == 0)
break;
}
}
return true;
}
private static boolean calcCancelSuccess(L2Effect effect, int cancelLvl, int baseRate)
{
int rate = 2 * (cancelLvl - effect.getSkill().getMagicLevel());
rate += (effect.getPeriod() - effect.getTime()) / 1200;
rate *= baseRate;
if (rate < 25)
rate = 25;
else if (rate > 75)
rate = 75;
return Rnd.get(100) < rate;
}
}
Can you define what you mean custom ?
I haven't look into how the client loads the data in what order and when, but if you give some examples of the files you've reduced that would be helpful.
To add to the topic, the virtual ram critical error that @Exdeathy describes doesn't necessarily mean that you've run out of Virtual Memory. The client tried to allocate a continuous series of N bytes within this Virtual Memory block, but wasn't able to find one. So this error can happen even if your client is using 1000mb and you try to allocate 100mb of continuous memory but there wasn't any.
Hello, as the title says I'm looking for a Java - Server developer to work on an already running server.
If you have the knowledge and you have free time for some extra money let me know in discord.
Discord name : Ugleethyn
hello my friend, it seems from the way you talk how stupid you are and I'm writing it again here so you can understand because you probably haven't understood, I won't tell anyone if he doesn't enter the server to see the work that's been done and then let's talk about what else he wants now if you call what I'm selling trash without going in to see the server, you're probably trying to do something else that won't work for you... because I'm very honest and I don't like people like you I see
let me tell you the price here publicly, just so you don't write to me again about the pack, I'm selling it for 3,000 euros
Question
Miracles
I do some modifications on EffectCancelDebuff but can't make Cleanse don't remove malaria and flu.
I try to change skills from DeBuff to Buff, but still removing it.
Link to comment
Share on other sites
5 answers to this question
Recommended Posts