From b4e0a775381898ec8e61d946adfe7548ff6ef58c Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Thu, 7 Sep 2017 02:33:43 +0000 Subject: [PATCH] Addition of ReuseSkillById effect. --- .../scripts/handlers/EffectMasterHandler.java | 1 + .../effecthandlers/ReuseSkillById.java | 60 +++++++++++++++++++ .../game/data/stats/skills/documentation.txt | 1 + .../scripts/handlers/EffectMasterHandler.java | 1 + .../effecthandlers/ReuseSkillById.java | 60 +++++++++++++++++++ .../game/data/stats/skills/documentation.txt | 1 + .../scripts/handlers/EffectMasterHandler.java | 1 + .../effecthandlers/ReuseSkillById.java | 60 +++++++++++++++++++ .../game/data/stats/skills/documentation.txt | 1 + .../scripts/handlers/EffectMasterHandler.java | 1 + .../effecthandlers/ReuseSkillById.java | 60 +++++++++++++++++++ .../game/data/stats/skills/01600-01699.xml | 12 ++-- .../game/data/stats/skills/documentation.txt | 1 + 13 files changed, 255 insertions(+), 5 deletions(-) create mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/ReuseSkillById.java create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/ReuseSkillById.java create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/ReuseSkillById.java create mode 100644 L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/ReuseSkillById.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 dce1bb8e98..6937db6e10 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 @@ -265,6 +265,7 @@ public final class EffectMasterHandler EffectHandler.getInstance().registerHandler("Resurrection", Resurrection::new); EffectHandler.getInstance().registerHandler("ResurrectionSpecial", ResurrectionSpecial::new); EffectHandler.getInstance().registerHandler("Reuse", Reuse::new); + EffectHandler.getInstance().registerHandler("ReuseSkillById", ReuseSkillById::new); EffectHandler.getInstance().registerHandler("RewardItemOnExit", RewardItemOnExit::new); EffectHandler.getInstance().registerHandler("Root", Root::new); EffectHandler.getInstance().registerHandler("SacrificeSummon", SacrificeSummon::new); diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/ReuseSkillById.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/ReuseSkillById.java new file mode 100644 index 0000000000..dd229c2c16 --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/ReuseSkillById.java @@ -0,0 +1,60 @@ +/* + * 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 com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.actor.L2Character; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.effects.AbstractEffect; +import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.model.skills.Skill; +import com.l2jmobius.gameserver.network.serverpackets.SkillCoolTime; + +/** + * @author Mobius + */ +public class ReuseSkillById extends AbstractEffect +{ + private final int _skillId; + + public ReuseSkillById(StatsSet params) + { + _skillId = params.getInt("skillId", 0); + } + + @Override + public boolean isInstant() + { + return true; + } + + @Override + public void instant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) + { + final L2PcInstance player = effector.getActingPlayer(); + if (player != null) + { + final Skill s = player.getKnownSkill(_skillId); + if (s != null) + { + player.removeTimeStamp(s); + player.enableSkill(s); + player.sendPacket(new SkillCoolTime(player)); + } + } + } +} 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 362c43e5de..b76b1a3494 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 @@ -232,6 +232,7 @@ RestorationRandom: Creates items randomly from a specified list. Its multiplied Resurrection: Resurrects target Player or Summon. ResurrectionSpecial: Resurrects target Player or Summon only in specified instance IDs. Reuse: Decreases skill reuse time based on its magic type. +ReuseSkillById: Resets reuse time for the skill with the specific id. (l2jmobius) RewardItemOnExit: Reward an item when effect ends. (l2jmobius) Root: Stops movement. SacrificeSummon: Sacrifices the players summon. (l2jmobius) 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 dce1bb8e98..6937db6e10 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 @@ -265,6 +265,7 @@ public final class EffectMasterHandler EffectHandler.getInstance().registerHandler("Resurrection", Resurrection::new); EffectHandler.getInstance().registerHandler("ResurrectionSpecial", ResurrectionSpecial::new); EffectHandler.getInstance().registerHandler("Reuse", Reuse::new); + EffectHandler.getInstance().registerHandler("ReuseSkillById", ReuseSkillById::new); EffectHandler.getInstance().registerHandler("RewardItemOnExit", RewardItemOnExit::new); EffectHandler.getInstance().registerHandler("Root", Root::new); EffectHandler.getInstance().registerHandler("SacrificeSummon", SacrificeSummon::new); diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/ReuseSkillById.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/ReuseSkillById.java new file mode 100644 index 0000000000..dd229c2c16 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/ReuseSkillById.java @@ -0,0 +1,60 @@ +/* + * 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 com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.actor.L2Character; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.effects.AbstractEffect; +import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.model.skills.Skill; +import com.l2jmobius.gameserver.network.serverpackets.SkillCoolTime; + +/** + * @author Mobius + */ +public class ReuseSkillById extends AbstractEffect +{ + private final int _skillId; + + public ReuseSkillById(StatsSet params) + { + _skillId = params.getInt("skillId", 0); + } + + @Override + public boolean isInstant() + { + return true; + } + + @Override + public void instant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) + { + final L2PcInstance player = effector.getActingPlayer(); + if (player != null) + { + final Skill s = player.getKnownSkill(_skillId); + if (s != null) + { + player.removeTimeStamp(s); + player.enableSkill(s); + player.sendPacket(new SkillCoolTime(player)); + } + } + } +} 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 362c43e5de..b76b1a3494 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 @@ -232,6 +232,7 @@ RestorationRandom: Creates items randomly from a specified list. Its multiplied Resurrection: Resurrects target Player or Summon. ResurrectionSpecial: Resurrects target Player or Summon only in specified instance IDs. Reuse: Decreases skill reuse time based on its magic type. +ReuseSkillById: Resets reuse time for the skill with the specific id. (l2jmobius) RewardItemOnExit: Reward an item when effect ends. (l2jmobius) Root: Stops movement. SacrificeSummon: Sacrifices the players summon. (l2jmobius) 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 dce1bb8e98..6937db6e10 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 @@ -265,6 +265,7 @@ public final class EffectMasterHandler EffectHandler.getInstance().registerHandler("Resurrection", Resurrection::new); EffectHandler.getInstance().registerHandler("ResurrectionSpecial", ResurrectionSpecial::new); EffectHandler.getInstance().registerHandler("Reuse", Reuse::new); + EffectHandler.getInstance().registerHandler("ReuseSkillById", ReuseSkillById::new); EffectHandler.getInstance().registerHandler("RewardItemOnExit", RewardItemOnExit::new); EffectHandler.getInstance().registerHandler("Root", Root::new); EffectHandler.getInstance().registerHandler("SacrificeSummon", SacrificeSummon::new); diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/ReuseSkillById.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/ReuseSkillById.java new file mode 100644 index 0000000000..dd229c2c16 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/ReuseSkillById.java @@ -0,0 +1,60 @@ +/* + * 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 com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.actor.L2Character; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.effects.AbstractEffect; +import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.model.skills.Skill; +import com.l2jmobius.gameserver.network.serverpackets.SkillCoolTime; + +/** + * @author Mobius + */ +public class ReuseSkillById extends AbstractEffect +{ + private final int _skillId; + + public ReuseSkillById(StatsSet params) + { + _skillId = params.getInt("skillId", 0); + } + + @Override + public boolean isInstant() + { + return true; + } + + @Override + public void instant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) + { + final L2PcInstance player = effector.getActingPlayer(); + if (player != null) + { + final Skill s = player.getKnownSkill(_skillId); + if (s != null) + { + player.removeTimeStamp(s); + player.enableSkill(s); + player.sendPacket(new SkillCoolTime(player)); + } + } + } +} 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 362c43e5de..b76b1a3494 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 @@ -232,6 +232,7 @@ RestorationRandom: Creates items randomly from a specified list. Its multiplied Resurrection: Resurrects target Player or Summon. ResurrectionSpecial: Resurrects target Player or Summon only in specified instance IDs. Reuse: Decreases skill reuse time based on its magic type. +ReuseSkillById: Resets reuse time for the skill with the specific id. (l2jmobius) RewardItemOnExit: Reward an item when effect ends. (l2jmobius) Root: Stops movement. SacrificeSummon: Sacrifices the players summon. (l2jmobius) 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 dce1bb8e98..6937db6e10 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 @@ -265,6 +265,7 @@ public final class EffectMasterHandler EffectHandler.getInstance().registerHandler("Resurrection", Resurrection::new); EffectHandler.getInstance().registerHandler("ResurrectionSpecial", ResurrectionSpecial::new); EffectHandler.getInstance().registerHandler("Reuse", Reuse::new); + EffectHandler.getInstance().registerHandler("ReuseSkillById", ReuseSkillById::new); EffectHandler.getInstance().registerHandler("RewardItemOnExit", RewardItemOnExit::new); EffectHandler.getInstance().registerHandler("Root", Root::new); EffectHandler.getInstance().registerHandler("SacrificeSummon", SacrificeSummon::new); diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/ReuseSkillById.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/ReuseSkillById.java new file mode 100644 index 0000000000..dd229c2c16 --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/ReuseSkillById.java @@ -0,0 +1,60 @@ +/* + * 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 com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.actor.L2Character; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.effects.AbstractEffect; +import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.model.skills.Skill; +import com.l2jmobius.gameserver.network.serverpackets.SkillCoolTime; + +/** + * @author Mobius + */ +public class ReuseSkillById extends AbstractEffect +{ + private final int _skillId; + + public ReuseSkillById(StatsSet params) + { + _skillId = params.getInt("skillId", 0); + } + + @Override + public boolean isInstant() + { + return true; + } + + @Override + public void instant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) + { + final L2PcInstance player = effector.getActingPlayer(); + if (player != null) + { + final Skill s = player.getKnownSkill(_skillId); + if (s != null) + { + player.removeTimeStamp(s); + player.enableSkill(s); + player.sendPacket(new SkillCoolTime(player)); + } + } + } +} diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/01600-01699.xml b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/01600-01699.xml index d6629b761c..f45f89b8ee 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/01600-01699.xml +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/01600-01699.xml @@ -510,7 +510,7 @@ icon.skill1631 - A3 + A2 1 NONE NONE @@ -521,11 +521,13 @@ SELF SINGLE 600000 + 1 - - -100 - PER - 0 + + 821 + + + 922 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 362c43e5de..b76b1a3494 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 @@ -232,6 +232,7 @@ RestorationRandom: Creates items randomly from a specified list. Its multiplied Resurrection: Resurrects target Player or Summon. ResurrectionSpecial: Resurrects target Player or Summon only in specified instance IDs. Reuse: Decreases skill reuse time based on its magic type. +ReuseSkillById: Resets reuse time for the skill with the specific id. (l2jmobius) RewardItemOnExit: Reward an item when effect ends. (l2jmobius) Root: Stops movement. SacrificeSummon: Sacrifices the players summon. (l2jmobius)