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 d3749a122e..ad0250f05d 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 @@ -260,6 +260,7 @@ public final class EffectMasterHandler EffectHandler.getInstance().registerHandler("RealDamage", RealDamage::new); EffectHandler.getInstance().registerHandler("RebalanceHP", RebalanceHP::new); EffectHandler.getInstance().registerHandler("RebalanceHPSummon", RebalanceHPSummon::new); + EffectHandler.getInstance().registerHandler("RecoverVitalityInPeaceZone", RecoverVitalityInPeaceZone::new); EffectHandler.getInstance().registerHandler("Recovery", Recovery::new); EffectHandler.getInstance().registerHandler("ReduceDamage", ReduceDamage::new); EffectHandler.getInstance().registerHandler("ReduceCancel", ReduceCancel::new); diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/RecoverVitalityInPeaceZone.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/RecoverVitalityInPeaceZone.java new file mode 100644 index 0000000000..510b5ecaa5 --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/RecoverVitalityInPeaceZone.java @@ -0,0 +1,84 @@ +/* + * 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.actor.stat.PcStat; +import com.l2jmobius.gameserver.model.effects.AbstractEffect; +import com.l2jmobius.gameserver.model.skills.BuffInfo; +import com.l2jmobius.gameserver.model.zone.ZoneId; + +/** + * Recover Vitality in Peace Zone effect implementation. + * @author Mobius + */ +public final class RecoverVitalityInPeaceZone extends AbstractEffect +{ + private final double _amount; + private final int _ticks; + + public RecoverVitalityInPeaceZone(StatsSet params) + { + _amount = params.getDouble("amount", 0); + _ticks = params.getInt("ticks", 10); + } + + @Override + public int getTicks() + { + return _ticks; + } + + @Override + public boolean onActionTime(BuffInfo info) + { + if ((info.getEffected() == null) // + || info.getEffected().isDead() // + || !info.getEffected().isPlayer() // + || !info.getEffected().isInsideZone(ZoneId.PEACE)) + { + return false; + } + + long vitality = info.getEffected().getActingPlayer().getVitalityPoints(); + vitality += _amount; + if (vitality >= PcStat.MAX_VITALITY_POINTS) + { + vitality = PcStat.MAX_VITALITY_POINTS; + } + info.getEffected().getActingPlayer().setVitalityPoints((int) vitality, true); + + return info.getSkill().isToggle(); + } + + @Override + public void onExit(BuffInfo info) + { + if ((info.getEffected() != null) // + && info.getEffected().isPlayer() // + && !info.isRemoved()) + { + long vitality = info.getEffected().getActingPlayer().getVitalityPoints(); + vitality += _amount * 100; + if (vitality >= PcStat.MAX_VITALITY_POINTS) + { + vitality = PcStat.MAX_VITALITY_POINTS; + } + info.getEffected().getActingPlayer().setVitalityPoints((int) vitality, true); + } + } +} 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 b35b85221f..7fbacfcb2e 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 @@ -229,6 +229,7 @@ RandomizeHate: Target NPC stops hating you and starts hating random target with RealDamage: Static damage. RebalanceHP: Balances targets' current HP. RebalanceHPSummon: Balances targets' current HP for summons. +RecoverVitalityInPeaceZone: Recover periodically vitality when player is in a peace zone. (l2jmobius) Recovery: Decreases death penalty level. ReduceCancel: Magic skill casting interruption stat. ReduceDropPenalty: Reduces EXP lost and death penalty chance. 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 d3749a122e..ad0250f05d 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 @@ -260,6 +260,7 @@ public final class EffectMasterHandler EffectHandler.getInstance().registerHandler("RealDamage", RealDamage::new); EffectHandler.getInstance().registerHandler("RebalanceHP", RebalanceHP::new); EffectHandler.getInstance().registerHandler("RebalanceHPSummon", RebalanceHPSummon::new); + EffectHandler.getInstance().registerHandler("RecoverVitalityInPeaceZone", RecoverVitalityInPeaceZone::new); EffectHandler.getInstance().registerHandler("Recovery", Recovery::new); EffectHandler.getInstance().registerHandler("ReduceDamage", ReduceDamage::new); EffectHandler.getInstance().registerHandler("ReduceCancel", ReduceCancel::new); diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/RecoverVitalityInPeaceZone.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/RecoverVitalityInPeaceZone.java new file mode 100644 index 0000000000..510b5ecaa5 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/RecoverVitalityInPeaceZone.java @@ -0,0 +1,84 @@ +/* + * 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.actor.stat.PcStat; +import com.l2jmobius.gameserver.model.effects.AbstractEffect; +import com.l2jmobius.gameserver.model.skills.BuffInfo; +import com.l2jmobius.gameserver.model.zone.ZoneId; + +/** + * Recover Vitality in Peace Zone effect implementation. + * @author Mobius + */ +public final class RecoverVitalityInPeaceZone extends AbstractEffect +{ + private final double _amount; + private final int _ticks; + + public RecoverVitalityInPeaceZone(StatsSet params) + { + _amount = params.getDouble("amount", 0); + _ticks = params.getInt("ticks", 10); + } + + @Override + public int getTicks() + { + return _ticks; + } + + @Override + public boolean onActionTime(BuffInfo info) + { + if ((info.getEffected() == null) // + || info.getEffected().isDead() // + || !info.getEffected().isPlayer() // + || !info.getEffected().isInsideZone(ZoneId.PEACE)) + { + return false; + } + + long vitality = info.getEffected().getActingPlayer().getVitalityPoints(); + vitality += _amount; + if (vitality >= PcStat.MAX_VITALITY_POINTS) + { + vitality = PcStat.MAX_VITALITY_POINTS; + } + info.getEffected().getActingPlayer().setVitalityPoints((int) vitality, true); + + return info.getSkill().isToggle(); + } + + @Override + public void onExit(BuffInfo info) + { + if ((info.getEffected() != null) // + && info.getEffected().isPlayer() // + && !info.isRemoved()) + { + long vitality = info.getEffected().getActingPlayer().getVitalityPoints(); + vitality += _amount * 100; + if (vitality >= PcStat.MAX_VITALITY_POINTS) + { + vitality = PcStat.MAX_VITALITY_POINTS; + } + info.getEffected().getActingPlayer().setVitalityPoints((int) vitality, true); + } + } +} 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 b35b85221f..7fbacfcb2e 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 @@ -229,6 +229,7 @@ RandomizeHate: Target NPC stops hating you and starts hating random target with RealDamage: Static damage. RebalanceHP: Balances targets' current HP. RebalanceHPSummon: Balances targets' current HP for summons. +RecoverVitalityInPeaceZone: Recover periodically vitality when player is in a peace zone. (l2jmobius) Recovery: Decreases death penalty level. ReduceCancel: Magic skill casting interruption stat. ReduceDropPenalty: Reduces EXP lost and death penalty chance. 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 d3749a122e..ad0250f05d 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 @@ -260,6 +260,7 @@ public final class EffectMasterHandler EffectHandler.getInstance().registerHandler("RealDamage", RealDamage::new); EffectHandler.getInstance().registerHandler("RebalanceHP", RebalanceHP::new); EffectHandler.getInstance().registerHandler("RebalanceHPSummon", RebalanceHPSummon::new); + EffectHandler.getInstance().registerHandler("RecoverVitalityInPeaceZone", RecoverVitalityInPeaceZone::new); EffectHandler.getInstance().registerHandler("Recovery", Recovery::new); EffectHandler.getInstance().registerHandler("ReduceDamage", ReduceDamage::new); EffectHandler.getInstance().registerHandler("ReduceCancel", ReduceCancel::new); diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/RecoverVitalityInPeaceZone.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/RecoverVitalityInPeaceZone.java new file mode 100644 index 0000000000..510b5ecaa5 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/RecoverVitalityInPeaceZone.java @@ -0,0 +1,84 @@ +/* + * 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.actor.stat.PcStat; +import com.l2jmobius.gameserver.model.effects.AbstractEffect; +import com.l2jmobius.gameserver.model.skills.BuffInfo; +import com.l2jmobius.gameserver.model.zone.ZoneId; + +/** + * Recover Vitality in Peace Zone effect implementation. + * @author Mobius + */ +public final class RecoverVitalityInPeaceZone extends AbstractEffect +{ + private final double _amount; + private final int _ticks; + + public RecoverVitalityInPeaceZone(StatsSet params) + { + _amount = params.getDouble("amount", 0); + _ticks = params.getInt("ticks", 10); + } + + @Override + public int getTicks() + { + return _ticks; + } + + @Override + public boolean onActionTime(BuffInfo info) + { + if ((info.getEffected() == null) // + || info.getEffected().isDead() // + || !info.getEffected().isPlayer() // + || !info.getEffected().isInsideZone(ZoneId.PEACE)) + { + return false; + } + + long vitality = info.getEffected().getActingPlayer().getVitalityPoints(); + vitality += _amount; + if (vitality >= PcStat.MAX_VITALITY_POINTS) + { + vitality = PcStat.MAX_VITALITY_POINTS; + } + info.getEffected().getActingPlayer().setVitalityPoints((int) vitality, true); + + return info.getSkill().isToggle(); + } + + @Override + public void onExit(BuffInfo info) + { + if ((info.getEffected() != null) // + && info.getEffected().isPlayer() // + && !info.isRemoved()) + { + long vitality = info.getEffected().getActingPlayer().getVitalityPoints(); + vitality += _amount * 100; + if (vitality >= PcStat.MAX_VITALITY_POINTS) + { + vitality = PcStat.MAX_VITALITY_POINTS; + } + info.getEffected().getActingPlayer().setVitalityPoints((int) vitality, true); + } + } +} diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/40300-40399.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/40300-40399.xml index b8dc64d5c0..e3af462572 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/40300-40399.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/40300-40399.xml @@ -174,7 +174,11 @@ - + + + + + diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/16400-16499.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/16400-16499.xml index 1ba8a22bca..bbd2085def 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/16400-16499.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/16400-16499.xml @@ -292,13 +292,24 @@ A1 - icon.etc_whiteday_choco A2 + 1 + 21600 + 1 + 40311 30000 100 4 + SELF + SINGLE + + + 100 + 10 + + 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 b35b85221f..7fbacfcb2e 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 @@ -229,6 +229,7 @@ RandomizeHate: Target NPC stops hating you and starts hating random target with RealDamage: Static damage. RebalanceHP: Balances targets' current HP. RebalanceHPSummon: Balances targets' current HP for summons. +RecoverVitalityInPeaceZone: Recover periodically vitality when player is in a peace zone. (l2jmobius) Recovery: Decreases death penalty level. ReduceCancel: Magic skill casting interruption stat. ReduceDropPenalty: Reduces EXP lost and death penalty chance. 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 5b0e13cb07..3b03c51e6c 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 @@ -264,6 +264,7 @@ public final class EffectMasterHandler EffectHandler.getInstance().registerHandler("RealDamage", RealDamage::new); EffectHandler.getInstance().registerHandler("RebalanceHP", RebalanceHP::new); EffectHandler.getInstance().registerHandler("RebalanceHPSummon", RebalanceHPSummon::new); + EffectHandler.getInstance().registerHandler("RecoverVitalityInPeaceZone", RecoverVitalityInPeaceZone::new); EffectHandler.getInstance().registerHandler("Recovery", Recovery::new); EffectHandler.getInstance().registerHandler("ReduceDamage", ReduceDamage::new); EffectHandler.getInstance().registerHandler("ReduceCancel", ReduceCancel::new); diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/RecoverVitalityInPeaceZone.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/RecoverVitalityInPeaceZone.java new file mode 100644 index 0000000000..510b5ecaa5 --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/RecoverVitalityInPeaceZone.java @@ -0,0 +1,84 @@ +/* + * 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.actor.stat.PcStat; +import com.l2jmobius.gameserver.model.effects.AbstractEffect; +import com.l2jmobius.gameserver.model.skills.BuffInfo; +import com.l2jmobius.gameserver.model.zone.ZoneId; + +/** + * Recover Vitality in Peace Zone effect implementation. + * @author Mobius + */ +public final class RecoverVitalityInPeaceZone extends AbstractEffect +{ + private final double _amount; + private final int _ticks; + + public RecoverVitalityInPeaceZone(StatsSet params) + { + _amount = params.getDouble("amount", 0); + _ticks = params.getInt("ticks", 10); + } + + @Override + public int getTicks() + { + return _ticks; + } + + @Override + public boolean onActionTime(BuffInfo info) + { + if ((info.getEffected() == null) // + || info.getEffected().isDead() // + || !info.getEffected().isPlayer() // + || !info.getEffected().isInsideZone(ZoneId.PEACE)) + { + return false; + } + + long vitality = info.getEffected().getActingPlayer().getVitalityPoints(); + vitality += _amount; + if (vitality >= PcStat.MAX_VITALITY_POINTS) + { + vitality = PcStat.MAX_VITALITY_POINTS; + } + info.getEffected().getActingPlayer().setVitalityPoints((int) vitality, true); + + return info.getSkill().isToggle(); + } + + @Override + public void onExit(BuffInfo info) + { + if ((info.getEffected() != null) // + && info.getEffected().isPlayer() // + && !info.isRemoved()) + { + long vitality = info.getEffected().getActingPlayer().getVitalityPoints(); + vitality += _amount * 100; + if (vitality >= PcStat.MAX_VITALITY_POINTS) + { + vitality = PcStat.MAX_VITALITY_POINTS; + } + info.getEffected().getActingPlayer().setVitalityPoints((int) vitality, true); + } + } +} 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 18d94d5ba2..b6a8dab881 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 @@ -233,6 +233,7 @@ RandomizeHate: Target NPC stops hating you and starts hating random target with RealDamage: Static damage. RebalanceHP: Balances targets' current HP. RebalanceHPSummon: Balances targets' current HP for summons. +RecoverVitalityInPeaceZone: Recover periodically vitality when player is in a peace zone. (l2jmobius) Recovery: Decreases death penalty level. ReduceCancel: Magic skill casting interruption stat. ReduceDropPenalty: Reduces EXP lost and death penalty chance. 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 8ef4ae36d6..52262767aa 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 @@ -259,6 +259,7 @@ public final class EffectMasterHandler EffectHandler.getInstance().registerHandler("RealDamage", RealDamage::new); EffectHandler.getInstance().registerHandler("RebalanceHP", RebalanceHP::new); EffectHandler.getInstance().registerHandler("RebalanceHPSummon", RebalanceHPSummon::new); + EffectHandler.getInstance().registerHandler("RecoverVitalityInPeaceZone", RecoverVitalityInPeaceZone::new); EffectHandler.getInstance().registerHandler("Recovery", Recovery::new); EffectHandler.getInstance().registerHandler("ReduceDamage", ReduceDamage::new); EffectHandler.getInstance().registerHandler("ReduceCancel", ReduceCancel::new); diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/RecoverVitalityInPeaceZone.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/RecoverVitalityInPeaceZone.java new file mode 100644 index 0000000000..510b5ecaa5 --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/RecoverVitalityInPeaceZone.java @@ -0,0 +1,84 @@ +/* + * 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.actor.stat.PcStat; +import com.l2jmobius.gameserver.model.effects.AbstractEffect; +import com.l2jmobius.gameserver.model.skills.BuffInfo; +import com.l2jmobius.gameserver.model.zone.ZoneId; + +/** + * Recover Vitality in Peace Zone effect implementation. + * @author Mobius + */ +public final class RecoverVitalityInPeaceZone extends AbstractEffect +{ + private final double _amount; + private final int _ticks; + + public RecoverVitalityInPeaceZone(StatsSet params) + { + _amount = params.getDouble("amount", 0); + _ticks = params.getInt("ticks", 10); + } + + @Override + public int getTicks() + { + return _ticks; + } + + @Override + public boolean onActionTime(BuffInfo info) + { + if ((info.getEffected() == null) // + || info.getEffected().isDead() // + || !info.getEffected().isPlayer() // + || !info.getEffected().isInsideZone(ZoneId.PEACE)) + { + return false; + } + + long vitality = info.getEffected().getActingPlayer().getVitalityPoints(); + vitality += _amount; + if (vitality >= PcStat.MAX_VITALITY_POINTS) + { + vitality = PcStat.MAX_VITALITY_POINTS; + } + info.getEffected().getActingPlayer().setVitalityPoints((int) vitality, true); + + return info.getSkill().isToggle(); + } + + @Override + public void onExit(BuffInfo info) + { + if ((info.getEffected() != null) // + && info.getEffected().isPlayer() // + && !info.isRemoved()) + { + long vitality = info.getEffected().getActingPlayer().getVitalityPoints(); + vitality += _amount * 100; + if (vitality >= PcStat.MAX_VITALITY_POINTS) + { + vitality = PcStat.MAX_VITALITY_POINTS; + } + info.getEffected().getActingPlayer().setVitalityPoints((int) vitality, true); + } + } +} 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 a77b5d1586..f5a14f4b91 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 @@ -228,6 +228,7 @@ RandomizeHate: Target NPC stops hating you and starts hating random target with RealDamage: Static damage. RebalanceHP: Balances targets' current HP. RebalanceHPSummon: Balances targets' current HP for summons. +RecoverVitalityInPeaceZone: Recover periodically vitality when player is in a peace zone. (l2jmobius) Recovery: Decreases death penalty level. ReduceCancel: Magic skill casting interruption stat. ReduceDropPenalty: Reduces EXP lost and death penalty chance.