diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java index 3cfb00a470..2d5228da66 100644 --- a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java +++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java @@ -63,6 +63,7 @@ public class SkillConditionMasterHandler SkillConditionHandler.getInstance().registerHandler("OpAffectedBySkill", OpAffectedBySkillSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAgathionEnergy", OpAgathionEnergySkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAlignment", OpAlignmentSkillCondition::new); + SkillConditionHandler.getInstance().registerHandler("OpBaseStat", OpBaseStatSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpBlink", OpBlinkSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCallPc", OpCallPcSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCanEscape", OpCanEscapeSkillCondition::new); diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java new file mode 100644 index 0000000000..1d515f6553 --- /dev/null +++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java @@ -0,0 +1,82 @@ +/* + * 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 . + */ +package handlers.skillconditionhandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.skill.ISkillCondition; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.BaseStat; + +/** + * @author Mobius + */ +public class OpBaseStatSkillCondition implements ISkillCondition +{ + private final BaseStat _stat; + private final int _min; + private final int _max; + + public OpBaseStatSkillCondition(StatSet params) + { + _stat = params.getEnum("stat", BaseStat.class); + _min = params.getInt("min", 0); + _max = params.getInt("max", 2147483647); + } + + @Override + public boolean canUse(Creature caster, Skill skill, WorldObject target) + { + int currentValue = 0; + switch (_stat) + { + case STR: + { + currentValue = caster.getSTR(); + break; + } + case INT: + { + currentValue = caster.getINT(); + break; + } + case DEX: + { + currentValue = caster.getDEX(); + break; + } + case WIT: + { + currentValue = caster.getWIT(); + break; + } + case CON: + { + currentValue = caster.getCON(); + break; + } + case MEN: + { + currentValue = caster.getMEN(); + break; + } + } + + return (currentValue >= _min) && (currentValue <= _max); + } +} diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java index 3cfb00a470..2d5228da66 100644 --- a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java +++ b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java @@ -63,6 +63,7 @@ public class SkillConditionMasterHandler SkillConditionHandler.getInstance().registerHandler("OpAffectedBySkill", OpAffectedBySkillSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAgathionEnergy", OpAgathionEnergySkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAlignment", OpAlignmentSkillCondition::new); + SkillConditionHandler.getInstance().registerHandler("OpBaseStat", OpBaseStatSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpBlink", OpBlinkSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCallPc", OpCallPcSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCanEscape", OpCanEscapeSkillCondition::new); diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java new file mode 100644 index 0000000000..1d515f6553 --- /dev/null +++ b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java @@ -0,0 +1,82 @@ +/* + * 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 . + */ +package handlers.skillconditionhandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.skill.ISkillCondition; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.BaseStat; + +/** + * @author Mobius + */ +public class OpBaseStatSkillCondition implements ISkillCondition +{ + private final BaseStat _stat; + private final int _min; + private final int _max; + + public OpBaseStatSkillCondition(StatSet params) + { + _stat = params.getEnum("stat", BaseStat.class); + _min = params.getInt("min", 0); + _max = params.getInt("max", 2147483647); + } + + @Override + public boolean canUse(Creature caster, Skill skill, WorldObject target) + { + int currentValue = 0; + switch (_stat) + { + case STR: + { + currentValue = caster.getSTR(); + break; + } + case INT: + { + currentValue = caster.getINT(); + break; + } + case DEX: + { + currentValue = caster.getDEX(); + break; + } + case WIT: + { + currentValue = caster.getWIT(); + break; + } + case CON: + { + currentValue = caster.getCON(); + break; + } + case MEN: + { + currentValue = caster.getMEN(); + break; + } + } + + return (currentValue >= _min) && (currentValue <= _max); + } +} diff --git a/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java b/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java index 3cfb00a470..2d5228da66 100644 --- a/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java +++ b/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java @@ -63,6 +63,7 @@ public class SkillConditionMasterHandler SkillConditionHandler.getInstance().registerHandler("OpAffectedBySkill", OpAffectedBySkillSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAgathionEnergy", OpAgathionEnergySkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAlignment", OpAlignmentSkillCondition::new); + SkillConditionHandler.getInstance().registerHandler("OpBaseStat", OpBaseStatSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpBlink", OpBlinkSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCallPc", OpCallPcSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCanEscape", OpCanEscapeSkillCondition::new); diff --git a/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java b/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java new file mode 100644 index 0000000000..1d515f6553 --- /dev/null +++ b/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java @@ -0,0 +1,82 @@ +/* + * 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 . + */ +package handlers.skillconditionhandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.skill.ISkillCondition; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.BaseStat; + +/** + * @author Mobius + */ +public class OpBaseStatSkillCondition implements ISkillCondition +{ + private final BaseStat _stat; + private final int _min; + private final int _max; + + public OpBaseStatSkillCondition(StatSet params) + { + _stat = params.getEnum("stat", BaseStat.class); + _min = params.getInt("min", 0); + _max = params.getInt("max", 2147483647); + } + + @Override + public boolean canUse(Creature caster, Skill skill, WorldObject target) + { + int currentValue = 0; + switch (_stat) + { + case STR: + { + currentValue = caster.getSTR(); + break; + } + case INT: + { + currentValue = caster.getINT(); + break; + } + case DEX: + { + currentValue = caster.getDEX(); + break; + } + case WIT: + { + currentValue = caster.getWIT(); + break; + } + case CON: + { + currentValue = caster.getCON(); + break; + } + case MEN: + { + currentValue = caster.getMEN(); + break; + } + } + + return (currentValue >= _min) && (currentValue <= _max); + } +} diff --git a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java index f42dbfa991..7525266203 100644 --- a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java +++ b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java @@ -64,6 +64,7 @@ public class SkillConditionMasterHandler SkillConditionHandler.getInstance().registerHandler("OpAffectedBySkill", OpAffectedBySkillSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAgathionEnergy", OpAgathionEnergySkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAlignment", OpAlignmentSkillCondition::new); + SkillConditionHandler.getInstance().registerHandler("OpBaseStat", OpBaseStatSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpBlink", OpBlinkSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCallPc", OpCallPcSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCanEscape", OpCanEscapeSkillCondition::new); diff --git a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java new file mode 100644 index 0000000000..1d515f6553 --- /dev/null +++ b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java @@ -0,0 +1,82 @@ +/* + * 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 . + */ +package handlers.skillconditionhandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.skill.ISkillCondition; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.BaseStat; + +/** + * @author Mobius + */ +public class OpBaseStatSkillCondition implements ISkillCondition +{ + private final BaseStat _stat; + private final int _min; + private final int _max; + + public OpBaseStatSkillCondition(StatSet params) + { + _stat = params.getEnum("stat", BaseStat.class); + _min = params.getInt("min", 0); + _max = params.getInt("max", 2147483647); + } + + @Override + public boolean canUse(Creature caster, Skill skill, WorldObject target) + { + int currentValue = 0; + switch (_stat) + { + case STR: + { + currentValue = caster.getSTR(); + break; + } + case INT: + { + currentValue = caster.getINT(); + break; + } + case DEX: + { + currentValue = caster.getDEX(); + break; + } + case WIT: + { + currentValue = caster.getWIT(); + break; + } + case CON: + { + currentValue = caster.getCON(); + break; + } + case MEN: + { + currentValue = caster.getMEN(); + break; + } + } + + return (currentValue >= _min) && (currentValue <= _max); + } +} diff --git a/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java b/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java index f42dbfa991..7525266203 100644 --- a/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java +++ b/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java @@ -64,6 +64,7 @@ public class SkillConditionMasterHandler SkillConditionHandler.getInstance().registerHandler("OpAffectedBySkill", OpAffectedBySkillSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAgathionEnergy", OpAgathionEnergySkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAlignment", OpAlignmentSkillCondition::new); + SkillConditionHandler.getInstance().registerHandler("OpBaseStat", OpBaseStatSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpBlink", OpBlinkSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCallPc", OpCallPcSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCanEscape", OpCanEscapeSkillCondition::new); diff --git a/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java b/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java new file mode 100644 index 0000000000..1d515f6553 --- /dev/null +++ b/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java @@ -0,0 +1,82 @@ +/* + * 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 . + */ +package handlers.skillconditionhandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.skill.ISkillCondition; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.BaseStat; + +/** + * @author Mobius + */ +public class OpBaseStatSkillCondition implements ISkillCondition +{ + private final BaseStat _stat; + private final int _min; + private final int _max; + + public OpBaseStatSkillCondition(StatSet params) + { + _stat = params.getEnum("stat", BaseStat.class); + _min = params.getInt("min", 0); + _max = params.getInt("max", 2147483647); + } + + @Override + public boolean canUse(Creature caster, Skill skill, WorldObject target) + { + int currentValue = 0; + switch (_stat) + { + case STR: + { + currentValue = caster.getSTR(); + break; + } + case INT: + { + currentValue = caster.getINT(); + break; + } + case DEX: + { + currentValue = caster.getDEX(); + break; + } + case WIT: + { + currentValue = caster.getWIT(); + break; + } + case CON: + { + currentValue = caster.getCON(); + break; + } + case MEN: + { + currentValue = caster.getMEN(); + break; + } + } + + return (currentValue >= _min) && (currentValue <= _max); + } +} diff --git a/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java b/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java index f42dbfa991..7525266203 100644 --- a/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java +++ b/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java @@ -64,6 +64,7 @@ public class SkillConditionMasterHandler SkillConditionHandler.getInstance().registerHandler("OpAffectedBySkill", OpAffectedBySkillSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAgathionEnergy", OpAgathionEnergySkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAlignment", OpAlignmentSkillCondition::new); + SkillConditionHandler.getInstance().registerHandler("OpBaseStat", OpBaseStatSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpBlink", OpBlinkSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCallPc", OpCallPcSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCanEscape", OpCanEscapeSkillCondition::new); diff --git a/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java b/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java new file mode 100644 index 0000000000..1d515f6553 --- /dev/null +++ b/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java @@ -0,0 +1,82 @@ +/* + * 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 . + */ +package handlers.skillconditionhandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.skill.ISkillCondition; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.BaseStat; + +/** + * @author Mobius + */ +public class OpBaseStatSkillCondition implements ISkillCondition +{ + private final BaseStat _stat; + private final int _min; + private final int _max; + + public OpBaseStatSkillCondition(StatSet params) + { + _stat = params.getEnum("stat", BaseStat.class); + _min = params.getInt("min", 0); + _max = params.getInt("max", 2147483647); + } + + @Override + public boolean canUse(Creature caster, Skill skill, WorldObject target) + { + int currentValue = 0; + switch (_stat) + { + case STR: + { + currentValue = caster.getSTR(); + break; + } + case INT: + { + currentValue = caster.getINT(); + break; + } + case DEX: + { + currentValue = caster.getDEX(); + break; + } + case WIT: + { + currentValue = caster.getWIT(); + break; + } + case CON: + { + currentValue = caster.getCON(); + break; + } + case MEN: + { + currentValue = caster.getMEN(); + break; + } + } + + return (currentValue >= _min) && (currentValue <= _max); + } +} diff --git a/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java b/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java index f42dbfa991..7525266203 100644 --- a/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java +++ b/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java @@ -64,6 +64,7 @@ public class SkillConditionMasterHandler SkillConditionHandler.getInstance().registerHandler("OpAffectedBySkill", OpAffectedBySkillSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAgathionEnergy", OpAgathionEnergySkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAlignment", OpAlignmentSkillCondition::new); + SkillConditionHandler.getInstance().registerHandler("OpBaseStat", OpBaseStatSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpBlink", OpBlinkSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCallPc", OpCallPcSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCanEscape", OpCanEscapeSkillCondition::new); diff --git a/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java b/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java new file mode 100644 index 0000000000..1d515f6553 --- /dev/null +++ b/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java @@ -0,0 +1,82 @@ +/* + * 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 . + */ +package handlers.skillconditionhandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.skill.ISkillCondition; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.BaseStat; + +/** + * @author Mobius + */ +public class OpBaseStatSkillCondition implements ISkillCondition +{ + private final BaseStat _stat; + private final int _min; + private final int _max; + + public OpBaseStatSkillCondition(StatSet params) + { + _stat = params.getEnum("stat", BaseStat.class); + _min = params.getInt("min", 0); + _max = params.getInt("max", 2147483647); + } + + @Override + public boolean canUse(Creature caster, Skill skill, WorldObject target) + { + int currentValue = 0; + switch (_stat) + { + case STR: + { + currentValue = caster.getSTR(); + break; + } + case INT: + { + currentValue = caster.getINT(); + break; + } + case DEX: + { + currentValue = caster.getDEX(); + break; + } + case WIT: + { + currentValue = caster.getWIT(); + break; + } + case CON: + { + currentValue = caster.getCON(); + break; + } + case MEN: + { + currentValue = caster.getMEN(); + break; + } + } + + return (currentValue >= _min) && (currentValue <= _max); + } +} diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java index f42dbfa991..7525266203 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java +++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java @@ -64,6 +64,7 @@ public class SkillConditionMasterHandler SkillConditionHandler.getInstance().registerHandler("OpAffectedBySkill", OpAffectedBySkillSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAgathionEnergy", OpAgathionEnergySkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAlignment", OpAlignmentSkillCondition::new); + SkillConditionHandler.getInstance().registerHandler("OpBaseStat", OpBaseStatSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpBlink", OpBlinkSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCallPc", OpCallPcSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCanEscape", OpCanEscapeSkillCondition::new); diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java new file mode 100644 index 0000000000..1d515f6553 --- /dev/null +++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java @@ -0,0 +1,82 @@ +/* + * 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 . + */ +package handlers.skillconditionhandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.skill.ISkillCondition; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.BaseStat; + +/** + * @author Mobius + */ +public class OpBaseStatSkillCondition implements ISkillCondition +{ + private final BaseStat _stat; + private final int _min; + private final int _max; + + public OpBaseStatSkillCondition(StatSet params) + { + _stat = params.getEnum("stat", BaseStat.class); + _min = params.getInt("min", 0); + _max = params.getInt("max", 2147483647); + } + + @Override + public boolean canUse(Creature caster, Skill skill, WorldObject target) + { + int currentValue = 0; + switch (_stat) + { + case STR: + { + currentValue = caster.getSTR(); + break; + } + case INT: + { + currentValue = caster.getINT(); + break; + } + case DEX: + { + currentValue = caster.getDEX(); + break; + } + case WIT: + { + currentValue = caster.getWIT(); + break; + } + case CON: + { + currentValue = caster.getCON(); + break; + } + case MEN: + { + currentValue = caster.getMEN(); + break; + } + } + + return (currentValue >= _min) && (currentValue <= _max); + } +} diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java index 85845e699e..3fd093ad4d 100644 --- a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java +++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java @@ -65,6 +65,7 @@ public class SkillConditionMasterHandler SkillConditionHandler.getInstance().registerHandler("OpAffectedBySkill", OpAffectedBySkillSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAgathionEnergy", OpAgathionEnergySkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAlignment", OpAlignmentSkillCondition::new); + SkillConditionHandler.getInstance().registerHandler("OpBaseStat", OpBaseStatSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpBlink", OpBlinkSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCallPc", OpCallPcSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCanEscape", OpCanEscapeSkillCondition::new); diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java new file mode 100644 index 0000000000..1d515f6553 --- /dev/null +++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java @@ -0,0 +1,82 @@ +/* + * 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 . + */ +package handlers.skillconditionhandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.skill.ISkillCondition; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.BaseStat; + +/** + * @author Mobius + */ +public class OpBaseStatSkillCondition implements ISkillCondition +{ + private final BaseStat _stat; + private final int _min; + private final int _max; + + public OpBaseStatSkillCondition(StatSet params) + { + _stat = params.getEnum("stat", BaseStat.class); + _min = params.getInt("min", 0); + _max = params.getInt("max", 2147483647); + } + + @Override + public boolean canUse(Creature caster, Skill skill, WorldObject target) + { + int currentValue = 0; + switch (_stat) + { + case STR: + { + currentValue = caster.getSTR(); + break; + } + case INT: + { + currentValue = caster.getINT(); + break; + } + case DEX: + { + currentValue = caster.getDEX(); + break; + } + case WIT: + { + currentValue = caster.getWIT(); + break; + } + case CON: + { + currentValue = caster.getCON(); + break; + } + case MEN: + { + currentValue = caster.getMEN(); + break; + } + } + + return (currentValue >= _min) && (currentValue <= _max); + } +} diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java index 85845e699e..3fd093ad4d 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java @@ -65,6 +65,7 @@ public class SkillConditionMasterHandler SkillConditionHandler.getInstance().registerHandler("OpAffectedBySkill", OpAffectedBySkillSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAgathionEnergy", OpAgathionEnergySkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAlignment", OpAlignmentSkillCondition::new); + SkillConditionHandler.getInstance().registerHandler("OpBaseStat", OpBaseStatSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpBlink", OpBlinkSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCallPc", OpCallPcSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCanEscape", OpCanEscapeSkillCondition::new); diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java new file mode 100644 index 0000000000..1d515f6553 --- /dev/null +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java @@ -0,0 +1,82 @@ +/* + * 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 . + */ +package handlers.skillconditionhandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.skill.ISkillCondition; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.BaseStat; + +/** + * @author Mobius + */ +public class OpBaseStatSkillCondition implements ISkillCondition +{ + private final BaseStat _stat; + private final int _min; + private final int _max; + + public OpBaseStatSkillCondition(StatSet params) + { + _stat = params.getEnum("stat", BaseStat.class); + _min = params.getInt("min", 0); + _max = params.getInt("max", 2147483647); + } + + @Override + public boolean canUse(Creature caster, Skill skill, WorldObject target) + { + int currentValue = 0; + switch (_stat) + { + case STR: + { + currentValue = caster.getSTR(); + break; + } + case INT: + { + currentValue = caster.getINT(); + break; + } + case DEX: + { + currentValue = caster.getDEX(); + break; + } + case WIT: + { + currentValue = caster.getWIT(); + break; + } + case CON: + { + currentValue = caster.getCON(); + break; + } + case MEN: + { + currentValue = caster.getMEN(); + break; + } + } + + return (currentValue >= _min) && (currentValue <= _max); + } +} diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java index 85845e699e..3fd093ad4d 100644 --- a/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java +++ b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java @@ -65,6 +65,7 @@ public class SkillConditionMasterHandler SkillConditionHandler.getInstance().registerHandler("OpAffectedBySkill", OpAffectedBySkillSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAgathionEnergy", OpAgathionEnergySkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAlignment", OpAlignmentSkillCondition::new); + SkillConditionHandler.getInstance().registerHandler("OpBaseStat", OpBaseStatSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpBlink", OpBlinkSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCallPc", OpCallPcSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCanEscape", OpCanEscapeSkillCondition::new); diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java new file mode 100644 index 0000000000..1d515f6553 --- /dev/null +++ b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java @@ -0,0 +1,82 @@ +/* + * 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 . + */ +package handlers.skillconditionhandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.skill.ISkillCondition; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.BaseStat; + +/** + * @author Mobius + */ +public class OpBaseStatSkillCondition implements ISkillCondition +{ + private final BaseStat _stat; + private final int _min; + private final int _max; + + public OpBaseStatSkillCondition(StatSet params) + { + _stat = params.getEnum("stat", BaseStat.class); + _min = params.getInt("min", 0); + _max = params.getInt("max", 2147483647); + } + + @Override + public boolean canUse(Creature caster, Skill skill, WorldObject target) + { + int currentValue = 0; + switch (_stat) + { + case STR: + { + currentValue = caster.getSTR(); + break; + } + case INT: + { + currentValue = caster.getINT(); + break; + } + case DEX: + { + currentValue = caster.getDEX(); + break; + } + case WIT: + { + currentValue = caster.getWIT(); + break; + } + case CON: + { + currentValue = caster.getCON(); + break; + } + case MEN: + { + currentValue = caster.getMEN(); + break; + } + } + + return (currentValue >= _min) && (currentValue <= _max); + } +} diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java index 85845e699e..3fd093ad4d 100644 --- a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java @@ -65,6 +65,7 @@ public class SkillConditionMasterHandler SkillConditionHandler.getInstance().registerHandler("OpAffectedBySkill", OpAffectedBySkillSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAgathionEnergy", OpAgathionEnergySkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAlignment", OpAlignmentSkillCondition::new); + SkillConditionHandler.getInstance().registerHandler("OpBaseStat", OpBaseStatSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpBlink", OpBlinkSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCallPc", OpCallPcSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCanEscape", OpCanEscapeSkillCondition::new); diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java new file mode 100644 index 0000000000..1d515f6553 --- /dev/null +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java @@ -0,0 +1,82 @@ +/* + * 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 . + */ +package handlers.skillconditionhandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.skill.ISkillCondition; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.BaseStat; + +/** + * @author Mobius + */ +public class OpBaseStatSkillCondition implements ISkillCondition +{ + private final BaseStat _stat; + private final int _min; + private final int _max; + + public OpBaseStatSkillCondition(StatSet params) + { + _stat = params.getEnum("stat", BaseStat.class); + _min = params.getInt("min", 0); + _max = params.getInt("max", 2147483647); + } + + @Override + public boolean canUse(Creature caster, Skill skill, WorldObject target) + { + int currentValue = 0; + switch (_stat) + { + case STR: + { + currentValue = caster.getSTR(); + break; + } + case INT: + { + currentValue = caster.getINT(); + break; + } + case DEX: + { + currentValue = caster.getDEX(); + break; + } + case WIT: + { + currentValue = caster.getWIT(); + break; + } + case CON: + { + currentValue = caster.getCON(); + break; + } + case MEN: + { + currentValue = caster.getMEN(); + break; + } + } + + return (currentValue >= _min) && (currentValue <= _max); + } +} diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java index 2181cea828..a369f01ad8 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java @@ -63,6 +63,7 @@ public class SkillConditionMasterHandler SkillConditionHandler.getInstance().registerHandler("OpAffectedBySkill", OpAffectedBySkillSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAgathionEnergy", OpAgathionEnergySkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAlignment", OpAlignmentSkillCondition::new); + SkillConditionHandler.getInstance().registerHandler("OpBaseStat", OpBaseStatSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpBlink", OpBlinkSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCallPc", OpCallPcSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCanEscape", OpCanEscapeSkillCondition::new); diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java new file mode 100644 index 0000000000..1d515f6553 --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java @@ -0,0 +1,82 @@ +/* + * 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 . + */ +package handlers.skillconditionhandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.skill.ISkillCondition; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.BaseStat; + +/** + * @author Mobius + */ +public class OpBaseStatSkillCondition implements ISkillCondition +{ + private final BaseStat _stat; + private final int _min; + private final int _max; + + public OpBaseStatSkillCondition(StatSet params) + { + _stat = params.getEnum("stat", BaseStat.class); + _min = params.getInt("min", 0); + _max = params.getInt("max", 2147483647); + } + + @Override + public boolean canUse(Creature caster, Skill skill, WorldObject target) + { + int currentValue = 0; + switch (_stat) + { + case STR: + { + currentValue = caster.getSTR(); + break; + } + case INT: + { + currentValue = caster.getINT(); + break; + } + case DEX: + { + currentValue = caster.getDEX(); + break; + } + case WIT: + { + currentValue = caster.getWIT(); + break; + } + case CON: + { + currentValue = caster.getCON(); + break; + } + case MEN: + { + currentValue = caster.getMEN(); + break; + } + } + + return (currentValue >= _min) && (currentValue <= _max); + } +} diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java index 4fd65b0441..4646cda53d 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java @@ -64,6 +64,7 @@ public class SkillConditionMasterHandler SkillConditionHandler.getInstance().registerHandler("OpAffectedBySkill", OpAffectedBySkillSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAgathionEnergy", OpAgathionEnergySkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAlignment", OpAlignmentSkillCondition::new); + SkillConditionHandler.getInstance().registerHandler("OpBaseStat", OpBaseStatSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpBlink", OpBlinkSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCallPc", OpCallPcSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCanEscape", OpCanEscapeSkillCondition::new); diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java new file mode 100644 index 0000000000..1d515f6553 --- /dev/null +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java @@ -0,0 +1,82 @@ +/* + * 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 . + */ +package handlers.skillconditionhandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.skill.ISkillCondition; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.BaseStat; + +/** + * @author Mobius + */ +public class OpBaseStatSkillCondition implements ISkillCondition +{ + private final BaseStat _stat; + private final int _min; + private final int _max; + + public OpBaseStatSkillCondition(StatSet params) + { + _stat = params.getEnum("stat", BaseStat.class); + _min = params.getInt("min", 0); + _max = params.getInt("max", 2147483647); + } + + @Override + public boolean canUse(Creature caster, Skill skill, WorldObject target) + { + int currentValue = 0; + switch (_stat) + { + case STR: + { + currentValue = caster.getSTR(); + break; + } + case INT: + { + currentValue = caster.getINT(); + break; + } + case DEX: + { + currentValue = caster.getDEX(); + break; + } + case WIT: + { + currentValue = caster.getWIT(); + break; + } + case CON: + { + currentValue = caster.getCON(); + break; + } + case MEN: + { + currentValue = caster.getMEN(); + break; + } + } + + return (currentValue >= _min) && (currentValue <= _max); + } +} diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java index 4fd65b0441..4646cda53d 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java @@ -64,6 +64,7 @@ public class SkillConditionMasterHandler SkillConditionHandler.getInstance().registerHandler("OpAffectedBySkill", OpAffectedBySkillSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAgathionEnergy", OpAgathionEnergySkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAlignment", OpAlignmentSkillCondition::new); + SkillConditionHandler.getInstance().registerHandler("OpBaseStat", OpBaseStatSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpBlink", OpBlinkSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCallPc", OpCallPcSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCanEscape", OpCanEscapeSkillCondition::new); diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java new file mode 100644 index 0000000000..1d515f6553 --- /dev/null +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java @@ -0,0 +1,82 @@ +/* + * 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 . + */ +package handlers.skillconditionhandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.skill.ISkillCondition; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.BaseStat; + +/** + * @author Mobius + */ +public class OpBaseStatSkillCondition implements ISkillCondition +{ + private final BaseStat _stat; + private final int _min; + private final int _max; + + public OpBaseStatSkillCondition(StatSet params) + { + _stat = params.getEnum("stat", BaseStat.class); + _min = params.getInt("min", 0); + _max = params.getInt("max", 2147483647); + } + + @Override + public boolean canUse(Creature caster, Skill skill, WorldObject target) + { + int currentValue = 0; + switch (_stat) + { + case STR: + { + currentValue = caster.getSTR(); + break; + } + case INT: + { + currentValue = caster.getINT(); + break; + } + case DEX: + { + currentValue = caster.getDEX(); + break; + } + case WIT: + { + currentValue = caster.getWIT(); + break; + } + case CON: + { + currentValue = caster.getCON(); + break; + } + case MEN: + { + currentValue = caster.getMEN(); + break; + } + } + + return (currentValue >= _min) && (currentValue <= _max); + } +} diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java index 4fd65b0441..4646cda53d 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java @@ -64,6 +64,7 @@ public class SkillConditionMasterHandler SkillConditionHandler.getInstance().registerHandler("OpAffectedBySkill", OpAffectedBySkillSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAgathionEnergy", OpAgathionEnergySkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAlignment", OpAlignmentSkillCondition::new); + SkillConditionHandler.getInstance().registerHandler("OpBaseStat", OpBaseStatSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpBlink", OpBlinkSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCallPc", OpCallPcSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCanEscape", OpCanEscapeSkillCondition::new); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java new file mode 100644 index 0000000000..1d515f6553 --- /dev/null +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java @@ -0,0 +1,82 @@ +/* + * 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 . + */ +package handlers.skillconditionhandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.skill.ISkillCondition; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.BaseStat; + +/** + * @author Mobius + */ +public class OpBaseStatSkillCondition implements ISkillCondition +{ + private final BaseStat _stat; + private final int _min; + private final int _max; + + public OpBaseStatSkillCondition(StatSet params) + { + _stat = params.getEnum("stat", BaseStat.class); + _min = params.getInt("min", 0); + _max = params.getInt("max", 2147483647); + } + + @Override + public boolean canUse(Creature caster, Skill skill, WorldObject target) + { + int currentValue = 0; + switch (_stat) + { + case STR: + { + currentValue = caster.getSTR(); + break; + } + case INT: + { + currentValue = caster.getINT(); + break; + } + case DEX: + { + currentValue = caster.getDEX(); + break; + } + case WIT: + { + currentValue = caster.getWIT(); + break; + } + case CON: + { + currentValue = caster.getCON(); + break; + } + case MEN: + { + currentValue = caster.getMEN(); + break; + } + } + + return (currentValue >= _min) && (currentValue <= _max); + } +} diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java index 4fd65b0441..4646cda53d 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java @@ -64,6 +64,7 @@ public class SkillConditionMasterHandler SkillConditionHandler.getInstance().registerHandler("OpAffectedBySkill", OpAffectedBySkillSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAgathionEnergy", OpAgathionEnergySkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAlignment", OpAlignmentSkillCondition::new); + SkillConditionHandler.getInstance().registerHandler("OpBaseStat", OpBaseStatSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpBlink", OpBlinkSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCallPc", OpCallPcSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCanEscape", OpCanEscapeSkillCondition::new); diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java new file mode 100644 index 0000000000..1d515f6553 --- /dev/null +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java @@ -0,0 +1,82 @@ +/* + * 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 . + */ +package handlers.skillconditionhandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.skill.ISkillCondition; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.BaseStat; + +/** + * @author Mobius + */ +public class OpBaseStatSkillCondition implements ISkillCondition +{ + private final BaseStat _stat; + private final int _min; + private final int _max; + + public OpBaseStatSkillCondition(StatSet params) + { + _stat = params.getEnum("stat", BaseStat.class); + _min = params.getInt("min", 0); + _max = params.getInt("max", 2147483647); + } + + @Override + public boolean canUse(Creature caster, Skill skill, WorldObject target) + { + int currentValue = 0; + switch (_stat) + { + case STR: + { + currentValue = caster.getSTR(); + break; + } + case INT: + { + currentValue = caster.getINT(); + break; + } + case DEX: + { + currentValue = caster.getDEX(); + break; + } + case WIT: + { + currentValue = caster.getWIT(); + break; + } + case CON: + { + currentValue = caster.getCON(); + break; + } + case MEN: + { + currentValue = caster.getMEN(); + break; + } + } + + return (currentValue >= _min) && (currentValue <= _max); + } +} diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java index 4fd65b0441..4646cda53d 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java @@ -64,6 +64,7 @@ public class SkillConditionMasterHandler SkillConditionHandler.getInstance().registerHandler("OpAffectedBySkill", OpAffectedBySkillSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAgathionEnergy", OpAgathionEnergySkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAlignment", OpAlignmentSkillCondition::new); + SkillConditionHandler.getInstance().registerHandler("OpBaseStat", OpBaseStatSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpBlink", OpBlinkSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCallPc", OpCallPcSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCanEscape", OpCanEscapeSkillCondition::new); diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java new file mode 100644 index 0000000000..1d515f6553 --- /dev/null +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java @@ -0,0 +1,82 @@ +/* + * 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 . + */ +package handlers.skillconditionhandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.skill.ISkillCondition; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.BaseStat; + +/** + * @author Mobius + */ +public class OpBaseStatSkillCondition implements ISkillCondition +{ + private final BaseStat _stat; + private final int _min; + private final int _max; + + public OpBaseStatSkillCondition(StatSet params) + { + _stat = params.getEnum("stat", BaseStat.class); + _min = params.getInt("min", 0); + _max = params.getInt("max", 2147483647); + } + + @Override + public boolean canUse(Creature caster, Skill skill, WorldObject target) + { + int currentValue = 0; + switch (_stat) + { + case STR: + { + currentValue = caster.getSTR(); + break; + } + case INT: + { + currentValue = caster.getINT(); + break; + } + case DEX: + { + currentValue = caster.getDEX(); + break; + } + case WIT: + { + currentValue = caster.getWIT(); + break; + } + case CON: + { + currentValue = caster.getCON(); + break; + } + case MEN: + { + currentValue = caster.getMEN(); + break; + } + } + + return (currentValue >= _min) && (currentValue <= _max); + } +} diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java index 4fd65b0441..4646cda53d 100644 --- a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java +++ b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java @@ -64,6 +64,7 @@ public class SkillConditionMasterHandler SkillConditionHandler.getInstance().registerHandler("OpAffectedBySkill", OpAffectedBySkillSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAgathionEnergy", OpAgathionEnergySkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAlignment", OpAlignmentSkillCondition::new); + SkillConditionHandler.getInstance().registerHandler("OpBaseStat", OpBaseStatSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpBlink", OpBlinkSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCallPc", OpCallPcSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCanEscape", OpCanEscapeSkillCondition::new); diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java new file mode 100644 index 0000000000..1d515f6553 --- /dev/null +++ b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java @@ -0,0 +1,82 @@ +/* + * 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 . + */ +package handlers.skillconditionhandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.skill.ISkillCondition; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.BaseStat; + +/** + * @author Mobius + */ +public class OpBaseStatSkillCondition implements ISkillCondition +{ + private final BaseStat _stat; + private final int _min; + private final int _max; + + public OpBaseStatSkillCondition(StatSet params) + { + _stat = params.getEnum("stat", BaseStat.class); + _min = params.getInt("min", 0); + _max = params.getInt("max", 2147483647); + } + + @Override + public boolean canUse(Creature caster, Skill skill, WorldObject target) + { + int currentValue = 0; + switch (_stat) + { + case STR: + { + currentValue = caster.getSTR(); + break; + } + case INT: + { + currentValue = caster.getINT(); + break; + } + case DEX: + { + currentValue = caster.getDEX(); + break; + } + case WIT: + { + currentValue = caster.getWIT(); + break; + } + case CON: + { + currentValue = caster.getCON(); + break; + } + case MEN: + { + currentValue = caster.getMEN(); + break; + } + } + + return (currentValue >= _min) && (currentValue <= _max); + } +} diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java index da29ab90ed..5e5b98aad5 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java @@ -66,6 +66,7 @@ public class SkillConditionMasterHandler SkillConditionHandler.getInstance().registerHandler("OpAffectedBySkill", OpAffectedBySkillSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAgathionEnergy", OpAgathionEnergySkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAlignment", OpAlignmentSkillCondition::new); + SkillConditionHandler.getInstance().registerHandler("OpBaseStat", OpBaseStatSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpBlink", OpBlinkSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCallPc", OpCallPcSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCanEscape", OpCanEscapeSkillCondition::new); diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java new file mode 100644 index 0000000000..1d515f6553 --- /dev/null +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java @@ -0,0 +1,82 @@ +/* + * 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 . + */ +package handlers.skillconditionhandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.skill.ISkillCondition; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.BaseStat; + +/** + * @author Mobius + */ +public class OpBaseStatSkillCondition implements ISkillCondition +{ + private final BaseStat _stat; + private final int _min; + private final int _max; + + public OpBaseStatSkillCondition(StatSet params) + { + _stat = params.getEnum("stat", BaseStat.class); + _min = params.getInt("min", 0); + _max = params.getInt("max", 2147483647); + } + + @Override + public boolean canUse(Creature caster, Skill skill, WorldObject target) + { + int currentValue = 0; + switch (_stat) + { + case STR: + { + currentValue = caster.getSTR(); + break; + } + case INT: + { + currentValue = caster.getINT(); + break; + } + case DEX: + { + currentValue = caster.getDEX(); + break; + } + case WIT: + { + currentValue = caster.getWIT(); + break; + } + case CON: + { + currentValue = caster.getCON(); + break; + } + case MEN: + { + currentValue = caster.getMEN(); + break; + } + } + + return (currentValue >= _min) && (currentValue <= _max); + } +} diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java index da29ab90ed..5e5b98aad5 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java @@ -66,6 +66,7 @@ public class SkillConditionMasterHandler SkillConditionHandler.getInstance().registerHandler("OpAffectedBySkill", OpAffectedBySkillSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAgathionEnergy", OpAgathionEnergySkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAlignment", OpAlignmentSkillCondition::new); + SkillConditionHandler.getInstance().registerHandler("OpBaseStat", OpBaseStatSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpBlink", OpBlinkSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCallPc", OpCallPcSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCanEscape", OpCanEscapeSkillCondition::new); diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java new file mode 100644 index 0000000000..1d515f6553 --- /dev/null +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java @@ -0,0 +1,82 @@ +/* + * 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 . + */ +package handlers.skillconditionhandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.skill.ISkillCondition; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.BaseStat; + +/** + * @author Mobius + */ +public class OpBaseStatSkillCondition implements ISkillCondition +{ + private final BaseStat _stat; + private final int _min; + private final int _max; + + public OpBaseStatSkillCondition(StatSet params) + { + _stat = params.getEnum("stat", BaseStat.class); + _min = params.getInt("min", 0); + _max = params.getInt("max", 2147483647); + } + + @Override + public boolean canUse(Creature caster, Skill skill, WorldObject target) + { + int currentValue = 0; + switch (_stat) + { + case STR: + { + currentValue = caster.getSTR(); + break; + } + case INT: + { + currentValue = caster.getINT(); + break; + } + case DEX: + { + currentValue = caster.getDEX(); + break; + } + case WIT: + { + currentValue = caster.getWIT(); + break; + } + case CON: + { + currentValue = caster.getCON(); + break; + } + case MEN: + { + currentValue = caster.getMEN(); + break; + } + } + + return (currentValue >= _min) && (currentValue <= _max); + } +} diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java index da29ab90ed..5e5b98aad5 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java @@ -66,6 +66,7 @@ public class SkillConditionMasterHandler SkillConditionHandler.getInstance().registerHandler("OpAffectedBySkill", OpAffectedBySkillSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAgathionEnergy", OpAgathionEnergySkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAlignment", OpAlignmentSkillCondition::new); + SkillConditionHandler.getInstance().registerHandler("OpBaseStat", OpBaseStatSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpBlink", OpBlinkSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCallPc", OpCallPcSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCanEscape", OpCanEscapeSkillCondition::new); diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java new file mode 100644 index 0000000000..1d515f6553 --- /dev/null +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java @@ -0,0 +1,82 @@ +/* + * 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 . + */ +package handlers.skillconditionhandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.skill.ISkillCondition; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.BaseStat; + +/** + * @author Mobius + */ +public class OpBaseStatSkillCondition implements ISkillCondition +{ + private final BaseStat _stat; + private final int _min; + private final int _max; + + public OpBaseStatSkillCondition(StatSet params) + { + _stat = params.getEnum("stat", BaseStat.class); + _min = params.getInt("min", 0); + _max = params.getInt("max", 2147483647); + } + + @Override + public boolean canUse(Creature caster, Skill skill, WorldObject target) + { + int currentValue = 0; + switch (_stat) + { + case STR: + { + currentValue = caster.getSTR(); + break; + } + case INT: + { + currentValue = caster.getINT(); + break; + } + case DEX: + { + currentValue = caster.getDEX(); + break; + } + case WIT: + { + currentValue = caster.getWIT(); + break; + } + case CON: + { + currentValue = caster.getCON(); + break; + } + case MEN: + { + currentValue = caster.getMEN(); + break; + } + } + + return (currentValue >= _min) && (currentValue <= _max); + } +} diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java index 4326c9f558..93f93b4580 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java @@ -67,6 +67,7 @@ public class SkillConditionMasterHandler SkillConditionHandler.getInstance().registerHandler("OpAffectedBySkill", OpAffectedBySkillSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAgathionEnergy", OpAgathionEnergySkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpAlignment", OpAlignmentSkillCondition::new); + SkillConditionHandler.getInstance().registerHandler("OpBaseStat", OpBaseStatSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpBlink", OpBlinkSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCallPc", OpCallPcSkillCondition::new); SkillConditionHandler.getInstance().registerHandler("OpCanEscape", OpCanEscapeSkillCondition::new); diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java new file mode 100644 index 0000000000..1d515f6553 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/skillconditionhandlers/OpBaseStatSkillCondition.java @@ -0,0 +1,82 @@ +/* + * 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 . + */ +package handlers.skillconditionhandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.skill.ISkillCondition; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.BaseStat; + +/** + * @author Mobius + */ +public class OpBaseStatSkillCondition implements ISkillCondition +{ + private final BaseStat _stat; + private final int _min; + private final int _max; + + public OpBaseStatSkillCondition(StatSet params) + { + _stat = params.getEnum("stat", BaseStat.class); + _min = params.getInt("min", 0); + _max = params.getInt("max", 2147483647); + } + + @Override + public boolean canUse(Creature caster, Skill skill, WorldObject target) + { + int currentValue = 0; + switch (_stat) + { + case STR: + { + currentValue = caster.getSTR(); + break; + } + case INT: + { + currentValue = caster.getINT(); + break; + } + case DEX: + { + currentValue = caster.getDEX(); + break; + } + case WIT: + { + currentValue = caster.getWIT(); + break; + } + case CON: + { + currentValue = caster.getCON(); + break; + } + case MEN: + { + currentValue = caster.getMEN(); + break; + } + } + + return (currentValue >= _min) && (currentValue <= _max); + } +}