Support for additional potion bonuses.
This commit is contained in:
		@@ -37,6 +37,9 @@ public final class EffectMasterHandler
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("AbsorbDamage", AbsorbDamage::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("Accuracy", Accuracy::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("AddHate", AddHate::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("AdditionalPotionCp", AdditionalPotionCp::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("AdditionalPotionHp", AdditionalPotionHp::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("AdditionalPotionMp", AdditionalPotionMp::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("AddSkillBySkill", AddSkillBySkill::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("AddTeleportBookmarkSlot", AddTeleportBookmarkSlot::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("AirBind", AirBind::new);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										31
									
								
								L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,31 @@
 | 
			
		||||
/*
 | 
			
		||||
 * 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 com.l2jmobius.gameserver.model.StatsSet;
 | 
			
		||||
import com.l2jmobius.gameserver.model.stats.Stats;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author Mobius
 | 
			
		||||
 */
 | 
			
		||||
public class AdditionalPotionCp extends AbstractStatAddEffect
 | 
			
		||||
{
 | 
			
		||||
	public AdditionalPotionCp(StatsSet params)
 | 
			
		||||
	{
 | 
			
		||||
		super(params, Stats.ADDITIONAL_POTION_CP);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										31
									
								
								L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,31 @@
 | 
			
		||||
/*
 | 
			
		||||
 * 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 com.l2jmobius.gameserver.model.StatsSet;
 | 
			
		||||
import com.l2jmobius.gameserver.model.stats.Stats;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author Mobius
 | 
			
		||||
 */
 | 
			
		||||
public class AdditionalPotionHp extends AbstractStatAddEffect
 | 
			
		||||
{
 | 
			
		||||
	public AdditionalPotionHp(StatsSet params)
 | 
			
		||||
	{
 | 
			
		||||
		super(params, Stats.ADDITIONAL_POTION_HP);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										31
									
								
								L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,31 @@
 | 
			
		||||
/*
 | 
			
		||||
 * 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 com.l2jmobius.gameserver.model.StatsSet;
 | 
			
		||||
import com.l2jmobius.gameserver.model.stats.Stats;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author Mobius
 | 
			
		||||
 */
 | 
			
		||||
public class AdditionalPotionMp extends AbstractStatAddEffect
 | 
			
		||||
{
 | 
			
		||||
	public AdditionalPotionMp(StatsSet params)
 | 
			
		||||
	{
 | 
			
		||||
		super(params, Stats.ADDITIONAL_POTION_MP);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@@ -22,6 +22,7 @@ import com.l2jmobius.gameserver.model.actor.L2Character;
 | 
			
		||||
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.model.stats.Stats;
 | 
			
		||||
import com.l2jmobius.gameserver.network.SystemMessageId;
 | 
			
		||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
 | 
			
		||||
 | 
			
		||||
@@ -54,17 +55,23 @@ public final class Cp extends AbstractEffect
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		int basicAmount = _amount;
 | 
			
		||||
		if ((item != null) && (item.isPotion() || item.isElixir()))
 | 
			
		||||
		{
 | 
			
		||||
			basicAmount += effected.getStat().getValue(Stats.ADDITIONAL_POTION_CP, 0);
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		double amount = 0;
 | 
			
		||||
		switch (_mode)
 | 
			
		||||
		{
 | 
			
		||||
			case DIFF:
 | 
			
		||||
			{
 | 
			
		||||
				amount = Math.min(_amount, effected.getMaxRecoverableCp() - effected.getCurrentCp());
 | 
			
		||||
				amount = Math.min(basicAmount, effected.getMaxRecoverableCp() - effected.getCurrentCp());
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
			case PER:
 | 
			
		||||
			{
 | 
			
		||||
				amount = Math.min((effected.getMaxCp() * _amount) / 100.0, effected.getMaxRecoverableCp() - effected.getCurrentCp());
 | 
			
		||||
				amount = Math.min((effected.getMaxCp() * basicAmount) / 100.0, effected.getMaxRecoverableCp() - effected.getCurrentCp());
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -22,6 +22,7 @@ import com.l2jmobius.gameserver.model.effects.AbstractEffect;
 | 
			
		||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
 | 
			
		||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
 | 
			
		||||
import com.l2jmobius.gameserver.model.skills.Skill;
 | 
			
		||||
import com.l2jmobius.gameserver.model.stats.Stats;
 | 
			
		||||
import com.l2jmobius.gameserver.network.SystemMessageId;
 | 
			
		||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
 | 
			
		||||
 | 
			
		||||
@@ -59,6 +60,10 @@ public final class CpHeal extends AbstractEffect
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		double amount = _power;
 | 
			
		||||
		if ((item != null) && (item.isPotion() || item.isElixir()))
 | 
			
		||||
		{
 | 
			
		||||
			amount += effected.getStat().getValue(Stats.ADDITIONAL_POTION_CP, 0);
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		// Prevents overheal and negative amount
 | 
			
		||||
		amount = Math.max(Math.min(amount, effected.getMaxRecoverableCp() - effected.getCurrentCp()), 0);
 | 
			
		||||
 
 | 
			
		||||
@@ -19,7 +19,9 @@ package handlers.effecthandlers;
 | 
			
		||||
import com.l2jmobius.gameserver.model.StatsSet;
 | 
			
		||||
import com.l2jmobius.gameserver.model.actor.L2Character;
 | 
			
		||||
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.model.stats.Stats;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Cp Heal Over Time effect implementation.
 | 
			
		||||
@@ -35,7 +37,7 @@ public final class CpHealOverTime extends AbstractEffect
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
	public boolean onActionTime(L2Character effector, L2Character effected, Skill skill)
 | 
			
		||||
	public boolean onActionTime(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
 | 
			
		||||
	{
 | 
			
		||||
		if (effected.isDead())
 | 
			
		||||
		{
 | 
			
		||||
@@ -51,7 +53,13 @@ public final class CpHealOverTime extends AbstractEffect
 | 
			
		||||
			return false;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		cp += _power * getTicksMultiplier();
 | 
			
		||||
		double power = _power;
 | 
			
		||||
		if ((item != null) && (item.isPotion() || item.isElixir()))
 | 
			
		||||
		{
 | 
			
		||||
			power += effected.getStat().getValue(Stats.ADDITIONAL_POTION_CP, 0) / getTicks();
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		cp += power * getTicksMultiplier();
 | 
			
		||||
		cp = Math.min(cp, maxcp);
 | 
			
		||||
		effected.setCurrentCp(cp, false);
 | 
			
		||||
		effected.broadcastStatusUpdate(effector);
 | 
			
		||||
 
 | 
			
		||||
@@ -21,6 +21,7 @@ import com.l2jmobius.gameserver.model.actor.L2Character;
 | 
			
		||||
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.model.stats.Stats;
 | 
			
		||||
import com.l2jmobius.gameserver.network.SystemMessageId;
 | 
			
		||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
 | 
			
		||||
 | 
			
		||||
@@ -56,6 +57,11 @@ public final class CpHealPercent extends AbstractEffect
 | 
			
		||||
		final boolean full = (power == 100.0);
 | 
			
		||||
		
 | 
			
		||||
		amount = full ? effected.getMaxCp() : (effected.getMaxCp() * power) / 100.0;
 | 
			
		||||
		if ((item != null) && (item.isPotion() || item.isElixir()))
 | 
			
		||||
		{
 | 
			
		||||
			amount += effected.getStat().getValue(Stats.ADDITIONAL_POTION_CP, 0);
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		// Prevents overheal and negative amount
 | 
			
		||||
		amount = Math.max(Math.min(amount, effected.getMaxRecoverableCp() - effected.getCurrentCp()), 0);
 | 
			
		||||
		if (amount != 0)
 | 
			
		||||
 
 | 
			
		||||
@@ -70,6 +70,11 @@ public final class Heal extends AbstractEffect
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		double amount = _power;
 | 
			
		||||
		if ((item != null) && (item.isPotion() || item.isElixir()))
 | 
			
		||||
		{
 | 
			
		||||
			amount += effected.getStat().getValue(Stats.ADDITIONAL_POTION_HP, 0);
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		double staticShotBonus = 0;
 | 
			
		||||
		double mAtkMul = 1;
 | 
			
		||||
		final boolean sps = skill.isMagic() && effector.isChargedShot(ShotType.SPIRITSHOTS);
 | 
			
		||||
 
 | 
			
		||||
@@ -19,8 +19,10 @@ package handlers.effecthandlers;
 | 
			
		||||
import com.l2jmobius.gameserver.model.StatsSet;
 | 
			
		||||
import com.l2jmobius.gameserver.model.actor.L2Character;
 | 
			
		||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
 | 
			
		||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
 | 
			
		||||
import com.l2jmobius.gameserver.model.skills.AbnormalType;
 | 
			
		||||
import com.l2jmobius.gameserver.model.skills.Skill;
 | 
			
		||||
import com.l2jmobius.gameserver.model.stats.Stats;
 | 
			
		||||
import com.l2jmobius.gameserver.network.serverpackets.ExRegenMax;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@@ -37,7 +39,7 @@ public final class HealOverTime extends AbstractEffect
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
	public boolean onActionTime(L2Character effector, L2Character effected, Skill skill)
 | 
			
		||||
	public boolean onActionTime(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
 | 
			
		||||
	{
 | 
			
		||||
		if (effected.isDead() || effected.isDoor())
 | 
			
		||||
		{
 | 
			
		||||
@@ -53,7 +55,13 @@ public final class HealOverTime extends AbstractEffect
 | 
			
		||||
			return false;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		hp += _power * getTicksMultiplier();
 | 
			
		||||
		double power = _power;
 | 
			
		||||
		if ((item != null) && (item.isPotion() || item.isElixir()))
 | 
			
		||||
		{
 | 
			
		||||
			power += effected.getStat().getValue(Stats.ADDITIONAL_POTION_HP, 0) / getTicks();
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		hp += power * getTicksMultiplier();
 | 
			
		||||
		hp = Math.min(hp, maxhp);
 | 
			
		||||
		effected.setCurrentHp(hp, false);
 | 
			
		||||
		effected.broadcastStatusUpdate(effector);
 | 
			
		||||
@@ -61,11 +69,21 @@ public final class HealOverTime extends AbstractEffect
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
	public void onStart(L2Character effector, L2Character effected, Skill skill)
 | 
			
		||||
	public void onStart(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
 | 
			
		||||
	{
 | 
			
		||||
		if (effected.isPlayer() && (getTicks() > 0) && (skill.getAbnormalType() == AbnormalType.HP_RECOVER))
 | 
			
		||||
		{
 | 
			
		||||
			effected.sendPacket(new ExRegenMax(skill.getAbnormalTime(), getTicks(), _power));
 | 
			
		||||
			double power = _power;
 | 
			
		||||
			if ((item != null) && (item.isPotion() || item.isElixir()))
 | 
			
		||||
			{
 | 
			
		||||
				final double bonus = effected.getStat().getValue(Stats.ADDITIONAL_POTION_HP, 0);
 | 
			
		||||
				if (bonus > 0)
 | 
			
		||||
				{
 | 
			
		||||
					power += bonus / getTicks();
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			
 | 
			
		||||
			effected.sendPacket(new ExRegenMax(skill.getAbnormalTime(), getTicks(), power));
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -22,6 +22,7 @@ import com.l2jmobius.gameserver.model.effects.AbstractEffect;
 | 
			
		||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
 | 
			
		||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
 | 
			
		||||
import com.l2jmobius.gameserver.model.skills.Skill;
 | 
			
		||||
import com.l2jmobius.gameserver.model.stats.Stats;
 | 
			
		||||
import com.l2jmobius.gameserver.network.SystemMessageId;
 | 
			
		||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
 | 
			
		||||
 | 
			
		||||
@@ -63,6 +64,11 @@ public final class HealPercent extends AbstractEffect
 | 
			
		||||
		final boolean full = (power == 100.0);
 | 
			
		||||
		
 | 
			
		||||
		amount = full ? effected.getMaxHp() : (effected.getMaxHp() * power) / 100.0;
 | 
			
		||||
		if ((item != null) && (item.isPotion() || item.isElixir()))
 | 
			
		||||
		{
 | 
			
		||||
			amount += effected.getStat().getValue(Stats.ADDITIONAL_POTION_HP, 0);
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		// Prevents overheal
 | 
			
		||||
		amount = Math.min(amount, effected.getMaxRecoverableHp() - effected.getCurrentHp());
 | 
			
		||||
		if (amount >= 0)
 | 
			
		||||
 
 | 
			
		||||
@@ -22,6 +22,7 @@ import com.l2jmobius.gameserver.model.actor.L2Character;
 | 
			
		||||
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.model.stats.Stats;
 | 
			
		||||
import com.l2jmobius.gameserver.network.SystemMessageId;
 | 
			
		||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
 | 
			
		||||
 | 
			
		||||
@@ -54,17 +55,23 @@ public final class Hp extends AbstractEffect
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		int basicAmount = _amount;
 | 
			
		||||
		if ((item != null) && (item.isPotion() || item.isElixir()))
 | 
			
		||||
		{
 | 
			
		||||
			basicAmount += effected.getStat().getValue(Stats.ADDITIONAL_POTION_HP, 0);
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		double amount = 0;
 | 
			
		||||
		switch (_mode)
 | 
			
		||||
		{
 | 
			
		||||
			case DIFF:
 | 
			
		||||
			{
 | 
			
		||||
				amount = Math.min(_amount, effected.getMaxRecoverableHp() - effected.getCurrentHp());
 | 
			
		||||
				amount = Math.min(basicAmount, effected.getMaxRecoverableHp() - effected.getCurrentHp());
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
			case PER:
 | 
			
		||||
			{
 | 
			
		||||
				amount = Math.min((effected.getMaxHp() * _amount) / 100.0, effected.getMaxRecoverableHp() - effected.getCurrentHp());
 | 
			
		||||
				amount = Math.min((effected.getMaxHp() * basicAmount) / 100.0, effected.getMaxRecoverableHp() - effected.getCurrentHp());
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -59,6 +59,10 @@ public final class ManaHeal extends AbstractEffect
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		double amount = _power;
 | 
			
		||||
		if ((item != null) && (item.isPotion() || item.isElixir()))
 | 
			
		||||
		{
 | 
			
		||||
			amount += effected.getStat().getValue(Stats.ADDITIONAL_POTION_MP, 0);
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		if (!skill.isStatic())
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -19,7 +19,9 @@ package handlers.effecthandlers;
 | 
			
		||||
import com.l2jmobius.gameserver.model.StatsSet;
 | 
			
		||||
import com.l2jmobius.gameserver.model.actor.L2Character;
 | 
			
		||||
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.model.stats.Stats;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Mana Heal Over Time effect implementation.
 | 
			
		||||
@@ -35,7 +37,7 @@ public final class ManaHealOverTime extends AbstractEffect
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
	public boolean onActionTime(L2Character effector, L2Character effected, Skill skill)
 | 
			
		||||
	public boolean onActionTime(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
 | 
			
		||||
	{
 | 
			
		||||
		if (effected.isDead())
 | 
			
		||||
		{
 | 
			
		||||
@@ -51,7 +53,13 @@ public final class ManaHealOverTime extends AbstractEffect
 | 
			
		||||
			return true;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		mp += _power * getTicksMultiplier();
 | 
			
		||||
		double power = _power;
 | 
			
		||||
		if ((item != null) && (item.isPotion() || item.isElixir()))
 | 
			
		||||
		{
 | 
			
		||||
			power += effected.getStat().getValue(Stats.ADDITIONAL_POTION_MP, 0) / getTicks();
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		mp += power * getTicksMultiplier();
 | 
			
		||||
		mp = Math.min(mp, maxmp);
 | 
			
		||||
		effected.setCurrentMp(mp, false);
 | 
			
		||||
		effected.broadcastStatusUpdate(effector);
 | 
			
		||||
 
 | 
			
		||||
@@ -22,6 +22,7 @@ import com.l2jmobius.gameserver.model.effects.AbstractEffect;
 | 
			
		||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
 | 
			
		||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
 | 
			
		||||
import com.l2jmobius.gameserver.model.skills.Skill;
 | 
			
		||||
import com.l2jmobius.gameserver.model.stats.Stats;
 | 
			
		||||
import com.l2jmobius.gameserver.network.SystemMessageId;
 | 
			
		||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
 | 
			
		||||
 | 
			
		||||
@@ -63,6 +64,11 @@ public final class ManaHealPercent extends AbstractEffect
 | 
			
		||||
		final boolean full = (power == 100.0);
 | 
			
		||||
		
 | 
			
		||||
		amount = full ? effected.getMaxMp() : (effected.getMaxMp() * power) / 100.0;
 | 
			
		||||
		if ((item != null) && (item.isPotion() || item.isElixir()))
 | 
			
		||||
		{
 | 
			
		||||
			amount += effected.getStat().getValue(Stats.ADDITIONAL_POTION_MP, 0);
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		// Prevents overheal
 | 
			
		||||
		amount = Math.min(amount, effected.getMaxRecoverableMp() - effected.getCurrentMp());
 | 
			
		||||
		if (amount != 0)
 | 
			
		||||
 
 | 
			
		||||
@@ -22,6 +22,7 @@ import com.l2jmobius.gameserver.model.actor.L2Character;
 | 
			
		||||
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.model.stats.Stats;
 | 
			
		||||
import com.l2jmobius.gameserver.network.SystemMessageId;
 | 
			
		||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
 | 
			
		||||
 | 
			
		||||
@@ -54,17 +55,23 @@ public final class Mp extends AbstractEffect
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		int basicAmount = _amount;
 | 
			
		||||
		if ((item != null) && (item.isPotion() || item.isElixir()))
 | 
			
		||||
		{
 | 
			
		||||
			basicAmount += effected.getStat().getValue(Stats.ADDITIONAL_POTION_MP, 0);
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		double amount = 0;
 | 
			
		||||
		switch (_mode)
 | 
			
		||||
		{
 | 
			
		||||
			case DIFF:
 | 
			
		||||
			{
 | 
			
		||||
				amount = Math.min(_amount, effected.getMaxRecoverableMp() - effected.getCurrentMp());
 | 
			
		||||
				amount = Math.min(basicAmount, effected.getMaxRecoverableMp() - effected.getCurrentMp());
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
			case PER:
 | 
			
		||||
			{
 | 
			
		||||
				amount = Math.min((effected.getMaxMp() * _amount) / 100.0, effected.getMaxRecoverableMp() - effected.getCurrentMp());
 | 
			
		||||
				amount = Math.min((effected.getMaxMp() * basicAmount) / 100.0, effected.getMaxRecoverableMp() - effected.getCurrentMp());
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -6,6 +6,9 @@ AbstractStatAddEffect: Abstract class for managing stat adding.
 | 
			
		||||
AbstractStatEffect: Abstract class for managing stats.
 | 
			
		||||
Accuracy: P. Accuracy stat.
 | 
			
		||||
AddHate: Instant effect that increases target's hate towards you.
 | 
			
		||||
AdditionalPotionCp: Increases the amount of CP heal gained from potions or elixirs. (l2jmobius)
 | 
			
		||||
AdditionalPotionHp: Increases the amount of HP heal gained from potions or elixirs. (l2jmobius)
 | 
			
		||||
AdditionalPotionMp: Increases the amount of MP heal gained from potions or elixirs. (l2jmobius)
 | 
			
		||||
AddSkillBySkill: Add skill when other skill already exists. (l2jmobius)
 | 
			
		||||
AddTeleportBookmarkSlot: Instant effect that increases the amount of My Teleport slots.
 | 
			
		||||
AirBind: Used by airbind chain skills. (l2jmobius)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user