diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/EffectMasterHandler.java index 038f25abd8..0a9d59c545 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -226,6 +226,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MaxMagicCriticalRate", MaxMagicCriticalRate::new); EffectHandler.getInstance().registerHandler("MaxMp", MaxMp::new); EffectHandler.getInstance().registerHandler("ModifyDeathPoints", ModifyDeathPoints::new); + EffectHandler.getInstance().registerHandler("ModifyMagicLampPoints", ModifyMagicLampPoints::new); EffectHandler.getInstance().registerHandler("ModifyVital", ModifyVital::new); EffectHandler.getInstance().registerHandler("Mp", Mp::new); EffectHandler.getInstance().registerHandler("MpConsumePerLevel", MpConsumePerLevel::new); diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/ModifyMagicLampPoints.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/ModifyMagicLampPoints.java new file mode 100644 index 0000000000..9c85b3936d --- /dev/null +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/ModifyMagicLampPoints.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 org.l2jmobius.gameserver.data.xml.MagicLampData; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.effects.AbstractEffect; +import org.l2jmobius.gameserver.model.items.instance.ItemInstance; +import org.l2jmobius.gameserver.model.skills.Skill; + +/** + * @author Mobius + */ +public class ModifyMagicLampPoints extends AbstractEffect +{ + private final int _amount; + + public ModifyMagicLampPoints(StatSet params) + { + _amount = params.getInt("amount"); + } + + @Override + public boolean isInstant() + { + return true; + } + + @Override + public void instant(Creature effector, Creature effected, Skill skill, ItemInstance item) + { + if (effected == null) + { + return; + } + + final PlayerInstance player = effected.getActingPlayer(); + if (player == null) + { + return; + } + + MagicLampData.getInstance().addLampExp(player, _amount); + } +} diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/skills/documentation.txt index 2bd0856261..58d6c9593a 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/skills/documentation.txt @@ -196,6 +196,7 @@ MaxHp: Max. HP stat. MaxMagicCriticalRate: Stat that overrides the default config MAX_MCRIT_RATE. (l2jmobius) MaxMp: Max. MP stat. ModifyDeathPoints: Modifies player Death Point count. (l2jmobius) +ModifyMagicLampPoints: Modifies player MagicLamp point count. (l2jmobius) ModifyVital: Modifies current HP/MP/CP MpConsumePerLevel: Consumes mana over time depending on your level. Mp: Increases current MP by a given static amount. diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/data/xml/MagicLampData.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/data/xml/MagicLampData.java index 86db299d3f..7ef68533c7 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/data/xml/MagicLampData.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/data/xml/MagicLampData.java @@ -68,7 +68,7 @@ public class MagicLampData implements IXmlReader })); } - public void addLampExp(final PlayerInstance player, final double exp) + public void addLampExp(PlayerInstance player, double exp) { if (Config.MAGIC_LAMP_ENABLE) {