Renamed Modifier effects to Modify.
This commit is contained in:
+1
-1
@@ -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);
|
||||
|
||||
+2
-2
@@ -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<Creature> 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");
|
||||
@@ -6458,7 +6458,7 @@
|
||||
<operateType>P</operateType>
|
||||
<magicCriticalRate>5</magicCriticalRate>
|
||||
<effects>
|
||||
<effect name="NightStatModifier">
|
||||
<effect name="NightStatModify">
|
||||
<stat>ACCURACY_COMBAT</stat>
|
||||
<amount>3</amount>
|
||||
</effect>
|
||||
|
||||
@@ -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.
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
+2
-2
@@ -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<Creature> 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");
|
||||
@@ -6456,7 +6456,7 @@
|
||||
<operateType>P</operateType>
|
||||
<magicCriticalRate>5</magicCriticalRate>
|
||||
<effects>
|
||||
<effect name="NightStatModifier">
|
||||
<effect name="NightStatModify">
|
||||
<stat>ACCURACY_COMBAT</stat>
|
||||
<amount>3</amount>
|
||||
</effect>
|
||||
|
||||
@@ -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.
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
+2
-2
@@ -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<Creature> 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");
|
||||
@@ -6456,7 +6456,7 @@
|
||||
<operateType>P</operateType>
|
||||
<magicCriticalRate>5</magicCriticalRate>
|
||||
<effects>
|
||||
<effect name="NightStatModifier">
|
||||
<effect name="NightStatModify">
|
||||
<stat>ACCURACY_COMBAT</stat>
|
||||
<amount>3</amount>
|
||||
</effect>
|
||||
|
||||
@@ -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.
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
+2
-2
@@ -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<Creature> 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");
|
||||
@@ -6484,7 +6484,7 @@
|
||||
<operateType>P</operateType>
|
||||
<magicCriticalRate>5</magicCriticalRate>
|
||||
<effects>
|
||||
<effect name="NightStatModifier">
|
||||
<effect name="NightStatModify">
|
||||
<stat>ACCURACY_COMBAT</stat>
|
||||
<amount>3</amount>
|
||||
</effect>
|
||||
|
||||
@@ -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.
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
Vendored
-130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6484,7 +6484,7 @@
|
||||
<operateType>P</operateType>
|
||||
<magicCriticalRate>5</magicCriticalRate>
|
||||
<effects>
|
||||
<effect name="NightStatModifier">
|
||||
<effect name="NightStatModify">
|
||||
<stat>ACCURACY_COMBAT</stat>
|
||||
<amount>3</amount>
|
||||
</effect>
|
||||
|
||||
@@ -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.
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
Vendored
-130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6484,7 +6484,7 @@
|
||||
<operateType>P</operateType>
|
||||
<magicCriticalRate>5</magicCriticalRate>
|
||||
<effects>
|
||||
<effect name="NightStatModifier">
|
||||
<effect name="NightStatModify">
|
||||
<stat>ACCURACY_COMBAT</stat>
|
||||
<amount>3</amount>
|
||||
</effect>
|
||||
|
||||
@@ -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.
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
Vendored
-130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6507,7 +6507,7 @@
|
||||
<operateType>P</operateType>
|
||||
<magicCriticalRate>5</magicCriticalRate>
|
||||
<effects>
|
||||
<effect name="NightStatModifier">
|
||||
<effect name="NightStatModify">
|
||||
<stat>ACCURACY_COMBAT</stat>
|
||||
<amount>3</amount>
|
||||
</effect>
|
||||
|
||||
@@ -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.
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
Vendored
-130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6490,7 +6490,7 @@
|
||||
<operateType>P</operateType>
|
||||
<magicCriticalRate>5</magicCriticalRate>
|
||||
<effects>
|
||||
<effect name="NightStatModifier">
|
||||
<effect name="NightStatModify">
|
||||
<stat>ACCURACY_COMBAT</stat>
|
||||
<amount>3</amount>
|
||||
</effect>
|
||||
|
||||
@@ -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.
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
Vendored
-130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6480,7 +6480,7 @@
|
||||
<operateType>P</operateType>
|
||||
<magicCriticalRate>5</magicCriticalRate>
|
||||
<effects>
|
||||
<effect name="NightStatModifier">
|
||||
<effect name="NightStatModify">
|
||||
<stat>ACCURACY_COMBAT</stat>
|
||||
<amount>3</amount>
|
||||
</effect>
|
||||
|
||||
@@ -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.
|
||||
|
||||
Vendored
+1
-1
@@ -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);
|
||||
|
||||
-130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -6480,7 +6480,7 @@
|
||||
<operateType>P</operateType>
|
||||
<magicCriticalRate>5</magicCriticalRate>
|
||||
<effects>
|
||||
<effect name="NightStatModifier">
|
||||
<effect name="NightStatModify">
|
||||
<stat>ACCURACY_COMBAT</stat>
|
||||
<amount>3</amount>
|
||||
</effect>
|
||||
|
||||
+1
-1
@@ -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.
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
Vendored
-130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6480,7 +6480,7 @@
|
||||
<operateType>P</operateType>
|
||||
<magicCriticalRate>5</magicCriticalRate>
|
||||
<effects>
|
||||
<effect name="NightStatModifier">
|
||||
<effect name="NightStatModify">
|
||||
<stat>ACCURACY_COMBAT</stat>
|
||||
<amount>3</amount>
|
||||
</effect>
|
||||
|
||||
@@ -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.
|
||||
|
||||
+2
-2
@@ -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);
|
||||
|
||||
+3
-3
@@ -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);
|
||||
}
|
||||
}
|
||||
Vendored
-130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6480,7 +6480,7 @@
|
||||
<operateType>P</operateType>
|
||||
<magicCriticalRate>5</magicCriticalRate>
|
||||
<effects>
|
||||
<effect name="NightStatModifier">
|
||||
<effect name="NightStatModify">
|
||||
<stat>ACCURACY_COMBAT</stat>
|
||||
<amount>3</amount>
|
||||
</effect>
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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"),
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/NightStatModifier.java
Vendored
-130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6634,7 +6634,7 @@
|
||||
<operateType>P</operateType>
|
||||
<magicCriticalRate>5</magicCriticalRate>
|
||||
<effects>
|
||||
<effect name="NightStatModifier">
|
||||
<effect name="NightStatModify">
|
||||
<stat>ACCURACY_COMBAT</stat>
|
||||
<amount>3</amount>
|
||||
</effect>
|
||||
|
||||
+1
-1
@@ -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.
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
Vendored
-130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6652,7 +6652,7 @@
|
||||
<operateType>P</operateType>
|
||||
<magicCriticalRate>5</magicCriticalRate>
|
||||
<effects>
|
||||
<effect name="NightStatModifier">
|
||||
<effect name="NightStatModify">
|
||||
<stat>ACCURACY_COMBAT</stat>
|
||||
<amount>3</amount>
|
||||
</effect>
|
||||
|
||||
@@ -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.
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
-130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -7192,7 +7192,7 @@
|
||||
<operateType>P</operateType>
|
||||
<magicCriticalRate>5</magicCriticalRate>
|
||||
<effects>
|
||||
<effect name="NightStatModifier">
|
||||
<effect name="NightStatModify">
|
||||
<stat>ACCURACY_COMBAT</stat>
|
||||
<amount>3</amount>
|
||||
</effect>
|
||||
|
||||
+1
-1
@@ -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.
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
-130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -7234,7 +7234,7 @@
|
||||
<operateType>P</operateType>
|
||||
<magicCriticalRate>5</magicCriticalRate>
|
||||
<effects>
|
||||
<effect name="NightStatModifier">
|
||||
<effect name="NightStatModify">
|
||||
<stat>ACCURACY_COMBAT</stat>
|
||||
<amount>3</amount>
|
||||
</effect>
|
||||
|
||||
+1
-1
@@ -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.
|
||||
|
||||
Vendored
+1
-1
@@ -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);
|
||||
|
||||
-130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -7817,7 +7817,7 @@
|
||||
<operateType>P</operateType>
|
||||
<magicCriticalRate>5</magicCriticalRate>
|
||||
<effects>
|
||||
<effect name="NightStatModifier">
|
||||
<effect name="NightStatModify">
|
||||
<stat>ACCURACY_COMBAT</stat>
|
||||
<amount>3</amount>
|
||||
</effect>
|
||||
|
||||
+1
-1
@@ -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.
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
-130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/NightStatModify.java
Vendored
+130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -7817,7 +7817,7 @@
|
||||
<operateType>P</operateType>
|
||||
<magicCriticalRate>5</magicCriticalRate>
|
||||
<effects>
|
||||
<effect name="NightStatModifier">
|
||||
<effect name="NightStatModify">
|
||||
<stat>ACCURACY_COMBAT</stat>
|
||||
<amount>3</amount>
|
||||
</effect>
|
||||
|
||||
+1
-1
@@ -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.
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
Vendored
-130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6462,7 +6462,7 @@
|
||||
<operateType>P</operateType>
|
||||
<magicCriticalRate>5</magicCriticalRate>
|
||||
<effects>
|
||||
<effect name="NightStatModifier">
|
||||
<effect name="NightStatModify">
|
||||
<stat>ACCURACY_COMBAT</stat>
|
||||
<amount>3</amount>
|
||||
</effect>
|
||||
|
||||
@@ -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.
|
||||
|
||||
Vendored
+1
-1
@@ -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);
|
||||
|
||||
-130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+130
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Creature> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -7752,7 +7752,7 @@
|
||||
<operateType>P</operateType>
|
||||
<magicCriticalRate>5</magicCriticalRate>
|
||||
<effects>
|
||||
<effect name="NightStatModifier">
|
||||
<effect name="NightStatModify">
|
||||
<stat>ACCURACY_COMBAT</stat>
|
||||
<amount>3</amount>
|
||||
</effect>
|
||||
|
||||
+1
-1
@@ -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.
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user