Fixed toggle mp consume.
This commit is contained in:
parent
cdbbd6dd18
commit
1b6b89acbf
@ -17,6 +17,7 @@
|
|||||||
package handlers.effecthandlers;
|
package handlers.effecthandlers;
|
||||||
|
|
||||||
import com.l2jmobius.gameserver.model.StatsSet;
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
import com.l2jmobius.gameserver.model.conditions.Condition;
|
import com.l2jmobius.gameserver.model.conditions.Condition;
|
||||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||||
import com.l2jmobius.gameserver.model.skills.BuffInfo;
|
import com.l2jmobius.gameserver.model.skills.BuffInfo;
|
||||||
@ -39,20 +40,20 @@ public final class MpConsumePerLevel extends AbstractEffect
|
|||||||
@Override
|
@Override
|
||||||
public boolean onActionTime(BuffInfo info)
|
public boolean onActionTime(BuffInfo info)
|
||||||
{
|
{
|
||||||
if (info.getEffected().isDead())
|
final L2Character target = info.getEffected();
|
||||||
|
if (target.isDead())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
final double base = _power * getTicksMultiplier();
|
final double consume = _power * getTicksMultiplier() * ((target.getLevel() - 1) / 7.5);
|
||||||
final double consume = (info.getAbnormalTime() > 0) ? ((info.getEffected().getLevel() - 1) / 7.5) * base * info.getAbnormalTime() : base;
|
if (consume > target.getCurrentMp())
|
||||||
if (consume > info.getEffected().getCurrentMp())
|
|
||||||
{
|
{
|
||||||
info.getEffected().sendPacket(SystemMessageId.YOUR_SKILL_WAS_DEACTIVATED_DUE_TO_LACK_OF_MP);
|
target.sendPacket(SystemMessageId.YOUR_SKILL_WAS_DEACTIVATED_DUE_TO_LACK_OF_MP);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
info.getEffected().reduceCurrentMp(consume);
|
target.reduceCurrentMp(consume);
|
||||||
return info.getSkill().isToggle();
|
return info.getSkill().isToggle();
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user