if (target instanceof L2PcInstance
&& ((L2PcInstance) target).isInDuel()
&& skill.getSkillType() == SkillType.DEBUFF
&& activeCubic.getOwner().getDuelId() == ((L2PcInstance) target).getDuelId())
{
DuelManager dm = DuelManager.getInstance();
for (L2Effect debuff : skill.getEffects(activeCubic.getOwner(), target))
if (debuff != null)
dm.onBuff(((L2PcInstance) target), debuff);
}
else
skill.getEffects(activeCubic.getOwner(), target);
if (Config.DEBUG)
_log.info("Disablers: useCubicSkill() -> success");
}
else
{
if (Config.DEBUG)
_log.info("Disablers: useCubicSkill() -> failed");
}
break;
}
case PARALYZE: // use same as root for now
{
if (Formulas.calcCubicSkillSuccess(activeCubic, target, skill))
{
// if this is a debuff let the duel manager know about it
// so the debuff can be removed after the duel
// (player & target must be in the same duel)
if (target instanceof L2PcInstance
&& ((L2PcInstance) target).isInDuel()
&& skill.getSkillType() == SkillType.DEBUFF
&& activeCubic.getOwner().getDuelId() == ((L2PcInstance) target).getDuelId())
{
DuelManager dm = DuelManager.getInstance();
for (L2Effect debuff : skill.getEffects(activeCubic.getOwner(), target))
if (debuff != null)
dm.onBuff(((L2PcInstance) target), debuff);
}
else
skill.getEffects(activeCubic.getOwner(), target);
if (Config.DEBUG)
_log.info("Disablers: useCubicSkill() -> success");
}
else
{
if (Config.DEBUG)
_log.info("Disablers: useCubicSkill() -> failed");
}
break;
}
case CANCEL:
{
L2Effect[] effects = target.getAllEffects();
if (effects == null || effects.length == 0)
break;
int max_negated_effects = 3;
int count = 0;
for (L2Effect e : effects)
{
if (e.getSkill().isOffensive() && count < max_negated_effects)
{
// Do not remove raid curse skills
if (e.getSkill().getId() != 4215 && e.getSkill().getId() != 4515
&& e.getSkill().getId() != 4082)
{
e.exit(true);
if (count > -1)
count++;
}
}
}
break;
}
case ROOT:
{
if (Formulas.calcCubicSkillSuccess(activeCubic, target, skill))
{
// if this is a debuff let the duel manager know about it
// so the debuff can be removed after the duel
// (player & target must be in the same duel)
if (target instanceof L2PcInstance
&& ((L2PcInstance) target).isInDuel()
&& skill.getSkillType() == SkillType.DEBUFF
&& activeCubic.getOwner().getDuelId() == ((L2PcInstance) target).getDuelId())
{
DuelManager dm = DuelManager.getInstance();
for (L2Effect debuff : skill.getEffects(activeCubic.getOwner(), target))
if (debuff != null)
dm.onBuff(((L2PcInstance) target), debuff);
}
else
skill.getEffects(activeCubic.getOwner(), target);
if (Config.DEBUG)