From e4b5def978efe5adf1357f031e2ec7e8ed015575 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Mon, 13 Nov 2017 11:45:53 +0000 Subject: [PATCH] Addition of CallRandomSkill effect handler. --- .../scripts/handlers/EffectMasterHandler.java | 1 + .../effecthandlers/CallRandomSkill.java | 61 +++++++++++++++++++ .../game/data/stats/skills/documentation.txt | 1 + .../scripts/handlers/EffectMasterHandler.java | 1 + .../effecthandlers/CallRandomSkill.java | 61 +++++++++++++++++++ .../game/data/stats/skills/documentation.txt | 1 + .../scripts/handlers/EffectMasterHandler.java | 1 + .../effecthandlers/CallRandomSkill.java | 61 +++++++++++++++++++ .../game/data/stats/skills/documentation.txt | 1 + .../scripts/handlers/EffectMasterHandler.java | 1 + .../effecthandlers/CallRandomSkill.java | 61 +++++++++++++++++++ .../game/data/stats/skills/documentation.txt | 1 + .../scripts/handlers/EffectMasterHandler.java | 1 + .../effecthandlers/CallRandomSkill.java | 61 +++++++++++++++++++ .../game/data/stats/skills/documentation.txt | 1 + 15 files changed, 315 insertions(+) create mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/CallRandomSkill.java create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/CallRandomSkill.java create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/CallRandomSkill.java create mode 100644 L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/CallRandomSkill.java create mode 100644 L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/CallRandomSkill.java diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/EffectMasterHandler.java index 4a1e1c59c7..07d2f9cf70 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -68,6 +68,7 @@ public final class EffectMasterHandler EffectHandler.getInstance().registerHandler("BuffBlock", BuffBlock::new); EffectHandler.getInstance().registerHandler("CallParty", CallParty::new); EffectHandler.getInstance().registerHandler("CallPc", CallPc::new); + EffectHandler.getInstance().registerHandler("CallRandomSkill", CallRandomSkill::new); EffectHandler.getInstance().registerHandler("CallSkill", CallSkill::new); EffectHandler.getInstance().registerHandler("CallSkillOnActionTime", CallSkillOnActionTime::new); EffectHandler.getInstance().registerHandler("CallTargetParty", CallTargetParty::new); diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/CallRandomSkill.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/CallRandomSkill.java new file mode 100644 index 0000000000..c00e3e46de --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/CallRandomSkill.java @@ -0,0 +1,61 @@ +/* + * 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.effecthandlers; + +import java.util.ArrayList; +import java.util.List; + +import com.l2jmobius.commons.util.Rnd; +import com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.actor.L2Character; +import com.l2jmobius.gameserver.model.effects.AbstractEffect; +import com.l2jmobius.gameserver.model.holders.SkillHolder; +import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.model.skills.Skill; +import com.l2jmobius.gameserver.model.skills.SkillCaster; + +/** + * @author Mobius + */ +public class CallRandomSkill extends AbstractEffect +{ + private final List _skills = new ArrayList<>(); + + public CallRandomSkill(StatsSet params) + { + final String skills = params.getString("skills", null); + if (skills != null) + { + for (String skill : skills.split(";")) + { + _skills.add(new SkillHolder(Integer.parseInt(skill.split(",")[0]), Integer.parseInt(skill.split(",")[1]))); + } + } + } + + @Override + public boolean isInstant() + { + return true; + } + + @Override + public void instant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) + { + SkillCaster.triggerCast(effector, effected, _skills.get(Rnd.get(_skills.size())).getSkill()); + } +} diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/documentation.txt index f2cc1cb61e..c4f6ad75ed 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/documentation.txt @@ -37,6 +37,7 @@ Breath: Underwater breathing stat. BuffBlock: Blocks target from receiving buffs. CallParty: Recalls whole party. CallPc: Recalls a Player. +CallRandomSkill: Triggers a random skill. (l2jmobius) CallSkill: Triggers a specified skill. CallSkillOnActionTime: Triggers a specified skill every given amount of time. CallTargetParty: Recalls the whole party of the target. diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/EffectMasterHandler.java index 4a1e1c59c7..07d2f9cf70 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -68,6 +68,7 @@ public final class EffectMasterHandler EffectHandler.getInstance().registerHandler("BuffBlock", BuffBlock::new); EffectHandler.getInstance().registerHandler("CallParty", CallParty::new); EffectHandler.getInstance().registerHandler("CallPc", CallPc::new); + EffectHandler.getInstance().registerHandler("CallRandomSkill", CallRandomSkill::new); EffectHandler.getInstance().registerHandler("CallSkill", CallSkill::new); EffectHandler.getInstance().registerHandler("CallSkillOnActionTime", CallSkillOnActionTime::new); EffectHandler.getInstance().registerHandler("CallTargetParty", CallTargetParty::new); diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/CallRandomSkill.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/CallRandomSkill.java new file mode 100644 index 0000000000..c00e3e46de --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/CallRandomSkill.java @@ -0,0 +1,61 @@ +/* + * 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.effecthandlers; + +import java.util.ArrayList; +import java.util.List; + +import com.l2jmobius.commons.util.Rnd; +import com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.actor.L2Character; +import com.l2jmobius.gameserver.model.effects.AbstractEffect; +import com.l2jmobius.gameserver.model.holders.SkillHolder; +import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.model.skills.Skill; +import com.l2jmobius.gameserver.model.skills.SkillCaster; + +/** + * @author Mobius + */ +public class CallRandomSkill extends AbstractEffect +{ + private final List _skills = new ArrayList<>(); + + public CallRandomSkill(StatsSet params) + { + final String skills = params.getString("skills", null); + if (skills != null) + { + for (String skill : skills.split(";")) + { + _skills.add(new SkillHolder(Integer.parseInt(skill.split(",")[0]), Integer.parseInt(skill.split(",")[1]))); + } + } + } + + @Override + public boolean isInstant() + { + return true; + } + + @Override + public void instant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) + { + SkillCaster.triggerCast(effector, effected, _skills.get(Rnd.get(_skills.size())).getSkill()); + } +} diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/documentation.txt index f2cc1cb61e..c4f6ad75ed 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/documentation.txt @@ -37,6 +37,7 @@ Breath: Underwater breathing stat. BuffBlock: Blocks target from receiving buffs. CallParty: Recalls whole party. CallPc: Recalls a Player. +CallRandomSkill: Triggers a random skill. (l2jmobius) CallSkill: Triggers a specified skill. CallSkillOnActionTime: Triggers a specified skill every given amount of time. CallTargetParty: Recalls the whole party of the target. diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/EffectMasterHandler.java index 4a1e1c59c7..07d2f9cf70 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -68,6 +68,7 @@ public final class EffectMasterHandler EffectHandler.getInstance().registerHandler("BuffBlock", BuffBlock::new); EffectHandler.getInstance().registerHandler("CallParty", CallParty::new); EffectHandler.getInstance().registerHandler("CallPc", CallPc::new); + EffectHandler.getInstance().registerHandler("CallRandomSkill", CallRandomSkill::new); EffectHandler.getInstance().registerHandler("CallSkill", CallSkill::new); EffectHandler.getInstance().registerHandler("CallSkillOnActionTime", CallSkillOnActionTime::new); EffectHandler.getInstance().registerHandler("CallTargetParty", CallTargetParty::new); diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/CallRandomSkill.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/CallRandomSkill.java new file mode 100644 index 0000000000..c00e3e46de --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/CallRandomSkill.java @@ -0,0 +1,61 @@ +/* + * 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.effecthandlers; + +import java.util.ArrayList; +import java.util.List; + +import com.l2jmobius.commons.util.Rnd; +import com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.actor.L2Character; +import com.l2jmobius.gameserver.model.effects.AbstractEffect; +import com.l2jmobius.gameserver.model.holders.SkillHolder; +import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.model.skills.Skill; +import com.l2jmobius.gameserver.model.skills.SkillCaster; + +/** + * @author Mobius + */ +public class CallRandomSkill extends AbstractEffect +{ + private final List _skills = new ArrayList<>(); + + public CallRandomSkill(StatsSet params) + { + final String skills = params.getString("skills", null); + if (skills != null) + { + for (String skill : skills.split(";")) + { + _skills.add(new SkillHolder(Integer.parseInt(skill.split(",")[0]), Integer.parseInt(skill.split(",")[1]))); + } + } + } + + @Override + public boolean isInstant() + { + return true; + } + + @Override + public void instant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) + { + SkillCaster.triggerCast(effector, effected, _skills.get(Rnd.get(_skills.size())).getSkill()); + } +} diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/documentation.txt index f2cc1cb61e..c4f6ad75ed 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/documentation.txt @@ -37,6 +37,7 @@ Breath: Underwater breathing stat. BuffBlock: Blocks target from receiving buffs. CallParty: Recalls whole party. CallPc: Recalls a Player. +CallRandomSkill: Triggers a random skill. (l2jmobius) CallSkill: Triggers a specified skill. CallSkillOnActionTime: Triggers a specified skill every given amount of time. CallTargetParty: Recalls the whole party of the target. diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/EffectMasterHandler.java index 4a1e1c59c7..07d2f9cf70 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -68,6 +68,7 @@ public final class EffectMasterHandler EffectHandler.getInstance().registerHandler("BuffBlock", BuffBlock::new); EffectHandler.getInstance().registerHandler("CallParty", CallParty::new); EffectHandler.getInstance().registerHandler("CallPc", CallPc::new); + EffectHandler.getInstance().registerHandler("CallRandomSkill", CallRandomSkill::new); EffectHandler.getInstance().registerHandler("CallSkill", CallSkill::new); EffectHandler.getInstance().registerHandler("CallSkillOnActionTime", CallSkillOnActionTime::new); EffectHandler.getInstance().registerHandler("CallTargetParty", CallTargetParty::new); diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/CallRandomSkill.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/CallRandomSkill.java new file mode 100644 index 0000000000..c00e3e46de --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/CallRandomSkill.java @@ -0,0 +1,61 @@ +/* + * 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.effecthandlers; + +import java.util.ArrayList; +import java.util.List; + +import com.l2jmobius.commons.util.Rnd; +import com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.actor.L2Character; +import com.l2jmobius.gameserver.model.effects.AbstractEffect; +import com.l2jmobius.gameserver.model.holders.SkillHolder; +import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.model.skills.Skill; +import com.l2jmobius.gameserver.model.skills.SkillCaster; + +/** + * @author Mobius + */ +public class CallRandomSkill extends AbstractEffect +{ + private final List _skills = new ArrayList<>(); + + public CallRandomSkill(StatsSet params) + { + final String skills = params.getString("skills", null); + if (skills != null) + { + for (String skill : skills.split(";")) + { + _skills.add(new SkillHolder(Integer.parseInt(skill.split(",")[0]), Integer.parseInt(skill.split(",")[1]))); + } + } + } + + @Override + public boolean isInstant() + { + return true; + } + + @Override + public void instant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) + { + SkillCaster.triggerCast(effector, effected, _skills.get(Rnd.get(_skills.size())).getSkill()); + } +} diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/documentation.txt index f2cc1cb61e..c4f6ad75ed 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/documentation.txt @@ -37,6 +37,7 @@ Breath: Underwater breathing stat. BuffBlock: Blocks target from receiving buffs. CallParty: Recalls whole party. CallPc: Recalls a Player. +CallRandomSkill: Triggers a random skill. (l2jmobius) CallSkill: Triggers a specified skill. CallSkillOnActionTime: Triggers a specified skill every given amount of time. CallTargetParty: Recalls the whole party of the target. diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/EffectMasterHandler.java index c916ba78dd..60b8d8e62b 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -67,6 +67,7 @@ public final class EffectMasterHandler EffectHandler.getInstance().registerHandler("BuffBlock", BuffBlock::new); EffectHandler.getInstance().registerHandler("CallParty", CallParty::new); EffectHandler.getInstance().registerHandler("CallPc", CallPc::new); + EffectHandler.getInstance().registerHandler("CallRandomSkill", CallRandomSkill::new); EffectHandler.getInstance().registerHandler("CallSkill", CallSkill::new); EffectHandler.getInstance().registerHandler("CallSkillOnActionTime", CallSkillOnActionTime::new); EffectHandler.getInstance().registerHandler("CallTargetParty", CallTargetParty::new); diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/CallRandomSkill.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/CallRandomSkill.java new file mode 100644 index 0000000000..c00e3e46de --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/CallRandomSkill.java @@ -0,0 +1,61 @@ +/* + * 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.effecthandlers; + +import java.util.ArrayList; +import java.util.List; + +import com.l2jmobius.commons.util.Rnd; +import com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.actor.L2Character; +import com.l2jmobius.gameserver.model.effects.AbstractEffect; +import com.l2jmobius.gameserver.model.holders.SkillHolder; +import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.model.skills.Skill; +import com.l2jmobius.gameserver.model.skills.SkillCaster; + +/** + * @author Mobius + */ +public class CallRandomSkill extends AbstractEffect +{ + private final List _skills = new ArrayList<>(); + + public CallRandomSkill(StatsSet params) + { + final String skills = params.getString("skills", null); + if (skills != null) + { + for (String skill : skills.split(";")) + { + _skills.add(new SkillHolder(Integer.parseInt(skill.split(",")[0]), Integer.parseInt(skill.split(",")[1]))); + } + } + } + + @Override + public boolean isInstant() + { + return true; + } + + @Override + public void instant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) + { + SkillCaster.triggerCast(effector, effected, _skills.get(Rnd.get(_skills.size())).getSkill()); + } +} diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/documentation.txt index 62bdf7083e..ff4539897f 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/documentation.txt @@ -36,6 +36,7 @@ Breath: Underwater breathing stat. BuffBlock: Blocks target from receiving buffs. CallParty: Recalls whole party. CallPc: Recalls a Player. +CallRandomSkill: Triggers a random skill. (l2jmobius) CallSkill: Triggers a specified skill. CallSkillOnActionTime: Triggers a specified skill every given amount of time. CallTargetParty: Recalls the whole party of the target.