diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/EffectMasterHandler.java index 4fd4274ef9..75bd99940b 100644 --- a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -232,7 +232,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MpShield", MpShield::new); EffectHandler.getInstance().registerHandler("MpVampiricAttack", MpVampiricAttack::new); EffectHandler.getInstance().registerHandler("Mute", Mute::new); - EffectHandler.getInstance().registerHandler("NightStatModifier", NightStatModifier::new); + EffectHandler.getInstance().registerHandler("NightStatModify", NightStatModify::new); EffectHandler.getInstance().registerHandler("NoblesseBless", NoblesseBless::new); EffectHandler.getInstance().registerHandler("OpenChest", OpenChest::new); EffectHandler.getInstance().registerHandler("OpenCommonRecipeBook", OpenCommonRecipeBook::new); diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java similarity index 94% rename from L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java rename to L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java index 8dce6e4312..71f1c02986 100644 --- a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java +++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java @@ -39,7 +39,7 @@ import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; /** * @author Mobius */ -public class NightStatModifier extends AbstractEffect +public class NightStatModify extends AbstractEffect { private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); @@ -49,7 +49,7 @@ public class NightStatModifier extends AbstractEffect private final int _amount; protected final StatModifierType _mode; - public NightStatModifier(StatSet params) + public NightStatModify(StatSet params) { _stat = params.getEnum("stat", Stat.class); _amount = params.getInt("amount"); diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/skills/00200-00299.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/skills/00200-00299.xml index 1000e967cc..dc506191ca 100644 --- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/skills/00200-00299.xml +++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/skills/00200-00299.xml @@ -6458,7 +6458,7 @@ P 5 - + ACCURACY_COMBAT 3 diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/skills/documentation.txt index 5b482483d8..ff1e7661d6 100644 --- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/skills/documentation.txt @@ -202,7 +202,7 @@ MpRegen: MP Regeneration stat. MpShield: Transfers given percentage of damage as mana damage. Mana Shield. MpVampiricAttack: Absorbs given percentage of mana during attack. Mute: Prevents target from using magical skills. Silence. -NightStatModifier: Modify a specific stat at night time. (l2jmobius) +NightStatModify: Modify a specific stat at night time. (l2jmobius) NoblesseBless: Does not remove buffs upon death except itself. OpenChest: Opens a treasure chest. OpenCommonRecipeBook: Shows the common recipe book window. diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/EffectMasterHandler.java index 4fd4274ef9..75bd99940b 100644 --- a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -232,7 +232,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MpShield", MpShield::new); EffectHandler.getInstance().registerHandler("MpVampiricAttack", MpVampiricAttack::new); EffectHandler.getInstance().registerHandler("Mute", Mute::new); - EffectHandler.getInstance().registerHandler("NightStatModifier", NightStatModifier::new); + EffectHandler.getInstance().registerHandler("NightStatModify", NightStatModify::new); EffectHandler.getInstance().registerHandler("NoblesseBless", NoblesseBless::new); EffectHandler.getInstance().registerHandler("OpenChest", OpenChest::new); EffectHandler.getInstance().registerHandler("OpenCommonRecipeBook", OpenCommonRecipeBook::new); diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java similarity index 94% rename from L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java rename to L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java index 8dce6e4312..71f1c02986 100644 --- a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java +++ b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java @@ -39,7 +39,7 @@ import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; /** * @author Mobius */ -public class NightStatModifier extends AbstractEffect +public class NightStatModify extends AbstractEffect { private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); @@ -49,7 +49,7 @@ public class NightStatModifier extends AbstractEffect private final int _amount; protected final StatModifierType _mode; - public NightStatModifier(StatSet params) + public NightStatModify(StatSet params) { _stat = params.getEnum("stat", Stat.class); _amount = params.getInt("amount"); diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/skills/00200-00299.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/skills/00200-00299.xml index ec56addede..e241730e24 100644 --- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/skills/00200-00299.xml +++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/skills/00200-00299.xml @@ -6456,7 +6456,7 @@ P 5 - + ACCURACY_COMBAT 3 diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_02.5_Underground/dist/game/data/stats/skills/documentation.txt index 5b482483d8..ff1e7661d6 100644 --- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/skills/documentation.txt @@ -202,7 +202,7 @@ MpRegen: MP Regeneration stat. MpShield: Transfers given percentage of damage as mana damage. Mana Shield. MpVampiricAttack: Absorbs given percentage of mana during attack. Mute: Prevents target from using magical skills. Silence. -NightStatModifier: Modify a specific stat at night time. (l2jmobius) +NightStatModify: Modify a specific stat at night time. (l2jmobius) NoblesseBless: Does not remove buffs upon death except itself. OpenChest: Opens a treasure chest. OpenCommonRecipeBook: Shows the common recipe book window. diff --git a/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/EffectMasterHandler.java index 4fd4274ef9..75bd99940b 100644 --- a/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -232,7 +232,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MpShield", MpShield::new); EffectHandler.getInstance().registerHandler("MpVampiricAttack", MpVampiricAttack::new); EffectHandler.getInstance().registerHandler("Mute", Mute::new); - EffectHandler.getInstance().registerHandler("NightStatModifier", NightStatModifier::new); + EffectHandler.getInstance().registerHandler("NightStatModify", NightStatModify::new); EffectHandler.getInstance().registerHandler("NoblesseBless", NoblesseBless::new); EffectHandler.getInstance().registerHandler("OpenChest", OpenChest::new); EffectHandler.getInstance().registerHandler("OpenCommonRecipeBook", OpenCommonRecipeBook::new); diff --git a/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java b/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java similarity index 94% rename from L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java rename to L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java index 8dce6e4312..71f1c02986 100644 --- a/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java +++ b/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java @@ -39,7 +39,7 @@ import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; /** * @author Mobius */ -public class NightStatModifier extends AbstractEffect +public class NightStatModify extends AbstractEffect { private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); @@ -49,7 +49,7 @@ public class NightStatModifier extends AbstractEffect private final int _amount; protected final StatModifierType _mode; - public NightStatModifier(StatSet params) + public NightStatModify(StatSet params) { _stat = params.getEnum("stat", Stat.class); _amount = params.getInt("amount"); diff --git a/L2J_Mobius_03.0_Helios/dist/game/data/stats/skills/00200-00299.xml b/L2J_Mobius_03.0_Helios/dist/game/data/stats/skills/00200-00299.xml index 264cca21b4..a19b5f7fb7 100644 --- a/L2J_Mobius_03.0_Helios/dist/game/data/stats/skills/00200-00299.xml +++ b/L2J_Mobius_03.0_Helios/dist/game/data/stats/skills/00200-00299.xml @@ -6456,7 +6456,7 @@ P 5 - + ACCURACY_COMBAT 3 diff --git a/L2J_Mobius_03.0_Helios/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_03.0_Helios/dist/game/data/stats/skills/documentation.txt index 5b482483d8..ff1e7661d6 100644 --- a/L2J_Mobius_03.0_Helios/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_03.0_Helios/dist/game/data/stats/skills/documentation.txt @@ -202,7 +202,7 @@ MpRegen: MP Regeneration stat. MpShield: Transfers given percentage of damage as mana damage. Mana Shield. MpVampiricAttack: Absorbs given percentage of mana during attack. Mute: Prevents target from using magical skills. Silence. -NightStatModifier: Modify a specific stat at night time. (l2jmobius) +NightStatModify: Modify a specific stat at night time. (l2jmobius) NoblesseBless: Does not remove buffs upon death except itself. OpenChest: Opens a treasure chest. OpenCommonRecipeBook: Shows the common recipe book window. diff --git a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/EffectMasterHandler.java index 91b037477e..8f845cab36 100644 --- a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -236,7 +236,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MpShield", MpShield::new); EffectHandler.getInstance().registerHandler("MpVampiricAttack", MpVampiricAttack::new); EffectHandler.getInstance().registerHandler("Mute", Mute::new); - EffectHandler.getInstance().registerHandler("NightStatModifier", NightStatModifier::new); + EffectHandler.getInstance().registerHandler("NightStatModify", NightStatModify::new); EffectHandler.getInstance().registerHandler("NoblesseBless", NoblesseBless::new); EffectHandler.getInstance().registerHandler("OpenChest", OpenChest::new); EffectHandler.getInstance().registerHandler("OpenCommonRecipeBook", OpenCommonRecipeBook::new); diff --git a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java similarity index 94% rename from L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java rename to L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java index 8dce6e4312..71f1c02986 100644 --- a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java +++ b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java @@ -39,7 +39,7 @@ import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; /** * @author Mobius */ -public class NightStatModifier extends AbstractEffect +public class NightStatModify extends AbstractEffect { private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); @@ -49,7 +49,7 @@ public class NightStatModifier extends AbstractEffect private final int _amount; protected final StatModifierType _mode; - public NightStatModifier(StatSet params) + public NightStatModify(StatSet params) { _stat = params.getEnum("stat", Stat.class); _amount = params.getInt("amount"); diff --git a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/stats/skills/00200-00299.xml b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/stats/skills/00200-00299.xml index 7d26a4f63c..189bc413ed 100644 --- a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/stats/skills/00200-00299.xml +++ b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/stats/skills/00200-00299.xml @@ -6484,7 +6484,7 @@ P 5 - + ACCURACY_COMBAT 3 diff --git a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/stats/skills/documentation.txt index 64006a6fdf..5a5e16fb1e 100644 --- a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/stats/skills/documentation.txt @@ -206,7 +206,7 @@ MpRegen: MP Regeneration stat. MpShield: Transfers given percentage of damage as mana damage. Mana Shield. MpVampiricAttack: Absorbs given percentage of mana during attack. Mute: Prevents target from using magical skills. Silence. -NightStatModifier: Modify a specific stat at night time. (l2jmobius) +NightStatModify: Modify a specific stat at night time. (l2jmobius) NoblesseBless: Does not remove buffs upon death except itself. OpenChest: Opens a treasure chest. OpenCommonRecipeBook: Shows the common recipe book window. diff --git a/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/EffectMasterHandler.java index 29c5636326..510c75ae2d 100644 --- a/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -240,7 +240,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MpShield", MpShield::new); EffectHandler.getInstance().registerHandler("MpVampiricAttack", MpVampiricAttack::new); EffectHandler.getInstance().registerHandler("Mute", Mute::new); - EffectHandler.getInstance().registerHandler("NightStatModifier", NightStatModifier::new); + EffectHandler.getInstance().registerHandler("NightStatModify", NightStatModify::new); EffectHandler.getInstance().registerHandler("NoblesseBless", NoblesseBless::new); EffectHandler.getInstance().registerHandler("OpenChest", OpenChest::new); EffectHandler.getInstance().registerHandler("OpenCommonRecipeBook", OpenCommonRecipeBook::new); diff --git a/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java b/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java deleted file mode 100644 index 8dce6e4312..0000000000 --- a/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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 java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicBoolean; - -import org.l2jmobius.gameserver.enums.StatModifierType; -import org.l2jmobius.gameserver.model.StatSet; -import org.l2jmobius.gameserver.model.actor.Creature; -import org.l2jmobius.gameserver.model.effects.AbstractEffect; -import org.l2jmobius.gameserver.model.events.Containers; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenersContainer; -import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; -import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; -import org.l2jmobius.gameserver.model.item.instance.Item; -import org.l2jmobius.gameserver.model.skill.Skill; -import org.l2jmobius.gameserver.model.stats.Stat; -import org.l2jmobius.gameserver.network.SystemMessageId; -import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; -import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; - -/** - * @author Mobius - */ -public class NightStatModifier extends AbstractEffect -{ - private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); - private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); - private static final int SHADOW_SENSE = 294; - - private final Stat _stat; - private final int _amount; - protected final StatModifierType _mode; - - public NightStatModifier(StatSet params) - { - _stat = params.getEnum("stat", Stat.class); - _amount = params.getInt("amount"); - _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); - - // Init a global day-night change listener. - final ListenersContainer container = Containers.Global(); - container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); - } - - @Override - public void onStart(Creature effector, Creature effected, Skill skill, Item item) - { - NIGHT_STAT_CHARACTERS.add(effected); - } - - @Override - public void onExit(Creature effector, Creature effected, Skill skill) - { - NIGHT_STAT_CHARACTERS.remove(effected); - } - - @Override - public void pump(Creature effected, Skill skill) - { - // Not night. - if (!GameTimeTaskManager.getInstance().isNight()) - { - return; - } - - // Apply stat. - switch (_mode) - { - case DIFF: - { - effected.getStat().mergeAdd(_stat, _amount); - break; - } - case PER: - { - effected.getStat().mergeMul(_stat, (_amount / 100) + 1); - break; - } - } - } - - public void onDayNightChange(OnDayNightChange event) - { - synchronized (DAY_TIME) - { - final boolean isNight = event.isNight(); - - // Run only once per daytime change. - if (isNight == DAY_TIME.get()) - { - return; - } - DAY_TIME.set(isNight); - - // System message for Shadow Sense. - final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); - msg.addSkillName(SHADOW_SENSE); - - for (Creature creature : NIGHT_STAT_CHARACTERS) - { - // Pump again. - creature.getStat().recalculateStats(true); - - // Send Shadow Sense message when player has skill. - if (creature.getKnownSkill(SHADOW_SENSE) != null) - { - creature.sendPacket(msg); - } - } - } - } -} diff --git a/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java b/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java new file mode 100644 index 0000000000..71f1c02986 --- /dev/null +++ b/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java @@ -0,0 +1,130 @@ +/* + * 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 java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.l2jmobius.gameserver.enums.StatModifierType; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.effects.AbstractEffect; +import org.l2jmobius.gameserver.model.events.Containers; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.ListenersContainer; +import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; +import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; +import org.l2jmobius.gameserver.model.item.instance.Item; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.Stat; +import org.l2jmobius.gameserver.network.SystemMessageId; +import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; +import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; + +/** + * @author Mobius + */ +public class NightStatModify extends AbstractEffect +{ + private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); + private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); + private static final int SHADOW_SENSE = 294; + + private final Stat _stat; + private final int _amount; + protected final StatModifierType _mode; + + public NightStatModify(StatSet params) + { + _stat = params.getEnum("stat", Stat.class); + _amount = params.getInt("amount"); + _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); + + // Init a global day-night change listener. + final ListenersContainer container = Containers.Global(); + container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); + } + + @Override + public void onStart(Creature effector, Creature effected, Skill skill, Item item) + { + NIGHT_STAT_CHARACTERS.add(effected); + } + + @Override + public void onExit(Creature effector, Creature effected, Skill skill) + { + NIGHT_STAT_CHARACTERS.remove(effected); + } + + @Override + public void pump(Creature effected, Skill skill) + { + // Not night. + if (!GameTimeTaskManager.getInstance().isNight()) + { + return; + } + + // Apply stat. + switch (_mode) + { + case DIFF: + { + effected.getStat().mergeAdd(_stat, _amount); + break; + } + case PER: + { + effected.getStat().mergeMul(_stat, (_amount / 100) + 1); + break; + } + } + } + + public void onDayNightChange(OnDayNightChange event) + { + synchronized (DAY_TIME) + { + final boolean isNight = event.isNight(); + + // Run only once per daytime change. + if (isNight == DAY_TIME.get()) + { + return; + } + DAY_TIME.set(isNight); + + // System message for Shadow Sense. + final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); + msg.addSkillName(SHADOW_SENSE); + + for (Creature creature : NIGHT_STAT_CHARACTERS) + { + // Pump again. + creature.getStat().recalculateStats(true); + + // Send Shadow Sense message when player has skill. + if (creature.getKnownSkill(SHADOW_SENSE) != null) + { + creature.sendPacket(msg); + } + } + } + } +} diff --git a/L2J_Mobius_05.0_Salvation/dist/game/data/stats/skills/00200-00299.xml b/L2J_Mobius_05.0_Salvation/dist/game/data/stats/skills/00200-00299.xml index 2f6da43f70..710514498c 100644 --- a/L2J_Mobius_05.0_Salvation/dist/game/data/stats/skills/00200-00299.xml +++ b/L2J_Mobius_05.0_Salvation/dist/game/data/stats/skills/00200-00299.xml @@ -6484,7 +6484,7 @@ P 5 - + ACCURACY_COMBAT 3 diff --git a/L2J_Mobius_05.0_Salvation/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_05.0_Salvation/dist/game/data/stats/skills/documentation.txt index e7b016e4f3..5d61e7ca6b 100644 --- a/L2J_Mobius_05.0_Salvation/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_05.0_Salvation/dist/game/data/stats/skills/documentation.txt @@ -210,7 +210,7 @@ MpRegen: MP Regeneration stat. MpShield: Transfers given percentage of damage as mana damage. Mana Shield. MpVampiricAttack: Absorbs given percentage of mana during attack. Mute: Prevents target from using magical skills. Silence. -NightStatModifier: Modify a specific stat at night time. (l2jmobius) +NightStatModify: Modify a specific stat at night time. (l2jmobius) NoblesseBless: Does not remove buffs upon death except itself. OpenChest: Opens a treasure chest. OpenCommonRecipeBook: Shows the common recipe book window. diff --git a/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/EffectMasterHandler.java index f2449adee5..7ce038bf63 100644 --- a/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -241,7 +241,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MpShield", MpShield::new); EffectHandler.getInstance().registerHandler("MpVampiricAttack", MpVampiricAttack::new); EffectHandler.getInstance().registerHandler("Mute", Mute::new); - EffectHandler.getInstance().registerHandler("NightStatModifier", NightStatModifier::new); + EffectHandler.getInstance().registerHandler("NightStatModify", NightStatModify::new); EffectHandler.getInstance().registerHandler("NoblesseBless", NoblesseBless::new); EffectHandler.getInstance().registerHandler("OpenChest", OpenChest::new); EffectHandler.getInstance().registerHandler("OpenCommonRecipeBook", OpenCommonRecipeBook::new); diff --git a/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java b/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java deleted file mode 100644 index 8dce6e4312..0000000000 --- a/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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 java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicBoolean; - -import org.l2jmobius.gameserver.enums.StatModifierType; -import org.l2jmobius.gameserver.model.StatSet; -import org.l2jmobius.gameserver.model.actor.Creature; -import org.l2jmobius.gameserver.model.effects.AbstractEffect; -import org.l2jmobius.gameserver.model.events.Containers; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenersContainer; -import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; -import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; -import org.l2jmobius.gameserver.model.item.instance.Item; -import org.l2jmobius.gameserver.model.skill.Skill; -import org.l2jmobius.gameserver.model.stats.Stat; -import org.l2jmobius.gameserver.network.SystemMessageId; -import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; -import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; - -/** - * @author Mobius - */ -public class NightStatModifier extends AbstractEffect -{ - private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); - private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); - private static final int SHADOW_SENSE = 294; - - private final Stat _stat; - private final int _amount; - protected final StatModifierType _mode; - - public NightStatModifier(StatSet params) - { - _stat = params.getEnum("stat", Stat.class); - _amount = params.getInt("amount"); - _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); - - // Init a global day-night change listener. - final ListenersContainer container = Containers.Global(); - container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); - } - - @Override - public void onStart(Creature effector, Creature effected, Skill skill, Item item) - { - NIGHT_STAT_CHARACTERS.add(effected); - } - - @Override - public void onExit(Creature effector, Creature effected, Skill skill) - { - NIGHT_STAT_CHARACTERS.remove(effected); - } - - @Override - public void pump(Creature effected, Skill skill) - { - // Not night. - if (!GameTimeTaskManager.getInstance().isNight()) - { - return; - } - - // Apply stat. - switch (_mode) - { - case DIFF: - { - effected.getStat().mergeAdd(_stat, _amount); - break; - } - case PER: - { - effected.getStat().mergeMul(_stat, (_amount / 100) + 1); - break; - } - } - } - - public void onDayNightChange(OnDayNightChange event) - { - synchronized (DAY_TIME) - { - final boolean isNight = event.isNight(); - - // Run only once per daytime change. - if (isNight == DAY_TIME.get()) - { - return; - } - DAY_TIME.set(isNight); - - // System message for Shadow Sense. - final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); - msg.addSkillName(SHADOW_SENSE); - - for (Creature creature : NIGHT_STAT_CHARACTERS) - { - // Pump again. - creature.getStat().recalculateStats(true); - - // Send Shadow Sense message when player has skill. - if (creature.getKnownSkill(SHADOW_SENSE) != null) - { - creature.sendPacket(msg); - } - } - } - } -} diff --git a/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java b/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java new file mode 100644 index 0000000000..71f1c02986 --- /dev/null +++ b/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java @@ -0,0 +1,130 @@ +/* + * 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 java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.l2jmobius.gameserver.enums.StatModifierType; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.effects.AbstractEffect; +import org.l2jmobius.gameserver.model.events.Containers; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.ListenersContainer; +import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; +import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; +import org.l2jmobius.gameserver.model.item.instance.Item; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.Stat; +import org.l2jmobius.gameserver.network.SystemMessageId; +import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; +import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; + +/** + * @author Mobius + */ +public class NightStatModify extends AbstractEffect +{ + private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); + private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); + private static final int SHADOW_SENSE = 294; + + private final Stat _stat; + private final int _amount; + protected final StatModifierType _mode; + + public NightStatModify(StatSet params) + { + _stat = params.getEnum("stat", Stat.class); + _amount = params.getInt("amount"); + _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); + + // Init a global day-night change listener. + final ListenersContainer container = Containers.Global(); + container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); + } + + @Override + public void onStart(Creature effector, Creature effected, Skill skill, Item item) + { + NIGHT_STAT_CHARACTERS.add(effected); + } + + @Override + public void onExit(Creature effector, Creature effected, Skill skill) + { + NIGHT_STAT_CHARACTERS.remove(effected); + } + + @Override + public void pump(Creature effected, Skill skill) + { + // Not night. + if (!GameTimeTaskManager.getInstance().isNight()) + { + return; + } + + // Apply stat. + switch (_mode) + { + case DIFF: + { + effected.getStat().mergeAdd(_stat, _amount); + break; + } + case PER: + { + effected.getStat().mergeMul(_stat, (_amount / 100) + 1); + break; + } + } + } + + public void onDayNightChange(OnDayNightChange event) + { + synchronized (DAY_TIME) + { + final boolean isNight = event.isNight(); + + // Run only once per daytime change. + if (isNight == DAY_TIME.get()) + { + return; + } + DAY_TIME.set(isNight); + + // System message for Shadow Sense. + final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); + msg.addSkillName(SHADOW_SENSE); + + for (Creature creature : NIGHT_STAT_CHARACTERS) + { + // Pump again. + creature.getStat().recalculateStats(true); + + // Send Shadow Sense message when player has skill. + if (creature.getKnownSkill(SHADOW_SENSE) != null) + { + creature.sendPacket(msg); + } + } + } + } +} diff --git a/L2J_Mobius_05.5_EtinasFate/dist/game/data/stats/skills/00200-00299.xml b/L2J_Mobius_05.5_EtinasFate/dist/game/data/stats/skills/00200-00299.xml index 0e0c56fe26..778fcfd595 100644 --- a/L2J_Mobius_05.5_EtinasFate/dist/game/data/stats/skills/00200-00299.xml +++ b/L2J_Mobius_05.5_EtinasFate/dist/game/data/stats/skills/00200-00299.xml @@ -6484,7 +6484,7 @@ P 5 - + ACCURACY_COMBAT 3 diff --git a/L2J_Mobius_05.5_EtinasFate/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_05.5_EtinasFate/dist/game/data/stats/skills/documentation.txt index 489603b1a9..81f698c478 100644 --- a/L2J_Mobius_05.5_EtinasFate/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_05.5_EtinasFate/dist/game/data/stats/skills/documentation.txt @@ -211,7 +211,7 @@ MpRegen: MP Regeneration stat. MpShield: Transfers given percentage of damage as mana damage. Mana Shield. MpVampiricAttack: Absorbs given percentage of mana during attack. Mute: Prevents target from using magical skills. Silence. -NightStatModifier: Modify a specific stat at night time. (l2jmobius) +NightStatModify: Modify a specific stat at night time. (l2jmobius) NoblesseBless: Does not remove buffs upon death except itself. OpenChest: Opens a treasure chest. OpenCommonRecipeBook: Shows the common recipe book window. diff --git a/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/EffectMasterHandler.java index f2449adee5..7ce038bf63 100644 --- a/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -241,7 +241,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MpShield", MpShield::new); EffectHandler.getInstance().registerHandler("MpVampiricAttack", MpVampiricAttack::new); EffectHandler.getInstance().registerHandler("Mute", Mute::new); - EffectHandler.getInstance().registerHandler("NightStatModifier", NightStatModifier::new); + EffectHandler.getInstance().registerHandler("NightStatModify", NightStatModify::new); EffectHandler.getInstance().registerHandler("NoblesseBless", NoblesseBless::new); EffectHandler.getInstance().registerHandler("OpenChest", OpenChest::new); EffectHandler.getInstance().registerHandler("OpenCommonRecipeBook", OpenCommonRecipeBook::new); diff --git a/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java b/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java deleted file mode 100644 index 8dce6e4312..0000000000 --- a/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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 java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicBoolean; - -import org.l2jmobius.gameserver.enums.StatModifierType; -import org.l2jmobius.gameserver.model.StatSet; -import org.l2jmobius.gameserver.model.actor.Creature; -import org.l2jmobius.gameserver.model.effects.AbstractEffect; -import org.l2jmobius.gameserver.model.events.Containers; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenersContainer; -import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; -import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; -import org.l2jmobius.gameserver.model.item.instance.Item; -import org.l2jmobius.gameserver.model.skill.Skill; -import org.l2jmobius.gameserver.model.stats.Stat; -import org.l2jmobius.gameserver.network.SystemMessageId; -import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; -import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; - -/** - * @author Mobius - */ -public class NightStatModifier extends AbstractEffect -{ - private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); - private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); - private static final int SHADOW_SENSE = 294; - - private final Stat _stat; - private final int _amount; - protected final StatModifierType _mode; - - public NightStatModifier(StatSet params) - { - _stat = params.getEnum("stat", Stat.class); - _amount = params.getInt("amount"); - _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); - - // Init a global day-night change listener. - final ListenersContainer container = Containers.Global(); - container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); - } - - @Override - public void onStart(Creature effector, Creature effected, Skill skill, Item item) - { - NIGHT_STAT_CHARACTERS.add(effected); - } - - @Override - public void onExit(Creature effector, Creature effected, Skill skill) - { - NIGHT_STAT_CHARACTERS.remove(effected); - } - - @Override - public void pump(Creature effected, Skill skill) - { - // Not night. - if (!GameTimeTaskManager.getInstance().isNight()) - { - return; - } - - // Apply stat. - switch (_mode) - { - case DIFF: - { - effected.getStat().mergeAdd(_stat, _amount); - break; - } - case PER: - { - effected.getStat().mergeMul(_stat, (_amount / 100) + 1); - break; - } - } - } - - public void onDayNightChange(OnDayNightChange event) - { - synchronized (DAY_TIME) - { - final boolean isNight = event.isNight(); - - // Run only once per daytime change. - if (isNight == DAY_TIME.get()) - { - return; - } - DAY_TIME.set(isNight); - - // System message for Shadow Sense. - final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); - msg.addSkillName(SHADOW_SENSE); - - for (Creature creature : NIGHT_STAT_CHARACTERS) - { - // Pump again. - creature.getStat().recalculateStats(true); - - // Send Shadow Sense message when player has skill. - if (creature.getKnownSkill(SHADOW_SENSE) != null) - { - creature.sendPacket(msg); - } - } - } - } -} diff --git a/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java b/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java new file mode 100644 index 0000000000..71f1c02986 --- /dev/null +++ b/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java @@ -0,0 +1,130 @@ +/* + * 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 java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.l2jmobius.gameserver.enums.StatModifierType; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.effects.AbstractEffect; +import org.l2jmobius.gameserver.model.events.Containers; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.ListenersContainer; +import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; +import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; +import org.l2jmobius.gameserver.model.item.instance.Item; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.Stat; +import org.l2jmobius.gameserver.network.SystemMessageId; +import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; +import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; + +/** + * @author Mobius + */ +public class NightStatModify extends AbstractEffect +{ + private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); + private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); + private static final int SHADOW_SENSE = 294; + + private final Stat _stat; + private final int _amount; + protected final StatModifierType _mode; + + public NightStatModify(StatSet params) + { + _stat = params.getEnum("stat", Stat.class); + _amount = params.getInt("amount"); + _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); + + // Init a global day-night change listener. + final ListenersContainer container = Containers.Global(); + container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); + } + + @Override + public void onStart(Creature effector, Creature effected, Skill skill, Item item) + { + NIGHT_STAT_CHARACTERS.add(effected); + } + + @Override + public void onExit(Creature effector, Creature effected, Skill skill) + { + NIGHT_STAT_CHARACTERS.remove(effected); + } + + @Override + public void pump(Creature effected, Skill skill) + { + // Not night. + if (!GameTimeTaskManager.getInstance().isNight()) + { + return; + } + + // Apply stat. + switch (_mode) + { + case DIFF: + { + effected.getStat().mergeAdd(_stat, _amount); + break; + } + case PER: + { + effected.getStat().mergeMul(_stat, (_amount / 100) + 1); + break; + } + } + } + + public void onDayNightChange(OnDayNightChange event) + { + synchronized (DAY_TIME) + { + final boolean isNight = event.isNight(); + + // Run only once per daytime change. + if (isNight == DAY_TIME.get()) + { + return; + } + DAY_TIME.set(isNight); + + // System message for Shadow Sense. + final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); + msg.addSkillName(SHADOW_SENSE); + + for (Creature creature : NIGHT_STAT_CHARACTERS) + { + // Pump again. + creature.getStat().recalculateStats(true); + + // Send Shadow Sense message when player has skill. + if (creature.getKnownSkill(SHADOW_SENSE) != null) + { + creature.sendPacket(msg); + } + } + } + } +} diff --git a/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/skills/00200-00299.xml b/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/skills/00200-00299.xml index 1e47175977..218b262940 100644 --- a/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/skills/00200-00299.xml +++ b/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/skills/00200-00299.xml @@ -6507,7 +6507,7 @@ P 5 - + ACCURACY_COMBAT 3 diff --git a/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/skills/documentation.txt index 489603b1a9..81f698c478 100644 --- a/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/skills/documentation.txt @@ -211,7 +211,7 @@ MpRegen: MP Regeneration stat. MpShield: Transfers given percentage of damage as mana damage. Mana Shield. MpVampiricAttack: Absorbs given percentage of mana during attack. Mute: Prevents target from using magical skills. Silence. -NightStatModifier: Modify a specific stat at night time. (l2jmobius) +NightStatModify: Modify a specific stat at night time. (l2jmobius) NoblesseBless: Does not remove buffs upon death except itself. OpenChest: Opens a treasure chest. OpenCommonRecipeBook: Shows the common recipe book window. diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/EffectMasterHandler.java index 29641d4d68..125c0a8e17 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -241,7 +241,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MpShield", MpShield::new); EffectHandler.getInstance().registerHandler("MpVampiricAttack", MpVampiricAttack::new); EffectHandler.getInstance().registerHandler("Mute", Mute::new); - EffectHandler.getInstance().registerHandler("NightStatModifier", NightStatModifier::new); + EffectHandler.getInstance().registerHandler("NightStatModify", NightStatModify::new); EffectHandler.getInstance().registerHandler("NoblesseBless", NoblesseBless::new); EffectHandler.getInstance().registerHandler("OpenChest", OpenChest::new); EffectHandler.getInstance().registerHandler("OpenCommonRecipeBook", OpenCommonRecipeBook::new); diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java deleted file mode 100644 index 8dce6e4312..0000000000 --- a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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 java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicBoolean; - -import org.l2jmobius.gameserver.enums.StatModifierType; -import org.l2jmobius.gameserver.model.StatSet; -import org.l2jmobius.gameserver.model.actor.Creature; -import org.l2jmobius.gameserver.model.effects.AbstractEffect; -import org.l2jmobius.gameserver.model.events.Containers; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenersContainer; -import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; -import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; -import org.l2jmobius.gameserver.model.item.instance.Item; -import org.l2jmobius.gameserver.model.skill.Skill; -import org.l2jmobius.gameserver.model.stats.Stat; -import org.l2jmobius.gameserver.network.SystemMessageId; -import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; -import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; - -/** - * @author Mobius - */ -public class NightStatModifier extends AbstractEffect -{ - private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); - private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); - private static final int SHADOW_SENSE = 294; - - private final Stat _stat; - private final int _amount; - protected final StatModifierType _mode; - - public NightStatModifier(StatSet params) - { - _stat = params.getEnum("stat", Stat.class); - _amount = params.getInt("amount"); - _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); - - // Init a global day-night change listener. - final ListenersContainer container = Containers.Global(); - container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); - } - - @Override - public void onStart(Creature effector, Creature effected, Skill skill, Item item) - { - NIGHT_STAT_CHARACTERS.add(effected); - } - - @Override - public void onExit(Creature effector, Creature effected, Skill skill) - { - NIGHT_STAT_CHARACTERS.remove(effected); - } - - @Override - public void pump(Creature effected, Skill skill) - { - // Not night. - if (!GameTimeTaskManager.getInstance().isNight()) - { - return; - } - - // Apply stat. - switch (_mode) - { - case DIFF: - { - effected.getStat().mergeAdd(_stat, _amount); - break; - } - case PER: - { - effected.getStat().mergeMul(_stat, (_amount / 100) + 1); - break; - } - } - } - - public void onDayNightChange(OnDayNightChange event) - { - synchronized (DAY_TIME) - { - final boolean isNight = event.isNight(); - - // Run only once per daytime change. - if (isNight == DAY_TIME.get()) - { - return; - } - DAY_TIME.set(isNight); - - // System message for Shadow Sense. - final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); - msg.addSkillName(SHADOW_SENSE); - - for (Creature creature : NIGHT_STAT_CHARACTERS) - { - // Pump again. - creature.getStat().recalculateStats(true); - - // Send Shadow Sense message when player has skill. - if (creature.getKnownSkill(SHADOW_SENSE) != null) - { - creature.sendPacket(msg); - } - } - } - } -} diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java new file mode 100644 index 0000000000..71f1c02986 --- /dev/null +++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java @@ -0,0 +1,130 @@ +/* + * 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 java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.l2jmobius.gameserver.enums.StatModifierType; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.effects.AbstractEffect; +import org.l2jmobius.gameserver.model.events.Containers; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.ListenersContainer; +import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; +import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; +import org.l2jmobius.gameserver.model.item.instance.Item; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.Stat; +import org.l2jmobius.gameserver.network.SystemMessageId; +import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; +import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; + +/** + * @author Mobius + */ +public class NightStatModify extends AbstractEffect +{ + private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); + private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); + private static final int SHADOW_SENSE = 294; + + private final Stat _stat; + private final int _amount; + protected final StatModifierType _mode; + + public NightStatModify(StatSet params) + { + _stat = params.getEnum("stat", Stat.class); + _amount = params.getInt("amount"); + _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); + + // Init a global day-night change listener. + final ListenersContainer container = Containers.Global(); + container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); + } + + @Override + public void onStart(Creature effector, Creature effected, Skill skill, Item item) + { + NIGHT_STAT_CHARACTERS.add(effected); + } + + @Override + public void onExit(Creature effector, Creature effected, Skill skill) + { + NIGHT_STAT_CHARACTERS.remove(effected); + } + + @Override + public void pump(Creature effected, Skill skill) + { + // Not night. + if (!GameTimeTaskManager.getInstance().isNight()) + { + return; + } + + // Apply stat. + switch (_mode) + { + case DIFF: + { + effected.getStat().mergeAdd(_stat, _amount); + break; + } + case PER: + { + effected.getStat().mergeMul(_stat, (_amount / 100) + 1); + break; + } + } + } + + public void onDayNightChange(OnDayNightChange event) + { + synchronized (DAY_TIME) + { + final boolean isNight = event.isNight(); + + // Run only once per daytime change. + if (isNight == DAY_TIME.get()) + { + return; + } + DAY_TIME.set(isNight); + + // System message for Shadow Sense. + final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); + msg.addSkillName(SHADOW_SENSE); + + for (Creature creature : NIGHT_STAT_CHARACTERS) + { + // Pump again. + creature.getStat().recalculateStats(true); + + // Send Shadow Sense message when player has skill. + if (creature.getKnownSkill(SHADOW_SENSE) != null) + { + creature.sendPacket(msg); + } + } + } + } +} diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/skills/00200-00299.xml b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/skills/00200-00299.xml index bdffbe74a4..991d92f8eb 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/skills/00200-00299.xml +++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/skills/00200-00299.xml @@ -6490,7 +6490,7 @@ P 5 - + ACCURACY_COMBAT 3 diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/skills/documentation.txt index 30b7b08171..02e7c02ef1 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/skills/documentation.txt @@ -211,7 +211,7 @@ MpRegen: MP Regeneration stat. MpShield: Transfers given percentage of damage as mana damage. Mana Shield. MpVampiricAttack: Absorbs given percentage of mana during attack. Mute: Prevents target from using magical skills. Silence. -NightStatModifier: Modify a specific stat at night time. (l2jmobius) +NightStatModify: Modify a specific stat at night time. (l2jmobius) NoblesseBless: Does not remove buffs upon death except itself. OpenChest: Opens a treasure chest. OpenCommonRecipeBook: Shows the common recipe book window. diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/EffectMasterHandler.java index 11906e68e9..41d1207e3a 100644 --- a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -242,7 +242,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MpShield", MpShield::new); EffectHandler.getInstance().registerHandler("MpVampiricAttack", MpVampiricAttack::new); EffectHandler.getInstance().registerHandler("Mute", Mute::new); - EffectHandler.getInstance().registerHandler("NightStatModifier", NightStatModifier::new); + EffectHandler.getInstance().registerHandler("NightStatModify", NightStatModify::new); EffectHandler.getInstance().registerHandler("NoblesseBless", NoblesseBless::new); EffectHandler.getInstance().registerHandler("OpenChest", OpenChest::new); EffectHandler.getInstance().registerHandler("OpenCommonRecipeBook", OpenCommonRecipeBook::new); diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java deleted file mode 100644 index 8dce6e4312..0000000000 --- a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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 java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicBoolean; - -import org.l2jmobius.gameserver.enums.StatModifierType; -import org.l2jmobius.gameserver.model.StatSet; -import org.l2jmobius.gameserver.model.actor.Creature; -import org.l2jmobius.gameserver.model.effects.AbstractEffect; -import org.l2jmobius.gameserver.model.events.Containers; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenersContainer; -import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; -import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; -import org.l2jmobius.gameserver.model.item.instance.Item; -import org.l2jmobius.gameserver.model.skill.Skill; -import org.l2jmobius.gameserver.model.stats.Stat; -import org.l2jmobius.gameserver.network.SystemMessageId; -import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; -import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; - -/** - * @author Mobius - */ -public class NightStatModifier extends AbstractEffect -{ - private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); - private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); - private static final int SHADOW_SENSE = 294; - - private final Stat _stat; - private final int _amount; - protected final StatModifierType _mode; - - public NightStatModifier(StatSet params) - { - _stat = params.getEnum("stat", Stat.class); - _amount = params.getInt("amount"); - _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); - - // Init a global day-night change listener. - final ListenersContainer container = Containers.Global(); - container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); - } - - @Override - public void onStart(Creature effector, Creature effected, Skill skill, Item item) - { - NIGHT_STAT_CHARACTERS.add(effected); - } - - @Override - public void onExit(Creature effector, Creature effected, Skill skill) - { - NIGHT_STAT_CHARACTERS.remove(effected); - } - - @Override - public void pump(Creature effected, Skill skill) - { - // Not night. - if (!GameTimeTaskManager.getInstance().isNight()) - { - return; - } - - // Apply stat. - switch (_mode) - { - case DIFF: - { - effected.getStat().mergeAdd(_stat, _amount); - break; - } - case PER: - { - effected.getStat().mergeMul(_stat, (_amount / 100) + 1); - break; - } - } - } - - public void onDayNightChange(OnDayNightChange event) - { - synchronized (DAY_TIME) - { - final boolean isNight = event.isNight(); - - // Run only once per daytime change. - if (isNight == DAY_TIME.get()) - { - return; - } - DAY_TIME.set(isNight); - - // System message for Shadow Sense. - final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); - msg.addSkillName(SHADOW_SENSE); - - for (Creature creature : NIGHT_STAT_CHARACTERS) - { - // Pump again. - creature.getStat().recalculateStats(true); - - // Send Shadow Sense message when player has skill. - if (creature.getKnownSkill(SHADOW_SENSE) != null) - { - creature.sendPacket(msg); - } - } - } - } -} diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java new file mode 100644 index 0000000000..71f1c02986 --- /dev/null +++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java @@ -0,0 +1,130 @@ +/* + * 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 java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.l2jmobius.gameserver.enums.StatModifierType; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.effects.AbstractEffect; +import org.l2jmobius.gameserver.model.events.Containers; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.ListenersContainer; +import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; +import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; +import org.l2jmobius.gameserver.model.item.instance.Item; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.Stat; +import org.l2jmobius.gameserver.network.SystemMessageId; +import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; +import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; + +/** + * @author Mobius + */ +public class NightStatModify extends AbstractEffect +{ + private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); + private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); + private static final int SHADOW_SENSE = 294; + + private final Stat _stat; + private final int _amount; + protected final StatModifierType _mode; + + public NightStatModify(StatSet params) + { + _stat = params.getEnum("stat", Stat.class); + _amount = params.getInt("amount"); + _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); + + // Init a global day-night change listener. + final ListenersContainer container = Containers.Global(); + container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); + } + + @Override + public void onStart(Creature effector, Creature effected, Skill skill, Item item) + { + NIGHT_STAT_CHARACTERS.add(effected); + } + + @Override + public void onExit(Creature effector, Creature effected, Skill skill) + { + NIGHT_STAT_CHARACTERS.remove(effected); + } + + @Override + public void pump(Creature effected, Skill skill) + { + // Not night. + if (!GameTimeTaskManager.getInstance().isNight()) + { + return; + } + + // Apply stat. + switch (_mode) + { + case DIFF: + { + effected.getStat().mergeAdd(_stat, _amount); + break; + } + case PER: + { + effected.getStat().mergeMul(_stat, (_amount / 100) + 1); + break; + } + } + } + + public void onDayNightChange(OnDayNightChange event) + { + synchronized (DAY_TIME) + { + final boolean isNight = event.isNight(); + + // Run only once per daytime change. + if (isNight == DAY_TIME.get()) + { + return; + } + DAY_TIME.set(isNight); + + // System message for Shadow Sense. + final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); + msg.addSkillName(SHADOW_SENSE); + + for (Creature creature : NIGHT_STAT_CHARACTERS) + { + // Pump again. + creature.getStat().recalculateStats(true); + + // Send Shadow Sense message when player has skill. + if (creature.getKnownSkill(SHADOW_SENSE) != null) + { + creature.sendPacket(msg); + } + } + } + } +} diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/skills/00200-00299.xml b/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/skills/00200-00299.xml index 7a550a5755..07c16fa014 100644 --- a/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/skills/00200-00299.xml +++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/skills/00200-00299.xml @@ -6480,7 +6480,7 @@ P 5 - + ACCURACY_COMBAT 3 diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/skills/documentation.txt index e701b82dce..744559410f 100644 --- a/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/skills/documentation.txt @@ -212,7 +212,7 @@ MpRegen: MP Regeneration stat. MpShield: Transfers given percentage of damage as mana damage. Mana Shield. MpVampiricAttack: Absorbs given percentage of mana during attack. Mute: Prevents target from using magical skills. Silence. -NightStatModifier: Modify a specific stat at night time. (l2jmobius) +NightStatModify: Modify a specific stat at night time. (l2jmobius) NoblesseBless: Does not remove buffs upon death except itself. OpenChest: Opens a treasure chest. OpenCommonRecipeBook: Shows the common recipe book window. diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/EffectMasterHandler.java index c5ac0cdd05..d99611e231 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -243,7 +243,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MpShield", MpShield::new); EffectHandler.getInstance().registerHandler("MpVampiricAttack", MpVampiricAttack::new); EffectHandler.getInstance().registerHandler("Mute", Mute::new); - EffectHandler.getInstance().registerHandler("NightStatModifier", NightStatModifier::new); + EffectHandler.getInstance().registerHandler("NightStatModify", NightStatModify::new); EffectHandler.getInstance().registerHandler("NoblesseBless", NoblesseBless::new); EffectHandler.getInstance().registerHandler("OpenChest", OpenChest::new); EffectHandler.getInstance().registerHandler("OpenCommonRecipeBook", OpenCommonRecipeBook::new); diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java deleted file mode 100644 index 8dce6e4312..0000000000 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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 java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicBoolean; - -import org.l2jmobius.gameserver.enums.StatModifierType; -import org.l2jmobius.gameserver.model.StatSet; -import org.l2jmobius.gameserver.model.actor.Creature; -import org.l2jmobius.gameserver.model.effects.AbstractEffect; -import org.l2jmobius.gameserver.model.events.Containers; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenersContainer; -import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; -import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; -import org.l2jmobius.gameserver.model.item.instance.Item; -import org.l2jmobius.gameserver.model.skill.Skill; -import org.l2jmobius.gameserver.model.stats.Stat; -import org.l2jmobius.gameserver.network.SystemMessageId; -import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; -import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; - -/** - * @author Mobius - */ -public class NightStatModifier extends AbstractEffect -{ - private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); - private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); - private static final int SHADOW_SENSE = 294; - - private final Stat _stat; - private final int _amount; - protected final StatModifierType _mode; - - public NightStatModifier(StatSet params) - { - _stat = params.getEnum("stat", Stat.class); - _amount = params.getInt("amount"); - _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); - - // Init a global day-night change listener. - final ListenersContainer container = Containers.Global(); - container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); - } - - @Override - public void onStart(Creature effector, Creature effected, Skill skill, Item item) - { - NIGHT_STAT_CHARACTERS.add(effected); - } - - @Override - public void onExit(Creature effector, Creature effected, Skill skill) - { - NIGHT_STAT_CHARACTERS.remove(effected); - } - - @Override - public void pump(Creature effected, Skill skill) - { - // Not night. - if (!GameTimeTaskManager.getInstance().isNight()) - { - return; - } - - // Apply stat. - switch (_mode) - { - case DIFF: - { - effected.getStat().mergeAdd(_stat, _amount); - break; - } - case PER: - { - effected.getStat().mergeMul(_stat, (_amount / 100) + 1); - break; - } - } - } - - public void onDayNightChange(OnDayNightChange event) - { - synchronized (DAY_TIME) - { - final boolean isNight = event.isNight(); - - // Run only once per daytime change. - if (isNight == DAY_TIME.get()) - { - return; - } - DAY_TIME.set(isNight); - - // System message for Shadow Sense. - final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); - msg.addSkillName(SHADOW_SENSE); - - for (Creature creature : NIGHT_STAT_CHARACTERS) - { - // Pump again. - creature.getStat().recalculateStats(true); - - // Send Shadow Sense message when player has skill. - if (creature.getKnownSkill(SHADOW_SENSE) != null) - { - creature.sendPacket(msg); - } - } - } - } -} diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java new file mode 100644 index 0000000000..71f1c02986 --- /dev/null +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java @@ -0,0 +1,130 @@ +/* + * 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 java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.l2jmobius.gameserver.enums.StatModifierType; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.effects.AbstractEffect; +import org.l2jmobius.gameserver.model.events.Containers; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.ListenersContainer; +import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; +import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; +import org.l2jmobius.gameserver.model.item.instance.Item; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.Stat; +import org.l2jmobius.gameserver.network.SystemMessageId; +import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; +import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; + +/** + * @author Mobius + */ +public class NightStatModify extends AbstractEffect +{ + private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); + private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); + private static final int SHADOW_SENSE = 294; + + private final Stat _stat; + private final int _amount; + protected final StatModifierType _mode; + + public NightStatModify(StatSet params) + { + _stat = params.getEnum("stat", Stat.class); + _amount = params.getInt("amount"); + _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); + + // Init a global day-night change listener. + final ListenersContainer container = Containers.Global(); + container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); + } + + @Override + public void onStart(Creature effector, Creature effected, Skill skill, Item item) + { + NIGHT_STAT_CHARACTERS.add(effected); + } + + @Override + public void onExit(Creature effector, Creature effected, Skill skill) + { + NIGHT_STAT_CHARACTERS.remove(effected); + } + + @Override + public void pump(Creature effected, Skill skill) + { + // Not night. + if (!GameTimeTaskManager.getInstance().isNight()) + { + return; + } + + // Apply stat. + switch (_mode) + { + case DIFF: + { + effected.getStat().mergeAdd(_stat, _amount); + break; + } + case PER: + { + effected.getStat().mergeMul(_stat, (_amount / 100) + 1); + break; + } + } + } + + public void onDayNightChange(OnDayNightChange event) + { + synchronized (DAY_TIME) + { + final boolean isNight = event.isNight(); + + // Run only once per daytime change. + if (isNight == DAY_TIME.get()) + { + return; + } + DAY_TIME.set(isNight); + + // System message for Shadow Sense. + final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); + msg.addSkillName(SHADOW_SENSE); + + for (Creature creature : NIGHT_STAT_CHARACTERS) + { + // Pump again. + creature.getStat().recalculateStats(true); + + // Send Shadow Sense message when player has skill. + if (creature.getKnownSkill(SHADOW_SENSE) != null) + { + creature.sendPacket(msg); + } + } + } + } +} diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/00200-00299.xml b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/00200-00299.xml index 59de78814f..47832c2260 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/00200-00299.xml +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/00200-00299.xml @@ -6480,7 +6480,7 @@ P 5 - + ACCURACY_COMBAT 3 diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/documentation.txt index 9410ae3085..1e0a572955 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/documentation.txt @@ -212,7 +212,7 @@ MpRegen: MP Regeneration stat. MpShield: Transfers given percentage of damage as mana damage. Mana Shield. MpVampiricAttack: Absorbs given percentage of mana during attack. Mute: Prevents target from using magical skills. Silence. -NightStatModifier: Modify a specific stat at night time. (l2jmobius) +NightStatModify: Modify a specific stat at night time. (l2jmobius) NoblesseBless: Does not remove buffs upon death except itself. OpenChest: Opens a treasure chest. OpenCommonRecipeBook: Shows the common recipe book window. diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/EffectMasterHandler.java index 5d08ed63ef..37ba7b9191 100644 --- a/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -244,7 +244,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MpShield", MpShield::new); EffectHandler.getInstance().registerHandler("MpVampiricAttack", MpVampiricAttack::new); EffectHandler.getInstance().registerHandler("Mute", Mute::new); - EffectHandler.getInstance().registerHandler("NightStatModifier", NightStatModifier::new); + EffectHandler.getInstance().registerHandler("NightStatModify", NightStatModify::new); EffectHandler.getInstance().registerHandler("NoblesseBless", NoblesseBless::new); EffectHandler.getInstance().registerHandler("OpenChest", OpenChest::new); EffectHandler.getInstance().registerHandler("OpenCommonRecipeBook", OpenCommonRecipeBook::new); diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java deleted file mode 100644 index 8dce6e4312..0000000000 --- a/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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 java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicBoolean; - -import org.l2jmobius.gameserver.enums.StatModifierType; -import org.l2jmobius.gameserver.model.StatSet; -import org.l2jmobius.gameserver.model.actor.Creature; -import org.l2jmobius.gameserver.model.effects.AbstractEffect; -import org.l2jmobius.gameserver.model.events.Containers; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenersContainer; -import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; -import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; -import org.l2jmobius.gameserver.model.item.instance.Item; -import org.l2jmobius.gameserver.model.skill.Skill; -import org.l2jmobius.gameserver.model.stats.Stat; -import org.l2jmobius.gameserver.network.SystemMessageId; -import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; -import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; - -/** - * @author Mobius - */ -public class NightStatModifier extends AbstractEffect -{ - private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); - private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); - private static final int SHADOW_SENSE = 294; - - private final Stat _stat; - private final int _amount; - protected final StatModifierType _mode; - - public NightStatModifier(StatSet params) - { - _stat = params.getEnum("stat", Stat.class); - _amount = params.getInt("amount"); - _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); - - // Init a global day-night change listener. - final ListenersContainer container = Containers.Global(); - container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); - } - - @Override - public void onStart(Creature effector, Creature effected, Skill skill, Item item) - { - NIGHT_STAT_CHARACTERS.add(effected); - } - - @Override - public void onExit(Creature effector, Creature effected, Skill skill) - { - NIGHT_STAT_CHARACTERS.remove(effected); - } - - @Override - public void pump(Creature effected, Skill skill) - { - // Not night. - if (!GameTimeTaskManager.getInstance().isNight()) - { - return; - } - - // Apply stat. - switch (_mode) - { - case DIFF: - { - effected.getStat().mergeAdd(_stat, _amount); - break; - } - case PER: - { - effected.getStat().mergeMul(_stat, (_amount / 100) + 1); - break; - } - } - } - - public void onDayNightChange(OnDayNightChange event) - { - synchronized (DAY_TIME) - { - final boolean isNight = event.isNight(); - - // Run only once per daytime change. - if (isNight == DAY_TIME.get()) - { - return; - } - DAY_TIME.set(isNight); - - // System message for Shadow Sense. - final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); - msg.addSkillName(SHADOW_SENSE); - - for (Creature creature : NIGHT_STAT_CHARACTERS) - { - // Pump again. - creature.getStat().recalculateStats(true); - - // Send Shadow Sense message when player has skill. - if (creature.getKnownSkill(SHADOW_SENSE) != null) - { - creature.sendPacket(msg); - } - } - } - } -} diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java new file mode 100644 index 0000000000..71f1c02986 --- /dev/null +++ b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java @@ -0,0 +1,130 @@ +/* + * 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 java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.l2jmobius.gameserver.enums.StatModifierType; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.effects.AbstractEffect; +import org.l2jmobius.gameserver.model.events.Containers; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.ListenersContainer; +import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; +import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; +import org.l2jmobius.gameserver.model.item.instance.Item; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.Stat; +import org.l2jmobius.gameserver.network.SystemMessageId; +import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; +import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; + +/** + * @author Mobius + */ +public class NightStatModify extends AbstractEffect +{ + private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); + private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); + private static final int SHADOW_SENSE = 294; + + private final Stat _stat; + private final int _amount; + protected final StatModifierType _mode; + + public NightStatModify(StatSet params) + { + _stat = params.getEnum("stat", Stat.class); + _amount = params.getInt("amount"); + _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); + + // Init a global day-night change listener. + final ListenersContainer container = Containers.Global(); + container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); + } + + @Override + public void onStart(Creature effector, Creature effected, Skill skill, Item item) + { + NIGHT_STAT_CHARACTERS.add(effected); + } + + @Override + public void onExit(Creature effector, Creature effected, Skill skill) + { + NIGHT_STAT_CHARACTERS.remove(effected); + } + + @Override + public void pump(Creature effected, Skill skill) + { + // Not night. + if (!GameTimeTaskManager.getInstance().isNight()) + { + return; + } + + // Apply stat. + switch (_mode) + { + case DIFF: + { + effected.getStat().mergeAdd(_stat, _amount); + break; + } + case PER: + { + effected.getStat().mergeMul(_stat, (_amount / 100) + 1); + break; + } + } + } + + public void onDayNightChange(OnDayNightChange event) + { + synchronized (DAY_TIME) + { + final boolean isNight = event.isNight(); + + // Run only once per daytime change. + if (isNight == DAY_TIME.get()) + { + return; + } + DAY_TIME.set(isNight); + + // System message for Shadow Sense. + final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); + msg.addSkillName(SHADOW_SENSE); + + for (Creature creature : NIGHT_STAT_CHARACTERS) + { + // Pump again. + creature.getStat().recalculateStats(true); + + // Send Shadow Sense message when player has skill. + if (creature.getKnownSkill(SHADOW_SENSE) != null) + { + creature.sendPacket(msg); + } + } + } + } +} diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/skills/00200-00299.xml b/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/skills/00200-00299.xml index 59de78814f..47832c2260 100644 --- a/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/skills/00200-00299.xml +++ b/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/skills/00200-00299.xml @@ -6480,7 +6480,7 @@ P 5 - + ACCURACY_COMBAT 3 diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/skills/documentation.txt index ebaeb2b303..5032da1429 100644 --- a/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/skills/documentation.txt @@ -213,7 +213,7 @@ MpRegen: MP Regeneration stat. MpShield: Transfers given percentage of damage as mana damage. Mana Shield. MpVampiricAttack: Absorbs given percentage of mana during attack. Mute: Prevents target from using magical skills. Silence. -NightStatModifier: Modify a specific stat at night time. (l2jmobius) +NightStatModify: Modify a specific stat at night time. (l2jmobius) NoblesseBless: Does not remove buffs upon death except itself. OpenChest: Opens a treasure chest. OpenCommonRecipeBook: Shows the common recipe book window. diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/EffectMasterHandler.java index de308d13e8..7bdaa8b26d 100644 --- a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -48,7 +48,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("AirBind", AirBind::new); EffectHandler.getInstance().registerHandler("AreaDamage", AreaDamage::new); EffectHandler.getInstance().registerHandler("AreaOfEffectDamageDefence", AreaOfEffectDamageDefence::new); - EffectHandler.getInstance().registerHandler("AreaOfEffectDamageModifier", AreaOfEffectDamageModifier::new); + EffectHandler.getInstance().registerHandler("AreaOfEffectDamageModify", AreaOfEffectDamageModify::new); EffectHandler.getInstance().registerHandler("ArtifactSlot", ArtifactSlot::new); EffectHandler.getInstance().registerHandler("AttackAttribute", AttackAttribute::new); EffectHandler.getInstance().registerHandler("AttackAttributeAdd", AttackAttributeAdd::new); @@ -246,7 +246,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MpShield", MpShield::new); EffectHandler.getInstance().registerHandler("MpVampiricAttack", MpVampiricAttack::new); EffectHandler.getInstance().registerHandler("Mute", Mute::new); - EffectHandler.getInstance().registerHandler("NightStatModifier", NightStatModifier::new); + EffectHandler.getInstance().registerHandler("NightStatModify", NightStatModify::new); EffectHandler.getInstance().registerHandler("NoblesseBless", NoblesseBless::new); EffectHandler.getInstance().registerHandler("OpenChest", OpenChest::new); EffectHandler.getInstance().registerHandler("OpenCommonRecipeBook", OpenCommonRecipeBook::new); diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/effecthandlers/AreaOfEffectDamageModifier.java b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/effecthandlers/AreaOfEffectDamageModify.java similarity index 80% rename from L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/effecthandlers/AreaOfEffectDamageModifier.java rename to L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/effecthandlers/AreaOfEffectDamageModify.java index a172e760e6..4d16a35398 100644 --- a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/effecthandlers/AreaOfEffectDamageModifier.java +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/effecthandlers/AreaOfEffectDamageModify.java @@ -22,10 +22,10 @@ import org.l2jmobius.gameserver.model.stats.Stat; /** * @author quangnguyen */ -public class AreaOfEffectDamageModifier extends AbstractStatPercentEffect +public class AreaOfEffectDamageModify extends AbstractStatPercentEffect { - public AreaOfEffectDamageModifier(StatSet params) + public AreaOfEffectDamageModify(StatSet params) { - super(params, Stat.AREA_OF_EFFECT_DAMAGE_MODIFIER); + super(params, Stat.AREA_OF_EFFECT_DAMAGE_MODIFY); } } diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java deleted file mode 100644 index 8dce6e4312..0000000000 --- a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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 java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicBoolean; - -import org.l2jmobius.gameserver.enums.StatModifierType; -import org.l2jmobius.gameserver.model.StatSet; -import org.l2jmobius.gameserver.model.actor.Creature; -import org.l2jmobius.gameserver.model.effects.AbstractEffect; -import org.l2jmobius.gameserver.model.events.Containers; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenersContainer; -import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; -import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; -import org.l2jmobius.gameserver.model.item.instance.Item; -import org.l2jmobius.gameserver.model.skill.Skill; -import org.l2jmobius.gameserver.model.stats.Stat; -import org.l2jmobius.gameserver.network.SystemMessageId; -import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; -import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; - -/** - * @author Mobius - */ -public class NightStatModifier extends AbstractEffect -{ - private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); - private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); - private static final int SHADOW_SENSE = 294; - - private final Stat _stat; - private final int _amount; - protected final StatModifierType _mode; - - public NightStatModifier(StatSet params) - { - _stat = params.getEnum("stat", Stat.class); - _amount = params.getInt("amount"); - _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); - - // Init a global day-night change listener. - final ListenersContainer container = Containers.Global(); - container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); - } - - @Override - public void onStart(Creature effector, Creature effected, Skill skill, Item item) - { - NIGHT_STAT_CHARACTERS.add(effected); - } - - @Override - public void onExit(Creature effector, Creature effected, Skill skill) - { - NIGHT_STAT_CHARACTERS.remove(effected); - } - - @Override - public void pump(Creature effected, Skill skill) - { - // Not night. - if (!GameTimeTaskManager.getInstance().isNight()) - { - return; - } - - // Apply stat. - switch (_mode) - { - case DIFF: - { - effected.getStat().mergeAdd(_stat, _amount); - break; - } - case PER: - { - effected.getStat().mergeMul(_stat, (_amount / 100) + 1); - break; - } - } - } - - public void onDayNightChange(OnDayNightChange event) - { - synchronized (DAY_TIME) - { - final boolean isNight = event.isNight(); - - // Run only once per daytime change. - if (isNight == DAY_TIME.get()) - { - return; - } - DAY_TIME.set(isNight); - - // System message for Shadow Sense. - final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); - msg.addSkillName(SHADOW_SENSE); - - for (Creature creature : NIGHT_STAT_CHARACTERS) - { - // Pump again. - creature.getStat().recalculateStats(true); - - // Send Shadow Sense message when player has skill. - if (creature.getKnownSkill(SHADOW_SENSE) != null) - { - creature.sendPacket(msg); - } - } - } - } -} diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java new file mode 100644 index 0000000000..71f1c02986 --- /dev/null +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java @@ -0,0 +1,130 @@ +/* + * 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 java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.l2jmobius.gameserver.enums.StatModifierType; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.effects.AbstractEffect; +import org.l2jmobius.gameserver.model.events.Containers; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.ListenersContainer; +import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; +import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; +import org.l2jmobius.gameserver.model.item.instance.Item; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.Stat; +import org.l2jmobius.gameserver.network.SystemMessageId; +import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; +import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; + +/** + * @author Mobius + */ +public class NightStatModify extends AbstractEffect +{ + private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); + private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); + private static final int SHADOW_SENSE = 294; + + private final Stat _stat; + private final int _amount; + protected final StatModifierType _mode; + + public NightStatModify(StatSet params) + { + _stat = params.getEnum("stat", Stat.class); + _amount = params.getInt("amount"); + _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); + + // Init a global day-night change listener. + final ListenersContainer container = Containers.Global(); + container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); + } + + @Override + public void onStart(Creature effector, Creature effected, Skill skill, Item item) + { + NIGHT_STAT_CHARACTERS.add(effected); + } + + @Override + public void onExit(Creature effector, Creature effected, Skill skill) + { + NIGHT_STAT_CHARACTERS.remove(effected); + } + + @Override + public void pump(Creature effected, Skill skill) + { + // Not night. + if (!GameTimeTaskManager.getInstance().isNight()) + { + return; + } + + // Apply stat. + switch (_mode) + { + case DIFF: + { + effected.getStat().mergeAdd(_stat, _amount); + break; + } + case PER: + { + effected.getStat().mergeMul(_stat, (_amount / 100) + 1); + break; + } + } + } + + public void onDayNightChange(OnDayNightChange event) + { + synchronized (DAY_TIME) + { + final boolean isNight = event.isNight(); + + // Run only once per daytime change. + if (isNight == DAY_TIME.get()) + { + return; + } + DAY_TIME.set(isNight); + + // System message for Shadow Sense. + final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); + msg.addSkillName(SHADOW_SENSE); + + for (Creature creature : NIGHT_STAT_CHARACTERS) + { + // Pump again. + creature.getStat().recalculateStats(true); + + // Send Shadow Sense message when player has skill. + if (creature.getKnownSkill(SHADOW_SENSE) != null) + { + creature.sendPacket(msg); + } + } + } + } +} diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/00200-00299.xml b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/00200-00299.xml index 59de78814f..47832c2260 100644 --- a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/00200-00299.xml +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/00200-00299.xml @@ -6480,7 +6480,7 @@ P 5 - + ACCURACY_COMBAT 3 diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/documentation.txt index 72dc83dded..2325bce691 100644 --- a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/documentation.txt @@ -17,7 +17,7 @@ AgathionSlot: Agathion slot modifier. (l2jmobius) AirBind: Used by airbind chain skills. (l2jmobius) AreaDamage: Topography (Danger Zone) resistance stat. AreaOfEffectDamageDefence: Area of effect damage defence stat. (l2jmobius) -AreaOfEffectDamageModifier: Area of effect damage modifier. (l2jmobius) +AreaOfEffectDamageModify: Area of effect damage modifier. (l2jmobius) ArtifactSlot: Artifact slot modifier. (l2jmobius) AttackAttribute: Stat that increases specific attack attribute. AttackAttributeAdd: Stat that increases all attack attribute. @@ -215,7 +215,7 @@ MpRegen: MP Regeneration stat. MpShield: Transfers given percentage of damage as mana damage. Mana Shield. MpVampiricAttack: Absorbs given percentage of mana during attack. Mute: Prevents target from using magical skills. Silence. -NightStatModifier: Modify a specific stat at night time. (l2jmobius) +NightStatModify: Modify a specific stat at night time. (l2jmobius) NoblesseBless: Does not remove buffs upon death except itself. OpenChest: Opens a treasure chest. OpenCommonRecipeBook: Shows the common recipe book window. diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/stats/Formulas.java index d65d9a7e4a..bbe0e78eb7 100644 --- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -201,7 +201,7 @@ public class Formulas // AoE modifiers. if (skill.isBad() && (skill.getAffectLimit() > 0)) { - damage *= attacker.getStat().getMul(Stat.AREA_OF_EFFECT_DAMAGE_MODIFIER, 1) - target.getStat().getValue(Stat.AREA_OF_EFFECT_DAMAGE_DEFENCE, 0); + damage *= attacker.getStat().getMul(Stat.AREA_OF_EFFECT_DAMAGE_MODIFY, 1) - target.getStat().getValue(Stat.AREA_OF_EFFECT_DAMAGE_DEFENCE, 0); } return damage; diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/stats/Stat.java index 7fd04fb7c8..38bb2c578a 100644 --- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -144,8 +144,8 @@ public enum Stat DEFENCE_CRITICAL_DAMAGE_ADD("defCritDamageAdd"), // Resistance to critical damage in value (Example: +100 will be 100 more critical damage, NOT 100% more). DEFENCE_PHYSICAL_SKILL_CRITICAL_DAMAGE("defCAtkSkill"), DEFENCE_PHYSICAL_SKILL_CRITICAL_DAMAGE_ADD("defCAtkSkillAdd"), - AREA_OF_EFFECT_DAMAGE_MODIFIER("aoeDamageMofifier"), AREA_OF_EFFECT_DAMAGE_DEFENCE("aoeDamageDefence"), + AREA_OF_EFFECT_DAMAGE_MODIFY("aoeDamageModify"), BLOW_RATE("blowRate"), BLOW_RATE_DEFENCE("blowRateDefence"), INSTANT_KILL_RESIST("instantKillResist"), 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 2c15804a5b..ec9b84779d 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 @@ -230,7 +230,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MpShield", MpShield::new); EffectHandler.getInstance().registerHandler("MpVampiricAttack", MpVampiricAttack::new); EffectHandler.getInstance().registerHandler("Mute", Mute::new); - EffectHandler.getInstance().registerHandler("NightStatModifier", NightStatModifier::new); + EffectHandler.getInstance().registerHandler("NightStatModify", NightStatModify::new); EffectHandler.getInstance().registerHandler("NoblesseBless", NoblesseBless::new); EffectHandler.getInstance().registerHandler("OpenChest", OpenChest::new); EffectHandler.getInstance().registerHandler("OpenCommonRecipeBook", OpenCommonRecipeBook::new); diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java deleted file mode 100644 index 8dce6e4312..0000000000 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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 java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicBoolean; - -import org.l2jmobius.gameserver.enums.StatModifierType; -import org.l2jmobius.gameserver.model.StatSet; -import org.l2jmobius.gameserver.model.actor.Creature; -import org.l2jmobius.gameserver.model.effects.AbstractEffect; -import org.l2jmobius.gameserver.model.events.Containers; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenersContainer; -import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; -import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; -import org.l2jmobius.gameserver.model.item.instance.Item; -import org.l2jmobius.gameserver.model.skill.Skill; -import org.l2jmobius.gameserver.model.stats.Stat; -import org.l2jmobius.gameserver.network.SystemMessageId; -import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; -import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; - -/** - * @author Mobius - */ -public class NightStatModifier extends AbstractEffect -{ - private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); - private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); - private static final int SHADOW_SENSE = 294; - - private final Stat _stat; - private final int _amount; - protected final StatModifierType _mode; - - public NightStatModifier(StatSet params) - { - _stat = params.getEnum("stat", Stat.class); - _amount = params.getInt("amount"); - _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); - - // Init a global day-night change listener. - final ListenersContainer container = Containers.Global(); - container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); - } - - @Override - public void onStart(Creature effector, Creature effected, Skill skill, Item item) - { - NIGHT_STAT_CHARACTERS.add(effected); - } - - @Override - public void onExit(Creature effector, Creature effected, Skill skill) - { - NIGHT_STAT_CHARACTERS.remove(effected); - } - - @Override - public void pump(Creature effected, Skill skill) - { - // Not night. - if (!GameTimeTaskManager.getInstance().isNight()) - { - return; - } - - // Apply stat. - switch (_mode) - { - case DIFF: - { - effected.getStat().mergeAdd(_stat, _amount); - break; - } - case PER: - { - effected.getStat().mergeMul(_stat, (_amount / 100) + 1); - break; - } - } - } - - public void onDayNightChange(OnDayNightChange event) - { - synchronized (DAY_TIME) - { - final boolean isNight = event.isNight(); - - // Run only once per daytime change. - if (isNight == DAY_TIME.get()) - { - return; - } - DAY_TIME.set(isNight); - - // System message for Shadow Sense. - final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); - msg.addSkillName(SHADOW_SENSE); - - for (Creature creature : NIGHT_STAT_CHARACTERS) - { - // Pump again. - creature.getStat().recalculateStats(true); - - // Send Shadow Sense message when player has skill. - if (creature.getKnownSkill(SHADOW_SENSE) != null) - { - creature.sendPacket(msg); - } - } - } - } -} diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java new file mode 100644 index 0000000000..71f1c02986 --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java @@ -0,0 +1,130 @@ +/* + * 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 java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.l2jmobius.gameserver.enums.StatModifierType; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.effects.AbstractEffect; +import org.l2jmobius.gameserver.model.events.Containers; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.ListenersContainer; +import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; +import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; +import org.l2jmobius.gameserver.model.item.instance.Item; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.Stat; +import org.l2jmobius.gameserver.network.SystemMessageId; +import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; +import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; + +/** + * @author Mobius + */ +public class NightStatModify extends AbstractEffect +{ + private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); + private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); + private static final int SHADOW_SENSE = 294; + + private final Stat _stat; + private final int _amount; + protected final StatModifierType _mode; + + public NightStatModify(StatSet params) + { + _stat = params.getEnum("stat", Stat.class); + _amount = params.getInt("amount"); + _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); + + // Init a global day-night change listener. + final ListenersContainer container = Containers.Global(); + container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); + } + + @Override + public void onStart(Creature effector, Creature effected, Skill skill, Item item) + { + NIGHT_STAT_CHARACTERS.add(effected); + } + + @Override + public void onExit(Creature effector, Creature effected, Skill skill) + { + NIGHT_STAT_CHARACTERS.remove(effected); + } + + @Override + public void pump(Creature effected, Skill skill) + { + // Not night. + if (!GameTimeTaskManager.getInstance().isNight()) + { + return; + } + + // Apply stat. + switch (_mode) + { + case DIFF: + { + effected.getStat().mergeAdd(_stat, _amount); + break; + } + case PER: + { + effected.getStat().mergeMul(_stat, (_amount / 100) + 1); + break; + } + } + } + + public void onDayNightChange(OnDayNightChange event) + { + synchronized (DAY_TIME) + { + final boolean isNight = event.isNight(); + + // Run only once per daytime change. + if (isNight == DAY_TIME.get()) + { + return; + } + DAY_TIME.set(isNight); + + // System message for Shadow Sense. + final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); + msg.addSkillName(SHADOW_SENSE); + + for (Creature creature : NIGHT_STAT_CHARACTERS) + { + // Pump again. + creature.getStat().recalculateStats(true); + + // Send Shadow Sense message when player has skill. + if (creature.getKnownSkill(SHADOW_SENSE) != null) + { + creature.sendPacket(msg); + } + } + } + } +} diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00200-00299.xml b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00200-00299.xml index 0877138b17..50071cd3a4 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00200-00299.xml +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00200-00299.xml @@ -6634,7 +6634,7 @@ P 5 - + ACCURACY_COMBAT 3 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 181cad10bf..e0fe56fa22 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 @@ -200,7 +200,7 @@ MpRegen: MP Regeneration stat. MpShield: Transfers given percentage of damage as mana damage. Mana Shield. MpVampiricAttack: Absorbs given percentage of mana during attack. Mute: Prevents target from using magical skills. Silence. -NightStatModifier: Modify a specific stat at night time. (l2jmobius) +NightStatModify: Modify a specific stat at night time. (l2jmobius) NoblesseBless: Does not remove buffs upon death except itself. OpenChest: Opens a treasure chest. OpenCommonRecipeBook: Shows the common recipe book window. 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 2c15804a5b..ec9b84779d 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 @@ -230,7 +230,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MpShield", MpShield::new); EffectHandler.getInstance().registerHandler("MpVampiricAttack", MpVampiricAttack::new); EffectHandler.getInstance().registerHandler("Mute", Mute::new); - EffectHandler.getInstance().registerHandler("NightStatModifier", NightStatModifier::new); + EffectHandler.getInstance().registerHandler("NightStatModify", NightStatModify::new); EffectHandler.getInstance().registerHandler("NoblesseBless", NoblesseBless::new); EffectHandler.getInstance().registerHandler("OpenChest", OpenChest::new); EffectHandler.getInstance().registerHandler("OpenCommonRecipeBook", OpenCommonRecipeBook::new); diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java deleted file mode 100644 index 8dce6e4312..0000000000 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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 java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicBoolean; - -import org.l2jmobius.gameserver.enums.StatModifierType; -import org.l2jmobius.gameserver.model.StatSet; -import org.l2jmobius.gameserver.model.actor.Creature; -import org.l2jmobius.gameserver.model.effects.AbstractEffect; -import org.l2jmobius.gameserver.model.events.Containers; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenersContainer; -import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; -import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; -import org.l2jmobius.gameserver.model.item.instance.Item; -import org.l2jmobius.gameserver.model.skill.Skill; -import org.l2jmobius.gameserver.model.stats.Stat; -import org.l2jmobius.gameserver.network.SystemMessageId; -import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; -import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; - -/** - * @author Mobius - */ -public class NightStatModifier extends AbstractEffect -{ - private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); - private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); - private static final int SHADOW_SENSE = 294; - - private final Stat _stat; - private final int _amount; - protected final StatModifierType _mode; - - public NightStatModifier(StatSet params) - { - _stat = params.getEnum("stat", Stat.class); - _amount = params.getInt("amount"); - _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); - - // Init a global day-night change listener. - final ListenersContainer container = Containers.Global(); - container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); - } - - @Override - public void onStart(Creature effector, Creature effected, Skill skill, Item item) - { - NIGHT_STAT_CHARACTERS.add(effected); - } - - @Override - public void onExit(Creature effector, Creature effected, Skill skill) - { - NIGHT_STAT_CHARACTERS.remove(effected); - } - - @Override - public void pump(Creature effected, Skill skill) - { - // Not night. - if (!GameTimeTaskManager.getInstance().isNight()) - { - return; - } - - // Apply stat. - switch (_mode) - { - case DIFF: - { - effected.getStat().mergeAdd(_stat, _amount); - break; - } - case PER: - { - effected.getStat().mergeMul(_stat, (_amount / 100) + 1); - break; - } - } - } - - public void onDayNightChange(OnDayNightChange event) - { - synchronized (DAY_TIME) - { - final boolean isNight = event.isNight(); - - // Run only once per daytime change. - if (isNight == DAY_TIME.get()) - { - return; - } - DAY_TIME.set(isNight); - - // System message for Shadow Sense. - final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); - msg.addSkillName(SHADOW_SENSE); - - for (Creature creature : NIGHT_STAT_CHARACTERS) - { - // Pump again. - creature.getStat().recalculateStats(true); - - // Send Shadow Sense message when player has skill. - if (creature.getKnownSkill(SHADOW_SENSE) != null) - { - creature.sendPacket(msg); - } - } - } - } -} diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java new file mode 100644 index 0000000000..71f1c02986 --- /dev/null +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java @@ -0,0 +1,130 @@ +/* + * 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 java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.l2jmobius.gameserver.enums.StatModifierType; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.effects.AbstractEffect; +import org.l2jmobius.gameserver.model.events.Containers; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.ListenersContainer; +import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; +import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; +import org.l2jmobius.gameserver.model.item.instance.Item; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.Stat; +import org.l2jmobius.gameserver.network.SystemMessageId; +import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; +import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; + +/** + * @author Mobius + */ +public class NightStatModify extends AbstractEffect +{ + private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); + private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); + private static final int SHADOW_SENSE = 294; + + private final Stat _stat; + private final int _amount; + protected final StatModifierType _mode; + + public NightStatModify(StatSet params) + { + _stat = params.getEnum("stat", Stat.class); + _amount = params.getInt("amount"); + _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); + + // Init a global day-night change listener. + final ListenersContainer container = Containers.Global(); + container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); + } + + @Override + public void onStart(Creature effector, Creature effected, Skill skill, Item item) + { + NIGHT_STAT_CHARACTERS.add(effected); + } + + @Override + public void onExit(Creature effector, Creature effected, Skill skill) + { + NIGHT_STAT_CHARACTERS.remove(effected); + } + + @Override + public void pump(Creature effected, Skill skill) + { + // Not night. + if (!GameTimeTaskManager.getInstance().isNight()) + { + return; + } + + // Apply stat. + switch (_mode) + { + case DIFF: + { + effected.getStat().mergeAdd(_stat, _amount); + break; + } + case PER: + { + effected.getStat().mergeMul(_stat, (_amount / 100) + 1); + break; + } + } + } + + public void onDayNightChange(OnDayNightChange event) + { + synchronized (DAY_TIME) + { + final boolean isNight = event.isNight(); + + // Run only once per daytime change. + if (isNight == DAY_TIME.get()) + { + return; + } + DAY_TIME.set(isNight); + + // System message for Shadow Sense. + final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); + msg.addSkillName(SHADOW_SENSE); + + for (Creature creature : NIGHT_STAT_CHARACTERS) + { + // Pump again. + creature.getStat().recalculateStats(true); + + // Send Shadow Sense message when player has skill. + if (creature.getKnownSkill(SHADOW_SENSE) != null) + { + creature.sendPacket(msg); + } + } + } + } +} diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/skills/00200-00299.xml b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/skills/00200-00299.xml index f59a64abd0..fff533b643 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/skills/00200-00299.xml +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/skills/00200-00299.xml @@ -6652,7 +6652,7 @@ P 5 - + ACCURACY_COMBAT 3 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 181cad10bf..e0fe56fa22 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 @@ -200,7 +200,7 @@ MpRegen: MP Regeneration stat. MpShield: Transfers given percentage of damage as mana damage. Mana Shield. MpVampiricAttack: Absorbs given percentage of mana during attack. Mute: Prevents target from using magical skills. Silence. -NightStatModifier: Modify a specific stat at night time. (l2jmobius) +NightStatModify: Modify a specific stat at night time. (l2jmobius) NoblesseBless: Does not remove buffs upon death except itself. OpenChest: Opens a treasure chest. OpenCommonRecipeBook: Shows the common recipe book window. 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 68d7c68a1d..d5039cd7c2 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 @@ -232,7 +232,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MpShield", MpShield::new); EffectHandler.getInstance().registerHandler("MpVampiricAttack", MpVampiricAttack::new); EffectHandler.getInstance().registerHandler("Mute", Mute::new); - EffectHandler.getInstance().registerHandler("NightStatModifier", NightStatModifier::new); + EffectHandler.getInstance().registerHandler("NightStatModify", NightStatModify::new); EffectHandler.getInstance().registerHandler("NoblesseBless", NoblesseBless::new); EffectHandler.getInstance().registerHandler("OpenChest", OpenChest::new); EffectHandler.getInstance().registerHandler("OpenCommonRecipeBook", OpenCommonRecipeBook::new); diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java deleted file mode 100644 index 8dce6e4312..0000000000 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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 java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicBoolean; - -import org.l2jmobius.gameserver.enums.StatModifierType; -import org.l2jmobius.gameserver.model.StatSet; -import org.l2jmobius.gameserver.model.actor.Creature; -import org.l2jmobius.gameserver.model.effects.AbstractEffect; -import org.l2jmobius.gameserver.model.events.Containers; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenersContainer; -import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; -import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; -import org.l2jmobius.gameserver.model.item.instance.Item; -import org.l2jmobius.gameserver.model.skill.Skill; -import org.l2jmobius.gameserver.model.stats.Stat; -import org.l2jmobius.gameserver.network.SystemMessageId; -import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; -import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; - -/** - * @author Mobius - */ -public class NightStatModifier extends AbstractEffect -{ - private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); - private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); - private static final int SHADOW_SENSE = 294; - - private final Stat _stat; - private final int _amount; - protected final StatModifierType _mode; - - public NightStatModifier(StatSet params) - { - _stat = params.getEnum("stat", Stat.class); - _amount = params.getInt("amount"); - _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); - - // Init a global day-night change listener. - final ListenersContainer container = Containers.Global(); - container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); - } - - @Override - public void onStart(Creature effector, Creature effected, Skill skill, Item item) - { - NIGHT_STAT_CHARACTERS.add(effected); - } - - @Override - public void onExit(Creature effector, Creature effected, Skill skill) - { - NIGHT_STAT_CHARACTERS.remove(effected); - } - - @Override - public void pump(Creature effected, Skill skill) - { - // Not night. - if (!GameTimeTaskManager.getInstance().isNight()) - { - return; - } - - // Apply stat. - switch (_mode) - { - case DIFF: - { - effected.getStat().mergeAdd(_stat, _amount); - break; - } - case PER: - { - effected.getStat().mergeMul(_stat, (_amount / 100) + 1); - break; - } - } - } - - public void onDayNightChange(OnDayNightChange event) - { - synchronized (DAY_TIME) - { - final boolean isNight = event.isNight(); - - // Run only once per daytime change. - if (isNight == DAY_TIME.get()) - { - return; - } - DAY_TIME.set(isNight); - - // System message for Shadow Sense. - final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); - msg.addSkillName(SHADOW_SENSE); - - for (Creature creature : NIGHT_STAT_CHARACTERS) - { - // Pump again. - creature.getStat().recalculateStats(true); - - // Send Shadow Sense message when player has skill. - if (creature.getKnownSkill(SHADOW_SENSE) != null) - { - creature.sendPacket(msg); - } - } - } - } -} diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java new file mode 100644 index 0000000000..71f1c02986 --- /dev/null +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java @@ -0,0 +1,130 @@ +/* + * 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 java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.l2jmobius.gameserver.enums.StatModifierType; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.effects.AbstractEffect; +import org.l2jmobius.gameserver.model.events.Containers; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.ListenersContainer; +import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; +import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; +import org.l2jmobius.gameserver.model.item.instance.Item; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.Stat; +import org.l2jmobius.gameserver.network.SystemMessageId; +import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; +import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; + +/** + * @author Mobius + */ +public class NightStatModify extends AbstractEffect +{ + private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); + private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); + private static final int SHADOW_SENSE = 294; + + private final Stat _stat; + private final int _amount; + protected final StatModifierType _mode; + + public NightStatModify(StatSet params) + { + _stat = params.getEnum("stat", Stat.class); + _amount = params.getInt("amount"); + _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); + + // Init a global day-night change listener. + final ListenersContainer container = Containers.Global(); + container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); + } + + @Override + public void onStart(Creature effector, Creature effected, Skill skill, Item item) + { + NIGHT_STAT_CHARACTERS.add(effected); + } + + @Override + public void onExit(Creature effector, Creature effected, Skill skill) + { + NIGHT_STAT_CHARACTERS.remove(effected); + } + + @Override + public void pump(Creature effected, Skill skill) + { + // Not night. + if (!GameTimeTaskManager.getInstance().isNight()) + { + return; + } + + // Apply stat. + switch (_mode) + { + case DIFF: + { + effected.getStat().mergeAdd(_stat, _amount); + break; + } + case PER: + { + effected.getStat().mergeMul(_stat, (_amount / 100) + 1); + break; + } + } + } + + public void onDayNightChange(OnDayNightChange event) + { + synchronized (DAY_TIME) + { + final boolean isNight = event.isNight(); + + // Run only once per daytime change. + if (isNight == DAY_TIME.get()) + { + return; + } + DAY_TIME.set(isNight); + + // System message for Shadow Sense. + final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); + msg.addSkillName(SHADOW_SENSE); + + for (Creature creature : NIGHT_STAT_CHARACTERS) + { + // Pump again. + creature.getStat().recalculateStats(true); + + // Send Shadow Sense message when player has skill. + if (creature.getKnownSkill(SHADOW_SENSE) != null) + { + creature.sendPacket(msg); + } + } + } + } +} diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/skills/00200-00299.xml b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/skills/00200-00299.xml index 25c6a0bed3..3264778c7c 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/skills/00200-00299.xml +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/skills/00200-00299.xml @@ -7192,7 +7192,7 @@ P 5 - + ACCURACY_COMBAT 3 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 6f153be265..d7b712ec4f 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 @@ -202,7 +202,7 @@ MpRegen: MP Regeneration stat. MpShield: Transfers given percentage of damage as mana damage. Mana Shield. MpVampiricAttack: Absorbs given percentage of mana during attack. Mute: Prevents target from using magical skills. Silence. -NightStatModifier: Modify a specific stat at night time. (l2jmobius) +NightStatModify: Modify a specific stat at night time. (l2jmobius) NoblesseBless: Does not remove buffs upon death except itself. OpenChest: Opens a treasure chest. OpenCommonRecipeBook: Shows the common recipe book window. 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 969874cbd3..0af7e97d24 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 @@ -235,7 +235,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MpShield", MpShield::new); EffectHandler.getInstance().registerHandler("MpVampiricAttack", MpVampiricAttack::new); EffectHandler.getInstance().registerHandler("Mute", Mute::new); - EffectHandler.getInstance().registerHandler("NightStatModifier", NightStatModifier::new); + EffectHandler.getInstance().registerHandler("NightStatModify", NightStatModify::new); EffectHandler.getInstance().registerHandler("NoblesseBless", NoblesseBless::new); EffectHandler.getInstance().registerHandler("OpenChest", OpenChest::new); EffectHandler.getInstance().registerHandler("OpenCommonRecipeBook", OpenCommonRecipeBook::new); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java deleted file mode 100644 index 8dce6e4312..0000000000 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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 java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicBoolean; - -import org.l2jmobius.gameserver.enums.StatModifierType; -import org.l2jmobius.gameserver.model.StatSet; -import org.l2jmobius.gameserver.model.actor.Creature; -import org.l2jmobius.gameserver.model.effects.AbstractEffect; -import org.l2jmobius.gameserver.model.events.Containers; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenersContainer; -import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; -import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; -import org.l2jmobius.gameserver.model.item.instance.Item; -import org.l2jmobius.gameserver.model.skill.Skill; -import org.l2jmobius.gameserver.model.stats.Stat; -import org.l2jmobius.gameserver.network.SystemMessageId; -import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; -import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; - -/** - * @author Mobius - */ -public class NightStatModifier extends AbstractEffect -{ - private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); - private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); - private static final int SHADOW_SENSE = 294; - - private final Stat _stat; - private final int _amount; - protected final StatModifierType _mode; - - public NightStatModifier(StatSet params) - { - _stat = params.getEnum("stat", Stat.class); - _amount = params.getInt("amount"); - _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); - - // Init a global day-night change listener. - final ListenersContainer container = Containers.Global(); - container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); - } - - @Override - public void onStart(Creature effector, Creature effected, Skill skill, Item item) - { - NIGHT_STAT_CHARACTERS.add(effected); - } - - @Override - public void onExit(Creature effector, Creature effected, Skill skill) - { - NIGHT_STAT_CHARACTERS.remove(effected); - } - - @Override - public void pump(Creature effected, Skill skill) - { - // Not night. - if (!GameTimeTaskManager.getInstance().isNight()) - { - return; - } - - // Apply stat. - switch (_mode) - { - case DIFF: - { - effected.getStat().mergeAdd(_stat, _amount); - break; - } - case PER: - { - effected.getStat().mergeMul(_stat, (_amount / 100) + 1); - break; - } - } - } - - public void onDayNightChange(OnDayNightChange event) - { - synchronized (DAY_TIME) - { - final boolean isNight = event.isNight(); - - // Run only once per daytime change. - if (isNight == DAY_TIME.get()) - { - return; - } - DAY_TIME.set(isNight); - - // System message for Shadow Sense. - final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); - msg.addSkillName(SHADOW_SENSE); - - for (Creature creature : NIGHT_STAT_CHARACTERS) - { - // Pump again. - creature.getStat().recalculateStats(true); - - // Send Shadow Sense message when player has skill. - if (creature.getKnownSkill(SHADOW_SENSE) != null) - { - creature.sendPacket(msg); - } - } - } - } -} diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java new file mode 100644 index 0000000000..71f1c02986 --- /dev/null +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java @@ -0,0 +1,130 @@ +/* + * 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 java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.l2jmobius.gameserver.enums.StatModifierType; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.effects.AbstractEffect; +import org.l2jmobius.gameserver.model.events.Containers; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.ListenersContainer; +import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; +import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; +import org.l2jmobius.gameserver.model.item.instance.Item; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.Stat; +import org.l2jmobius.gameserver.network.SystemMessageId; +import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; +import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; + +/** + * @author Mobius + */ +public class NightStatModify extends AbstractEffect +{ + private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); + private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); + private static final int SHADOW_SENSE = 294; + + private final Stat _stat; + private final int _amount; + protected final StatModifierType _mode; + + public NightStatModify(StatSet params) + { + _stat = params.getEnum("stat", Stat.class); + _amount = params.getInt("amount"); + _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); + + // Init a global day-night change listener. + final ListenersContainer container = Containers.Global(); + container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); + } + + @Override + public void onStart(Creature effector, Creature effected, Skill skill, Item item) + { + NIGHT_STAT_CHARACTERS.add(effected); + } + + @Override + public void onExit(Creature effector, Creature effected, Skill skill) + { + NIGHT_STAT_CHARACTERS.remove(effected); + } + + @Override + public void pump(Creature effected, Skill skill) + { + // Not night. + if (!GameTimeTaskManager.getInstance().isNight()) + { + return; + } + + // Apply stat. + switch (_mode) + { + case DIFF: + { + effected.getStat().mergeAdd(_stat, _amount); + break; + } + case PER: + { + effected.getStat().mergeMul(_stat, (_amount / 100) + 1); + break; + } + } + } + + public void onDayNightChange(OnDayNightChange event) + { + synchronized (DAY_TIME) + { + final boolean isNight = event.isNight(); + + // Run only once per daytime change. + if (isNight == DAY_TIME.get()) + { + return; + } + DAY_TIME.set(isNight); + + // System message for Shadow Sense. + final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); + msg.addSkillName(SHADOW_SENSE); + + for (Creature creature : NIGHT_STAT_CHARACTERS) + { + // Pump again. + creature.getStat().recalculateStats(true); + + // Send Shadow Sense message when player has skill. + if (creature.getKnownSkill(SHADOW_SENSE) != null) + { + creature.sendPacket(msg); + } + } + } + } +} diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/skills/00200-00299.xml b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/skills/00200-00299.xml index cba90169b4..9221e1f7fa 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/skills/00200-00299.xml +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/skills/00200-00299.xml @@ -7234,7 +7234,7 @@ P 5 - + ACCURACY_COMBAT 3 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 cb2787b9cc..19c6391a18 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 @@ -205,7 +205,7 @@ MpRegen: MP Regeneration stat. MpShield: Transfers given percentage of damage as mana damage. Mana Shield. MpVampiricAttack: Absorbs given percentage of mana during attack. Mute: Prevents target from using magical skills. Silence. -NightStatModifier: Modify a specific stat at night time. (l2jmobius) +NightStatModify: Modify a specific stat at night time. (l2jmobius) NoblesseBless: Does not remove buffs upon death except itself. OpenChest: Opens a treasure chest. OpenCommonRecipeBook: Shows the common recipe book window. diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/EffectMasterHandler.java index 969874cbd3..0af7e97d24 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -235,7 +235,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MpShield", MpShield::new); EffectHandler.getInstance().registerHandler("MpVampiricAttack", MpVampiricAttack::new); EffectHandler.getInstance().registerHandler("Mute", Mute::new); - EffectHandler.getInstance().registerHandler("NightStatModifier", NightStatModifier::new); + EffectHandler.getInstance().registerHandler("NightStatModify", NightStatModify::new); EffectHandler.getInstance().registerHandler("NoblesseBless", NoblesseBless::new); EffectHandler.getInstance().registerHandler("OpenChest", OpenChest::new); EffectHandler.getInstance().registerHandler("OpenCommonRecipeBook", OpenCommonRecipeBook::new); diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java deleted file mode 100644 index 8dce6e4312..0000000000 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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 java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicBoolean; - -import org.l2jmobius.gameserver.enums.StatModifierType; -import org.l2jmobius.gameserver.model.StatSet; -import org.l2jmobius.gameserver.model.actor.Creature; -import org.l2jmobius.gameserver.model.effects.AbstractEffect; -import org.l2jmobius.gameserver.model.events.Containers; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenersContainer; -import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; -import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; -import org.l2jmobius.gameserver.model.item.instance.Item; -import org.l2jmobius.gameserver.model.skill.Skill; -import org.l2jmobius.gameserver.model.stats.Stat; -import org.l2jmobius.gameserver.network.SystemMessageId; -import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; -import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; - -/** - * @author Mobius - */ -public class NightStatModifier extends AbstractEffect -{ - private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); - private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); - private static final int SHADOW_SENSE = 294; - - private final Stat _stat; - private final int _amount; - protected final StatModifierType _mode; - - public NightStatModifier(StatSet params) - { - _stat = params.getEnum("stat", Stat.class); - _amount = params.getInt("amount"); - _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); - - // Init a global day-night change listener. - final ListenersContainer container = Containers.Global(); - container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); - } - - @Override - public void onStart(Creature effector, Creature effected, Skill skill, Item item) - { - NIGHT_STAT_CHARACTERS.add(effected); - } - - @Override - public void onExit(Creature effector, Creature effected, Skill skill) - { - NIGHT_STAT_CHARACTERS.remove(effected); - } - - @Override - public void pump(Creature effected, Skill skill) - { - // Not night. - if (!GameTimeTaskManager.getInstance().isNight()) - { - return; - } - - // Apply stat. - switch (_mode) - { - case DIFF: - { - effected.getStat().mergeAdd(_stat, _amount); - break; - } - case PER: - { - effected.getStat().mergeMul(_stat, (_amount / 100) + 1); - break; - } - } - } - - public void onDayNightChange(OnDayNightChange event) - { - synchronized (DAY_TIME) - { - final boolean isNight = event.isNight(); - - // Run only once per daytime change. - if (isNight == DAY_TIME.get()) - { - return; - } - DAY_TIME.set(isNight); - - // System message for Shadow Sense. - final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); - msg.addSkillName(SHADOW_SENSE); - - for (Creature creature : NIGHT_STAT_CHARACTERS) - { - // Pump again. - creature.getStat().recalculateStats(true); - - // Send Shadow Sense message when player has skill. - if (creature.getKnownSkill(SHADOW_SENSE) != null) - { - creature.sendPacket(msg); - } - } - } - } -} diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java new file mode 100644 index 0000000000..71f1c02986 --- /dev/null +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java @@ -0,0 +1,130 @@ +/* + * 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 java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.l2jmobius.gameserver.enums.StatModifierType; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.effects.AbstractEffect; +import org.l2jmobius.gameserver.model.events.Containers; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.ListenersContainer; +import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; +import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; +import org.l2jmobius.gameserver.model.item.instance.Item; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.Stat; +import org.l2jmobius.gameserver.network.SystemMessageId; +import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; +import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; + +/** + * @author Mobius + */ +public class NightStatModify extends AbstractEffect +{ + private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); + private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); + private static final int SHADOW_SENSE = 294; + + private final Stat _stat; + private final int _amount; + protected final StatModifierType _mode; + + public NightStatModify(StatSet params) + { + _stat = params.getEnum("stat", Stat.class); + _amount = params.getInt("amount"); + _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); + + // Init a global day-night change listener. + final ListenersContainer container = Containers.Global(); + container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); + } + + @Override + public void onStart(Creature effector, Creature effected, Skill skill, Item item) + { + NIGHT_STAT_CHARACTERS.add(effected); + } + + @Override + public void onExit(Creature effector, Creature effected, Skill skill) + { + NIGHT_STAT_CHARACTERS.remove(effected); + } + + @Override + public void pump(Creature effected, Skill skill) + { + // Not night. + if (!GameTimeTaskManager.getInstance().isNight()) + { + return; + } + + // Apply stat. + switch (_mode) + { + case DIFF: + { + effected.getStat().mergeAdd(_stat, _amount); + break; + } + case PER: + { + effected.getStat().mergeMul(_stat, (_amount / 100) + 1); + break; + } + } + } + + public void onDayNightChange(OnDayNightChange event) + { + synchronized (DAY_TIME) + { + final boolean isNight = event.isNight(); + + // Run only once per daytime change. + if (isNight == DAY_TIME.get()) + { + return; + } + DAY_TIME.set(isNight); + + // System message for Shadow Sense. + final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); + msg.addSkillName(SHADOW_SENSE); + + for (Creature creature : NIGHT_STAT_CHARACTERS) + { + // Pump again. + creature.getStat().recalculateStats(true); + + // Send Shadow Sense message when player has skill. + if (creature.getKnownSkill(SHADOW_SENSE) != null) + { + creature.sendPacket(msg); + } + } + } + } +} diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/skills/00200-00299.xml b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/skills/00200-00299.xml index 83043c0313..7e7d84274b 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/skills/00200-00299.xml +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/skills/00200-00299.xml @@ -7817,7 +7817,7 @@ P 5 - + ACCURACY_COMBAT 3 diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/skills/documentation.txt index cb2787b9cc..19c6391a18 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/skills/documentation.txt @@ -205,7 +205,7 @@ MpRegen: MP Regeneration stat. MpShield: Transfers given percentage of damage as mana damage. Mana Shield. MpVampiricAttack: Absorbs given percentage of mana during attack. Mute: Prevents target from using magical skills. Silence. -NightStatModifier: Modify a specific stat at night time. (l2jmobius) +NightStatModify: Modify a specific stat at night time. (l2jmobius) NoblesseBless: Does not remove buffs upon death except itself. OpenChest: Opens a treasure chest. OpenCommonRecipeBook: Shows the common recipe book window. diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/EffectMasterHandler.java index f865417b40..8a2eef2308 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -237,7 +237,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MpShield", MpShield::new); EffectHandler.getInstance().registerHandler("MpVampiricAttack", MpVampiricAttack::new); EffectHandler.getInstance().registerHandler("Mute", Mute::new); - EffectHandler.getInstance().registerHandler("NightStatModifier", NightStatModifier::new); + EffectHandler.getInstance().registerHandler("NightStatModify", NightStatModify::new); EffectHandler.getInstance().registerHandler("NoblesseBless", NoblesseBless::new); EffectHandler.getInstance().registerHandler("OpenChest", OpenChest::new); EffectHandler.getInstance().registerHandler("OpenCommonRecipeBook", OpenCommonRecipeBook::new); diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java deleted file mode 100644 index 8dce6e4312..0000000000 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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 java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicBoolean; - -import org.l2jmobius.gameserver.enums.StatModifierType; -import org.l2jmobius.gameserver.model.StatSet; -import org.l2jmobius.gameserver.model.actor.Creature; -import org.l2jmobius.gameserver.model.effects.AbstractEffect; -import org.l2jmobius.gameserver.model.events.Containers; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenersContainer; -import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; -import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; -import org.l2jmobius.gameserver.model.item.instance.Item; -import org.l2jmobius.gameserver.model.skill.Skill; -import org.l2jmobius.gameserver.model.stats.Stat; -import org.l2jmobius.gameserver.network.SystemMessageId; -import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; -import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; - -/** - * @author Mobius - */ -public class NightStatModifier extends AbstractEffect -{ - private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); - private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); - private static final int SHADOW_SENSE = 294; - - private final Stat _stat; - private final int _amount; - protected final StatModifierType _mode; - - public NightStatModifier(StatSet params) - { - _stat = params.getEnum("stat", Stat.class); - _amount = params.getInt("amount"); - _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); - - // Init a global day-night change listener. - final ListenersContainer container = Containers.Global(); - container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); - } - - @Override - public void onStart(Creature effector, Creature effected, Skill skill, Item item) - { - NIGHT_STAT_CHARACTERS.add(effected); - } - - @Override - public void onExit(Creature effector, Creature effected, Skill skill) - { - NIGHT_STAT_CHARACTERS.remove(effected); - } - - @Override - public void pump(Creature effected, Skill skill) - { - // Not night. - if (!GameTimeTaskManager.getInstance().isNight()) - { - return; - } - - // Apply stat. - switch (_mode) - { - case DIFF: - { - effected.getStat().mergeAdd(_stat, _amount); - break; - } - case PER: - { - effected.getStat().mergeMul(_stat, (_amount / 100) + 1); - break; - } - } - } - - public void onDayNightChange(OnDayNightChange event) - { - synchronized (DAY_TIME) - { - final boolean isNight = event.isNight(); - - // Run only once per daytime change. - if (isNight == DAY_TIME.get()) - { - return; - } - DAY_TIME.set(isNight); - - // System message for Shadow Sense. - final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); - msg.addSkillName(SHADOW_SENSE); - - for (Creature creature : NIGHT_STAT_CHARACTERS) - { - // Pump again. - creature.getStat().recalculateStats(true); - - // Send Shadow Sense message when player has skill. - if (creature.getKnownSkill(SHADOW_SENSE) != null) - { - creature.sendPacket(msg); - } - } - } - } -} diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java new file mode 100644 index 0000000000..71f1c02986 --- /dev/null +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java @@ -0,0 +1,130 @@ +/* + * 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 java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.l2jmobius.gameserver.enums.StatModifierType; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.effects.AbstractEffect; +import org.l2jmobius.gameserver.model.events.Containers; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.ListenersContainer; +import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; +import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; +import org.l2jmobius.gameserver.model.item.instance.Item; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.Stat; +import org.l2jmobius.gameserver.network.SystemMessageId; +import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; +import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; + +/** + * @author Mobius + */ +public class NightStatModify extends AbstractEffect +{ + private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); + private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); + private static final int SHADOW_SENSE = 294; + + private final Stat _stat; + private final int _amount; + protected final StatModifierType _mode; + + public NightStatModify(StatSet params) + { + _stat = params.getEnum("stat", Stat.class); + _amount = params.getInt("amount"); + _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); + + // Init a global day-night change listener. + final ListenersContainer container = Containers.Global(); + container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); + } + + @Override + public void onStart(Creature effector, Creature effected, Skill skill, Item item) + { + NIGHT_STAT_CHARACTERS.add(effected); + } + + @Override + public void onExit(Creature effector, Creature effected, Skill skill) + { + NIGHT_STAT_CHARACTERS.remove(effected); + } + + @Override + public void pump(Creature effected, Skill skill) + { + // Not night. + if (!GameTimeTaskManager.getInstance().isNight()) + { + return; + } + + // Apply stat. + switch (_mode) + { + case DIFF: + { + effected.getStat().mergeAdd(_stat, _amount); + break; + } + case PER: + { + effected.getStat().mergeMul(_stat, (_amount / 100) + 1); + break; + } + } + } + + public void onDayNightChange(OnDayNightChange event) + { + synchronized (DAY_TIME) + { + final boolean isNight = event.isNight(); + + // Run only once per daytime change. + if (isNight == DAY_TIME.get()) + { + return; + } + DAY_TIME.set(isNight); + + // System message for Shadow Sense. + final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); + msg.addSkillName(SHADOW_SENSE); + + for (Creature creature : NIGHT_STAT_CHARACTERS) + { + // Pump again. + creature.getStat().recalculateStats(true); + + // Send Shadow Sense message when player has skill. + if (creature.getKnownSkill(SHADOW_SENSE) != null) + { + creature.sendPacket(msg); + } + } + } + } +} diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/skills/00200-00299.xml b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/skills/00200-00299.xml index 5b89e79935..c4ed86ad75 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/skills/00200-00299.xml +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/skills/00200-00299.xml @@ -7817,7 +7817,7 @@ P 5 - + ACCURACY_COMBAT 3 diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/skills/documentation.txt index d387638a59..07c1db2163 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/skills/documentation.txt @@ -207,7 +207,7 @@ MpRegen: MP Regeneration stat. MpShield: Transfers given percentage of damage as mana damage. Mana Shield. MpVampiricAttack: Absorbs given percentage of mana during attack. Mute: Prevents target from using magical skills. Silence. -NightStatModifier: Modify a specific stat at night time. (l2jmobius) +NightStatModify: Modify a specific stat at night time. (l2jmobius) NoblesseBless: Does not remove buffs upon death except itself. OpenChest: Opens a treasure chest. OpenCommonRecipeBook: Shows the common recipe book window. diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/EffectMasterHandler.java index 4fd4274ef9..75bd99940b 100644 --- a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -232,7 +232,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MpShield", MpShield::new); EffectHandler.getInstance().registerHandler("MpVampiricAttack", MpVampiricAttack::new); EffectHandler.getInstance().registerHandler("Mute", Mute::new); - EffectHandler.getInstance().registerHandler("NightStatModifier", NightStatModifier::new); + EffectHandler.getInstance().registerHandler("NightStatModify", NightStatModify::new); EffectHandler.getInstance().registerHandler("NoblesseBless", NoblesseBless::new); EffectHandler.getInstance().registerHandler("OpenChest", OpenChest::new); EffectHandler.getInstance().registerHandler("OpenCommonRecipeBook", OpenCommonRecipeBook::new); diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java deleted file mode 100644 index 8dce6e4312..0000000000 --- a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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 java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicBoolean; - -import org.l2jmobius.gameserver.enums.StatModifierType; -import org.l2jmobius.gameserver.model.StatSet; -import org.l2jmobius.gameserver.model.actor.Creature; -import org.l2jmobius.gameserver.model.effects.AbstractEffect; -import org.l2jmobius.gameserver.model.events.Containers; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenersContainer; -import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; -import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; -import org.l2jmobius.gameserver.model.item.instance.Item; -import org.l2jmobius.gameserver.model.skill.Skill; -import org.l2jmobius.gameserver.model.stats.Stat; -import org.l2jmobius.gameserver.network.SystemMessageId; -import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; -import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; - -/** - * @author Mobius - */ -public class NightStatModifier extends AbstractEffect -{ - private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); - private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); - private static final int SHADOW_SENSE = 294; - - private final Stat _stat; - private final int _amount; - protected final StatModifierType _mode; - - public NightStatModifier(StatSet params) - { - _stat = params.getEnum("stat", Stat.class); - _amount = params.getInt("amount"); - _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); - - // Init a global day-night change listener. - final ListenersContainer container = Containers.Global(); - container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); - } - - @Override - public void onStart(Creature effector, Creature effected, Skill skill, Item item) - { - NIGHT_STAT_CHARACTERS.add(effected); - } - - @Override - public void onExit(Creature effector, Creature effected, Skill skill) - { - NIGHT_STAT_CHARACTERS.remove(effected); - } - - @Override - public void pump(Creature effected, Skill skill) - { - // Not night. - if (!GameTimeTaskManager.getInstance().isNight()) - { - return; - } - - // Apply stat. - switch (_mode) - { - case DIFF: - { - effected.getStat().mergeAdd(_stat, _amount); - break; - } - case PER: - { - effected.getStat().mergeMul(_stat, (_amount / 100) + 1); - break; - } - } - } - - public void onDayNightChange(OnDayNightChange event) - { - synchronized (DAY_TIME) - { - final boolean isNight = event.isNight(); - - // Run only once per daytime change. - if (isNight == DAY_TIME.get()) - { - return; - } - DAY_TIME.set(isNight); - - // System message for Shadow Sense. - final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); - msg.addSkillName(SHADOW_SENSE); - - for (Creature creature : NIGHT_STAT_CHARACTERS) - { - // Pump again. - creature.getStat().recalculateStats(true); - - // Send Shadow Sense message when player has skill. - if (creature.getKnownSkill(SHADOW_SENSE) != null) - { - creature.sendPacket(msg); - } - } - } - } -} diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java new file mode 100644 index 0000000000..71f1c02986 --- /dev/null +++ b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java @@ -0,0 +1,130 @@ +/* + * 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 java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.l2jmobius.gameserver.enums.StatModifierType; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.effects.AbstractEffect; +import org.l2jmobius.gameserver.model.events.Containers; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.ListenersContainer; +import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; +import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; +import org.l2jmobius.gameserver.model.item.instance.Item; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.Stat; +import org.l2jmobius.gameserver.network.SystemMessageId; +import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; +import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; + +/** + * @author Mobius + */ +public class NightStatModify extends AbstractEffect +{ + private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); + private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); + private static final int SHADOW_SENSE = 294; + + private final Stat _stat; + private final int _amount; + protected final StatModifierType _mode; + + public NightStatModify(StatSet params) + { + _stat = params.getEnum("stat", Stat.class); + _amount = params.getInt("amount"); + _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); + + // Init a global day-night change listener. + final ListenersContainer container = Containers.Global(); + container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); + } + + @Override + public void onStart(Creature effector, Creature effected, Skill skill, Item item) + { + NIGHT_STAT_CHARACTERS.add(effected); + } + + @Override + public void onExit(Creature effector, Creature effected, Skill skill) + { + NIGHT_STAT_CHARACTERS.remove(effected); + } + + @Override + public void pump(Creature effected, Skill skill) + { + // Not night. + if (!GameTimeTaskManager.getInstance().isNight()) + { + return; + } + + // Apply stat. + switch (_mode) + { + case DIFF: + { + effected.getStat().mergeAdd(_stat, _amount); + break; + } + case PER: + { + effected.getStat().mergeMul(_stat, (_amount / 100) + 1); + break; + } + } + } + + public void onDayNightChange(OnDayNightChange event) + { + synchronized (DAY_TIME) + { + final boolean isNight = event.isNight(); + + // Run only once per daytime change. + if (isNight == DAY_TIME.get()) + { + return; + } + DAY_TIME.set(isNight); + + // System message for Shadow Sense. + final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); + msg.addSkillName(SHADOW_SENSE); + + for (Creature creature : NIGHT_STAT_CHARACTERS) + { + // Pump again. + creature.getStat().recalculateStats(true); + + // Send Shadow Sense message when player has skill. + if (creature.getKnownSkill(SHADOW_SENSE) != null) + { + creature.sendPacket(msg); + } + } + } + } +} diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/00200-00299.xml b/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/00200-00299.xml index 066e1a340b..7c240bd7e6 100644 --- a/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/00200-00299.xml +++ b/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/00200-00299.xml @@ -6462,7 +6462,7 @@ P 5 - + ACCURACY_COMBAT 3 diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/documentation.txt index efb126e47d..5abbb27cc2 100644 --- a/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/documentation.txt @@ -202,7 +202,7 @@ MpRegen: MP Regeneration stat. MpShield: Transfers given percentage of damage as mana damage. Mana Shield. MpVampiricAttack: Absorbs given percentage of mana during attack. Mute: Prevents target from using magical skills. Silence. -NightStatModifier: Modify a specific stat at night time. (l2jmobius) +NightStatModify: Modify a specific stat at night time. (l2jmobius) NoblesseBless: Does not remove buffs upon death except itself. OpenChest: Opens a treasure chest. OpenCommonRecipeBook: Shows the common recipe book window. diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/EffectMasterHandler.java index 9585b44c54..3363b0c9a8 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -242,7 +242,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MpShield", MpShield::new); EffectHandler.getInstance().registerHandler("MpVampiricAttack", MpVampiricAttack::new); EffectHandler.getInstance().registerHandler("Mute", Mute::new); - EffectHandler.getInstance().registerHandler("NightStatModifier", NightStatModifier::new); + EffectHandler.getInstance().registerHandler("NightStatModify", NightStatModify::new); EffectHandler.getInstance().registerHandler("NoblesseBless", NoblesseBless::new); EffectHandler.getInstance().registerHandler("OpenChest", OpenChest::new); EffectHandler.getInstance().registerHandler("OpenCommonRecipeBook", OpenCommonRecipeBook::new); diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java deleted file mode 100644 index 8dce6e4312..0000000000 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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 java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicBoolean; - -import org.l2jmobius.gameserver.enums.StatModifierType; -import org.l2jmobius.gameserver.model.StatSet; -import org.l2jmobius.gameserver.model.actor.Creature; -import org.l2jmobius.gameserver.model.effects.AbstractEffect; -import org.l2jmobius.gameserver.model.events.Containers; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenersContainer; -import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; -import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; -import org.l2jmobius.gameserver.model.item.instance.Item; -import org.l2jmobius.gameserver.model.skill.Skill; -import org.l2jmobius.gameserver.model.stats.Stat; -import org.l2jmobius.gameserver.network.SystemMessageId; -import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; -import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; - -/** - * @author Mobius - */ -public class NightStatModifier extends AbstractEffect -{ - private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); - private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); - private static final int SHADOW_SENSE = 294; - - private final Stat _stat; - private final int _amount; - protected final StatModifierType _mode; - - public NightStatModifier(StatSet params) - { - _stat = params.getEnum("stat", Stat.class); - _amount = params.getInt("amount"); - _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); - - // Init a global day-night change listener. - final ListenersContainer container = Containers.Global(); - container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); - } - - @Override - public void onStart(Creature effector, Creature effected, Skill skill, Item item) - { - NIGHT_STAT_CHARACTERS.add(effected); - } - - @Override - public void onExit(Creature effector, Creature effected, Skill skill) - { - NIGHT_STAT_CHARACTERS.remove(effected); - } - - @Override - public void pump(Creature effected, Skill skill) - { - // Not night. - if (!GameTimeTaskManager.getInstance().isNight()) - { - return; - } - - // Apply stat. - switch (_mode) - { - case DIFF: - { - effected.getStat().mergeAdd(_stat, _amount); - break; - } - case PER: - { - effected.getStat().mergeMul(_stat, (_amount / 100) + 1); - break; - } - } - } - - public void onDayNightChange(OnDayNightChange event) - { - synchronized (DAY_TIME) - { - final boolean isNight = event.isNight(); - - // Run only once per daytime change. - if (isNight == DAY_TIME.get()) - { - return; - } - DAY_TIME.set(isNight); - - // System message for Shadow Sense. - final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); - msg.addSkillName(SHADOW_SENSE); - - for (Creature creature : NIGHT_STAT_CHARACTERS) - { - // Pump again. - creature.getStat().recalculateStats(true); - - // Send Shadow Sense message when player has skill. - if (creature.getKnownSkill(SHADOW_SENSE) != null) - { - creature.sendPacket(msg); - } - } - } - } -} diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java new file mode 100644 index 0000000000..71f1c02986 --- /dev/null +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java @@ -0,0 +1,130 @@ +/* + * 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 java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.l2jmobius.gameserver.enums.StatModifierType; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.effects.AbstractEffect; +import org.l2jmobius.gameserver.model.events.Containers; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.ListenersContainer; +import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; +import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; +import org.l2jmobius.gameserver.model.item.instance.Item; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.Stat; +import org.l2jmobius.gameserver.network.SystemMessageId; +import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; +import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; + +/** + * @author Mobius + */ +public class NightStatModify extends AbstractEffect +{ + private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); + private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); + private static final int SHADOW_SENSE = 294; + + private final Stat _stat; + private final int _amount; + protected final StatModifierType _mode; + + public NightStatModify(StatSet params) + { + _stat = params.getEnum("stat", Stat.class); + _amount = params.getInt("amount"); + _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); + + // Init a global day-night change listener. + final ListenersContainer container = Containers.Global(); + container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); + } + + @Override + public void onStart(Creature effector, Creature effected, Skill skill, Item item) + { + NIGHT_STAT_CHARACTERS.add(effected); + } + + @Override + public void onExit(Creature effector, Creature effected, Skill skill) + { + NIGHT_STAT_CHARACTERS.remove(effected); + } + + @Override + public void pump(Creature effected, Skill skill) + { + // Not night. + if (!GameTimeTaskManager.getInstance().isNight()) + { + return; + } + + // Apply stat. + switch (_mode) + { + case DIFF: + { + effected.getStat().mergeAdd(_stat, _amount); + break; + } + case PER: + { + effected.getStat().mergeMul(_stat, (_amount / 100) + 1); + break; + } + } + } + + public void onDayNightChange(OnDayNightChange event) + { + synchronized (DAY_TIME) + { + final boolean isNight = event.isNight(); + + // Run only once per daytime change. + if (isNight == DAY_TIME.get()) + { + return; + } + DAY_TIME.set(isNight); + + // System message for Shadow Sense. + final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); + msg.addSkillName(SHADOW_SENSE); + + for (Creature creature : NIGHT_STAT_CHARACTERS) + { + // Pump again. + creature.getStat().recalculateStats(true); + + // Send Shadow Sense message when player has skill. + if (creature.getKnownSkill(SHADOW_SENSE) != null) + { + creature.sendPacket(msg); + } + } + } + } +} diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/00200-00299.xml b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/00200-00299.xml index efc6b45cf3..31127e89d5 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/00200-00299.xml +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/00200-00299.xml @@ -7752,7 +7752,7 @@ P 5 - + ACCURACY_COMBAT 3 diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/documentation.txt index ed2ed02e05..adeb204664 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/documentation.txt @@ -212,7 +212,7 @@ MpRegen: MP Regeneration stat. MpShield: Transfers given percentage of damage as mana damage. Mana Shield. MpVampiricAttack: Absorbs given percentage of mana during attack. Mute: Prevents target from using magical skills. Silence. -NightStatModifier: Modify a specific stat at night time. (l2jmobius) +NightStatModify: Modify a specific stat at night time. (l2jmobius) NoblesseBless: Does not remove buffs upon death except itself. OpenChest: Opens a treasure chest. OpenCommonRecipeBook: Shows the common recipe book window. diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/EffectMasterHandler.java index 37f4eb0bbc..a407733c19 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -243,7 +243,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MpShield", MpShield::new); EffectHandler.getInstance().registerHandler("MpVampiricAttack", MpVampiricAttack::new); EffectHandler.getInstance().registerHandler("Mute", Mute::new); - EffectHandler.getInstance().registerHandler("NightStatModifier", NightStatModifier::new); + EffectHandler.getInstance().registerHandler("NightStatModify", NightStatModify::new); EffectHandler.getInstance().registerHandler("NoblesseBless", NoblesseBless::new); EffectHandler.getInstance().registerHandler("OpenChest", OpenChest::new); EffectHandler.getInstance().registerHandler("OpenCommonRecipeBook", OpenCommonRecipeBook::new); diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java deleted file mode 100644 index 8dce6e4312..0000000000 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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 java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicBoolean; - -import org.l2jmobius.gameserver.enums.StatModifierType; -import org.l2jmobius.gameserver.model.StatSet; -import org.l2jmobius.gameserver.model.actor.Creature; -import org.l2jmobius.gameserver.model.effects.AbstractEffect; -import org.l2jmobius.gameserver.model.events.Containers; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenersContainer; -import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; -import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; -import org.l2jmobius.gameserver.model.item.instance.Item; -import org.l2jmobius.gameserver.model.skill.Skill; -import org.l2jmobius.gameserver.model.stats.Stat; -import org.l2jmobius.gameserver.network.SystemMessageId; -import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; -import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; - -/** - * @author Mobius - */ -public class NightStatModifier extends AbstractEffect -{ - private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); - private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); - private static final int SHADOW_SENSE = 294; - - private final Stat _stat; - private final int _amount; - protected final StatModifierType _mode; - - public NightStatModifier(StatSet params) - { - _stat = params.getEnum("stat", Stat.class); - _amount = params.getInt("amount"); - _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); - - // Init a global day-night change listener. - final ListenersContainer container = Containers.Global(); - container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); - } - - @Override - public void onStart(Creature effector, Creature effected, Skill skill, Item item) - { - NIGHT_STAT_CHARACTERS.add(effected); - } - - @Override - public void onExit(Creature effector, Creature effected, Skill skill) - { - NIGHT_STAT_CHARACTERS.remove(effected); - } - - @Override - public void pump(Creature effected, Skill skill) - { - // Not night. - if (!GameTimeTaskManager.getInstance().isNight()) - { - return; - } - - // Apply stat. - switch (_mode) - { - case DIFF: - { - effected.getStat().mergeAdd(_stat, _amount); - break; - } - case PER: - { - effected.getStat().mergeMul(_stat, (_amount / 100) + 1); - break; - } - } - } - - public void onDayNightChange(OnDayNightChange event) - { - synchronized (DAY_TIME) - { - final boolean isNight = event.isNight(); - - // Run only once per daytime change. - if (isNight == DAY_TIME.get()) - { - return; - } - DAY_TIME.set(isNight); - - // System message for Shadow Sense. - final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); - msg.addSkillName(SHADOW_SENSE); - - for (Creature creature : NIGHT_STAT_CHARACTERS) - { - // Pump again. - creature.getStat().recalculateStats(true); - - // Send Shadow Sense message when player has skill. - if (creature.getKnownSkill(SHADOW_SENSE) != null) - { - creature.sendPacket(msg); - } - } - } - } -} diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java new file mode 100644 index 0000000000..71f1c02986 --- /dev/null +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java @@ -0,0 +1,130 @@ +/* + * 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 java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.l2jmobius.gameserver.enums.StatModifierType; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.effects.AbstractEffect; +import org.l2jmobius.gameserver.model.events.Containers; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.ListenersContainer; +import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; +import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; +import org.l2jmobius.gameserver.model.item.instance.Item; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.Stat; +import org.l2jmobius.gameserver.network.SystemMessageId; +import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; +import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; + +/** + * @author Mobius + */ +public class NightStatModify extends AbstractEffect +{ + private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); + private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); + private static final int SHADOW_SENSE = 294; + + private final Stat _stat; + private final int _amount; + protected final StatModifierType _mode; + + public NightStatModify(StatSet params) + { + _stat = params.getEnum("stat", Stat.class); + _amount = params.getInt("amount"); + _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); + + // Init a global day-night change listener. + final ListenersContainer container = Containers.Global(); + container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); + } + + @Override + public void onStart(Creature effector, Creature effected, Skill skill, Item item) + { + NIGHT_STAT_CHARACTERS.add(effected); + } + + @Override + public void onExit(Creature effector, Creature effected, Skill skill) + { + NIGHT_STAT_CHARACTERS.remove(effected); + } + + @Override + public void pump(Creature effected, Skill skill) + { + // Not night. + if (!GameTimeTaskManager.getInstance().isNight()) + { + return; + } + + // Apply stat. + switch (_mode) + { + case DIFF: + { + effected.getStat().mergeAdd(_stat, _amount); + break; + } + case PER: + { + effected.getStat().mergeMul(_stat, (_amount / 100) + 1); + break; + } + } + } + + public void onDayNightChange(OnDayNightChange event) + { + synchronized (DAY_TIME) + { + final boolean isNight = event.isNight(); + + // Run only once per daytime change. + if (isNight == DAY_TIME.get()) + { + return; + } + DAY_TIME.set(isNight); + + // System message for Shadow Sense. + final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); + msg.addSkillName(SHADOW_SENSE); + + for (Creature creature : NIGHT_STAT_CHARACTERS) + { + // Pump again. + creature.getStat().recalculateStats(true); + + // Send Shadow Sense message when player has skill. + if (creature.getKnownSkill(SHADOW_SENSE) != null) + { + creature.sendPacket(msg); + } + } + } + } +} diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/00200-00299.xml b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/00200-00299.xml index c4ad97ff1f..5b9cecb4f9 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/00200-00299.xml +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/00200-00299.xml @@ -7943,7 +7943,7 @@ P 5 - + ACCURACY_COMBAT 3 diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/documentation.txt index 22d0072be0..721399b9e2 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/documentation.txt @@ -213,7 +213,7 @@ MpRegen: MP Regeneration stat. MpShield: Transfers given percentage of damage as mana damage. Mana Shield. MpVampiricAttack: Absorbs given percentage of mana during attack. Mute: Prevents target from using magical skills. Silence. -NightStatModifier: Modify a specific stat at night time. (l2jmobius) +NightStatModify: Modify a specific stat at night time. (l2jmobius) NoblesseBless: Does not remove buffs upon death except itself. OpenChest: Opens a treasure chest. OpenCommonRecipeBook: Shows the common recipe book window. diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/EffectMasterHandler.java index 6aead3c085..7416978e9c 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -245,7 +245,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MpVampiricAttack", MpVampiricAttack::new); EffectHandler.getInstance().registerHandler("Mute", Mute::new); EffectHandler.getInstance().registerHandler("NewHennaSlot", NewHennaSlot::new); - EffectHandler.getInstance().registerHandler("NightStatModifier", NightStatModifier::new); + EffectHandler.getInstance().registerHandler("NightStatModify", NightStatModify::new); EffectHandler.getInstance().registerHandler("NoblesseBless", NoblesseBless::new); EffectHandler.getInstance().registerHandler("OpenChest", OpenChest::new); EffectHandler.getInstance().registerHandler("OpenCommonRecipeBook", OpenCommonRecipeBook::new); diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java deleted file mode 100644 index 8dce6e4312..0000000000 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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 java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicBoolean; - -import org.l2jmobius.gameserver.enums.StatModifierType; -import org.l2jmobius.gameserver.model.StatSet; -import org.l2jmobius.gameserver.model.actor.Creature; -import org.l2jmobius.gameserver.model.effects.AbstractEffect; -import org.l2jmobius.gameserver.model.events.Containers; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenersContainer; -import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; -import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; -import org.l2jmobius.gameserver.model.item.instance.Item; -import org.l2jmobius.gameserver.model.skill.Skill; -import org.l2jmobius.gameserver.model.stats.Stat; -import org.l2jmobius.gameserver.network.SystemMessageId; -import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; -import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; - -/** - * @author Mobius - */ -public class NightStatModifier extends AbstractEffect -{ - private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); - private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); - private static final int SHADOW_SENSE = 294; - - private final Stat _stat; - private final int _amount; - protected final StatModifierType _mode; - - public NightStatModifier(StatSet params) - { - _stat = params.getEnum("stat", Stat.class); - _amount = params.getInt("amount"); - _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); - - // Init a global day-night change listener. - final ListenersContainer container = Containers.Global(); - container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); - } - - @Override - public void onStart(Creature effector, Creature effected, Skill skill, Item item) - { - NIGHT_STAT_CHARACTERS.add(effected); - } - - @Override - public void onExit(Creature effector, Creature effected, Skill skill) - { - NIGHT_STAT_CHARACTERS.remove(effected); - } - - @Override - public void pump(Creature effected, Skill skill) - { - // Not night. - if (!GameTimeTaskManager.getInstance().isNight()) - { - return; - } - - // Apply stat. - switch (_mode) - { - case DIFF: - { - effected.getStat().mergeAdd(_stat, _amount); - break; - } - case PER: - { - effected.getStat().mergeMul(_stat, (_amount / 100) + 1); - break; - } - } - } - - public void onDayNightChange(OnDayNightChange event) - { - synchronized (DAY_TIME) - { - final boolean isNight = event.isNight(); - - // Run only once per daytime change. - if (isNight == DAY_TIME.get()) - { - return; - } - DAY_TIME.set(isNight); - - // System message for Shadow Sense. - final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); - msg.addSkillName(SHADOW_SENSE); - - for (Creature creature : NIGHT_STAT_CHARACTERS) - { - // Pump again. - creature.getStat().recalculateStats(true); - - // Send Shadow Sense message when player has skill. - if (creature.getKnownSkill(SHADOW_SENSE) != null) - { - creature.sendPacket(msg); - } - } - } - } -} diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java new file mode 100644 index 0000000000..71f1c02986 --- /dev/null +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java @@ -0,0 +1,130 @@ +/* + * 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 java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.l2jmobius.gameserver.enums.StatModifierType; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.effects.AbstractEffect; +import org.l2jmobius.gameserver.model.events.Containers; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.ListenersContainer; +import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; +import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; +import org.l2jmobius.gameserver.model.item.instance.Item; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.Stat; +import org.l2jmobius.gameserver.network.SystemMessageId; +import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; +import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; + +/** + * @author Mobius + */ +public class NightStatModify extends AbstractEffect +{ + private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); + private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); + private static final int SHADOW_SENSE = 294; + + private final Stat _stat; + private final int _amount; + protected final StatModifierType _mode; + + public NightStatModify(StatSet params) + { + _stat = params.getEnum("stat", Stat.class); + _amount = params.getInt("amount"); + _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); + + // Init a global day-night change listener. + final ListenersContainer container = Containers.Global(); + container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); + } + + @Override + public void onStart(Creature effector, Creature effected, Skill skill, Item item) + { + NIGHT_STAT_CHARACTERS.add(effected); + } + + @Override + public void onExit(Creature effector, Creature effected, Skill skill) + { + NIGHT_STAT_CHARACTERS.remove(effected); + } + + @Override + public void pump(Creature effected, Skill skill) + { + // Not night. + if (!GameTimeTaskManager.getInstance().isNight()) + { + return; + } + + // Apply stat. + switch (_mode) + { + case DIFF: + { + effected.getStat().mergeAdd(_stat, _amount); + break; + } + case PER: + { + effected.getStat().mergeMul(_stat, (_amount / 100) + 1); + break; + } + } + } + + public void onDayNightChange(OnDayNightChange event) + { + synchronized (DAY_TIME) + { + final boolean isNight = event.isNight(); + + // Run only once per daytime change. + if (isNight == DAY_TIME.get()) + { + return; + } + DAY_TIME.set(isNight); + + // System message for Shadow Sense. + final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); + msg.addSkillName(SHADOW_SENSE); + + for (Creature creature : NIGHT_STAT_CHARACTERS) + { + // Pump again. + creature.getStat().recalculateStats(true); + + // Send Shadow Sense message when player has skill. + if (creature.getKnownSkill(SHADOW_SENSE) != null) + { + creature.sendPacket(msg); + } + } + } + } +} diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/stats/skills/00200-00299.xml b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/stats/skills/00200-00299.xml index 4820d270e1..881e04cb62 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/stats/skills/00200-00299.xml +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/stats/skills/00200-00299.xml @@ -7943,7 +7943,7 @@ P 5 - + ACCURACY_COMBAT 3 diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/stats/skills/documentation.txt index 51fa1c000b..a9a7492711 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/stats/skills/documentation.txt @@ -215,7 +215,7 @@ MpShield: Transfers given percentage of damage as mana damage. Mana Shield. MpVampiricAttack: Absorbs given percentage of mana during attack. Mute: Prevents target from using magical skills. Silence. NewHennaSlot: New henna slot modifier. (l2jmobius) -NightStatModifier: Modify a specific stat at night time. (l2jmobius) +NightStatModify: Modify a specific stat at night time. (l2jmobius) NoblesseBless: Does not remove buffs upon death except itself. OpenChest: Opens a treasure chest. OpenCommonRecipeBook: Shows the common recipe book window. diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/EffectMasterHandler.java index de67b019a1..1209076062 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -46,7 +46,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("AgathionSlot", AgathionSlot::new); EffectHandler.getInstance().registerHandler("AreaDamage", AreaDamage::new); EffectHandler.getInstance().registerHandler("AreaOfEffectDamageDefence", AreaOfEffectDamageDefence::new); - EffectHandler.getInstance().registerHandler("AreaOfEffectDamageModifier", AreaOfEffectDamageModifier::new); + EffectHandler.getInstance().registerHandler("AreaOfEffectDamageModify", AreaOfEffectDamageModify::new); EffectHandler.getInstance().registerHandler("ArtifactSlot", ArtifactSlot::new); EffectHandler.getInstance().registerHandler("AttackAttribute", AttackAttribute::new); EffectHandler.getInstance().registerHandler("AttackAttributeAdd", AttackAttributeAdd::new); @@ -248,7 +248,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MpVampiricAttack", MpVampiricAttack::new); EffectHandler.getInstance().registerHandler("Mute", Mute::new); EffectHandler.getInstance().registerHandler("NewHennaSlot", NewHennaSlot::new); - EffectHandler.getInstance().registerHandler("NightStatModifier", NightStatModifier::new); + EffectHandler.getInstance().registerHandler("NightStatModify", NightStatModify::new); EffectHandler.getInstance().registerHandler("NoblesseBless", NoblesseBless::new); EffectHandler.getInstance().registerHandler("OpenChest", OpenChest::new); EffectHandler.getInstance().registerHandler("OpenCommonRecipeBook", OpenCommonRecipeBook::new); diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/effecthandlers/AreaOfEffectDamageModifier.java b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/effecthandlers/AreaOfEffectDamageModify.java similarity index 80% rename from L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/effecthandlers/AreaOfEffectDamageModifier.java rename to L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/effecthandlers/AreaOfEffectDamageModify.java index a172e760e6..4d16a35398 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/effecthandlers/AreaOfEffectDamageModifier.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/effecthandlers/AreaOfEffectDamageModify.java @@ -22,10 +22,10 @@ import org.l2jmobius.gameserver.model.stats.Stat; /** * @author quangnguyen */ -public class AreaOfEffectDamageModifier extends AbstractStatPercentEffect +public class AreaOfEffectDamageModify extends AbstractStatPercentEffect { - public AreaOfEffectDamageModifier(StatSet params) + public AreaOfEffectDamageModify(StatSet params) { - super(params, Stat.AREA_OF_EFFECT_DAMAGE_MODIFIER); + super(params, Stat.AREA_OF_EFFECT_DAMAGE_MODIFY); } } diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java deleted file mode 100644 index 8dce6e4312..0000000000 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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 java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicBoolean; - -import org.l2jmobius.gameserver.enums.StatModifierType; -import org.l2jmobius.gameserver.model.StatSet; -import org.l2jmobius.gameserver.model.actor.Creature; -import org.l2jmobius.gameserver.model.effects.AbstractEffect; -import org.l2jmobius.gameserver.model.events.Containers; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenersContainer; -import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; -import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; -import org.l2jmobius.gameserver.model.item.instance.Item; -import org.l2jmobius.gameserver.model.skill.Skill; -import org.l2jmobius.gameserver.model.stats.Stat; -import org.l2jmobius.gameserver.network.SystemMessageId; -import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; -import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; - -/** - * @author Mobius - */ -public class NightStatModifier extends AbstractEffect -{ - private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); - private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); - private static final int SHADOW_SENSE = 294; - - private final Stat _stat; - private final int _amount; - protected final StatModifierType _mode; - - public NightStatModifier(StatSet params) - { - _stat = params.getEnum("stat", Stat.class); - _amount = params.getInt("amount"); - _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); - - // Init a global day-night change listener. - final ListenersContainer container = Containers.Global(); - container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); - } - - @Override - public void onStart(Creature effector, Creature effected, Skill skill, Item item) - { - NIGHT_STAT_CHARACTERS.add(effected); - } - - @Override - public void onExit(Creature effector, Creature effected, Skill skill) - { - NIGHT_STAT_CHARACTERS.remove(effected); - } - - @Override - public void pump(Creature effected, Skill skill) - { - // Not night. - if (!GameTimeTaskManager.getInstance().isNight()) - { - return; - } - - // Apply stat. - switch (_mode) - { - case DIFF: - { - effected.getStat().mergeAdd(_stat, _amount); - break; - } - case PER: - { - effected.getStat().mergeMul(_stat, (_amount / 100) + 1); - break; - } - } - } - - public void onDayNightChange(OnDayNightChange event) - { - synchronized (DAY_TIME) - { - final boolean isNight = event.isNight(); - - // Run only once per daytime change. - if (isNight == DAY_TIME.get()) - { - return; - } - DAY_TIME.set(isNight); - - // System message for Shadow Sense. - final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); - msg.addSkillName(SHADOW_SENSE); - - for (Creature creature : NIGHT_STAT_CHARACTERS) - { - // Pump again. - creature.getStat().recalculateStats(true); - - // Send Shadow Sense message when player has skill. - if (creature.getKnownSkill(SHADOW_SENSE) != null) - { - creature.sendPacket(msg); - } - } - } - } -} diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java new file mode 100644 index 0000000000..71f1c02986 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java @@ -0,0 +1,130 @@ +/* + * 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 java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.l2jmobius.gameserver.enums.StatModifierType; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.effects.AbstractEffect; +import org.l2jmobius.gameserver.model.events.Containers; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.ListenersContainer; +import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange; +import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener; +import org.l2jmobius.gameserver.model.item.instance.Item; +import org.l2jmobius.gameserver.model.skill.Skill; +import org.l2jmobius.gameserver.model.stats.Stat; +import org.l2jmobius.gameserver.network.SystemMessageId; +import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; +import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; + +/** + * @author Mobius + */ +public class NightStatModify extends AbstractEffect +{ + private static final AtomicBoolean DAY_TIME = new AtomicBoolean(GameTimeTaskManager.getInstance().isNight()); + private static final Set NIGHT_STAT_CHARACTERS = ConcurrentHashMap.newKeySet(); + private static final int SHADOW_SENSE = 294; + + private final Stat _stat; + private final int _amount; + protected final StatModifierType _mode; + + public NightStatModify(StatSet params) + { + _stat = params.getEnum("stat", Stat.class); + _amount = params.getInt("amount"); + _mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF); + + // Init a global day-night change listener. + final ListenersContainer container = Containers.Global(); + container.addListener(new ConsumerEventListener(container, EventType.ON_DAY_NIGHT_CHANGE, (OnDayNightChange event) -> onDayNightChange(event), this)); + } + + @Override + public void onStart(Creature effector, Creature effected, Skill skill, Item item) + { + NIGHT_STAT_CHARACTERS.add(effected); + } + + @Override + public void onExit(Creature effector, Creature effected, Skill skill) + { + NIGHT_STAT_CHARACTERS.remove(effected); + } + + @Override + public void pump(Creature effected, Skill skill) + { + // Not night. + if (!GameTimeTaskManager.getInstance().isNight()) + { + return; + } + + // Apply stat. + switch (_mode) + { + case DIFF: + { + effected.getStat().mergeAdd(_stat, _amount); + break; + } + case PER: + { + effected.getStat().mergeMul(_stat, (_amount / 100) + 1); + break; + } + } + } + + public void onDayNightChange(OnDayNightChange event) + { + synchronized (DAY_TIME) + { + final boolean isNight = event.isNight(); + + // Run only once per daytime change. + if (isNight == DAY_TIME.get()) + { + return; + } + DAY_TIME.set(isNight); + + // System message for Shadow Sense. + final SystemMessage msg = new SystemMessage(isNight ? SystemMessageId.IT_IS_NOW_MIDNIGHT_AND_THE_EFFECT_OF_S1_CAN_BE_FELT : SystemMessageId.IT_IS_DAWN_AND_THE_EFFECT_OF_S1_WILL_NOW_DISAPPEAR); + msg.addSkillName(SHADOW_SENSE); + + for (Creature creature : NIGHT_STAT_CHARACTERS) + { + // Pump again. + creature.getStat().recalculateStats(true); + + // Send Shadow Sense message when player has skill. + if (creature.getKnownSkill(SHADOW_SENSE) != null) + { + creature.sendPacket(msg); + } + } + } + } +} diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/stats/skills/00200-00299.xml b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/stats/skills/00200-00299.xml index d512c8d2c3..923053af7b 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/stats/skills/00200-00299.xml +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/stats/skills/00200-00299.xml @@ -7945,7 +7945,7 @@ P 5 - + ACCURACY_COMBAT 3 diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/stats/skills/documentation.txt index 732418450c..2f2598dfce 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/stats/skills/documentation.txt @@ -16,7 +16,7 @@ AddTeleportBookmarkSlot: Instant effect that increases the amount of My Teleport AgathionSlot: Agathion slot modifier. (l2jmobius) AreaDamage: Topography (Danger Zone) resistance stat. AreaOfEffectDamageDefence: Area of effect damage defence stat. (l2jmobius) -AreaOfEffectDamageModifier: Area of effect damage modifier. (l2jmobius) +AreaOfEffectDamageModify: Area of effect damage modifier. (l2jmobius) ArtifactSlot: Artifact slot modifier. (l2jmobius) AttackAttribute: Stat that increases specific attack attribute. AttackAttributeAdd: Stat that increases all attack attribute. @@ -218,7 +218,7 @@ MpShield: Transfers given percentage of damage as mana damage. Mana Shield. MpVampiricAttack: Absorbs given percentage of mana during attack. Mute: Prevents target from using magical skills. Silence. NewHennaSlot: New henna slot modifier. (l2jmobius) -NightStatModifier: Modify a specific stat at night time. (l2jmobius) +NightStatModify: Modify a specific stat at night time. (l2jmobius) NoblesseBless: Does not remove buffs upon death except itself. OpenChest: Opens a treasure chest. OpenCommonRecipeBook: Shows the common recipe book window. diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/stats/Formulas.java index 0392fba03b..90d8b2c467 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -202,7 +202,7 @@ public class Formulas // AoE modifiers. if (skill.isBad() && (skill.getAffectLimit() > 0)) { - damage *= attacker.getStat().getMul(Stat.AREA_OF_EFFECT_DAMAGE_MODIFIER, 1) - target.getStat().getValue(Stat.AREA_OF_EFFECT_DAMAGE_DEFENCE, 0); + damage *= attacker.getStat().getMul(Stat.AREA_OF_EFFECT_DAMAGE_MODIFY, 1) - target.getStat().getValue(Stat.AREA_OF_EFFECT_DAMAGE_DEFENCE, 0); } return damage; diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/stats/Stat.java index ff7903dac3..9d804ef672 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -158,8 +158,8 @@ public enum Stat DEFENCE_CRITICAL_DAMAGE_ADD("defCritDamageAdd"), // Resistance to critical damage in value (Example: +100 will be 100 more critical damage, NOT 100% more). DEFENCE_PHYSICAL_SKILL_CRITICAL_DAMAGE("defCAtkSkill"), DEFENCE_PHYSICAL_SKILL_CRITICAL_DAMAGE_ADD("defCAtkSkillAdd"), - AREA_OF_EFFECT_DAMAGE_MODIFIER("aoeDamageMofifier"), AREA_OF_EFFECT_DAMAGE_DEFENCE("aoeDamageDefence"), + AREA_OF_EFFECT_DAMAGE_MODIFY("aoeDamageModify"), BLOW_RATE("blowRate"), BLOW_RATE_DEFENCE("blowRateDefence"), INSTANT_KILL_RESIST("instantKillResist"),