Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- ===================================================================
- --- config/frozen.properties (revision 5)
- +++ config/frozen.properties (working copy)
- @@ -80,6 +80,10 @@
- #---------------------------------------
- # Announce olympiad end on enter world.
- #---------------------------------------
- # Default: False
- AltOlyEndAnnounce = True
- ===================================================================
- --- java/head-src/com/l2jfrozen/Config.java (revision 5)
- +++ java/head-src/com/l2jfrozen/Config.java (working copy)
- @@ -163,6 +163,7 @@
- public static String PM_TEXT2;
- public static boolean NEW_PLAYER_EFFECT;
- + public static boolean ALT_OLY_END_ANNOUNCE;
- @@ -790,6 +795,7 @@
- PM_TEXT2 = frozenSettings.getProperty("PMText2", "Vote for us every 24h");
- NEW_PLAYER_EFFECT = Boolean.parseBoolean(frozenSettings.getProperty("NewPlayerEffect", "True"));
- + ALT_OLY_END_ANNOUNCE = Boolean.parseBoolean(events.getProperty("AltOlyEndAnnounce", "False"));
- ===================================================================
- --- java/head-src/com/l2jfrozen/gameserver/model/entity/olympiad/Olympiad.java (revision 5)
- +++ java/head-src/com/l2jfrozen/gameserver/model/entity/olympiad/Olympiad.java(working copy)
- @@ -39,6 +39,8 @@
- import com.l2jfrozen.gameserver.model.entity.Announcements;
- import com.l2jfrozen.gameserver.model.entity.Hero;
- import com.l2jfrozen.gameserver.model.spawn.L2Spawn;
- import com.l2jfrozen.gameserver.network.SystemMessageId;
- +import net.sf.l2j.gameserver.network.clientpackets.Say2;
- +import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
- import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
- import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage;
- @@ -86,15 +88,15 @@
- 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;
- /**
- * The current period of the olympiad.<br>
- * <b>0 -</b> Competition period<br>
- * <b>1 -</b> Validation Period
- */
- - protected int _period;
- + protected static int _period;
- protected long _nextWeeklyChange;
- protected int _currentCycle;
- private long _compEnd;
- @@ -454,7 +456,7 @@
- }, getMillisToCompBegin());
- }
- - private long getMillisToOlympiadEnd()
- + private static long getMillisToOlympiadEnd()
- {
- return (_olympiadEnd - Calendar.getInstance().getTimeInMillis());
- }
- @@ -467,7 +469,7 @@
- _scheduledOlympiadEnd = ThreadPoolManager.getInstance().scheduleGeneral(new OlympiadEndTask(), 0);
- }
- - protected long getMillisToValidationEnd()
- + protected static long getMillisToValidationEnd()
- {
- if (_validationEnd > Calendar.getInstance().getTimeInMillis())
- return (_validationEnd - Calendar.getInstance().getTimeInMillis());
- @@ -475,6 +477,29 @@
- return 10L;
- }
- + public static void olympiadEnd(L2PcInstance player)
- + {
- + long milliToEnd;
- + if(_period == 0)
- + {
- + 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, Say2.ANNOUNCEMENT, "", "Olympiad period ends in " + numDays + " days, " + numHours + " hours and " + numMins + " mins.");
- + player.sendPacket(cs);
- + }
- +
- public boolean isOlympiadEnd()
- {
- return (_period != 0);
- Index: java/head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java
- ===================================================================
- --- java/head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java (revision 5)
- +++ java/head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java (working copy)
- @@ -168,6 +168,11 @@
- // Check for crowns
- CrownManager.getInstance().checkCrowns(activeChar);
- + if (Config.ALT_OLY_END_ANNOUNCE)
- + {
- + Olympiad.olympiadEnd(activeChar);
- + }
- +
- // Check player skills
- if (Config.CHECK_SKILLS_ON_ENTER && !Config.ALT_GAME_SKILL_LEARN)
- activeChar.checkAllowedSkills();
Add Comment
Please, Sign In to add comment