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