Addition of OlympiadEnabled configuration.
This commit is contained in:
@@ -9,6 +9,10 @@
|
||||
# Also please understand what you are changing before you do so on a live server.
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Enable Olympiad.
|
||||
# Default: True
|
||||
OlympiadEnabled = True
|
||||
|
||||
# Olympiad Start Time in Military hours Default 6pm (18)
|
||||
# Default: 18
|
||||
AltOlyStartTime = 18
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package ai.others.MonumentOfHeroes;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.CommonUtil;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
@@ -59,8 +60,11 @@ public class MonumentOfHeroes extends AbstractNpcAI
|
||||
|
||||
private MonumentOfHeroes()
|
||||
{
|
||||
addStartNpc(MONUMENTS);
|
||||
addTalkId(MONUMENTS);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(MONUMENTS);
|
||||
addTalkId(MONUMENTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.usercommandhandlers;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
@@ -37,6 +38,12 @@ public class OlympiadStat implements IUserCommandHandler
|
||||
@Override
|
||||
public boolean useUserCommand(int id, Player player)
|
||||
{
|
||||
if (!Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
player.sendPacket(SystemMessageId.THE_GRAND_OLYMPIAD_GAMES_ARE_NOT_CURRENTLY_IN_PROGRESS);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (id != COMMAND_IDS[0])
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -593,6 +593,7 @@ public class Config
|
||||
public static boolean USE_SAY_FILTER;
|
||||
public static String CHAT_FILTER_CHARS;
|
||||
public static Set<ChatType> BAN_CHAT_CHANNELS;
|
||||
public static boolean OLYMPIAD_ENABLED;
|
||||
public static int ALT_OLY_START_TIME;
|
||||
public static int ALT_OLY_MIN;
|
||||
public static int ALT_OLY_MAX_BUFFS;
|
||||
@@ -2472,6 +2473,7 @@ public class Config
|
||||
|
||||
// Load Olympiad config file (if exists)
|
||||
final PropertiesParser olympiadConfig = new PropertiesParser(OLYMPIAD_CONFIG_FILE);
|
||||
OLYMPIAD_ENABLED = olympiadConfig.getBoolean("OlympiadEnabled", true);
|
||||
ALT_OLY_START_TIME = olympiadConfig.getInt("AltOlyStartTime", 18);
|
||||
ALT_OLY_MIN = olympiadConfig.getInt("AltOlyMin", 0);
|
||||
ALT_OLY_MAX_BUFFS = olympiadConfig.getInt("AltOlyMaxBuffs", 5);
|
||||
|
||||
@@ -93,7 +93,10 @@ public class Hero
|
||||
|
||||
protected Hero()
|
||||
{
|
||||
init();
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
init();
|
||||
}
|
||||
}
|
||||
|
||||
private void init()
|
||||
|
||||
@@ -166,12 +166,19 @@ public class Olympiad extends ListenersContainer
|
||||
|
||||
protected Olympiad()
|
||||
{
|
||||
load();
|
||||
AntiFeedManager.getInstance().registerEvent(AntiFeedManager.OLYMPIAD_ID);
|
||||
|
||||
if (_period == 0)
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
init();
|
||||
load();
|
||||
AntiFeedManager.getInstance().registerEvent(AntiFeedManager.OLYMPIAD_ID);
|
||||
|
||||
if (_period == 0)
|
||||
{
|
||||
init();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.log(Level.INFO, "Disabled.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user