Addition of ModifyMagicLampPoints effect handler.

This commit is contained in:
MobiusDevelopment 2021-01-04 22:52:31 +00:00
parent 54513f2913
commit 3c94ec8792
4 changed files with 64 additions and 1 deletions

View File

@ -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);

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
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);
}
}

View File

@ -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.

View File

@ -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)
{