From 2173a49eb890c3d65ef7a123305d23fb2cd35216 Mon Sep 17 00:00:00 2001
From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com>
Date: Mon, 30 Oct 2017 21:52:28 +0000
Subject: [PATCH] Addition of OpAffectedBySkill skill condition.
---
.../handlers/SkillConditionMasterHandler.java | 1 +
.../OpAffectedBySkillSkillCondition.java | 42 +++++++++++++++++++
.../handlers/SkillConditionMasterHandler.java | 1 +
.../OpAffectedBySkillSkillCondition.java | 42 +++++++++++++++++++
.../handlers/SkillConditionMasterHandler.java | 1 +
.../OpAffectedBySkillSkillCondition.java | 42 +++++++++++++++++++
.../handlers/SkillConditionMasterHandler.java | 1 +
.../OpAffectedBySkillSkillCondition.java | 42 +++++++++++++++++++
8 files changed, 172 insertions(+)
create mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/skillconditionhandlers/OpAffectedBySkillSkillCondition.java
create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/skillconditionhandlers/OpAffectedBySkillSkillCondition.java
create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/skillconditionhandlers/OpAffectedBySkillSkillCondition.java
create mode 100644 L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/skillconditionhandlers/OpAffectedBySkillSkillCondition.java
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java
index 530295c9dd..c0d20acfd3 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java
@@ -119,6 +119,7 @@ public class SkillConditionMasterHandler
SkillConditionHandler.getInstance().registerHandler("OpEquipItem", OpEquipItemSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpInstantzone", OpInstantzoneSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpSubjob", OpSubjobSkillCondition::new);
+ SkillConditionHandler.getInstance().registerHandler("OpAffectedBySkill", OpAffectedBySkillSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpAgathionEnergy", OpAgathionEnergySkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpPledge", OpPledgeSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpSocialClass", OpSocialClassSkillCondition::new);
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/skillconditionhandlers/OpAffectedBySkillSkillCondition.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/skillconditionhandlers/OpAffectedBySkillSkillCondition.java
new file mode 100644
index 0000000000..d2c118e127
--- /dev/null
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/skillconditionhandlers/OpAffectedBySkillSkillCondition.java
@@ -0,0 +1,42 @@
+/*
+ * 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 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 OpAffectedBySkillSkillCondition implements ISkillCondition
+{
+ private final int _skillId;
+
+ public OpAffectedBySkillSkillCondition(StatsSet params)
+ {
+ _skillId = params.getInt("skillId", -1);
+ }
+
+ @Override
+ public boolean canUse(L2Character caster, Skill skill, L2Object target)
+ {
+ return caster.getEffectList().getBuffInfoBySkillId(_skillId) != null;
+ }
+}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java
index 530295c9dd..c0d20acfd3 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java
@@ -119,6 +119,7 @@ public class SkillConditionMasterHandler
SkillConditionHandler.getInstance().registerHandler("OpEquipItem", OpEquipItemSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpInstantzone", OpInstantzoneSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpSubjob", OpSubjobSkillCondition::new);
+ SkillConditionHandler.getInstance().registerHandler("OpAffectedBySkill", OpAffectedBySkillSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpAgathionEnergy", OpAgathionEnergySkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpPledge", OpPledgeSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpSocialClass", OpSocialClassSkillCondition::new);
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/skillconditionhandlers/OpAffectedBySkillSkillCondition.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/skillconditionhandlers/OpAffectedBySkillSkillCondition.java
new file mode 100644
index 0000000000..d2c118e127
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/skillconditionhandlers/OpAffectedBySkillSkillCondition.java
@@ -0,0 +1,42 @@
+/*
+ * 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 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 OpAffectedBySkillSkillCondition implements ISkillCondition
+{
+ private final int _skillId;
+
+ public OpAffectedBySkillSkillCondition(StatsSet params)
+ {
+ _skillId = params.getInt("skillId", -1);
+ }
+
+ @Override
+ public boolean canUse(L2Character caster, Skill skill, L2Object target)
+ {
+ return caster.getEffectList().getBuffInfoBySkillId(_skillId) != null;
+ }
+}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java
index 530295c9dd..c0d20acfd3 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java
@@ -119,6 +119,7 @@ public class SkillConditionMasterHandler
SkillConditionHandler.getInstance().registerHandler("OpEquipItem", OpEquipItemSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpInstantzone", OpInstantzoneSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpSubjob", OpSubjobSkillCondition::new);
+ SkillConditionHandler.getInstance().registerHandler("OpAffectedBySkill", OpAffectedBySkillSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpAgathionEnergy", OpAgathionEnergySkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpPledge", OpPledgeSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpSocialClass", OpSocialClassSkillCondition::new);
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/skillconditionhandlers/OpAffectedBySkillSkillCondition.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/skillconditionhandlers/OpAffectedBySkillSkillCondition.java
new file mode 100644
index 0000000000..d2c118e127
--- /dev/null
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/skillconditionhandlers/OpAffectedBySkillSkillCondition.java
@@ -0,0 +1,42 @@
+/*
+ * 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 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 OpAffectedBySkillSkillCondition implements ISkillCondition
+{
+ private final int _skillId;
+
+ public OpAffectedBySkillSkillCondition(StatsSet params)
+ {
+ _skillId = params.getInt("skillId", -1);
+ }
+
+ @Override
+ public boolean canUse(L2Character caster, Skill skill, L2Object target)
+ {
+ return caster.getEffectList().getBuffInfoBySkillId(_skillId) != null;
+ }
+}
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 530295c9dd..c0d20acfd3 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
@@ -119,6 +119,7 @@ public class SkillConditionMasterHandler
SkillConditionHandler.getInstance().registerHandler("OpEquipItem", OpEquipItemSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpInstantzone", OpInstantzoneSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpSubjob", OpSubjobSkillCondition::new);
+ SkillConditionHandler.getInstance().registerHandler("OpAffectedBySkill", OpAffectedBySkillSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpAgathionEnergy", OpAgathionEnergySkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpPledge", OpPledgeSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpSocialClass", OpSocialClassSkillCondition::new);
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/skillconditionhandlers/OpAffectedBySkillSkillCondition.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/skillconditionhandlers/OpAffectedBySkillSkillCondition.java
new file mode 100644
index 0000000000..d2c118e127
--- /dev/null
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/skillconditionhandlers/OpAffectedBySkillSkillCondition.java
@@ -0,0 +1,42 @@
+/*
+ * 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 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 OpAffectedBySkillSkillCondition implements ISkillCondition
+{
+ private final int _skillId;
+
+ public OpAffectedBySkillSkillCondition(StatsSet params)
+ {
+ _skillId = params.getInt("skillId", -1);
+ }
+
+ @Override
+ public boolean canUse(L2Character caster, Skill skill, L2Object target)
+ {
+ return caster.getEffectList().getBuffInfoBySkillId(_skillId) != null;
+ }
+}