diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/EffectMasterHandler.java index f6a548186c..442d850e32 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -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); diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java new file mode 100644 index 0000000000..9a91a1c057 --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java new file mode 100644 index 0000000000..c98645baf2 --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java new file mode 100644 index 0000000000..ec1da0851c --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Cp.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Cp.java index 9c34f60b62..8675f9ab79 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Cp.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Cp.java @@ -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; } } diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java index 186137d565..81cb5b46dd 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java @@ -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); diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java index bc5e693a78..9eac6954f7 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java @@ -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); diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java index 94d2ff3c6b..4102d0f843 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java @@ -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) diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Heal.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Heal.java index 109a70b11b..1f81bd92a8 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Heal.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Heal.java @@ -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); diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java index fc88d64de0..1eb798681f 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java @@ -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)); } } } diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java index b7231e71be..24fe9b2349 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java @@ -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) diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Hp.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Hp.java index cd28f926cb..75dd285a5e 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Hp.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Hp.java @@ -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; } } diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java index 47b003ec45..faca7bfa02 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java @@ -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()) { diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java index fefa4ffef1..a6d00a2a2f 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java @@ -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); diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java index b3b7aa52ba..1c648c408a 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java @@ -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) diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Mp.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Mp.java index 617fcc3fdb..f7abaa1469 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Mp.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Mp.java @@ -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; } } diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/documentation.txt index 16a19b6c06..e6d2674e1e 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/documentation.txt @@ -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) diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java index 805960c36b..66dfeaf025 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java @@ -97,16 +97,35 @@ public abstract class AbstractEffect } - public void onStart(L2Character effector, L2Character effected, Skill skill) + public void onStart(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) { } + public void onStart(L2Character effector, L2Character effected, Skill skill) + { + onStart(effector, effected, skill, null); + } + public void onExit(L2Character effector, L2Character effected, Skill skill) { } + /** + * Called on each tick.
+ * If the abnormal time is lesser than zero it will last forever. + * @param effector + * @param effected + * @param skill + * @param item + * @return if {@code true} this effect will continue forever, if {@code false} it will stop after abnormal time has passed + */ + public boolean onActionTime(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) + { + return false; + } + /** * Called on each tick.
* If the abnormal time is lesser than zero it will last forever. @@ -117,7 +136,7 @@ public abstract class AbstractEffect */ public boolean onActionTime(L2Character effector, L2Character effected, Skill skill) { - return false; + return onActionTime(effector, effected, skill, null); } /** diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java index 8e361a6566..90f0dc9f8b 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java @@ -333,7 +333,7 @@ public final class BuffInfo } // Call on start. - effect.onStart(_effector, _effected, _skill); + effect.onStart(_effector, _effected, _skill, _item); // If it's a continuous effect, if has ticks schedule a task with period, otherwise schedule a simple task to end it. if (effect.getTicks() > 0) @@ -360,7 +360,7 @@ public final class BuffInfo if (_isInUse) { // Callback for on action time event. - continueForever = effect.onActionTime(_effector, _effected, _skill); + continueForever = effect.onActionTime(_effector, _effected, _skill, _item); } if (!continueForever && _skill.isToggle()) diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/stats/Stats.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/stats/Stats.java index 7a5d12bb24..7e3abc492a 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/stats/Stats.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/stats/Stats.java @@ -68,6 +68,9 @@ public enum Stats REGENERATE_HP_RATE("regHp", new RegenHPFinalizer()), REGENERATE_CP_RATE("regCp", new RegenCPFinalizer()), REGENERATE_MP_RATE("regMp", new RegenMPFinalizer()), + ADDITIONAL_POTION_HP("addPotionHp"), + ADDITIONAL_POTION_MP("addPotionMp"), + ADDITIONAL_POTION_CP("addPotionCp"), MANA_CHARGE("manaCharge"), HEAL_EFFECT("healEffect"), diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/EffectMasterHandler.java index f6a548186c..442d850e32 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -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); diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java new file mode 100644 index 0000000000..9a91a1c057 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java new file mode 100644 index 0000000000..c98645baf2 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java new file mode 100644 index 0000000000..ec1da0851c --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Cp.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Cp.java index 9c34f60b62..8675f9ab79 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Cp.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Cp.java @@ -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; } } diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java index 186137d565..81cb5b46dd 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java @@ -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); diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java index bc5e693a78..9eac6954f7 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java @@ -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); diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java index 94d2ff3c6b..4102d0f843 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java @@ -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) diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Heal.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Heal.java index 109a70b11b..1f81bd92a8 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Heal.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Heal.java @@ -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); diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java index fc88d64de0..1eb798681f 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java @@ -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)); } } } diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java index b7231e71be..24fe9b2349 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java @@ -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) diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Hp.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Hp.java index cd28f926cb..75dd285a5e 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Hp.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Hp.java @@ -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; } } diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java index 47b003ec45..faca7bfa02 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java @@ -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()) { diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java index fefa4ffef1..a6d00a2a2f 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java @@ -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); diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java index b3b7aa52ba..1c648c408a 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java @@ -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) diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Mp.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Mp.java index 617fcc3fdb..f7abaa1469 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Mp.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Mp.java @@ -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; } } diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/documentation.txt index 16a19b6c06..e6d2674e1e 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/documentation.txt @@ -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) diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java index 805960c36b..66dfeaf025 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java @@ -97,16 +97,35 @@ public abstract class AbstractEffect } - public void onStart(L2Character effector, L2Character effected, Skill skill) + public void onStart(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) { } + public void onStart(L2Character effector, L2Character effected, Skill skill) + { + onStart(effector, effected, skill, null); + } + public void onExit(L2Character effector, L2Character effected, Skill skill) { } + /** + * Called on each tick.
+ * If the abnormal time is lesser than zero it will last forever. + * @param effector + * @param effected + * @param skill + * @param item + * @return if {@code true} this effect will continue forever, if {@code false} it will stop after abnormal time has passed + */ + public boolean onActionTime(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) + { + return false; + } + /** * Called on each tick.
* If the abnormal time is lesser than zero it will last forever. @@ -117,7 +136,7 @@ public abstract class AbstractEffect */ public boolean onActionTime(L2Character effector, L2Character effected, Skill skill) { - return false; + return onActionTime(effector, effected, skill, null); } /** diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java index 8e361a6566..90f0dc9f8b 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java @@ -333,7 +333,7 @@ public final class BuffInfo } // Call on start. - effect.onStart(_effector, _effected, _skill); + effect.onStart(_effector, _effected, _skill, _item); // If it's a continuous effect, if has ticks schedule a task with period, otherwise schedule a simple task to end it. if (effect.getTicks() > 0) @@ -360,7 +360,7 @@ public final class BuffInfo if (_isInUse) { // Callback for on action time event. - continueForever = effect.onActionTime(_effector, _effected, _skill); + continueForever = effect.onActionTime(_effector, _effected, _skill, _item); } if (!continueForever && _skill.isToggle()) diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/stats/Stats.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/stats/Stats.java index 7a5d12bb24..7e3abc492a 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/stats/Stats.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/stats/Stats.java @@ -68,6 +68,9 @@ public enum Stats REGENERATE_HP_RATE("regHp", new RegenHPFinalizer()), REGENERATE_CP_RATE("regCp", new RegenCPFinalizer()), REGENERATE_MP_RATE("regMp", new RegenMPFinalizer()), + ADDITIONAL_POTION_HP("addPotionHp"), + ADDITIONAL_POTION_MP("addPotionMp"), + ADDITIONAL_POTION_CP("addPotionCp"), MANA_CHARGE("manaCharge"), HEAL_EFFECT("healEffect"), diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/EffectMasterHandler.java index f6a548186c..442d850e32 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -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); diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java new file mode 100644 index 0000000000..9a91a1c057 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java new file mode 100644 index 0000000000..c98645baf2 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java new file mode 100644 index 0000000000..ec1da0851c --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Cp.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Cp.java index 9c34f60b62..8675f9ab79 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Cp.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Cp.java @@ -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; } } diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java index 186137d565..81cb5b46dd 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java @@ -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); diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java index bc5e693a78..9eac6954f7 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java @@ -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); diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java index 94d2ff3c6b..4102d0f843 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java @@ -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) diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Heal.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Heal.java index 109a70b11b..1f81bd92a8 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Heal.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Heal.java @@ -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); diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java index fc88d64de0..1eb798681f 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java @@ -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)); } } } diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java index b7231e71be..24fe9b2349 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java @@ -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) diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Hp.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Hp.java index cd28f926cb..75dd285a5e 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Hp.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Hp.java @@ -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; } } diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java index 47b003ec45..faca7bfa02 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java @@ -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()) { diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java index fefa4ffef1..a6d00a2a2f 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java @@ -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); diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java index b3b7aa52ba..1c648c408a 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java @@ -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) diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Mp.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Mp.java index 617fcc3fdb..f7abaa1469 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Mp.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Mp.java @@ -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; } } diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/documentation.txt index 16a19b6c06..e6d2674e1e 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/documentation.txt @@ -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) diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java index 805960c36b..66dfeaf025 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java @@ -97,16 +97,35 @@ public abstract class AbstractEffect } - public void onStart(L2Character effector, L2Character effected, Skill skill) + public void onStart(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) { } + public void onStart(L2Character effector, L2Character effected, Skill skill) + { + onStart(effector, effected, skill, null); + } + public void onExit(L2Character effector, L2Character effected, Skill skill) { } + /** + * Called on each tick.
+ * If the abnormal time is lesser than zero it will last forever. + * @param effector + * @param effected + * @param skill + * @param item + * @return if {@code true} this effect will continue forever, if {@code false} it will stop after abnormal time has passed + */ + public boolean onActionTime(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) + { + return false; + } + /** * Called on each tick.
* If the abnormal time is lesser than zero it will last forever. @@ -117,7 +136,7 @@ public abstract class AbstractEffect */ public boolean onActionTime(L2Character effector, L2Character effected, Skill skill) { - return false; + return onActionTime(effector, effected, skill, null); } /** diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java index 8e361a6566..90f0dc9f8b 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java @@ -333,7 +333,7 @@ public final class BuffInfo } // Call on start. - effect.onStart(_effector, _effected, _skill); + effect.onStart(_effector, _effected, _skill, _item); // If it's a continuous effect, if has ticks schedule a task with period, otherwise schedule a simple task to end it. if (effect.getTicks() > 0) @@ -360,7 +360,7 @@ public final class BuffInfo if (_isInUse) { // Callback for on action time event. - continueForever = effect.onActionTime(_effector, _effected, _skill); + continueForever = effect.onActionTime(_effector, _effected, _skill, _item); } if (!continueForever && _skill.isToggle()) diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/stats/Stats.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/stats/Stats.java index 7a5d12bb24..7e3abc492a 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/stats/Stats.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/stats/Stats.java @@ -68,6 +68,9 @@ public enum Stats REGENERATE_HP_RATE("regHp", new RegenHPFinalizer()), REGENERATE_CP_RATE("regCp", new RegenCPFinalizer()), REGENERATE_MP_RATE("regMp", new RegenMPFinalizer()), + ADDITIONAL_POTION_HP("addPotionHp"), + ADDITIONAL_POTION_MP("addPotionMp"), + ADDITIONAL_POTION_CP("addPotionCp"), MANA_CHARGE("manaCharge"), HEAL_EFFECT("healEffect"), diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/EffectMasterHandler.java index b1c0190b2d..32470a23f1 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -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); diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java new file mode 100644 index 0000000000..9a91a1c057 --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java new file mode 100644 index 0000000000..c98645baf2 --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java new file mode 100644 index 0000000000..ec1da0851c --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Cp.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Cp.java index 9c34f60b62..8675f9ab79 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Cp.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Cp.java @@ -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; } } diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java index 186137d565..81cb5b46dd 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java @@ -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); diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java index bc5e693a78..9eac6954f7 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java @@ -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); diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java index 94d2ff3c6b..4102d0f843 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java @@ -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) diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Heal.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Heal.java index 109a70b11b..1f81bd92a8 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Heal.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Heal.java @@ -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); diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java index fc88d64de0..1eb798681f 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java @@ -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)); } } } diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java index b7231e71be..24fe9b2349 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java @@ -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) diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Hp.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Hp.java index cd28f926cb..75dd285a5e 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Hp.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Hp.java @@ -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; } } diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java index 47b003ec45..faca7bfa02 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java @@ -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()) { diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java index fefa4ffef1..a6d00a2a2f 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java @@ -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); diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java index b3b7aa52ba..1c648c408a 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java @@ -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) diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Mp.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Mp.java index 617fcc3fdb..f7abaa1469 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Mp.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Mp.java @@ -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; } } diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/documentation.txt index 474bb4fa89..9d2edf0c2e 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/documentation.txt @@ -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) diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java index 805960c36b..66dfeaf025 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java @@ -97,16 +97,35 @@ public abstract class AbstractEffect } - public void onStart(L2Character effector, L2Character effected, Skill skill) + public void onStart(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) { } + public void onStart(L2Character effector, L2Character effected, Skill skill) + { + onStart(effector, effected, skill, null); + } + public void onExit(L2Character effector, L2Character effected, Skill skill) { } + /** + * Called on each tick.
+ * If the abnormal time is lesser than zero it will last forever. + * @param effector + * @param effected + * @param skill + * @param item + * @return if {@code true} this effect will continue forever, if {@code false} it will stop after abnormal time has passed + */ + public boolean onActionTime(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) + { + return false; + } + /** * Called on each tick.
* If the abnormal time is lesser than zero it will last forever. @@ -117,7 +136,7 @@ public abstract class AbstractEffect */ public boolean onActionTime(L2Character effector, L2Character effected, Skill skill) { - return false; + return onActionTime(effector, effected, skill, null); } /** diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java index 8e361a6566..90f0dc9f8b 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java @@ -333,7 +333,7 @@ public final class BuffInfo } // Call on start. - effect.onStart(_effector, _effected, _skill); + effect.onStart(_effector, _effected, _skill, _item); // If it's a continuous effect, if has ticks schedule a task with period, otherwise schedule a simple task to end it. if (effect.getTicks() > 0) @@ -360,7 +360,7 @@ public final class BuffInfo if (_isInUse) { // Callback for on action time event. - continueForever = effect.onActionTime(_effector, _effected, _skill); + continueForever = effect.onActionTime(_effector, _effected, _skill, _item); } if (!continueForever && _skill.isToggle()) diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/stats/Stats.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/stats/Stats.java index 8ec09001b8..1557afbdb6 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/stats/Stats.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/stats/Stats.java @@ -68,6 +68,9 @@ public enum Stats REGENERATE_HP_RATE("regHp", new RegenHPFinalizer()), REGENERATE_CP_RATE("regCp", new RegenCPFinalizer()), REGENERATE_MP_RATE("regMp", new RegenMPFinalizer()), + ADDITIONAL_POTION_HP("addPotionHp"), + ADDITIONAL_POTION_MP("addPotionMp"), + ADDITIONAL_POTION_CP("addPotionCp"), MANA_CHARGE("manaCharge"), HEAL_EFFECT("healEffect"), diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/EffectMasterHandler.java index 24c491705c..fabc7d0f6e 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -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("AgathionSlot", AgathionSlot::new); diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java new file mode 100644 index 0000000000..9a91a1c057 --- /dev/null +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java new file mode 100644 index 0000000000..c98645baf2 --- /dev/null +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java new file mode 100644 index 0000000000..ec1da0851c --- /dev/null +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Cp.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Cp.java index 9c34f60b62..8675f9ab79 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Cp.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Cp.java @@ -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; } } diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java index 186137d565..81cb5b46dd 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java @@ -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); diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java index bc5e693a78..9eac6954f7 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java @@ -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); diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java index 94d2ff3c6b..4102d0f843 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java @@ -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) diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Heal.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Heal.java index 109a70b11b..1f81bd92a8 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Heal.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Heal.java @@ -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); diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java index fc88d64de0..1eb798681f 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java @@ -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)); } } } diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java index b7231e71be..24fe9b2349 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java @@ -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) diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Hp.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Hp.java index cd28f926cb..75dd285a5e 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Hp.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Hp.java @@ -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; } } diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java index 47b003ec45..faca7bfa02 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java @@ -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()) { diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java index fefa4ffef1..a6d00a2a2f 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java @@ -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); diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java index b3b7aa52ba..1c648c408a 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java @@ -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) diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Mp.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Mp.java index 617fcc3fdb..f7abaa1469 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Mp.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Mp.java @@ -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; } } diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/skills/documentation.txt index 9626945b75..81c31cc3ca 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/skills/documentation.txt @@ -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. AgathionSlot: Agathion slot modifier. (l2jmobius) diff --git a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java index 805960c36b..66dfeaf025 100644 --- a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java +++ b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java @@ -97,16 +97,35 @@ public abstract class AbstractEffect } - public void onStart(L2Character effector, L2Character effected, Skill skill) + public void onStart(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) { } + public void onStart(L2Character effector, L2Character effected, Skill skill) + { + onStart(effector, effected, skill, null); + } + public void onExit(L2Character effector, L2Character effected, Skill skill) { } + /** + * Called on each tick.
+ * If the abnormal time is lesser than zero it will last forever. + * @param effector + * @param effected + * @param skill + * @param item + * @return if {@code true} this effect will continue forever, if {@code false} it will stop after abnormal time has passed + */ + public boolean onActionTime(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) + { + return false; + } + /** * Called on each tick.
* If the abnormal time is lesser than zero it will last forever. @@ -117,7 +136,7 @@ public abstract class AbstractEffect */ public boolean onActionTime(L2Character effector, L2Character effected, Skill skill) { - return false; + return onActionTime(effector, effected, skill, null); } /** diff --git a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java index 8e361a6566..90f0dc9f8b 100644 --- a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java +++ b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java @@ -333,7 +333,7 @@ public final class BuffInfo } // Call on start. - effect.onStart(_effector, _effected, _skill); + effect.onStart(_effector, _effected, _skill, _item); // If it's a continuous effect, if has ticks schedule a task with period, otherwise schedule a simple task to end it. if (effect.getTicks() > 0) @@ -360,7 +360,7 @@ public final class BuffInfo if (_isInUse) { // Callback for on action time event. - continueForever = effect.onActionTime(_effector, _effected, _skill); + continueForever = effect.onActionTime(_effector, _effected, _skill, _item); } if (!continueForever && _skill.isToggle()) diff --git a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/stats/Stats.java b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/stats/Stats.java index 296836e8aa..559d9e4c08 100644 --- a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/stats/Stats.java +++ b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/stats/Stats.java @@ -68,6 +68,9 @@ public enum Stats REGENERATE_HP_RATE("regHp", new RegenHPFinalizer()), REGENERATE_CP_RATE("regCp", new RegenCPFinalizer()), REGENERATE_MP_RATE("regMp", new RegenMPFinalizer()), + ADDITIONAL_POTION_HP("addPotionHp"), + ADDITIONAL_POTION_MP("addPotionMp"), + ADDITIONAL_POTION_CP("addPotionCp"), MANA_CHARGE("manaCharge"), HEAL_EFFECT("healEffect"), diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/EffectMasterHandler.java index bf2ca853d9..b6ff4f773c 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -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("AgathionSlot", AgathionSlot::new); diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java new file mode 100644 index 0000000000..9a91a1c057 --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java new file mode 100644 index 0000000000..c98645baf2 --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java new file mode 100644 index 0000000000..ec1da0851c --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Cp.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Cp.java index 9c34f60b62..8675f9ab79 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Cp.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Cp.java @@ -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; } } diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java index 186137d565..81cb5b46dd 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java @@ -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); diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java index bc5e693a78..9eac6954f7 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java @@ -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); diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java index 94d2ff3c6b..4102d0f843 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java @@ -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) diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Heal.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Heal.java index 109a70b11b..1f81bd92a8 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Heal.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Heal.java @@ -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); diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java index fc88d64de0..1eb798681f 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java @@ -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)); } } } diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java index b7231e71be..24fe9b2349 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java @@ -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) diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Hp.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Hp.java index cd28f926cb..75dd285a5e 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Hp.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Hp.java @@ -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; } } diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java index 47b003ec45..faca7bfa02 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java @@ -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()) { diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java index fefa4ffef1..a6d00a2a2f 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java @@ -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); diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java index b3b7aa52ba..1c648c408a 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java @@ -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) diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Mp.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Mp.java index 617fcc3fdb..f7abaa1469 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Mp.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Mp.java @@ -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; } } diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/skills/documentation.txt index 2a13b19789..33c3bd672b 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/skills/documentation.txt @@ -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. AgathionSlot: Agathion slot modifier. (l2jmobius) diff --git a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java index 805960c36b..66dfeaf025 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java +++ b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java @@ -97,16 +97,35 @@ public abstract class AbstractEffect } - public void onStart(L2Character effector, L2Character effected, Skill skill) + public void onStart(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) { } + public void onStart(L2Character effector, L2Character effected, Skill skill) + { + onStart(effector, effected, skill, null); + } + public void onExit(L2Character effector, L2Character effected, Skill skill) { } + /** + * Called on each tick.
+ * If the abnormal time is lesser than zero it will last forever. + * @param effector + * @param effected + * @param skill + * @param item + * @return if {@code true} this effect will continue forever, if {@code false} it will stop after abnormal time has passed + */ + public boolean onActionTime(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) + { + return false; + } + /** * Called on each tick.
* If the abnormal time is lesser than zero it will last forever. @@ -117,7 +136,7 @@ public abstract class AbstractEffect */ public boolean onActionTime(L2Character effector, L2Character effected, Skill skill) { - return false; + return onActionTime(effector, effected, skill, null); } /** diff --git a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java index 8e361a6566..90f0dc9f8b 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java +++ b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java @@ -333,7 +333,7 @@ public final class BuffInfo } // Call on start. - effect.onStart(_effector, _effected, _skill); + effect.onStart(_effector, _effected, _skill, _item); // If it's a continuous effect, if has ticks schedule a task with period, otherwise schedule a simple task to end it. if (effect.getTicks() > 0) @@ -360,7 +360,7 @@ public final class BuffInfo if (_isInUse) { // Callback for on action time event. - continueForever = effect.onActionTime(_effector, _effected, _skill); + continueForever = effect.onActionTime(_effector, _effected, _skill, _item); } if (!continueForever && _skill.isToggle()) diff --git a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/stats/Stats.java b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/stats/Stats.java index 5df426e084..5a95bdc048 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/stats/Stats.java +++ b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/stats/Stats.java @@ -68,6 +68,9 @@ public enum Stats REGENERATE_HP_RATE("regHp", new RegenHPFinalizer()), REGENERATE_CP_RATE("regCp", new RegenCPFinalizer()), REGENERATE_MP_RATE("regMp", new RegenMPFinalizer()), + ADDITIONAL_POTION_HP("addPotionHp"), + ADDITIONAL_POTION_MP("addPotionMp"), + ADDITIONAL_POTION_CP("addPotionCp"), MANA_CHARGE("manaCharge"), HEAL_EFFECT("healEffect"), diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/EffectMasterHandler.java index bf2ca853d9..b6ff4f773c 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -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("AgathionSlot", AgathionSlot::new); diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java new file mode 100644 index 0000000000..9a91a1c057 --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java new file mode 100644 index 0000000000..c98645baf2 --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java new file mode 100644 index 0000000000..ec1da0851c --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/Cp.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/Cp.java index 9c34f60b62..8675f9ab79 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/Cp.java +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/Cp.java @@ -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; } } diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java index 186137d565..81cb5b46dd 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java @@ -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); diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java index bc5e693a78..9eac6954f7 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java @@ -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); diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java index 94d2ff3c6b..4102d0f843 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java @@ -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) diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/Heal.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/Heal.java index 109a70b11b..1f81bd92a8 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/Heal.java +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/Heal.java @@ -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); diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java index fc88d64de0..1eb798681f 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java @@ -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)); } } } diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java index b7231e71be..24fe9b2349 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java @@ -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) diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/Hp.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/Hp.java index cd28f926cb..75dd285a5e 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/Hp.java +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/Hp.java @@ -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; } } diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java index 47b003ec45..faca7bfa02 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java @@ -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()) { diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java index fefa4ffef1..a6d00a2a2f 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java @@ -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); diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java index b3b7aa52ba..1c648c408a 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java @@ -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) diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/Mp.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/Mp.java index 617fcc3fdb..f7abaa1469 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/Mp.java +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/Mp.java @@ -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; } } diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/skills/documentation.txt index 2a13b19789..33c3bd672b 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/skills/documentation.txt @@ -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. AgathionSlot: Agathion slot modifier. (l2jmobius) diff --git a/L2J_Mobius_6.0_Fafurion/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java b/L2J_Mobius_6.0_Fafurion/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java index 805960c36b..66dfeaf025 100644 --- a/L2J_Mobius_6.0_Fafurion/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java +++ b/L2J_Mobius_6.0_Fafurion/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java @@ -97,16 +97,35 @@ public abstract class AbstractEffect } - public void onStart(L2Character effector, L2Character effected, Skill skill) + public void onStart(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) { } + public void onStart(L2Character effector, L2Character effected, Skill skill) + { + onStart(effector, effected, skill, null); + } + public void onExit(L2Character effector, L2Character effected, Skill skill) { } + /** + * Called on each tick.
+ * If the abnormal time is lesser than zero it will last forever. + * @param effector + * @param effected + * @param skill + * @param item + * @return if {@code true} this effect will continue forever, if {@code false} it will stop after abnormal time has passed + */ + public boolean onActionTime(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) + { + return false; + } + /** * Called on each tick.
* If the abnormal time is lesser than zero it will last forever. @@ -117,7 +136,7 @@ public abstract class AbstractEffect */ public boolean onActionTime(L2Character effector, L2Character effected, Skill skill) { - return false; + return onActionTime(effector, effected, skill, null); } /** diff --git a/L2J_Mobius_6.0_Fafurion/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java b/L2J_Mobius_6.0_Fafurion/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java index 8e361a6566..90f0dc9f8b 100644 --- a/L2J_Mobius_6.0_Fafurion/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java +++ b/L2J_Mobius_6.0_Fafurion/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java @@ -333,7 +333,7 @@ public final class BuffInfo } // Call on start. - effect.onStart(_effector, _effected, _skill); + effect.onStart(_effector, _effected, _skill, _item); // If it's a continuous effect, if has ticks schedule a task with period, otherwise schedule a simple task to end it. if (effect.getTicks() > 0) @@ -360,7 +360,7 @@ public final class BuffInfo if (_isInUse) { // Callback for on action time event. - continueForever = effect.onActionTime(_effector, _effected, _skill); + continueForever = effect.onActionTime(_effector, _effected, _skill, _item); } if (!continueForever && _skill.isToggle()) diff --git a/L2J_Mobius_6.0_Fafurion/java/com/l2jmobius/gameserver/model/stats/Stats.java b/L2J_Mobius_6.0_Fafurion/java/com/l2jmobius/gameserver/model/stats/Stats.java index 5df426e084..5a95bdc048 100644 --- a/L2J_Mobius_6.0_Fafurion/java/com/l2jmobius/gameserver/model/stats/Stats.java +++ b/L2J_Mobius_6.0_Fafurion/java/com/l2jmobius/gameserver/model/stats/Stats.java @@ -68,6 +68,9 @@ public enum Stats REGENERATE_HP_RATE("regHp", new RegenHPFinalizer()), REGENERATE_CP_RATE("regCp", new RegenCPFinalizer()), REGENERATE_MP_RATE("regMp", new RegenMPFinalizer()), + ADDITIONAL_POTION_HP("addPotionHp"), + ADDITIONAL_POTION_MP("addPotionMp"), + ADDITIONAL_POTION_CP("addPotionCp"), MANA_CHARGE("manaCharge"), HEAL_EFFECT("healEffect"), diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/EffectMasterHandler.java index aea7146792..a909fb8652 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -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("AreaDamage", AreaDamage::new); diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java new file mode 100644 index 0000000000..9a91a1c057 --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java new file mode 100644 index 0000000000..c98645baf2 --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java new file mode 100644 index 0000000000..ec1da0851c --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Cp.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Cp.java index 9c34f60b62..8675f9ab79 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Cp.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Cp.java @@ -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; } } diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java index 186137d565..81cb5b46dd 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java @@ -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); diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java index bc5e693a78..9eac6954f7 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java @@ -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); diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java index 94d2ff3c6b..4102d0f843 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java @@ -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) diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Heal.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Heal.java index 109a70b11b..1f81bd92a8 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Heal.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Heal.java @@ -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); diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java index fc88d64de0..1eb798681f 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java @@ -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)); } } } diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java index b7231e71be..24fe9b2349 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java @@ -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) diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Hp.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Hp.java index cd28f926cb..75dd285a5e 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Hp.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Hp.java @@ -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; } } diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java index 47b003ec45..faca7bfa02 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java @@ -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()) { diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java index fefa4ffef1..a6d00a2a2f 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java @@ -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); diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java index b3b7aa52ba..1c648c408a 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java @@ -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) diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Mp.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Mp.java index 617fcc3fdb..f7abaa1469 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Mp.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Mp.java @@ -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; } } diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/documentation.txt index dccc51036a..70fa9df6b4 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/documentation.txt @@ -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. AreaDamage: Topography (Danger Zone) resistance stat. diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java index 805960c36b..66dfeaf025 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java @@ -97,16 +97,35 @@ public abstract class AbstractEffect } - public void onStart(L2Character effector, L2Character effected, Skill skill) + public void onStart(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) { } + public void onStart(L2Character effector, L2Character effected, Skill skill) + { + onStart(effector, effected, skill, null); + } + public void onExit(L2Character effector, L2Character effected, Skill skill) { } + /** + * Called on each tick.
+ * If the abnormal time is lesser than zero it will last forever. + * @param effector + * @param effected + * @param skill + * @param item + * @return if {@code true} this effect will continue forever, if {@code false} it will stop after abnormal time has passed + */ + public boolean onActionTime(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) + { + return false; + } + /** * Called on each tick.
* If the abnormal time is lesser than zero it will last forever. @@ -117,7 +136,7 @@ public abstract class AbstractEffect */ public boolean onActionTime(L2Character effector, L2Character effected, Skill skill) { - return false; + return onActionTime(effector, effected, skill, null); } /** diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java index 8e361a6566..90f0dc9f8b 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java @@ -333,7 +333,7 @@ public final class BuffInfo } // Call on start. - effect.onStart(_effector, _effected, _skill); + effect.onStart(_effector, _effected, _skill, _item); // If it's a continuous effect, if has ticks schedule a task with period, otherwise schedule a simple task to end it. if (effect.getTicks() > 0) @@ -360,7 +360,7 @@ public final class BuffInfo if (_isInUse) { // Callback for on action time event. - continueForever = effect.onActionTime(_effector, _effected, _skill); + continueForever = effect.onActionTime(_effector, _effected, _skill, _item); } if (!continueForever && _skill.isToggle()) diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/stats/Stats.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/stats/Stats.java index 5f83bc7242..4f53fcb5d7 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/stats/Stats.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/stats/Stats.java @@ -68,6 +68,9 @@ public enum Stats REGENERATE_HP_RATE("regHp", new RegenHPFinalizer()), REGENERATE_CP_RATE("regCp", new RegenCPFinalizer()), REGENERATE_MP_RATE("regMp", new RegenMPFinalizer()), + ADDITIONAL_POTION_HP("addPotionHp"), + ADDITIONAL_POTION_MP("addPotionMp"), + ADDITIONAL_POTION_CP("addPotionCp"), MANA_CHARGE("manaCharge"), HEAL_EFFECT("healEffect"), diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/EffectMasterHandler.java index aea7146792..a909fb8652 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -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("AreaDamage", AreaDamage::new); diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java new file mode 100644 index 0000000000..9a91a1c057 --- /dev/null +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java new file mode 100644 index 0000000000..c98645baf2 --- /dev/null +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java new file mode 100644 index 0000000000..ec1da0851c --- /dev/null +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Cp.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Cp.java index 9c34f60b62..8675f9ab79 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Cp.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Cp.java @@ -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; } } diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java index 186137d565..81cb5b46dd 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java @@ -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); diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java index bc5e693a78..9eac6954f7 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java @@ -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); diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java index 94d2ff3c6b..4102d0f843 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java @@ -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) diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Heal.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Heal.java index 109a70b11b..1f81bd92a8 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Heal.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Heal.java @@ -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); diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java index fc88d64de0..1eb798681f 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java @@ -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)); } } } diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java index b7231e71be..24fe9b2349 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java @@ -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) diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Hp.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Hp.java index cd28f926cb..75dd285a5e 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Hp.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Hp.java @@ -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; } } diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java index 47b003ec45..faca7bfa02 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java @@ -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()) { diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java index fefa4ffef1..a6d00a2a2f 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java @@ -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); diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java index b3b7aa52ba..1c648c408a 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java @@ -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) diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Mp.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Mp.java index 617fcc3fdb..f7abaa1469 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Mp.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Mp.java @@ -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; } } diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/skills/documentation.txt index dccc51036a..70fa9df6b4 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/skills/documentation.txt @@ -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. AreaDamage: Topography (Danger Zone) resistance stat. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java index 805960c36b..66dfeaf025 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java @@ -97,16 +97,35 @@ public abstract class AbstractEffect } - public void onStart(L2Character effector, L2Character effected, Skill skill) + public void onStart(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) { } + public void onStart(L2Character effector, L2Character effected, Skill skill) + { + onStart(effector, effected, skill, null); + } + public void onExit(L2Character effector, L2Character effected, Skill skill) { } + /** + * Called on each tick.
+ * If the abnormal time is lesser than zero it will last forever. + * @param effector + * @param effected + * @param skill + * @param item + * @return if {@code true} this effect will continue forever, if {@code false} it will stop after abnormal time has passed + */ + public boolean onActionTime(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) + { + return false; + } + /** * Called on each tick.
* If the abnormal time is lesser than zero it will last forever. @@ -117,7 +136,7 @@ public abstract class AbstractEffect */ public boolean onActionTime(L2Character effector, L2Character effected, Skill skill) { - return false; + return onActionTime(effector, effected, skill, null); } /** diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java index 8e361a6566..90f0dc9f8b 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java @@ -333,7 +333,7 @@ public final class BuffInfo } // Call on start. - effect.onStart(_effector, _effected, _skill); + effect.onStart(_effector, _effected, _skill, _item); // If it's a continuous effect, if has ticks schedule a task with period, otherwise schedule a simple task to end it. if (effect.getTicks() > 0) @@ -360,7 +360,7 @@ public final class BuffInfo if (_isInUse) { // Callback for on action time event. - continueForever = effect.onActionTime(_effector, _effected, _skill); + continueForever = effect.onActionTime(_effector, _effected, _skill, _item); } if (!continueForever && _skill.isToggle()) diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/stats/Stats.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/stats/Stats.java index 5f83bc7242..4f53fcb5d7 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/stats/Stats.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/stats/Stats.java @@ -68,6 +68,9 @@ public enum Stats REGENERATE_HP_RATE("regHp", new RegenHPFinalizer()), REGENERATE_CP_RATE("regCp", new RegenCPFinalizer()), REGENERATE_MP_RATE("regMp", new RegenMPFinalizer()), + ADDITIONAL_POTION_HP("addPotionHp"), + ADDITIONAL_POTION_MP("addPotionMp"), + ADDITIONAL_POTION_CP("addPotionCp"), MANA_CHARGE("manaCharge"), HEAL_EFFECT("healEffect"), diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/EffectMasterHandler.java index 24d4f6b16c..bbf958323b 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -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("AgathionSlot", AgathionSlot::new); diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java new file mode 100644 index 0000000000..9a91a1c057 --- /dev/null +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java new file mode 100644 index 0000000000..c98645baf2 --- /dev/null +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java new file mode 100644 index 0000000000..ec1da0851c --- /dev/null +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Cp.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Cp.java index 9c34f60b62..8675f9ab79 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Cp.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Cp.java @@ -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; } } diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java index 186137d565..81cb5b46dd 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java @@ -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); diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java index bc5e693a78..9eac6954f7 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java @@ -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); diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java index 94d2ff3c6b..4102d0f843 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java @@ -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) diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Heal.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Heal.java index 109a70b11b..1f81bd92a8 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Heal.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Heal.java @@ -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); diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java index fc88d64de0..1eb798681f 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java @@ -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)); } } } diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java index b7231e71be..24fe9b2349 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java @@ -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) diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Hp.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Hp.java index cd28f926cb..75dd285a5e 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Hp.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Hp.java @@ -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; } } diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java index 47b003ec45..faca7bfa02 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java @@ -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()) { diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java index fefa4ffef1..a6d00a2a2f 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java @@ -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); diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java index b3b7aa52ba..1c648c408a 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java @@ -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) diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Mp.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Mp.java index 617fcc3fdb..f7abaa1469 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Mp.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Mp.java @@ -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; } } diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/skills/documentation.txt index 4d68e11b56..79b5995ef8 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/skills/documentation.txt @@ -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. AgathionSlot: Agathion slot modifier. (l2jmobius) diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java index 805960c36b..66dfeaf025 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java @@ -97,16 +97,35 @@ public abstract class AbstractEffect } - public void onStart(L2Character effector, L2Character effected, Skill skill) + public void onStart(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) { } + public void onStart(L2Character effector, L2Character effected, Skill skill) + { + onStart(effector, effected, skill, null); + } + public void onExit(L2Character effector, L2Character effected, Skill skill) { } + /** + * Called on each tick.
+ * If the abnormal time is lesser than zero it will last forever. + * @param effector + * @param effected + * @param skill + * @param item + * @return if {@code true} this effect will continue forever, if {@code false} it will stop after abnormal time has passed + */ + public boolean onActionTime(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) + { + return false; + } + /** * Called on each tick.
* If the abnormal time is lesser than zero it will last forever. @@ -117,7 +136,7 @@ public abstract class AbstractEffect */ public boolean onActionTime(L2Character effector, L2Character effected, Skill skill) { - return false; + return onActionTime(effector, effected, skill, null); } /** diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java index 8e361a6566..90f0dc9f8b 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java @@ -333,7 +333,7 @@ public final class BuffInfo } // Call on start. - effect.onStart(_effector, _effected, _skill); + effect.onStart(_effector, _effected, _skill, _item); // If it's a continuous effect, if has ticks schedule a task with period, otherwise schedule a simple task to end it. if (effect.getTicks() > 0) @@ -360,7 +360,7 @@ public final class BuffInfo if (_isInUse) { // Callback for on action time event. - continueForever = effect.onActionTime(_effector, _effected, _skill); + continueForever = effect.onActionTime(_effector, _effected, _skill, _item); } if (!continueForever && _skill.isToggle()) diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/stats/Stats.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/stats/Stats.java index 8d694bdb83..5c423c1348 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/stats/Stats.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/stats/Stats.java @@ -68,6 +68,9 @@ public enum Stats REGENERATE_HP_RATE("regHp", new RegenHPFinalizer()), REGENERATE_CP_RATE("regCp", new RegenCPFinalizer()), REGENERATE_MP_RATE("regMp", new RegenMPFinalizer()), + ADDITIONAL_POTION_HP("addPotionHp"), + ADDITIONAL_POTION_MP("addPotionMp"), + ADDITIONAL_POTION_CP("addPotionCp"), MANA_CHARGE("manaCharge"), HEAL_EFFECT("healEffect"), diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/EffectMasterHandler.java index 5efa1d3edd..32262c7191 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -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("AgathionSlot", AgathionSlot::new); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java new file mode 100644 index 0000000000..9a91a1c057 --- /dev/null +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionCp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java new file mode 100644 index 0000000000..c98645baf2 --- /dev/null +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionHp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java new file mode 100644 index 0000000000..ec1da0851c --- /dev/null +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/AdditionalPotionMp.java @@ -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 . + */ +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); + } +} diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Cp.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Cp.java index 9c34f60b62..8675f9ab79 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Cp.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Cp.java @@ -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; } } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java index 186137d565..81cb5b46dd 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/CpHeal.java @@ -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); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java index bc5e693a78..9eac6954f7 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/CpHealOverTime.java @@ -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); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java index 94d2ff3c6b..4102d0f843 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java @@ -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) diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Heal.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Heal.java index 109a70b11b..1f81bd92a8 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Heal.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Heal.java @@ -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); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java index fc88d64de0..1eb798681f 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/HealOverTime.java @@ -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)); } } } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java index b7231e71be..24fe9b2349 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/HealPercent.java @@ -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) diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Hp.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Hp.java index cd28f926cb..75dd285a5e 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Hp.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Hp.java @@ -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; } } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java index 47b003ec45..faca7bfa02 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/ManaHeal.java @@ -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()) { diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java index fefa4ffef1..a6d00a2a2f 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/ManaHealOverTime.java @@ -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); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java index b3b7aa52ba..1c648c408a 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/ManaHealPercent.java @@ -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) diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Mp.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Mp.java index 617fcc3fdb..f7abaa1469 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Mp.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Mp.java @@ -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; } } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/skills/documentation.txt index 88dc9ce743..065debf668 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/skills/documentation.txt @@ -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. AgathionSlot: Agathion slot modifier. (l2jmobius) diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java index 805960c36b..66dfeaf025 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/effects/AbstractEffect.java @@ -97,16 +97,35 @@ public abstract class AbstractEffect } - public void onStart(L2Character effector, L2Character effected, Skill skill) + public void onStart(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) { } + public void onStart(L2Character effector, L2Character effected, Skill skill) + { + onStart(effector, effected, skill, null); + } + public void onExit(L2Character effector, L2Character effected, Skill skill) { } + /** + * Called on each tick.
+ * If the abnormal time is lesser than zero it will last forever. + * @param effector + * @param effected + * @param skill + * @param item + * @return if {@code true} this effect will continue forever, if {@code false} it will stop after abnormal time has passed + */ + public boolean onActionTime(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item) + { + return false; + } + /** * Called on each tick.
* If the abnormal time is lesser than zero it will last forever. @@ -117,7 +136,7 @@ public abstract class AbstractEffect */ public boolean onActionTime(L2Character effector, L2Character effected, Skill skill) { - return false; + return onActionTime(effector, effected, skill, null); } /** diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java index 8e361a6566..90f0dc9f8b 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java @@ -333,7 +333,7 @@ public final class BuffInfo } // Call on start. - effect.onStart(_effector, _effected, _skill); + effect.onStart(_effector, _effected, _skill, _item); // If it's a continuous effect, if has ticks schedule a task with period, otherwise schedule a simple task to end it. if (effect.getTicks() > 0) @@ -360,7 +360,7 @@ public final class BuffInfo if (_isInUse) { // Callback for on action time event. - continueForever = effect.onActionTime(_effector, _effected, _skill); + continueForever = effect.onActionTime(_effector, _effected, _skill, _item); } if (!continueForever && _skill.isToggle()) diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/stats/Stats.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/stats/Stats.java index 00e9b9effa..e5ea4b54e4 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/stats/Stats.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/stats/Stats.java @@ -68,6 +68,9 @@ public enum Stats REGENERATE_HP_RATE("regHp", new RegenHPFinalizer()), REGENERATE_CP_RATE("regCp", new RegenCPFinalizer()), REGENERATE_MP_RATE("regMp", new RegenMPFinalizer()), + ADDITIONAL_POTION_HP("addPotionHp"), + ADDITIONAL_POTION_MP("addPotionMp"), + ADDITIONAL_POTION_CP("addPotionCp"), MANA_CHARGE("manaCharge"), HEAL_EFFECT("healEffect"),