Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/java/net/sf/l2j/Config.java b/java/net/sf/l2j/Config.java
- index e0405b0..4a44fb5 100644
- --- a/java/net/sf/l2j/Config.java
- +++ b/java/net/sf/l2j/Config.java
- @@ -551,7 +551,7 @@
- public static boolean NO_SPAWNS;
- public static boolean DEVELOPER;
- public static boolean PACKET_HANDLER_DEBUG;
- -
- + public static boolean ALT_OLY_END_ANNOUNCE;
- /** Deadlock Detector */
- public static boolean DEADLOCK_DETECTOR;
- public static int DEADLOCK_CHECK_INTERVAL;
- @@ -952,6 +952,7 @@
- private static final void loadSpecialMods()
- {
- final ExProperties Special = initProperties(SPECIALMODS);
- + ALT_OLY_END_ANNOUNCE = Boolean.parseBoolean(Special.getProperty("AltOlyEndAnnounce", "False"));
- ENABLE_ALTERNATIVE_SKILL_DURATION = Boolean.parseBoolean(Special.getProperty("EnableModifySkillDuration", "false"));
- if(ENABLE_ALTERNATIVE_SKILL_DURATION)
- {
- diff --git a/java/net/sf/l2j/gameserver/model/olympiad/Olympiad.java b/java/net/sf/l2j/gameserver/model/olympiad/Olympiad.java
- index 96cdf65..077081e 100644
- --- a/java/net/sf/l2j/gameserver/model/olympiad/Olympiad.java
- +++ b/java/net/sf/l2j/gameserver/model/olympiad/Olympiad.java
- @@ -27,6 +27,7 @@
- import net.sf.l2j.gameserver.model.actor.instance.OlympiadManagerNpc;
- import net.sf.l2j.gameserver.model.zone.type.OlympiadStadiumZone;
- import net.sf.l2j.gameserver.network.SystemMessageId;
- +import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
- import net.sf.l2j.gameserver.network.serverpackets.NpcSay;
- import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
- @@ -64,10 +65,10 @@
- public static final String COMP_LOST = "competitions_lost";
- public static final String COMP_DRAWN = "competitions_drawn";
- - protected long _olympiadEnd;
- - protected long _validationEnd;
- + protected static long _olympiadEnd;
- + protected static long _validationEnd;
- - protected OlympiadState _period;
- + protected static OlympiadState _period;
- protected long _nextWeeklyChange;
- protected int _currentCycle;
- private long _compEnd;
- @@ -389,7 +390,7 @@
- }, getMillisToCompBegin());
- }
- - private long getMillisToOlympiadEnd()
- + public static long getMillisToOlympiadEnd()
- {
- return (_olympiadEnd - Calendar.getInstance().getTimeInMillis());
- }
- @@ -402,14 +403,35 @@
- _scheduledOlympiadEnd = ThreadPool.schedule(new OlympiadEndTask(), 0);
- }
- - protected long getMillisToValidationEnd()
- + protected static long getMillisToValidationEnd()
- {
- if (_validationEnd > Calendar.getInstance().getTimeInMillis())
- return (_validationEnd - Calendar.getInstance().getTimeInMillis());
- return 10L;
- }
- -
- + public static void olympiadEnd(Player player)
- + {
- + long milliToEnd;
- + if(_period == OlympiadState.COMPETITION)
- + {
- + milliToEnd = getMillisToOlympiadEnd();
- + }
- + else
- + {
- + milliToEnd = getMillisToValidationEnd();
- + }
- +
- + double numSecs = milliToEnd / 1000 % 60;
- + double countDown = (milliToEnd / 1000 - numSecs) / 60;
- + int numMins = (int) Math.floor(countDown % 60);
- + countDown = (countDown - numMins) / 60;
- + int numHours = (int) Math.floor(countDown % 24);
- + int numDays = (int) Math.floor((countDown - numHours) / 24);
- +
- + CreatureSay cs = new CreatureSay(0, SayType.PARTY, "Announcements", "Olympiad period ends in " + numDays + " days, " + numHours + " hours and " + numMins + " mins.");
- + player.sendPacket(cs);
- + }
- public boolean isOlympiadEnd()
- {
- return _period == OlympiadState.VALIDATION;
- diff --git a/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java b/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
- index 48ed287..d0a9768 100644
- --- a/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
- +++ b/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
- @@ -230,6 +230,11 @@
- player.sendPacket(SevenSignsManager.getInstance().getCurrentPeriod().getMessageId());
- AnnouncementData.getInstance().showAnnouncements(player, false);
- + if (Config.ALT_OLY_END_ANNOUNCE)
- + {
- + Olympiad.olympiadEnd(player);
- + }
- +
- // if player is DE, check for shadow sense skill at night
- if (player.getRace() == ClassRace.DARK_ELF && player.hasSkill(L2Skill.SKILL_SHADOW_SENSE))
- player.sendPacket(SystemMessage.getSystemMessage((GameTimeTaskManager.getInstance().isNight()) ? SystemMessageId.NIGHT_S1_EFFECT_APPLIES : SystemMessageId.DAY_S1_EFFECT_DISAPPEARS).addSkillName(L2Skill.SKILL_SHADOW_SENSE));
- Parte config.
- +#=====================================================
- +# Annuncie Time Olympiad in Login Server
- +#=====================================================
- +# Announce olympiad end on enter world.
- +# Default: False
- +AltOlyEndAnnounce = True
Add Comment
Please, Sign In to add comment