Target door skill condition.

This commit is contained in:
MobiusDev
2017-04-14 15:42:43 +00:00
parent 4e0d3100be
commit e2b465cdfd
14 changed files with 580 additions and 0 deletions

View File

@@ -70,6 +70,7 @@ public class SkillConditionMasterHandler
SkillConditionHandler.getInstance().registerHandler("CanUntransform", CanUntransformSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("BuildAdvanceBase", BuildAdvanceBaseSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("CanTransformInDominion", CanTransformInDominionSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpTargetDoor", OpTargetDoorSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpTargetNpc", OpTargetNpcSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpHaveSummon", OpHaveSummonSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpNotInstantzone", OpNotInstantzoneSkillCondition::new);

View File

@@ -0,0 +1,44 @@
/*
* This file is part of the L2J Mobius project.
*
* 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 handlers.skillconditionhandlers;
import java.util.List;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.skills.ISkillCondition;
import com.l2jmobius.gameserver.model.skills.Skill;
/**
* @author Mobius
*/
public class OpTargetDoorSkillCondition implements ISkillCondition
{
private final List<Integer> _doorIds;
public OpTargetDoorSkillCondition(StatsSet params)
{
_doorIds = params.getList("doorIds", Integer.class);
}
@Override
public boolean canUse(L2Character caster, Skill skill, L2Object target)
{
return (target != null) && target.isDoor() && _doorIds.contains(target.getId());
}
}