/*
package handlers.effecthandlers;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.model.skill.Skill;
import org.l2jmobius.gameserver.model.skill.SkillCaster;
import org.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
public class ComboSkill extends AbstractEffect
{
private final SkillHolder _skill;
private final int _checkSkill;
private final int _checkSkill2;
private final String _mode;
public ComboSkill(StatSet params)
{
_skill = new SkillHolder(params.getInt("skillId"), params.getInt("skillLevel", 1), params.getInt("skillSubLevel", 0));
_checkSkill = params.getInt("targetCheckSkillId", 0);
_checkSkill2 = params.getInt("targetCheckSkillId2", 0);
_mode = params.getString("mode", "DUAL");
}
@Override
public boolean isInstant()
{
return true;
}
@Override
public void instant(Creature effector, Creature effected, Skill skill, Item item)
{
final Skill triggerSkill = _skill.getSkill();
switch (_mode)
{
case "DUAL":
{
if (!effected.isAffectedBySkill(_checkSkill))
{
return;
}
break;
}
case "TRIPLE":
{
if (((!effected.isAffectedBySkill(_checkSkill) && !effected.isAffectedBySkill(_checkSkill2))) || (!effected.isAffectedBySkill(_checkSkill) && effected.isAffectedBySkill(_checkSkill2)) || (effected.isAffectedBySkill(_checkSkill) && !effected.isAffectedBySkill(_checkSkill2)))
{
return;
}
break;
}
}
if (triggerSkill != null)
{
// Prevent infinite loop.
if ((skill.getId() == triggerSkill.getId()) && (skill.getLevel() == triggerSkill.getLevel()))
{
return;
}
final int hitTime = triggerSkill.getHitTime();
if (hitTime > 0)
{
if (effector.isSkillDisabled(triggerSkill))
{
return;
}
effector.broadcastPacket(new MagicSkillUse(effector, effected, triggerSkill.getDisplayId(), triggerSkill.getLevel(), hitTime, 0));
ThreadPool.schedule(() -> SkillCaster.triggerCast(effector, effected, triggerSkill), hitTime);
}
else
{
SkillCaster.triggerCast(effector, effected, triggerSkill);
}
}
else
{
LOGGER.warning("Skill not found effect called from " + skill);
}
}
}