Addition of StatMulForLevel effect.
Contributed by MacuK.
This commit is contained in:
@@ -345,6 +345,7 @@ public class EffectMasterHandler
|
||||
EffectHandler.getInstance().registerHandler("StatBonusSkillCritical", StatBonusSkillCritical::new);
|
||||
EffectHandler.getInstance().registerHandler("StatBonusSpeed", StatBonusSpeed::new);
|
||||
EffectHandler.getInstance().registerHandler("StatByMoveType", StatByMoveType::new);
|
||||
EffectHandler.getInstance().registerHandler("StatMulForLevel", StatMulForLevel::new);
|
||||
EffectHandler.getInstance().registerHandler("StatUp", StatUp::new);
|
||||
EffectHandler.getInstance().registerHandler("StealAbnormal", StealAbnormal::new);
|
||||
EffectHandler.getInstance().registerHandler("Summon", Summon::new);
|
||||
|
65
L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/effecthandlers/StatMulForLevel.java
vendored
Normal file
65
L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/effecthandlers/StatMulForLevel.java
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* 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 java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.StatModifierType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class StatMulForLevel extends AbstractEffect
|
||||
{
|
||||
private final Stat _stat;
|
||||
private final Map<Integer, Integer> _values;
|
||||
|
||||
public StatMulForLevel(StatSet params)
|
||||
{
|
||||
_stat = params.getEnum("stat", Stat.class);
|
||||
|
||||
final List<Integer> amount = params.getIntegerList("amount");
|
||||
_values = new HashMap<>(amount.size());
|
||||
int index = 0;
|
||||
for (Integer level : params.getIntegerList("level"))
|
||||
{
|
||||
_values.put(level, amount.get(index++));
|
||||
}
|
||||
|
||||
if (params.getEnum("mode", StatModifierType.class, StatModifierType.PER) != StatModifierType.PER)
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + " can only use PER mode.");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pump(Creature effected, Skill skill)
|
||||
{
|
||||
final Integer amount = _values.get(effected.getLevel());
|
||||
if (amount != null)
|
||||
{
|
||||
effected.getStat().mergeMul(_stat, (amount / 100) + 1);
|
||||
}
|
||||
}
|
||||
}
|
@@ -313,6 +313,7 @@ StatAddForMp: Adds a fixed amount of a Stat for when player max MP is over a val
|
||||
StatBonusSkillCritical: Changes skill critical rate to depend on the specified base stat.
|
||||
StatBonusSpeed: Changes Speed stat to depend on the specified base stat.
|
||||
StatByMoveType: Adds stat based on your movement type (standing, running, walking).
|
||||
StatMulForLevel: Multiplies a fixed amount of a Stat for a specific player level. (l2jmobius)
|
||||
StatUp: Increases the specified base stat.
|
||||
StealAbnormal: Steals enemy's buffs.
|
||||
Summon: Summons a servitor.
|
||||
|
Reference in New Issue
Block a user