Addition of OlympiadEnabled configuration.
This commit is contained in:
parent
cf32747997
commit
629cfae635
@ -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
|
||||
|
@ -18,6 +18,7 @@ package ai.others.MonumentOfHeroes;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.olympiad.Hero;
|
||||
@ -69,9 +70,12 @@ public class MonumentOfHeroes extends AbstractNpcAI
|
||||
|
||||
private MonumentOfHeroes()
|
||||
{
|
||||
addStartNpc(MONUMENTS);
|
||||
addFirstTalkId(MONUMENTS);
|
||||
addTalkId(MONUMENTS);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(MONUMENTS);
|
||||
addFirstTalkId(MONUMENTS);
|
||||
addTalkId(MONUMENTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -16,6 +16,7 @@
|
||||
*/
|
||||
package ai.others.OlyBuffer;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
@ -48,9 +49,12 @@ public class OlyBuffer extends AbstractNpcAI
|
||||
|
||||
private OlyBuffer()
|
||||
{
|
||||
addStartNpc(OLYMPIAD_BUFFER);
|
||||
addFirstTalkId(OLYMPIAD_BUFFER);
|
||||
addTalkId(OLYMPIAD_BUFFER);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(OLYMPIAD_BUFFER);
|
||||
addFirstTalkId(OLYMPIAD_BUFFER);
|
||||
addTalkId(OLYMPIAD_BUFFER);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -78,10 +78,13 @@ public class OlyManager extends AbstractNpcAI implements IBypassHandler
|
||||
|
||||
private OlyManager()
|
||||
{
|
||||
addStartNpc(MANAGER);
|
||||
addFirstTalkId(MANAGER);
|
||||
addTalkId(MANAGER);
|
||||
BypassHandler.getInstance().registerHandler(this);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(MANAGER);
|
||||
addFirstTalkId(MANAGER);
|
||||
addTalkId(MANAGER);
|
||||
BypassHandler.getInstance().registerHandler(this);
|
||||
}
|
||||
}
|
||||
|
||||
@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_OLYMPIAD_GAMES_ARE_NOT_CURRENTLY_IN_PROGRESS);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (id != COMMAND_IDS[0])
|
||||
{
|
||||
return false;
|
||||
|
@ -530,6 +530,7 @@ public class Config
|
||||
public static int WORLD_CHAT_MIN_LEVEL;
|
||||
public static int WORLD_CHAT_POINTS_PER_DAY;
|
||||
public static Duration WORLD_CHAT_INTERVAL;
|
||||
public static boolean OLYMPIAD_ENABLED;
|
||||
public static int ALT_OLY_START_TIME;
|
||||
public static int ALT_OLY_MIN;
|
||||
public static long ALT_OLY_CPERIOD;
|
||||
@ -2369,6 +2370,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", 20);
|
||||
ALT_OLY_MIN = olympiadConfig.getInt("AltOlyMin", 0);
|
||||
ALT_OLY_CPERIOD = olympiadConfig.getLong("AltOlyCPeriod", 14400000);
|
||||
|
@ -95,7 +95,10 @@ public class Hero
|
||||
|
||||
protected Hero()
|
||||
{
|
||||
init();
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
init();
|
||||
}
|
||||
}
|
||||
|
||||
private void init()
|
||||
|
@ -133,12 +133,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.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -18,6 +18,7 @@ package ai.others.MonumentOfHeroes;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.olympiad.Hero;
|
||||
@ -69,9 +70,12 @@ public class MonumentOfHeroes extends AbstractNpcAI
|
||||
|
||||
private MonumentOfHeroes()
|
||||
{
|
||||
addStartNpc(MONUMENTS);
|
||||
addFirstTalkId(MONUMENTS);
|
||||
addTalkId(MONUMENTS);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(MONUMENTS);
|
||||
addFirstTalkId(MONUMENTS);
|
||||
addTalkId(MONUMENTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -16,6 +16,7 @@
|
||||
*/
|
||||
package ai.others.OlyBuffer;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
@ -48,9 +49,12 @@ public class OlyBuffer extends AbstractNpcAI
|
||||
|
||||
private OlyBuffer()
|
||||
{
|
||||
addStartNpc(OLYMPIAD_BUFFER);
|
||||
addFirstTalkId(OLYMPIAD_BUFFER);
|
||||
addTalkId(OLYMPIAD_BUFFER);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(OLYMPIAD_BUFFER);
|
||||
addFirstTalkId(OLYMPIAD_BUFFER);
|
||||
addTalkId(OLYMPIAD_BUFFER);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -78,10 +78,13 @@ public class OlyManager extends AbstractNpcAI implements IBypassHandler
|
||||
|
||||
private OlyManager()
|
||||
{
|
||||
addStartNpc(MANAGER);
|
||||
addFirstTalkId(MANAGER);
|
||||
addTalkId(MANAGER);
|
||||
BypassHandler.getInstance().registerHandler(this);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(MANAGER);
|
||||
addFirstTalkId(MANAGER);
|
||||
addTalkId(MANAGER);
|
||||
BypassHandler.getInstance().registerHandler(this);
|
||||
}
|
||||
}
|
||||
|
||||
@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_OLYMPIAD_GAMES_ARE_NOT_CURRENTLY_IN_PROGRESS);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (id != COMMAND_IDS[0])
|
||||
{
|
||||
return false;
|
||||
|
@ -540,6 +540,7 @@ public class Config
|
||||
public static int WORLD_CHAT_MIN_LEVEL;
|
||||
public static int WORLD_CHAT_POINTS_PER_DAY;
|
||||
public static Duration WORLD_CHAT_INTERVAL;
|
||||
public static boolean OLYMPIAD_ENABLED;
|
||||
public static int ALT_OLY_START_TIME;
|
||||
public static int ALT_OLY_MIN;
|
||||
public static long ALT_OLY_CPERIOD;
|
||||
@ -2394,6 +2395,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", 20);
|
||||
ALT_OLY_MIN = olympiadConfig.getInt("AltOlyMin", 0);
|
||||
ALT_OLY_CPERIOD = olympiadConfig.getLong("AltOlyCPeriod", 14400000);
|
||||
|
@ -95,7 +95,10 @@ public class Hero
|
||||
|
||||
protected Hero()
|
||||
{
|
||||
init();
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
init();
|
||||
}
|
||||
}
|
||||
|
||||
private void init()
|
||||
|
@ -133,12 +133,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.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -18,6 +18,7 @@ package ai.others.MonumentOfHeroes;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.olympiad.Hero;
|
||||
@ -69,9 +70,12 @@ public class MonumentOfHeroes extends AbstractNpcAI
|
||||
|
||||
private MonumentOfHeroes()
|
||||
{
|
||||
addStartNpc(MONUMENTS);
|
||||
addFirstTalkId(MONUMENTS);
|
||||
addTalkId(MONUMENTS);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(MONUMENTS);
|
||||
addFirstTalkId(MONUMENTS);
|
||||
addTalkId(MONUMENTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -16,6 +16,7 @@
|
||||
*/
|
||||
package ai.others.OlyBuffer;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
@ -48,9 +49,12 @@ public class OlyBuffer extends AbstractNpcAI
|
||||
|
||||
private OlyBuffer()
|
||||
{
|
||||
addStartNpc(OLYMPIAD_BUFFER);
|
||||
addFirstTalkId(OLYMPIAD_BUFFER);
|
||||
addTalkId(OLYMPIAD_BUFFER);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(OLYMPIAD_BUFFER);
|
||||
addFirstTalkId(OLYMPIAD_BUFFER);
|
||||
addTalkId(OLYMPIAD_BUFFER);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -78,10 +78,13 @@ public class OlyManager extends AbstractNpcAI implements IBypassHandler
|
||||
|
||||
private OlyManager()
|
||||
{
|
||||
addStartNpc(MANAGER);
|
||||
addFirstTalkId(MANAGER);
|
||||
addTalkId(MANAGER);
|
||||
BypassHandler.getInstance().registerHandler(this);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(MANAGER);
|
||||
addFirstTalkId(MANAGER);
|
||||
addTalkId(MANAGER);
|
||||
BypassHandler.getInstance().registerHandler(this);
|
||||
}
|
||||
}
|
||||
|
||||
@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_OLYMPIAD_GAMES_ARE_NOT_CURRENTLY_IN_PROGRESS);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (id != COMMAND_IDS[0])
|
||||
{
|
||||
return false;
|
||||
|
@ -540,6 +540,7 @@ public class Config
|
||||
public static int WORLD_CHAT_MIN_LEVEL;
|
||||
public static int WORLD_CHAT_POINTS_PER_DAY;
|
||||
public static Duration WORLD_CHAT_INTERVAL;
|
||||
public static boolean OLYMPIAD_ENABLED;
|
||||
public static int ALT_OLY_START_TIME;
|
||||
public static int ALT_OLY_MIN;
|
||||
public static long ALT_OLY_CPERIOD;
|
||||
@ -2408,6 +2409,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", 20);
|
||||
ALT_OLY_MIN = olympiadConfig.getInt("AltOlyMin", 0);
|
||||
ALT_OLY_CPERIOD = olympiadConfig.getLong("AltOlyCPeriod", 14400000);
|
||||
|
@ -95,7 +95,10 @@ public class Hero
|
||||
|
||||
protected Hero()
|
||||
{
|
||||
init();
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
init();
|
||||
}
|
||||
}
|
||||
|
||||
private void init()
|
||||
|
@ -133,12 +133,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.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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 8pm (20)
|
||||
# Default: 20
|
||||
AltOlyStartTime = 20
|
||||
|
@ -18,6 +18,7 @@ package ai.others.MonumentOfHeroes;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.olympiad.Hero;
|
||||
@ -69,9 +70,12 @@ public class MonumentOfHeroes extends AbstractNpcAI
|
||||
|
||||
private MonumentOfHeroes()
|
||||
{
|
||||
addStartNpc(MONUMENTS);
|
||||
addFirstTalkId(MONUMENTS);
|
||||
addTalkId(MONUMENTS);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(MONUMENTS);
|
||||
addFirstTalkId(MONUMENTS);
|
||||
addTalkId(MONUMENTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -16,6 +16,7 @@
|
||||
*/
|
||||
package ai.others.OlyBuffer;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
@ -47,9 +48,12 @@ public class OlyBuffer extends AbstractNpcAI
|
||||
|
||||
private OlyBuffer()
|
||||
{
|
||||
addStartNpc(OLYMPIAD_BUFFER);
|
||||
addFirstTalkId(OLYMPIAD_BUFFER);
|
||||
addTalkId(OLYMPIAD_BUFFER);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(OLYMPIAD_BUFFER);
|
||||
addFirstTalkId(OLYMPIAD_BUFFER);
|
||||
addTalkId(OLYMPIAD_BUFFER);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -78,10 +78,13 @@ public class OlyManager extends AbstractNpcAI implements IBypassHandler
|
||||
|
||||
private OlyManager()
|
||||
{
|
||||
addStartNpc(MANAGER);
|
||||
addFirstTalkId(MANAGER);
|
||||
addTalkId(MANAGER);
|
||||
BypassHandler.getInstance().registerHandler(this);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(MANAGER);
|
||||
addFirstTalkId(MANAGER);
|
||||
addTalkId(MANAGER);
|
||||
BypassHandler.getInstance().registerHandler(this);
|
||||
}
|
||||
}
|
||||
|
||||
@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_OLYMPIAD_GAMES_ARE_NOT_CURRENTLY_IN_PROGRESS);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (id != COMMAND_IDS[0])
|
||||
{
|
||||
return false;
|
||||
|
@ -534,6 +534,7 @@ public class Config
|
||||
public static int WORLD_CHAT_MIN_LEVEL;
|
||||
public static int WORLD_CHAT_POINTS_PER_DAY;
|
||||
public static Duration WORLD_CHAT_INTERVAL;
|
||||
public static boolean OLYMPIAD_ENABLED;
|
||||
public static int ALT_OLY_START_TIME;
|
||||
public static int ALT_OLY_MIN;
|
||||
public static long ALT_OLY_CPERIOD;
|
||||
@ -2388,6 +2389,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", 20);
|
||||
ALT_OLY_MIN = olympiadConfig.getInt("AltOlyMin", 0);
|
||||
ALT_OLY_CPERIOD = olympiadConfig.getLong("AltOlyCPeriod", 14400000);
|
||||
|
@ -95,7 +95,10 @@ public class Hero
|
||||
|
||||
protected Hero()
|
||||
{
|
||||
init();
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
init();
|
||||
}
|
||||
}
|
||||
|
||||
private void init()
|
||||
|
@ -130,12 +130,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.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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 8pm (20)
|
||||
# Default: 20
|
||||
AltOlyStartTime = 20
|
||||
|
@ -18,6 +18,7 @@ package ai.others.MonumentOfHeroes;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.olympiad.Hero;
|
||||
@ -69,9 +70,12 @@ public class MonumentOfHeroes extends AbstractNpcAI
|
||||
|
||||
private MonumentOfHeroes()
|
||||
{
|
||||
addStartNpc(MONUMENTS);
|
||||
addFirstTalkId(MONUMENTS);
|
||||
addTalkId(MONUMENTS);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(MONUMENTS);
|
||||
addFirstTalkId(MONUMENTS);
|
||||
addTalkId(MONUMENTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -16,6 +16,7 @@
|
||||
*/
|
||||
package ai.others.OlyBuffer;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
@ -45,9 +46,12 @@ public class OlyBuffer extends AbstractNpcAI
|
||||
|
||||
private OlyBuffer()
|
||||
{
|
||||
addStartNpc(OLYMPIAD_BUFFER);
|
||||
addFirstTalkId(OLYMPIAD_BUFFER);
|
||||
addTalkId(OLYMPIAD_BUFFER);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(OLYMPIAD_BUFFER);
|
||||
addFirstTalkId(OLYMPIAD_BUFFER);
|
||||
addTalkId(OLYMPIAD_BUFFER);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -78,10 +78,13 @@ public class OlyManager extends AbstractNpcAI implements IBypassHandler
|
||||
|
||||
private OlyManager()
|
||||
{
|
||||
addStartNpc(MANAGER);
|
||||
addFirstTalkId(MANAGER);
|
||||
addTalkId(MANAGER);
|
||||
BypassHandler.getInstance().registerHandler(this);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(MANAGER);
|
||||
addFirstTalkId(MANAGER);
|
||||
addTalkId(MANAGER);
|
||||
BypassHandler.getInstance().registerHandler(this);
|
||||
}
|
||||
}
|
||||
|
||||
@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_OLYMPIAD_GAMES_ARE_NOT_CURRENTLY_IN_PROGRESS);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (id != COMMAND_IDS[0])
|
||||
{
|
||||
return false;
|
||||
|
@ -533,6 +533,7 @@ public class Config
|
||||
public static int WORLD_CHAT_MIN_LEVEL;
|
||||
public static int WORLD_CHAT_POINTS_PER_DAY;
|
||||
public static Duration WORLD_CHAT_INTERVAL;
|
||||
public static boolean OLYMPIAD_ENABLED;
|
||||
public static int ALT_OLY_START_TIME;
|
||||
public static int ALT_OLY_MIN;
|
||||
public static long ALT_OLY_CPERIOD;
|
||||
@ -2397,6 +2398,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", 20);
|
||||
ALT_OLY_MIN = olympiadConfig.getInt("AltOlyMin", 0);
|
||||
ALT_OLY_CPERIOD = olympiadConfig.getLong("AltOlyCPeriod", 14400000);
|
||||
|
@ -95,7 +95,10 @@ public class Hero
|
||||
|
||||
protected Hero()
|
||||
{
|
||||
init();
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
init();
|
||||
}
|
||||
}
|
||||
|
||||
private void init()
|
||||
|
@ -130,12 +130,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.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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 8pm (20)
|
||||
# Default: 20
|
||||
AltOlyStartTime = 20
|
||||
|
@ -18,6 +18,7 @@ package ai.others.MonumentOfHeroes;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.olympiad.Hero;
|
||||
@ -69,9 +70,12 @@ public class MonumentOfHeroes extends AbstractNpcAI
|
||||
|
||||
private MonumentOfHeroes()
|
||||
{
|
||||
addStartNpc(MONUMENTS);
|
||||
addFirstTalkId(MONUMENTS);
|
||||
addTalkId(MONUMENTS);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(MONUMENTS);
|
||||
addFirstTalkId(MONUMENTS);
|
||||
addTalkId(MONUMENTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -16,6 +16,7 @@
|
||||
*/
|
||||
package ai.others.OlyBuffer;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
@ -45,9 +46,12 @@ public class OlyBuffer extends AbstractNpcAI
|
||||
|
||||
private OlyBuffer()
|
||||
{
|
||||
addStartNpc(OLYMPIAD_BUFFER);
|
||||
addFirstTalkId(OLYMPIAD_BUFFER);
|
||||
addTalkId(OLYMPIAD_BUFFER);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(OLYMPIAD_BUFFER);
|
||||
addFirstTalkId(OLYMPIAD_BUFFER);
|
||||
addTalkId(OLYMPIAD_BUFFER);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -78,10 +78,13 @@ public class OlyManager extends AbstractNpcAI implements IBypassHandler
|
||||
|
||||
private OlyManager()
|
||||
{
|
||||
addStartNpc(MANAGER);
|
||||
addFirstTalkId(MANAGER);
|
||||
addTalkId(MANAGER);
|
||||
BypassHandler.getInstance().registerHandler(this);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(MANAGER);
|
||||
addFirstTalkId(MANAGER);
|
||||
addTalkId(MANAGER);
|
||||
BypassHandler.getInstance().registerHandler(this);
|
||||
}
|
||||
}
|
||||
|
||||
@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_OLYMPIAD_GAMES_ARE_NOT_CURRENTLY_IN_PROGRESS);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (id != COMMAND_IDS[0])
|
||||
{
|
||||
return false;
|
||||
|
@ -533,6 +533,7 @@ public class Config
|
||||
public static int WORLD_CHAT_MIN_LEVEL;
|
||||
public static int WORLD_CHAT_POINTS_PER_DAY;
|
||||
public static Duration WORLD_CHAT_INTERVAL;
|
||||
public static boolean OLYMPIAD_ENABLED;
|
||||
public static int ALT_OLY_START_TIME;
|
||||
public static int ALT_OLY_MIN;
|
||||
public static long ALT_OLY_CPERIOD;
|
||||
@ -2404,6 +2405,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", 20);
|
||||
ALT_OLY_MIN = olympiadConfig.getInt("AltOlyMin", 0);
|
||||
ALT_OLY_CPERIOD = olympiadConfig.getLong("AltOlyCPeriod", 14400000);
|
||||
|
@ -95,7 +95,10 @@ public class Hero
|
||||
|
||||
protected Hero()
|
||||
{
|
||||
init();
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
init();
|
||||
}
|
||||
}
|
||||
|
||||
private void init()
|
||||
|
@ -130,12 +130,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.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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 8pm (20)
|
||||
# Default: 20
|
||||
AltOlyStartTime = 20
|
||||
|
@ -18,6 +18,7 @@ package ai.others.MonumentOfHeroes;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.olympiad.Hero;
|
||||
@ -69,9 +70,12 @@ public class MonumentOfHeroes extends AbstractNpcAI
|
||||
|
||||
private MonumentOfHeroes()
|
||||
{
|
||||
addStartNpc(MONUMENTS);
|
||||
addFirstTalkId(MONUMENTS);
|
||||
addTalkId(MONUMENTS);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(MONUMENTS);
|
||||
addFirstTalkId(MONUMENTS);
|
||||
addTalkId(MONUMENTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -16,6 +16,7 @@
|
||||
*/
|
||||
package ai.others.OlyBuffer;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
@ -45,9 +46,12 @@ public class OlyBuffer extends AbstractNpcAI
|
||||
|
||||
private OlyBuffer()
|
||||
{
|
||||
addStartNpc(OLYMPIAD_BUFFER);
|
||||
addFirstTalkId(OLYMPIAD_BUFFER);
|
||||
addTalkId(OLYMPIAD_BUFFER);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(OLYMPIAD_BUFFER);
|
||||
addFirstTalkId(OLYMPIAD_BUFFER);
|
||||
addTalkId(OLYMPIAD_BUFFER);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -78,10 +78,13 @@ public class OlyManager extends AbstractNpcAI implements IBypassHandler
|
||||
|
||||
private OlyManager()
|
||||
{
|
||||
addStartNpc(MANAGER);
|
||||
addFirstTalkId(MANAGER);
|
||||
addTalkId(MANAGER);
|
||||
BypassHandler.getInstance().registerHandler(this);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(MANAGER);
|
||||
addFirstTalkId(MANAGER);
|
||||
addTalkId(MANAGER);
|
||||
BypassHandler.getInstance().registerHandler(this);
|
||||
}
|
||||
}
|
||||
|
||||
@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_OLYMPIAD_GAMES_ARE_NOT_CURRENTLY_IN_PROGRESS);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (id != COMMAND_IDS[0])
|
||||
{
|
||||
return false;
|
||||
|
@ -534,6 +534,7 @@ public class Config
|
||||
public static int WORLD_CHAT_MIN_LEVEL;
|
||||
public static int WORLD_CHAT_POINTS_PER_DAY;
|
||||
public static Duration WORLD_CHAT_INTERVAL;
|
||||
public static boolean OLYMPIAD_ENABLED;
|
||||
public static int ALT_OLY_START_TIME;
|
||||
public static int ALT_OLY_MIN;
|
||||
public static long ALT_OLY_CPERIOD;
|
||||
@ -2443,6 +2444,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", 20);
|
||||
ALT_OLY_MIN = olympiadConfig.getInt("AltOlyMin", 0);
|
||||
ALT_OLY_CPERIOD = olympiadConfig.getLong("AltOlyCPeriod", 14400000);
|
||||
|
@ -95,7 +95,10 @@ public class Hero
|
||||
|
||||
protected Hero()
|
||||
{
|
||||
init();
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
init();
|
||||
}
|
||||
}
|
||||
|
||||
private void init()
|
||||
|
@ -130,12 +130,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.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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 8pm (20)
|
||||
# Default: 20
|
||||
AltOlyStartTime = 20
|
||||
|
@ -18,6 +18,7 @@ package ai.others.MonumentOfHeroes;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.olympiad.Hero;
|
||||
@ -69,9 +70,12 @@ public class MonumentOfHeroes extends AbstractNpcAI
|
||||
|
||||
private MonumentOfHeroes()
|
||||
{
|
||||
addStartNpc(MONUMENTS);
|
||||
addFirstTalkId(MONUMENTS);
|
||||
addTalkId(MONUMENTS);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(MONUMENTS);
|
||||
addFirstTalkId(MONUMENTS);
|
||||
addTalkId(MONUMENTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -16,6 +16,7 @@
|
||||
*/
|
||||
package ai.others.OlyBuffer;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
@ -45,9 +46,12 @@ public class OlyBuffer extends AbstractNpcAI
|
||||
|
||||
private OlyBuffer()
|
||||
{
|
||||
addStartNpc(OLYMPIAD_BUFFER);
|
||||
addFirstTalkId(OLYMPIAD_BUFFER);
|
||||
addTalkId(OLYMPIAD_BUFFER);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(OLYMPIAD_BUFFER);
|
||||
addFirstTalkId(OLYMPIAD_BUFFER);
|
||||
addTalkId(OLYMPIAD_BUFFER);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -78,10 +78,13 @@ public class OlyManager extends AbstractNpcAI implements IBypassHandler
|
||||
|
||||
private OlyManager()
|
||||
{
|
||||
addStartNpc(MANAGER);
|
||||
addFirstTalkId(MANAGER);
|
||||
addTalkId(MANAGER);
|
||||
BypassHandler.getInstance().registerHandler(this);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(MANAGER);
|
||||
addFirstTalkId(MANAGER);
|
||||
addTalkId(MANAGER);
|
||||
BypassHandler.getInstance().registerHandler(this);
|
||||
}
|
||||
}
|
||||
|
||||
@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_OLYMPIAD_GAMES_ARE_NOT_CURRENTLY_IN_PROGRESS);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (id != COMMAND_IDS[0])
|
||||
{
|
||||
return false;
|
||||
|
@ -535,6 +535,7 @@ public class Config
|
||||
public static int WORLD_CHAT_MIN_LEVEL;
|
||||
public static int WORLD_CHAT_POINTS_PER_DAY;
|
||||
public static Duration WORLD_CHAT_INTERVAL;
|
||||
public static boolean OLYMPIAD_ENABLED;
|
||||
public static int ALT_OLY_START_TIME;
|
||||
public static int ALT_OLY_MIN;
|
||||
public static long ALT_OLY_CPERIOD;
|
||||
@ -2459,6 +2460,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", 20);
|
||||
ALT_OLY_MIN = olympiadConfig.getInt("AltOlyMin", 0);
|
||||
ALT_OLY_CPERIOD = olympiadConfig.getLong("AltOlyCPeriod", 14400000);
|
||||
|
@ -96,7 +96,10 @@ public class Hero
|
||||
|
||||
protected Hero()
|
||||
{
|
||||
init();
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
init();
|
||||
}
|
||||
}
|
||||
|
||||
private void init()
|
||||
|
@ -131,12 +131,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.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@ package ai.others.MonumentOfHeroes;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.olympiad.Hero;
|
||||
@ -87,9 +88,12 @@ public class MonumentOfHeroes extends AbstractNpcAI
|
||||
|
||||
private MonumentOfHeroes()
|
||||
{
|
||||
addStartNpc(MONUMENTS);
|
||||
addFirstTalkId(MONUMENTS);
|
||||
addTalkId(MONUMENTS);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(MONUMENTS);
|
||||
addFirstTalkId(MONUMENTS);
|
||||
addTalkId(MONUMENTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -16,6 +16,7 @@
|
||||
*/
|
||||
package ai.others.OlyBuffer;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.skill.CommonSkill;
|
||||
@ -43,9 +44,12 @@ public class OlyBuffer extends AbstractNpcAI
|
||||
|
||||
private OlyBuffer()
|
||||
{
|
||||
addStartNpc(OLYMPIAD_BUFFER);
|
||||
addFirstTalkId(OLYMPIAD_BUFFER);
|
||||
addTalkId(OLYMPIAD_BUFFER);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(OLYMPIAD_BUFFER);
|
||||
addFirstTalkId(OLYMPIAD_BUFFER);
|
||||
addTalkId(OLYMPIAD_BUFFER);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -78,10 +78,13 @@ public class OlyManager extends AbstractNpcAI implements IBypassHandler
|
||||
|
||||
private OlyManager()
|
||||
{
|
||||
addStartNpc(MANAGER);
|
||||
addFirstTalkId(MANAGER);
|
||||
addTalkId(MANAGER);
|
||||
BypassHandler.getInstance().registerHandler(this);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(MANAGER);
|
||||
addFirstTalkId(MANAGER);
|
||||
addTalkId(MANAGER);
|
||||
BypassHandler.getInstance().registerHandler(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,6 +18,7 @@ package ai.others.MonumentOfHeroes;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.olympiad.Hero;
|
||||
@ -87,9 +88,12 @@ public class MonumentOfHeroes extends AbstractNpcAI
|
||||
|
||||
private MonumentOfHeroes()
|
||||
{
|
||||
addStartNpc(MONUMENTS);
|
||||
addFirstTalkId(MONUMENTS);
|
||||
addTalkId(MONUMENTS);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(MONUMENTS);
|
||||
addFirstTalkId(MONUMENTS);
|
||||
addTalkId(MONUMENTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -16,6 +16,7 @@
|
||||
*/
|
||||
package ai.others.OlyBuffer;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.skill.CommonSkill;
|
||||
@ -43,9 +44,12 @@ public class OlyBuffer extends AbstractNpcAI
|
||||
|
||||
private OlyBuffer()
|
||||
{
|
||||
addStartNpc(OLYMPIAD_BUFFER);
|
||||
addFirstTalkId(OLYMPIAD_BUFFER);
|
||||
addTalkId(OLYMPIAD_BUFFER);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(OLYMPIAD_BUFFER);
|
||||
addFirstTalkId(OLYMPIAD_BUFFER);
|
||||
addTalkId(OLYMPIAD_BUFFER);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -78,10 +78,13 @@ public class OlyManager extends AbstractNpcAI implements IBypassHandler
|
||||
|
||||
private OlyManager()
|
||||
{
|
||||
addStartNpc(MANAGER);
|
||||
addFirstTalkId(MANAGER);
|
||||
addTalkId(MANAGER);
|
||||
BypassHandler.getInstance().registerHandler(this);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(MANAGER);
|
||||
addFirstTalkId(MANAGER);
|
||||
addTalkId(MANAGER);
|
||||
BypassHandler.getInstance().registerHandler(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,6 +18,7 @@ package ai.others.MonumentOfHeroes;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.olympiad.Hero;
|
||||
@ -87,9 +88,12 @@ public class MonumentOfHeroes extends AbstractNpcAI
|
||||
|
||||
private MonumentOfHeroes()
|
||||
{
|
||||
addStartNpc(MONUMENTS);
|
||||
addFirstTalkId(MONUMENTS);
|
||||
addTalkId(MONUMENTS);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(MONUMENTS);
|
||||
addFirstTalkId(MONUMENTS);
|
||||
addTalkId(MONUMENTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -16,6 +16,7 @@
|
||||
*/
|
||||
package ai.others.OlyBuffer;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.skill.CommonSkill;
|
||||
@ -40,9 +41,12 @@ public class OlyBuffer extends AbstractNpcAI
|
||||
|
||||
private OlyBuffer()
|
||||
{
|
||||
addStartNpc(OLYMPIAD_BUFFER);
|
||||
addFirstTalkId(OLYMPIAD_BUFFER);
|
||||
addTalkId(OLYMPIAD_BUFFER);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(OLYMPIAD_BUFFER);
|
||||
addFirstTalkId(OLYMPIAD_BUFFER);
|
||||
addTalkId(OLYMPIAD_BUFFER);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -78,10 +78,13 @@ public class OlyManager extends AbstractNpcAI implements IBypassHandler
|
||||
|
||||
private OlyManager()
|
||||
{
|
||||
addStartNpc(MANAGER);
|
||||
addFirstTalkId(MANAGER);
|
||||
addTalkId(MANAGER);
|
||||
BypassHandler.getInstance().registerHandler(this);
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
addStartNpc(MANAGER);
|
||||
addFirstTalkId(MANAGER);
|
||||
addTalkId(MANAGER);
|
||||
BypassHandler.getInstance().registerHandler(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -2,6 +2,10 @@
|
||||
# Olympiad Settings #
|
||||
#=======================================================#
|
||||
|
||||
# Enable Olympiad.
|
||||
# Default: True
|
||||
OlympiadEnabled = True
|
||||
|
||||
# Olympiad Start Time in Military hours Default 6pm (18)
|
||||
# Default: 18
|
||||
AltOlyStartTime = 18
|
||||
|
@ -731,6 +731,7 @@ public class Config
|
||||
public static boolean ANTI_FARM_IP_ENABLED;
|
||||
public static boolean ANTI_FARM_SUMMON;
|
||||
|
||||
public static boolean OLYMPIAD_ENABLED;
|
||||
public static int ALT_OLY_NUMBER_HEROS_EACH_CLASS;
|
||||
public static boolean ALT_OLY_LOG_FIGHTS;
|
||||
public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS;
|
||||
@ -2002,6 +2003,7 @@ public class Config
|
||||
public static void loadOlympConfig()
|
||||
{
|
||||
final PropertiesParser olympiadConfig = new PropertiesParser(OLYMP_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_CPERIOD = olympiadConfig.getLong("AltOlyCPeriod", 21600000);
|
||||
|
@ -16,6 +16,7 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.handler.usercommandhandlers;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
||||
@ -40,6 +41,12 @@ public class OlympiadStat implements IUserCommandHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
player.sendPacket(SystemMessageId.THE_GRAND_OLYMPIAD_GAMES_ARE_NOT_CURRENTLY_IN_PROGRESS);
|
||||
return false;
|
||||
}
|
||||
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.YOUR_CURRENT_RECORD_FOR_THIS_GRAND_OLYMPIAD_IS_S1_MATCH_ES_S2_WIN_S_AND_S3_DEFEAT_S_YOU_HAVE_EARNED_S4_OLYMPIAD_POINT_S);
|
||||
sm.addNumber(Olympiad.getInstance().getCompetitionDone(player.getObjectId()));
|
||||
sm.addNumber(Olympiad.getInstance().getCompetitionWon(player.getObjectId()));
|
||||
|
@ -28,6 +28,7 @@ import java.util.Map.Entry;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
@ -70,7 +71,10 @@ public class Hero
|
||||
|
||||
public Hero()
|
||||
{
|
||||
init();
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
init();
|
||||
}
|
||||
}
|
||||
|
||||
private void init()
|
||||
|
@ -57,8 +57,8 @@ public class Olympiad
|
||||
{
|
||||
protected static final Logger LOGGER = Logger.getLogger(Olympiad.class.getName());
|
||||
|
||||
private static Map<Integer, StatSet> NOBLES;
|
||||
private static Map<Integer, StatSet> NOBLES_RANK;
|
||||
private static Map<Integer, StatSet> NOBLES = new ConcurrentHashMap<>();
|
||||
private static Map<Integer, StatSet> NOBLES_RANK = new HashMap<>();
|
||||
protected static List<StatSet> HEROS_TO_BE;
|
||||
private static List<Player> _nonClassBasedRegisters;
|
||||
private static Map<Integer, List<Player>> _classBasedRegisters;
|
||||
@ -162,11 +162,18 @@ public class Olympiad
|
||||
|
||||
public Olympiad()
|
||||
{
|
||||
load();
|
||||
|
||||
if (_period == 0)
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
init();
|
||||
load();
|
||||
|
||||
if (_period == 0)
|
||||
{
|
||||
init();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.log(Level.INFO, "Disabled.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -177,8 +184,8 @@ public class Olympiad
|
||||
|
||||
private void load()
|
||||
{
|
||||
NOBLES = new ConcurrentHashMap<>();
|
||||
NOBLES_RANK = new HashMap<>();
|
||||
NOBLES.clear();
|
||||
NOBLES_RANK.clear();
|
||||
|
||||
boolean loaded = false;
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
|
@ -2,6 +2,10 @@
|
||||
# Olympiad Settings #
|
||||
#=======================================================#
|
||||
|
||||
# Enable Olympiad.
|
||||
# Default: True
|
||||
OlympiadEnabled = True
|
||||
|
||||
# Olympiad Start Time in Military hours Default 6pm (18)
|
||||
# Default: 18
|
||||
AltOlyStartTime = 18
|
||||
|
@ -759,6 +759,7 @@ public class Config
|
||||
public static boolean ANTI_FARM_IP_ENABLED;
|
||||
public static boolean ANTI_FARM_SUMMON;
|
||||
|
||||
public static boolean OLYMPIAD_ENABLED;
|
||||
public static int ALT_OLY_NUMBER_HEROS_EACH_CLASS;
|
||||
public static boolean ALT_OLY_LOG_FIGHTS;
|
||||
public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS;
|
||||
@ -2055,6 +2056,7 @@ public class Config
|
||||
public static void loadOlympConfig()
|
||||
{
|
||||
final PropertiesParser olympiadConfig = new PropertiesParser(OLYMP_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_CPERIOD = olympiadConfig.getLong("AltOlyCPeriod", 21600000);
|
||||
|
@ -16,6 +16,7 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.handler.usercommandhandlers;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
||||
@ -40,6 +41,12 @@ public class OlympiadStat implements IUserCommandHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
player.sendPacket(SystemMessageId.THE_GRAND_OLYMPIAD_GAMES_ARE_NOT_CURRENTLY_IN_PROGRESS);
|
||||
return false;
|
||||
}
|
||||
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.YOUR_CURRENT_RECORD_FOR_THIS_GRAND_OLYMPIAD_IS_S1_MATCH_ES_S2_WIN_S_AND_S3_DEFEAT_S_YOU_HAVE_EARNED_S4_OLYMPIAD_POINT_S);
|
||||
sm.addNumber(Olympiad.getInstance().getCompetitionDone(player.getObjectId()));
|
||||
sm.addNumber(Olympiad.getInstance().getCompetitionWon(player.getObjectId()));
|
||||
|
@ -28,6 +28,7 @@ import java.util.Map.Entry;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
@ -70,7 +71,10 @@ public class Hero
|
||||
|
||||
public Hero()
|
||||
{
|
||||
init();
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
init();
|
||||
}
|
||||
}
|
||||
|
||||
private void init()
|
||||
|
@ -57,8 +57,8 @@ public class Olympiad
|
||||
{
|
||||
protected static final Logger LOGGER = Logger.getLogger(Olympiad.class.getName());
|
||||
|
||||
private static Map<Integer, StatSet> NOBLES;
|
||||
private static Map<Integer, StatSet> NOBLES_RANK;
|
||||
private static Map<Integer, StatSet> NOBLES = new ConcurrentHashMap<>();
|
||||
private static Map<Integer, StatSet> NOBLES_RANK = new HashMap<>();
|
||||
protected static List<StatSet> HEROS_TO_BE;
|
||||
private static List<Player> _nonClassBasedRegisters;
|
||||
private static Map<Integer, List<Player>> _classBasedRegisters;
|
||||
@ -162,11 +162,18 @@ public class Olympiad
|
||||
|
||||
public Olympiad()
|
||||
{
|
||||
load();
|
||||
|
||||
if (_period == 0)
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
init();
|
||||
load();
|
||||
|
||||
if (_period == 0)
|
||||
{
|
||||
init();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.log(Level.INFO, "Disabled.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -177,8 +184,8 @@ public class Olympiad
|
||||
|
||||
private void load()
|
||||
{
|
||||
NOBLES = new ConcurrentHashMap<>();
|
||||
NOBLES_RANK = new HashMap<>();
|
||||
NOBLES.clear();
|
||||
NOBLES_RANK.clear();
|
||||
|
||||
boolean loaded = false;
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
|
@ -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;
|
||||
@ -57,8 +58,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;
|
||||
|
@ -577,6 +577,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;
|
||||
@ -2371,6 +2372,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);
|
||||
|
@ -92,7 +92,10 @@ public class Hero
|
||||
|
||||
protected Hero()
|
||||
{
|
||||
init();
|
||||
if (Config.OLYMPIAD_ENABLED)
|
||||
{
|
||||
init();
|
||||
}
|
||||
}
|
||||
|
||||
private void init()
|
||||
|
@ -166,12 +166,19 @@ public class Olympiad extends ListenersContainer
|
||||
|
||||
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.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
@ -60,8 +61,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;
|
||||
|
@ -588,6 +588,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;
|
||||
@ -2467,6 +2468,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
|
||||
|
||||
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.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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()
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user