Disable completely Nevit system by config.
Contributed by Sahar.
This commit is contained in:
parent
6bad215c79
commit
241ef1a1c4
@ -330,7 +330,10 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
player.broadcastUserInfo();
|
player.broadcastUserInfo();
|
||||||
player.sendPacket(new UserInfo(player));
|
player.sendPacket(new UserInfo(player));
|
||||||
player.sendPacket(new ExBrExtraUserInfo(player));
|
player.sendPacket(new ExBrExtraUserInfo(player));
|
||||||
player.sendPacket(new ExVoteSystemInfo(player));
|
if (Config.NEVIT_ENABLED)
|
||||||
|
{
|
||||||
|
player.sendPacket(new ExVoteSystemInfo(player));
|
||||||
|
}
|
||||||
player.sendMessage("A GM changed your Recommend points to " + recVal);
|
player.sendMessage("A GM changed your Recommend points to " + recVal);
|
||||||
activeChar.sendMessage(player.getName() + "'s Recommend changed to " + recVal);
|
activeChar.sendMessage(player.getName() + "'s Recommend changed to " + recVal);
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package handlers.effecthandlers;
|
package handlers.effecthandlers;
|
||||||
|
|
||||||
|
import com.l2jmobius.Config;
|
||||||
import com.l2jmobius.gameserver.model.StatsSet;
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.model.conditions.Condition;
|
import com.l2jmobius.gameserver.model.conditions.Condition;
|
||||||
@ -72,7 +73,10 @@ public final class GiveRecommendation extends AbstractEffect
|
|||||||
sm.addInt(recommendationsGiven);
|
sm.addInt(recommendationsGiven);
|
||||||
target.sendPacket(sm);
|
target.sendPacket(sm);
|
||||||
target.sendPacket(new UserInfo(target));
|
target.sendPacket(new UserInfo(target));
|
||||||
target.sendPacket(new ExVoteSystemInfo(target));
|
if (Config.NEVIT_ENABLED)
|
||||||
|
{
|
||||||
|
target.sendPacket(new ExVoteSystemInfo(target));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -137,7 +137,7 @@ public class PcStat extends PlayableStat
|
|||||||
double bonusSp = 1.;
|
double bonusSp = 1.;
|
||||||
|
|
||||||
// Start Nevit's Hourglass
|
// Start Nevit's Hourglass
|
||||||
if ((addToExp > 0) && !activeChar.isInsideZone(ZoneId.PEACE))
|
if (Config.NEVIT_ENABLED && (addToExp > 0) && !activeChar.isInsideZone(ZoneId.PEACE))
|
||||||
{
|
{
|
||||||
activeChar.startNevitHourglassTask();
|
activeChar.startNevitHourglassTask();
|
||||||
|
|
||||||
@ -153,7 +153,7 @@ public class PcStat extends PlayableStat
|
|||||||
bonusSp = getSpBonusMultiplier();
|
bonusSp = getSpBonusMultiplier();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((addToExp > 0) && !activeChar.isInsideZone(ZoneId.PEACE))
|
if (Config.NEVIT_ENABLED && (addToExp > 0) && !activeChar.isInsideZone(ZoneId.PEACE))
|
||||||
{
|
{
|
||||||
activeChar.getNevitSystem().startAdventTask();
|
activeChar.getNevitSystem().startAdventTask();
|
||||||
}
|
}
|
||||||
@ -331,9 +331,12 @@ public class PcStat extends PlayableStat
|
|||||||
// Send a Server->Client packet UserInfo to the L2PcInstance
|
// Send a Server->Client packet UserInfo to the L2PcInstance
|
||||||
getActiveChar().sendPacket(new UserInfo(getActiveChar()));
|
getActiveChar().sendPacket(new UserInfo(getActiveChar()));
|
||||||
getActiveChar().sendPacket(new ExBrExtraUserInfo(getActiveChar()));
|
getActiveChar().sendPacket(new ExBrExtraUserInfo(getActiveChar()));
|
||||||
getActiveChar().sendPacket(new ExVoteSystemInfo(getActiveChar()));
|
// Nevit System
|
||||||
// Nevit Points For Level
|
if (Config.NEVIT_ENABLED)
|
||||||
getActiveChar().getNevitSystem().addPoints(2000);
|
{
|
||||||
|
getActiveChar().sendPacket(new ExVoteSystemInfo(getActiveChar()));
|
||||||
|
getActiveChar().getNevitSystem().addPoints(2000);
|
||||||
|
}
|
||||||
|
|
||||||
return levelIncreased;
|
return levelIncreased;
|
||||||
}
|
}
|
||||||
|
@ -50,8 +50,11 @@ public class NevitSystem implements IUniqueId
|
|||||||
{
|
{
|
||||||
_player = player;
|
_player = player;
|
||||||
|
|
||||||
player.addListener(new ConsumerEventListener(player, EventType.ON_PLAYER_LOGIN, (OnPlayerLogin event) -> onPlayerLogin(event), this));
|
if (Config.NEVIT_ENABLED)
|
||||||
player.addListener(new ConsumerEventListener(player, EventType.ON_PLAYER_LOGOUT, (OnPlayerLogout event) -> OnPlayerLogout(event), this));
|
{
|
||||||
|
player.addListener(new ConsumerEventListener(player, EventType.ON_PLAYER_LOGIN, (OnPlayerLogin event) -> onPlayerLogin(event), this));
|
||||||
|
player.addListener(new ConsumerEventListener(player, EventType.ON_PLAYER_LOGOUT, (OnPlayerLogout event) -> OnPlayerLogout(event), this));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@RegisterEvent(EventType.ON_PLAYER_LOGIN)
|
@RegisterEvent(EventType.ON_PLAYER_LOGIN)
|
||||||
|
@ -53,11 +53,14 @@ public class L2PeaceZone extends L2ZoneType
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Nevit Turn Off on Peace Zone */
|
/* Nevit Turn Off on Peace Zone */
|
||||||
player.getNevitSystem().stopAdventTask(true);
|
if (Config.NEVIT_ENABLED)
|
||||||
|
{
|
||||||
|
player.getNevitSystem().stopAdventTask(true);
|
||||||
|
|
||||||
// Stop Nevit's Hourglass
|
// Stop Nevit's Hourglass
|
||||||
player.storeRecommendations(true);
|
player.storeRecommendations(true);
|
||||||
player.getStat().setPausedNevitHourglassStatus(true);
|
player.getStat().setPausedNevitHourglassStatus(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.PEACE_ZONE_MODE != 2)
|
if (Config.PEACE_ZONE_MODE != 2)
|
||||||
|
@ -393,7 +393,10 @@ public class EnterWorld implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
activeChar.checkRecoBonusTask();
|
if (Config.NEVIT_ENABLED)
|
||||||
|
{
|
||||||
|
activeChar.checkRecoBonusTask();
|
||||||
|
}
|
||||||
|
|
||||||
activeChar.broadcastUserInfo();
|
activeChar.broadcastUserInfo();
|
||||||
|
|
||||||
@ -540,7 +543,10 @@ public class EnterWorld implements IClientIncomingPacket
|
|||||||
activeChar.onPlayerEnter();
|
activeChar.onPlayerEnter();
|
||||||
|
|
||||||
client.sendPacket(new SkillCoolTime(activeChar));
|
client.sendPacket(new SkillCoolTime(activeChar));
|
||||||
client.sendPacket(new ExVoteSystemInfo(activeChar));
|
if (Config.NEVIT_ENABLED)
|
||||||
|
{
|
||||||
|
client.sendPacket(new ExVoteSystemInfo(activeChar));
|
||||||
|
}
|
||||||
client.sendPacket(new ExShowContactList(activeChar));
|
client.sendPacket(new ExShowContactList(activeChar));
|
||||||
|
|
||||||
for (L2ItemInstance i : activeChar.getInventory().getItems())
|
for (L2ItemInstance i : activeChar.getInventory().getItems())
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.gameserver.network.clientpackets;
|
package com.l2jmobius.gameserver.network.clientpackets;
|
||||||
|
|
||||||
|
import com.l2jmobius.Config;
|
||||||
import com.l2jmobius.commons.network.PacketReader;
|
import com.l2jmobius.commons.network.PacketReader;
|
||||||
import com.l2jmobius.gameserver.model.L2Object;
|
import com.l2jmobius.gameserver.model.L2Object;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
@ -101,7 +102,10 @@ public final class RequestVoteNew implements IClientIncomingPacket
|
|||||||
client.sendPacket(new ExBrExtraUserInfo(activeChar));
|
client.sendPacket(new ExBrExtraUserInfo(activeChar));
|
||||||
target.broadcastUserInfo();
|
target.broadcastUserInfo();
|
||||||
|
|
||||||
activeChar.sendPacket(new ExVoteSystemInfo(activeChar));
|
if (Config.NEVIT_ENABLED)
|
||||||
target.sendPacket(new ExVoteSystemInfo(target));
|
{
|
||||||
|
activeChar.sendPacket(new ExVoteSystemInfo(activeChar));
|
||||||
|
target.sendPacket(new ExVoteSystemInfo(target));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.gameserver.taskmanager.tasks;
|
package com.l2jmobius.gameserver.taskmanager.tasks;
|
||||||
|
|
||||||
|
import com.l2jmobius.Config;
|
||||||
import com.l2jmobius.gameserver.model.L2World;
|
import com.l2jmobius.gameserver.model.L2World;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.ExNevitAdventTimeChange;
|
import com.l2jmobius.gameserver.network.serverpackets.ExNevitAdventTimeChange;
|
||||||
@ -40,6 +41,11 @@ public class TaskNevit extends Task
|
|||||||
@Override
|
@Override
|
||||||
public void onTimeElapsed(ExecutedTask task)
|
public void onTimeElapsed(ExecutedTask task)
|
||||||
{
|
{
|
||||||
|
if (!Config.NEVIT_ENABLED)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (L2PcInstance player : L2World.getInstance().getPlayers())
|
for (L2PcInstance player : L2World.getInstance().getPlayers())
|
||||||
{
|
{
|
||||||
if ((player == null) || !player.isOnline())
|
if ((player == null) || !player.isOnline())
|
||||||
|
@ -19,6 +19,7 @@ package com.l2jmobius.gameserver.taskmanager.tasks;
|
|||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
|
|
||||||
|
import com.l2jmobius.Config;
|
||||||
import com.l2jmobius.commons.database.DatabaseFactory;
|
import com.l2jmobius.commons.database.DatabaseFactory;
|
||||||
import com.l2jmobius.gameserver.model.L2World;
|
import com.l2jmobius.gameserver.model.L2World;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
@ -65,12 +66,15 @@ public class TaskRecom extends Task
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Refresh reco bonus for online players
|
// Refresh reco bonus for online players
|
||||||
for (L2PcInstance player : L2World.getInstance().getPlayers())
|
if (Config.NEVIT_ENABLED)
|
||||||
{
|
{
|
||||||
if (player != null)
|
for (L2PcInstance player : L2World.getInstance().getPlayers())
|
||||||
{
|
{
|
||||||
player.stopNevitHourglassTask();
|
if (player != null)
|
||||||
player.startNevitHourglassTask();
|
{
|
||||||
|
player.stopNevitHourglassTask();
|
||||||
|
player.startNevitHourglassTask();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOGGER.info("Recommendations System reseted");
|
LOGGER.info("Recommendations System reseted");
|
||||||
|
Loading…
Reference in New Issue
Block a user