Advertisement
Guest User

Java

a guest
Aug 13th, 2013
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 42.14 KB | None | 0 0
  1. #---------------------------------------------------------------
  2. # XFactor  - Cobra for Maxcheaters.com                
  3. #---------------------------------------------------------------
  4. XFactorEventEnabled = false
  5. XFactorEventInterval = 11:00,15:00
  6. XFactorEventParticipationTime = 5
  7. XFactorEventRunningTime = 15
  8. XFactorEventParticipationNpcId = 1000000
  9. XFactorEventParticipationNpcCoordinates = 45451,48530,-3059
  10. XFactorEventMinPlayersInTeams = 1
  11. XFactorEventMaxPlayersInTeams = 50
  12. XFactorEventMinPlayerLevel = 1
  13. XFactorEventMaxPlayerLevel = 85
  14. XFactorEventRespawnTeleportDelay = 3
  15. XFactorEventStartLeaveTeleportDelay = 3
  16. XFactorEventTeam1Name = Knights
  17. XFactorEventTeam1Coordinates = 85578,256956,-11670
  18. XFactorEventTeam2Name = Zombies
  19. XFactorEventTeam2Coordinates = 85578,256956,-11670
  20. XFactorEventReward = 57,100000;5575,1000
  21. XFactorEventTargetTeamMembersAllowed = true
  22. XFactorEventScrollsAllowed = false
  23. XFactorEventPotionsAllowed = false
  24. XFactorEventSummonByItemAllowed = false
  25. Index: C:/l2j core/Shadow/java/net/sf/l2j/Config.java
  26. ===================================================================
  27.  C:/l2j core/Shadow/java/net/sf/l2j/Config.java (revision 2944)
  28.  C:/l2j core/Shadow/java/net/sf/l2j/Config.java (working copy)
  29. @@ -557,7 +557,90 @@
  30.         //XFactor - Cobra for Maxcheaters.com    
  31.         public static boolean   XFactor_EVENT_ENABLED;
  32.         public static String[]  XFactor_EVENT_INTERVAL;
  33.         public static int       XFactor_EVENT_PARTICIPATION_TIME;
  34.         public static int       XFactor_EVENT_RUNNING_TIME;
  35.         public static int       XFactor_EVENT_PARTICIPATION_NPC_ID;
  36.         public static int[]     XFactor_EVENT_PARTICIPATION_NPC_COORDINATES = new int[3];
  37.         public static int       XFactor_EVENT_MIN_PLAYERS_IN_TEAMS;
  38.         public static int       XFactor_EVENT_MAX_PLAYERS_IN_TEAMS;
  39.         public static int       XFactor_EVENT_RESPAWN_TELEPORT_DELAY;
  40.         public static int       XFactor_EVENT_START_LEAVE_TELEPORT_DELAY;
  41.         public static String    XFactor_EVENT_TEAM_1_NAME;
  42.         public static int[]     XFactor_EVENT_TEAM_1_COORDINATES = new int[3];
  43.         public static String    XFactor_EVENT_TEAM_2_NAME;
  44.         public static int[]     XFactor_EVENT_TEAM_2_COORDINATES = new int[3];
  45.         public static List<int[]>   XFactor_EVENT_REWARDS = new FastList<int[]>();
  46.         public static boolean   XFactor_EVENT_TARGET_TEAM_MEMBERS_ALLOWED;
  47.         public static boolean   XFactor_EVENT_SCROLL_ALLOWED;
  48.         public static boolean   XFactor_EVENT_POTIONS_ALLOWED;
  49.         public static boolean   XFactor_EVENT_SUMMON_BY_ITEM_ALLOWED;
  50.         public static List<Integer> XFactor_DOORS_IDS_TO_OPEN = new ArrayList<Integer>();
  51.         public static List<Integer> XFactor_DOORS_IDS_TO_CLOSE = new ArrayList<Integer>();
  52.         public static boolean   XFactor_REWARD_TEAM_TIE;
  53.         public static byte      XFactor_EVENT_MIN_LVL;
  54.         public static byte      XFactor_EVENT_MAX_LVL;
  55.        
  56.         //XFactor - Cobra for Maxcheaters.com    
  57.  
  58.  
  59.  
  60.                     XFactor_EVENT_ENABLED                        = Boolean.parseBoolean(L2JModSettings.getProperty("XFactorEventEnabled", "false"));
  61.                     XFactor_EVENT_INTERVAL                        = L2JModSettings.getProperty("XFactorEventInterval", "20:00").split(",");
  62.                     XFactor_EVENT_PARTICIPATION_TIME            = Integer.parseInt(L2JModSettings.getProperty("XFactorEventParticipationTime", "3600"));
  63.                     XFactor_EVENT_RUNNING_TIME                    = Integer.parseInt(L2JModSettings.getProperty("XFactorEventRunningTime", "1800"));
  64.                     XFactor_EVENT_PARTICIPATION_NPC_ID            = Integer.parseInt(L2JModSettings.getProperty("XFactorEventParticipationNpcId", "0"));
  65.  
  66.                           if (XFactor_EVENT_PARTICIPATION_NPC_ID == 0)
  67.                     {
  68.                         XFactor_EVENT_ENABLED = false;
  69.                         _log.warning("XFactorEventEngine[Config.load()]: invalid config property -> XFactorEventParticipationNpcId");
  70.                     }
  71.                     else
  72.                     {
  73.                         String[] propertySplit                = L2JModSettings.getProperty("XFactorEventParticipationNpcCoordinates", "0,0,0").split(",");
  74.    
  75.                         if (propertySplit.length < 3)
  76.                         {
  77.                             XFactor_EVENT_ENABLED = false;
  78.                             _log.warning("XFactorEventEngine[Config.load()]: invalid config property -> XFactorEventParticipationNpcCoordinates");
  79.                         }
  80.                         else
  81.                         {
  82.                             XFactor_EVENT_REWARDS = new FastList<int[]>();
  83.                             XFactor_DOORS_IDS_TO_OPEN = new ArrayList<Integer>();
  84.                             XFactor_DOORS_IDS_TO_CLOSE = new ArrayList<Integer>();
  85.                             XFactor_EVENT_PARTICIPATION_NPC_COORDINATES = new int[3];
  86.                             XFactor_EVENT_TEAM_1_COORDINATES = new int[3];
  87.                             XFactor_EVENT_TEAM_2_COORDINATES = new int[3];
  88.                             XFactor_EVENT_PARTICIPATION_NPC_COORDINATES[0]  = Integer.parseInt(propertySplit[0]);
  89.                             XFactor_EVENT_PARTICIPATION_NPC_COORDINATES[1]  = Integer.parseInt(propertySplit[1]);
  90.                             XFactor_EVENT_PARTICIPATION_NPC_COORDINATES[2]  = Integer.parseInt(propertySplit[2]);
  91.    
  92.                             XFactor_EVENT_MIN_PLAYERS_IN_TEAMS              = Integer.parseInt(L2JModSettings.getProperty("XFactorEventMinPlayersInTeams", "1"));
  93.                             XFactor_EVENT_MAX_PLAYERS_IN_TEAMS              = Integer.parseInt(L2JModSettings.getProperty("XFactorEventMaxPlayersInTeams", "20"));
  94.                             XFactor_EVENT_MIN_LVL                           = (byte)Integer.parseInt(L2JModSettings.getProperty("XFactorEventMinPlayerLevel", "1"));
  95.                             XFactor_EVENT_MAX_LVL                           = (byte)Integer.parseInt(L2JModSettings.getProperty("XFactorEventMaxPlayerLevel", "80"));
  96.                             XFactor_EVENT_RESPAWN_TELEPORT_DELAY            = Integer.parseInt(L2JModSettings.getProperty("XFactorEventRespawnTeleportDelay", "20"));
  97.                             XFactor_EVENT_START_LEAVE_TELEPORT_DELAY        = Integer.parseInt(L2JModSettings.getProperty("XFactorEventStartLeaveTeleportDelay", "20"));
  98.    
  99.                             XFactor_EVENT_TEAM_1_NAME                       = L2JModSettings.getProperty("XFactorEventTeam1Name", "Team1");
  100.                             propertySplit                               = L2JModSettings.getProperty("XFactorEventTeam1Coordinates", "0,0,0").split(",");
  101.    
  102.                             if (propertySplit.length < 3)
  103.                             {
  104.                                 XFactor_EVENT_ENABLED = false;
  105.                                 _log.warning("XFactorEventEngine[Config.load()]: invalid config property -> XFactorEventTeam1Coordinates");
  106.                             }
  107.                             else
  108.                             {
  109.                                 XFactor_EVENT_TEAM_1_COORDINATES[0]    = Integer.parseInt(propertySplit[0]);
  110.                                 XFactor_EVENT_TEAM_1_COORDINATES[1]    = Integer.parseInt(propertySplit[1]);
  111.                                 XFactor_EVENT_TEAM_1_COORDINATES[2]    = Integer.parseInt(propertySplit[2]);
  112.    
  113.                                 XFactor_EVENT_TEAM_2_NAME            = L2JModSettings.getProperty("XFactorEventTeam2Name", "Team2");
  114.                                 propertySplit                    = L2JModSettings.getProperty("XFactorEventTeam2Coordinates", "0,0,0").split(",");
  115.    
  116.                                 if (propertySplit.length < 3)
  117.                                 {
  118.                                     XFactor_EVENT_ENABLED= false;
  119.                                     _log.warning("XFactorEventEngine[Config.load()]: invalid config property -> XFactorEventTeam2Coordinates");
  120.                                 }
  121.                                 else
  122.                                 {
  123.                                     XFactor_EVENT_TEAM_2_COORDINATES[0]    = Integer.parseInt(propertySplit[0]);
  124.                                     XFactor_EVENT_TEAM_2_COORDINATES[1]    = Integer.parseInt(propertySplit[1]);
  125.                                     XFactor_EVENT_TEAM_2_COORDINATES[2]    = Integer.parseInt(propertySplit[2]);
  126.                                     propertySplit                    = L2JModSettings.getProperty("XFactorEventReward", "57,100000").split(";");
  127.    
  128.                                     for (String reward : propertySplit)
  129.                                     {
  130.                                         String[] rewardSplit = reward.split(",");
  131.    
  132.                                         if (rewardSplit.length != 2)
  133.                                             _log.warning(StringUtil.concat(
  134.                                                     "XFactorEventEngine[Config.load()]: invalid config property -> XFactorEventReward \"",
  135.                                                     reward, "\""));
  136.                                         else
  137.                                         {
  138.                                             try
  139.                                             {
  140.                                                 XFactor_EVENT_REWARDS.add(new int[]{Integer.parseInt(rewardSplit[0]), Integer.parseInt(rewardSplit[1])});
  141.                                             }
  142.                                             catch (NumberFormatException nfe)
  143.                                             {
  144.                                                 if (!reward.equals(""))
  145.                                                     _log.warning(StringUtil.concat(
  146.                                                             "XFactorEventEngine[Config.load()]: invalid config property -> XFactorEventReward \"",
  147.                                                             reward, "\""));
  148.                                             }
  149.                                         }
  150.                                     }
  151.    
  152.                                     XFactor_EVENT_TARGET_TEAM_MEMBERS_ALLOWED   = Boolean.parseBoolean(L2JModSettings.getProperty("XFactorEventTargetTeamMembersAllowed", "true"));
  153.                                     XFactor_EVENT_SCROLL_ALLOWED                = Boolean.parseBoolean(L2JModSettings.getProperty("XFactorEventScrollAllowed", "false"));
  154.                                     XFactor_EVENT_POTIONS_ALLOWED               = Boolean.parseBoolean(L2JModSettings.getProperty("XFactorEventPotionsAllowed", "false"));
  155.                                     XFactor_EVENT_SUMMON_BY_ITEM_ALLOWED        = Boolean.parseBoolean(L2JModSettings.getProperty("XFactorEventSummonByItemAllowed", "false"));
  156.                                     XFactor_REWARD_TEAM_TIE                     = Boolean.parseBoolean(L2JModSettings.getProperty("XFactorRewardTeamTie", "false"));
  157.                                     propertySplit                           = L2JModSettings.getProperty("XFactorDoorsToOpen", "").split(";");
  158.    
  159.                                     for (String door : propertySplit)
  160.                                     {
  161.                                         try
  162.                                         {
  163.                                             XFactor_DOORS_IDS_TO_OPEN.add(Integer.parseInt(door));
  164.                                         }
  165.                                         catch (NumberFormatException nfe)
  166.                                         {
  167.                                             if (!door.equals(""))
  168.                                                 _log.warning(StringUtil.concat(
  169.                                                         "XFactorEventEngine[Config.load()]: invalid config property -> XFactorDoorsToOpen \"",
  170.                                                         door, "\""));
  171.                                         }
  172.                                     }
  173.                                    
  174.                                     propertySplit                           = L2JModSettings.getProperty("XFactorDoorsToClose", "").split(";");
  175.                                    
  176.                                     for (String door : propertySplit)
  177.                                     {
  178.                                         try
  179.                                         {
  180.                                             XFactor_DOORS_IDS_TO_CLOSE.add(Integer.parseInt(door));
  181.                                         }
  182.                                         catch (NumberFormatException nfe)
  183.                                         {
  184.                                             if (!door.equals(""))
  185.                                                 _log.warning(StringUtil.concat(
  186.                                                         "XFactorEventEngine[Config.load()]: invalid config property -> XFactorDoorsToClose \"",
  187.                                                         door, "\""));
  188.                                         }
  189.                                     }
  190.                                 }
  191.                             }
  192.                         }
  193.                     }
  194.                //XFactor - Cobra for Maxcheaters.com    
  195.  
  196.        //XFactor - Cobra for Maxcheaters.com  
  197.         else if (pName.equalsIgnoreCase("XFactorEventEnabled")) XFactor_EVENT_ENABLED = Boolean.parseBoolean(pValue);
  198.         else if (pName.equalsIgnoreCase("XFactorEventInterval")) XFactor_EVENT_INTERVAL = pValue.split(",");
  199.         else if (pName.equalsIgnoreCase("XFactorEventParticipationTime")) XFactor_EVENT_PARTICIPATION_TIME = Integer.parseInt(pValue);
  200.         else if (pName.equalsIgnoreCase("XFactorEventRunningTime")) XFactor_EVENT_RUNNING_TIME = Integer.parseInt(pValue);
  201.         else if (pName.equalsIgnoreCase("XFactorEventParticipationNpcId")) XFactor_EVENT_PARTICIPATION_NPC_ID = Integer.parseInt(pValue);
  202.        //XFactor - Cobra for Maxcheaters.com  
  203.  
  204. Index: C:/l2j core/Shadow/java/net/sf/l2j/gameserver/network/serverpackets/Die.java
  205. ===================================================================
  206. --- C:/l2j core/Shadow/java/net/sf/l2j/gameserver/network/serverpackets/Die.java    (revision 2944)
  207. +++ C:/l2j core/Shadow/java/net/sf/l2j/gameserver/network/serverpackets/Die.java    (working copy)
  208. @@ -25,6 +25,9 @@
  209.  import net.sf.l2j.gameserver.model.entity.Castle;
  210.  import net.sf.l2j.gameserver.model.entity.Fort;
  211.  import net.sf.l2j.gameserver.model.entity.TvTEvent;
  212. +import net.sf.l2j.gameserver.model.entity.XFactorEvent;
  213. +import net.sf.l2j.gameserver.model.entity.afterlifeEvent;
  214. +import net.sf.l2j.gameserver.model.entity.eridanusEvent;
  215.  
  216. @@ -59,8 +62,12 @@
  217.              _clan=player.getClan();
  218.  
  219.          }
  220.        //shadow
  221.          _charObjId = cha.getObjectId();
  222. -        _canTeleport = !(cha instanceof L2PcInstance && TvTEvent.isStarted() && TvTEvent.isPlayerParticipant(_charObjId));
  223.         _canTeleport = !(cha instanceof L2PcInstance && TvTEvent.isStarted() && TvTEvent.isPlayerParticipant(_charObjId)
  224.             || afterlifeEvent.isStarted() && afterlifeEvent.isPlayerParticipant(_charObjId)
  225.                 || XFactorEvent.isStarted() && XFactorEvent.isPlayerParticipant(_charObjId)
  226.                 || eridanusEvent.isStarted() && eridanusEvent.isPlayerParticipant(_charObjId));
  227.                    
  228.                        
  229. Index: C:/l2j core/Shadow/java/net/sf/l2j/gameserver/network/clientpackets/Logout.java
  230. ===================================================================
  231. --- C:/l2j core/Shadow/java/net/sf/l2j/gameserver/network/clientpackets/Logout.java (revision 2944)
  232. +++ C:/l2j core/Shadow/java/net/sf/l2j/gameserver/network/clientpackets/Logout.java (working copy)
  233. @@ -27,6 +27,9 @@
  234.  import net.sf.l2j.gameserver.model.L2World;
  235.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  236.  import net.sf.l2j.gameserver.model.entity.TvTEvent;
  237. +import net.sf.l2j.gameserver.model.entity.XFactorEvent;
  238. +import net.sf.l2j.gameserver.model.entity.afterlifeEvent;
  239. +import net.sf.l2j.gameserver.model.entity.eridanusEvent;
  240.  import net.sf.l2j.gameserver.model.olympiad.Olympiad;
  241.  import net.sf.l2j.gameserver.network.SystemMessageId;
  242.  import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
  243. @@ -101,7 +104,11 @@
  244.         {
  245.             player.removeSkill(SkillTable.getInstance().getInfo(4289, 1));
  246.         }
  247. -
  248.         //shadow
  249.        
  250.         afterlifeEvent.onLogout(player);
  251.         XFactorEvent.onLogout(player);
  252.         eridanusEvent.onLogout(player);
  253.         TvTEvent.onLogout(player);
  254. Index: C:/l2j core/Shadow/java/net/sf/l2j/gameserver/model/actor/instance/L2CubicInstance.java
  255. ===================================================================
  256. --- C:/l2j core/Shadow/java/net/sf/l2j/gameserver/model/actor/instance/L2CubicInstance.java (revision 2944)
  257. +++ C:/l2j core/Shadow/java/net/sf/l2j/gameserver/model/actor/instance/L2CubicInstance.java (working copy)
  258. @@ -12,6 +12,7 @@
  259.  
  260.  package net.sf.l2j.gameserver.model.actor.instance;
  261.  
  262.  
  263.  import java.util.List;
  264.  import java.util.concurrent.Future;
  265.  import java.util.logging.Level;
  266. @@ -33,6 +34,12 @@
  267.  import net.sf.l2j.gameserver.model.actor.L2Character;
  268.  import net.sf.l2j.gameserver.model.entity.TvTEvent;
  269.  import net.sf.l2j.gameserver.model.entity.TvTEventTeam;
  270. +import net.sf.l2j.gameserver.model.entity.XFactorEvent;
  271. +import net.sf.l2j.gameserver.model.entity.XFactorEventTeam;
  272.  
  273.  
  274.             if (XFactorEvent.isStarted() && XFactorEvent.isPlayerParticipant(_owner.getObjectId()))
  275.             {
  276.                 XFactorEventTeam enemyTeam = XFactorEvent.getParticipantEnemyTeam(_owner.getObjectId());
  277.                
  278.                 if (ownerTarget.getActingPlayer() != null)
  279.                 {
  280.                     L2PcInstance target = ownerTarget.getActingPlayer();
  281.                     if (enemyTeam.containsPlayer(target.getObjectId()) && !(target.isDead()))
  282.                     {
  283.                         _target = (L2Character) ownerTarget;
  284.                     }
  285.                 }
  286.             return;
  287.             }
  288.  
  289. Index: C:/l2j core/Shadow/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
  290. ===================================================================
  291. --- C:/l2j core/Shadow/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java    (revision 2944)
  292. +++ C:/l2j core/Shadow/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java    (working copy)
  293. @@ -76,6 +76,7 @@
  294.  import net.sf.l2j.gameserver.instancemanager.ItemsOnGroundManager;
  295.  import net.sf.l2j.gameserver.instancemanager.QuestManager;
  296.  import net.sf.l2j.gameserver.instancemanager.SiegeManager;
  297. +import net.sf.l2j.gameserver.instancemanager.TownManager;
  298.  import net.sf.l2j.gameserver.model.BlockList;
  299.  import net.sf.l2j.gameserver.model.FishData;
  300.  import net.sf.l2j.gameserver.model.L2AccessLevel;
  301. @@ -128,6 +129,9 @@
  302.  import net.sf.l2j.gameserver.model.entity.L2Event;
  303.  import net.sf.l2j.gameserver.model.entity.Siege;
  304.  import net.sf.l2j.gameserver.model.entity.TvTEvent;
  305. +import net.sf.l2j.gameserver.model.entity.XFactorEvent;
  306. @@ -138,6 +142,7 @@
  307.  import net.sf.l2j.gameserver.model.quest.Quest;
  308.  import net.sf.l2j.gameserver.model.quest.QuestState;
  309.  import net.sf.l2j.gameserver.model.quest.State;
  310. +import net.sf.l2j.gameserver.model.zone.type.L2TownZone;
  311.  import net.sf.l2j.gameserver.network.L2GameClient;
  312.  import net.sf.l2j.gameserver.network.SystemMessageId;
  313.  import net.sf.l2j.gameserver.network.serverpackets.AbnormalStatusUpdate;
  314. @@ -145,6 +150,7 @@
  315.  import net.sf.l2j.gameserver.network.serverpackets.ChangeWaitType;
  316.  import net.sf.l2j.gameserver.network.serverpackets.CharInfo;
  317.  import net.sf.l2j.gameserver.network.serverpackets.ConfirmDlg;
  318. +import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
  319.  import net.sf.l2j.gameserver.network.serverpackets.EtcStatusUpdate;
  320.  import net.sf.l2j.gameserver.network.serverpackets.ExAutoSoulShot;
  321.  import net.sf.l2j.gameserver.network.serverpackets.ExBrExtraUserInfo;
  322. @@ -495,7 +501,13 @@
  323.  
  324.     public int _XFactorstreaks;
  325.     public boolean _XFactorstate = false;
  326.  
  327. @@ -2181,7 +2193,22 @@
  328.         if (abortAttack) abortAttack();
  329.         broadcastUserInfo();       
  330.  
  331.     //XFactor
  332.    
  333.     public int getXFactorStreaks()
  334.     {
  335.         return _XFactorstreaks;
  336.     }
  337.     //XFactor
  338.    
  339.  
  340. @@ -3771,7 +3801,34 @@
  341.             player.sendPacket(ActionFailed.STATIC_PACKET);
  342.             return;
  343.         }
  344. //XFactor
  345.         if (!XFactorEvent.onAction( player, getObjectId()))
  346.         {
  347.             player.sendPacket(ActionFailed.STATIC_PACKET);
  348.             return;
  349.         }
  350.        
  351.         //Xfactor
  352. @@ -5017,12 +5103,39 @@
  353.             L2PcInstance pk = killer.getActingPlayer();
  354.             //XFactor
  355.             XFactorEvent.onKill(killer, this);
  356.             //XFactor
  357.  
  358. //XFactor
  359.    
  360.             if (XFactorEvent.isStarted() && XFactorEvent.isPlayerParticipant(pk.getObjectId()) && XFactorEvent.isPlayerParticipant(killer.getObjectId()))
  361.             {
  362.                 pk._XFactorstreaks++;
  363.             }
  364.             //XFactor
  365.  
  366.   // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
  367.          sendPacket(new UserInfo(this));
  368. @@ -8090,6 +8265,22 @@
  369.  
  370. //XFactor
  371.         if (XFactorEvent.isStarted() && XFactorEvent.isPlayerParticipant(getObjectId()))
  372.             return true;
  373.         //XFactor
  374. @@ -11645,6 +11864,23 @@
  375.                
  376.                 if (!TvTEvent.isInactive() && TvTEvent.isPlayerParticipant(getObjectId()))
  377.                     TvTEvent.removeParticipant(getObjectId());
  378.   //XFactor
  379.                 if (!XFactorEvent.isInactive() && XFactorEvent.isPlayerParticipant(getObjectId()))
  380.                     XFactorEvent.removeParticipant(getObjectId());
  381.                 //XFactor
  382. @@ -12036,6 +12272,15 @@
  383. //XFactor
  384.                     && !(XFactorEvent.isStarted() && XFactorEvent.isPlayerParticipant(getObjectId()))
  385.                         //XFactor
  386. Index: C:/l2j core/Shadow/java/net/sf/l2j/gameserver/model/entity/XFactorManager.java
  387. ===================================================================
  388. --- C:/l2j core/Shadow/java/net/sf/l2j/gameserver/model/entity/XFactorManager.java  (revision 0)
  389.  C:/l2j core/Shadow/java/net/sf/l2j/gameserver/model/entity/XFactorManager.java (revision 0)
  390. /*
  391.  * This program is free software: you can redistribute it and/or modify it under
  392.  * the terms of the GNU General Public License as published by the Free Software
  393.  * Foundation, either version 3 of the License, or (at your option) any later
  394.  * version.
  395.  *
  396.  * This program is distributed in the hope that it will be useful, but WITHOUT
  397.  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  398.  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  399.  * details.
  400.  *
  401.  * You should have received a copy of the GNU General Public License along with
  402.  * this program. If not, see <http://www.gnu.org/licenses/>.
  403.  */
  404. package net.sf.l2j.gameserver.model.entity;
  405.  
  406. import java.util.Calendar;
  407. import java.util.Collection;
  408. import java.util.concurrent.ScheduledFuture;
  409. import java.util.logging.Logger;
  410.  
  411. import net.sf.l2j.Config;
  412. import net.sf.l2j.gameserver.ThreadPoolManager;
  413. import net.sf.l2j.gameserver.model.L2World;
  414. import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  415. import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
  416.  
  417.  
  418. public class XFactorManager
  419. {
  420.     protected static final Logger _log = Logger.getLogger(XFactorManager.class.getName());
  421.  
  422.     private static XFactorManager _instance = null;
  423.    
  424.    
  425.     private XFactorStartTask _task;
  426.  
  427.     Collection<L2PcInstance> myplayers = L2World.getInstance().getAllPlayers().values();
  428.  
  429.     private XFactorManager()
  430.     {
  431.         if (Config.XFactor_EVENT_ENABLED)
  432.         {
  433.             XFactorEvent.init();
  434.            
  435.             this.scheduleEventStart();
  436.             _log.info("XFactorEventEngine[XFactorManager.XFactorManager()]: Started.");
  437.         }
  438.         else
  439.         {
  440.             _log.info("XFactorEventEngine[XFactorManager.XFactorManager()]: Engine is disabled.");
  441.         }
  442.     }
  443.    
  444.  
  445.     public static XFactorManager getInstance()
  446.     {
  447.         return _instance == null ? (_instance = new XFactorManager()) : _instance;
  448.     }
  449.    
  450.  
  451.     public void scheduleEventStart()
  452.     {
  453.         try {
  454.             Calendar currentTime = Calendar.getInstance();
  455.             Calendar nextStartTime = null;
  456.             Calendar testStartTime = null;
  457.             for (String timeOfDay : Config.XFactor_EVENT_INTERVAL) {
  458.            
  459.                 testStartTime = Calendar.getInstance();
  460.                 testStartTime.setLenient(true);
  461.                 String[] splitTimeOfDay = timeOfDay.split(":");
  462.                 testStartTime.set(Calendar.HOUR_OF_DAY, Integer.parseInt(splitTimeOfDay[0]));
  463.                 testStartTime.set(Calendar.MINUTE, Integer.parseInt(splitTimeOfDay[1]));
  464.            
  465.                 if (testStartTime.getTimeInMillis() < currentTime.getTimeInMillis())
  466.                 {
  467.                     testStartTime.add(Calendar.DAY_OF_MONTH, 1);
  468.                 }
  469.            
  470.                 if (nextStartTime == null || testStartTime.getTimeInMillis() < nextStartTime.getTimeInMillis())
  471.                 {
  472.                     nextStartTime = testStartTime;
  473.                 }
  474.             }
  475.             _task = new XFactorStartTask(nextStartTime.getTimeInMillis());
  476.             ThreadPoolManager.getInstance().executeTask(_task);
  477.         }
  478.         catch (Exception e)
  479.         {
  480.             _log.warning("XFactorEventEngine[XFactorManager.scheduleEventStart()]: Error figuring out a start time. Check XFactorEventInterval in config file.");
  481.         }
  482.     }
  483.    
  484.    
  485.     public void startReg()
  486.     {
  487.         if (!XFactorEvent.startParticipation())
  488.         {
  489.             for (L2PcInstance onlinePlayer : myplayers)
  490.             {
  491.                 CreatureSay message = new CreatureSay(0, 15, "XFactor Event", "Event was Shut Down!");
  492.                 onlinePlayer.sendPacket(message);
  493.             }
  494.             _log.warning("XFactorEventEngine[XFactorManager.run()]: Error spawning event npc for participation.");
  495.            
  496.             this.scheduleEventStart();
  497.         }
  498.         else
  499.         {
  500.             for (L2PcInstance onlinePlayer : myplayers)
  501.             {
  502.                 CreatureSay message = new CreatureSay(0, 15, "XFactor Event", "Validation Period Started! It lasts for " + Config.XFactor_EVENT_PARTICIPATION_TIME + " minute(s).");
  503.                 onlinePlayer.sendPacket(message);
  504.             }
  505.            
  506.             // schedule registration end
  507.             _task.setStartTime(System.currentTimeMillis() + 60000L * Config.XFactor_EVENT_PARTICIPATION_TIME);
  508.             ThreadPoolManager.getInstance().executeTask(_task);
  509.         }
  510.     }
  511.    
  512.    
  513.     public void startEvent()
  514.     {
  515.         if (!XFactorEvent.startFight())
  516.         {
  517.             for (L2PcInstance onlinePlayer : myplayers)
  518.             {
  519.                 CreatureSay message = new CreatureSay(0, 15, "XFactor Event", "Event Is Shutting down! Players missed the sign up period!");
  520.                 onlinePlayer.sendPacket(message);
  521.             }
  522.             _log.info("XFactorEventEngine[XFactorManager.run()]: Lack of registration, abort event.");
  523.            
  524.             this.scheduleEventStart();
  525.         }
  526.         else
  527.         {
  528.             _task.setStartTime(System.currentTimeMillis() + 60000L * Config.XFactor_EVENT_RUNNING_TIME);
  529.             ThreadPoolManager.getInstance().executeTask(_task);
  530.             eventscheduler(1 * 901 * 1000); //executed once validation ends
  531.            
  532.         }
  533.     }
  534.    
  535.     private void eventscheduler(long l2reaction)
  536.     {
  537.    
  538.         long l2reactionstartimer = System.currentTimeMillis();
  539.         int countdown = (int) (l2reaction / 1000);
  540.  
  541.         while (l2reactionstartimer + l2reaction > System.currentTimeMillis())
  542.         {
  543.             countdown--;
  544.  
  545.            
  546.             {
  547.                 switch (countdown)
  548.                 {
  549.                     case 900: //start of first prep period
  550.                     {
  551.                         XFactorEvent.eventstatepos(); //enables team state
  552.                         XFactorEvent.teleporteams();// ports to prep period
  553.                         CreatureSay message = new CreatureSay(0, 15, "XFactor Event", "2 minute(s) prep for the first round.");
  554.                     XFactorEvent.sendPacket(message);
  555.                     }
  556.                     break;
  557.                     case 840: //1 minute first prep period
  558.                     {
  559.                    
  560.                         CreatureSay message = new CreatureSay(0, 15, "XFactor Event", "1 minute(s) prep for the first round.");
  561.                         XFactorEvent.sendPacket(message);
  562.                     }
  563.                     break;
  564.                 case 780: //start of first round
  565.                 {
  566.                 XFactorEvent.setstreaknull(); //restart point
  567.                     XFactorEvent.eventstateneg(); //disables team state
  568.                     XFactorEvent.teleporteamsinside(); //port inside
  569.                     CreatureSay message = new CreatureSay(0, 15, "XFactor Event", "First Round Started! 3 minute(s) left.");
  570.                     XFactorEvent.sendPacket(message);
  571.                 }
  572.                 break;
  573.                 case 720: //first round 2 minutes left
  574.                 {
  575.                
  576.                     CreatureSay message = new CreatureSay(0, 15, "XFactor Event", "First Round! 2 minute(s) left.");
  577.                     XFactorEvent.sendPacket(message);
  578.                 }
  579.                 break;
  580.                 case 660: //first round 1 minutes left
  581.                 {
  582.                     CreatureSay message = new CreatureSay(0, 15, "XFactor Event", "First Round! 1 minute(s) left.");
  583.                     XFactorEvent.sendPacket(message);
  584.                 }
  585.                 break;
  586.                 case 600: //start of second prep period
  587.                 {
  588. XFactorEvent.round1();
  589.                     XFactorEvent.eventstatepos(); //enables team state
  590.                     XFactorEvent.recoveryteamport();// ports to prep period
  591.                     CreatureSay message = new CreatureSay(0, 15, "XFactor Event", "2 minute(s) prep for the second round.");
  592.                     XFactorEvent.sendPacket(message);
  593.                 }
  594.                 break;
  595.                 case 540:
  596.                 {
  597.                     CreatureSay message = new CreatureSay(0, 15, "XFactor Event", "1 minute(s) prep for the second round.");
  598.                     XFactorEvent.sendPacket(message);
  599.                 }
  600.                 break;
  601.                 case 480: //start of second round
  602.                 {
  603.                     XFactorEvent.setstreaknull(); //restart point
  604.                     XFactorEvent.eventstateneg(); //disables team state
  605.                     XFactorEvent.teleporteamsinside();//port inside
  606.                     CreatureSay message = new CreatureSay(0, 15, "XFactor Event", "Second Round Started! 3 minute(s) left.");
  607.                     XFactorEvent.sendPacket(message);
  608.                 }
  609.                 break;
  610.                 case 420:
  611.                 {
  612.                     CreatureSay message = new CreatureSay(0, 15, "XFactor Event", "Second Round! 2 minute(s) left.");
  613.                     XFactorEvent.sendPacket(message);
  614.                 }
  615.                 break;
  616.                 case 360:
  617.                 {
  618.                     CreatureSay message = new CreatureSay(0, 15, "XFactor Event", "Second Round! 1 minute(s) left.");
  619.                     XFactorEvent.sendPacket(message);
  620.                 }
  621.                 break;
  622.                 case 300: //start of third prep period
  623.                 {
  624. XFactorEvent.round2();
  625.                     XFactorEvent.eventstatepos(); //enables team state
  626.                     XFactorEvent.recoveryteamport();// ports to prep period
  627.                     CreatureSay message = new CreatureSay(0, 15, "XFactor Event", "2 minute(s) prep for the third round.");
  628.                     XFactorEvent.sendPacket(message);
  629.                 }
  630.                 break;
  631.                 case 240:
  632.                 {
  633.                     CreatureSay message = new CreatureSay(0, 15, "XFactor Event", "1 minute(s) prep for the third round.");
  634.                     XFactorEvent.sendPacket(message);
  635.                 }
  636.                 break;
  637.                 case 180: //start of third round
  638.                 {
  639.                     XFactorEvent.setstreaknull(); //restart point
  640.                     XFactorEvent.eventstateneg(); //disables team state
  641.                     XFactorEvent.teleporteamsinside();//port inside
  642.                     CreatureSay message = new CreatureSay(0, 15, "XFactor Event", "Third Round started! 3 minute(s) left.");
  643.                     XFactorEvent.sendPacket(message);
  644.                 }
  645.                 break;
  646.                 case 120:
  647.                 {
  648.                     CreatureSay message = new CreatureSay(0, 15, "XFactor Event", "Third Round! 2 minute(s) left.");
  649.                     XFactorEvent.sendPacket(message);
  650.                 }
  651.                 break;
  652.                 case 60:
  653.                 {
  654.                     CreatureSay message = new CreatureSay(0, 15, "XFactor Event", "Third Round! 1 minute(s) left.");
  655.                     XFactorEvent.sendPacket(message);
  656.                 }
  657.                 break;
  658.                
  659.                 }
  660.                 if (countdown == 0)
  661.                 {
  662.            
  663.             //ends event and catches the third round winner
  664.                 }
  665.                
  666.             }
  667.  
  668.             long startl2reactionsecondtimer = System.currentTimeMillis();
  669.  
  670.             while (startl2reactionsecondtimer + 1000 > System.currentTimeMillis())
  671.             {
  672.                 try
  673.                 {
  674.                     Thread.sleep(1);
  675.                    
  676.                 }
  677.                 catch (InterruptedException ie)
  678.                 {
  679.                 }
  680.             }
  681.         }
  682.     }
  683.    
  684.    
  685.     public void endEvent()
  686.     {
  687.         CreatureSay message = new CreatureSay(0, 15, "XFactor", XFactorEvent.validoutcome());
  688.         XFactorEvent.sendPacket(message);
  689.         XFactorEvent.stopFight();
  690.        
  691.         this.scheduleEventStart();
  692.     }
  693.  
  694.     public void skipDelay()
  695.     {
  696.         if (_task.nextRun.cancel(false))
  697.         {
  698.             _task.setStartTime(System.currentTimeMillis());
  699.             ThreadPoolManager.getInstance().executeTask(_task);
  700.         }
  701.     }
  702.  
  703.    
  704.     class XFactorStartTask implements Runnable
  705.     {
  706.         private long _startTime;
  707.         public ScheduledFuture<?> nextRun;
  708.        
  709.         public XFactorStartTask(long startTime)
  710.         {
  711.             _startTime = startTime;
  712.         }
  713.        
  714.         public void setStartTime(long startTime)
  715.         {
  716.             _startTime = startTime;
  717.         }
  718.        
  719.    
  720.         public void run()
  721.         {
  722.             int delay = (int) Math.round((_startTime - System.currentTimeMillis()) / 1000.0);
  723.            
  724.             if (delay > 0)
  725.             {
  726.                 this.announce(delay);
  727.                             }
  728.            
  729.             int nextMsg = 0;
  730.             if (delay > 3600)
  731.             {
  732.                 nextMsg = delay - 3600;
  733.             }
  734.             else if (delay > 1800)
  735.             {
  736.                 nextMsg = delay - 1800;
  737.             }
  738.             else if (delay > 900)
  739.             {
  740.                 nextMsg = delay - 900;
  741.             }
  742.             else if (delay > 600)
  743.             {
  744.                 nextMsg = delay - 600;
  745.             }
  746.                             else if (delay > 300)
  747.             {
  748.                 nextMsg = delay - 300;
  749.             }
  750.             else if (delay > 60)
  751.             {
  752.                 nextMsg = delay - 60;
  753.             }
  754.             else if (delay > 5)
  755.             {
  756.                 nextMsg = delay - 5;
  757.             }
  758.             else if (delay > 0)
  759.             {
  760.                 nextMsg = delay;
  761.             }
  762.             else
  763.             {
  764.                 // start
  765.                 if (XFactorEvent.isInactive())
  766.                 {
  767.                     XFactorManager.this.startReg();
  768.                 }
  769.                 else if (XFactorEvent.isParticipating())
  770.                 {
  771.                     XFactorManager.this.startEvent();
  772.                 }
  773.                 else
  774.                 {
  775.                     XFactorManager.this.endEvent();
  776.                 }
  777.             }
  778.            
  779.             if (delay > 0)
  780.             {
  781.                 nextRun = ThreadPoolManager.getInstance().scheduleGeneral(this, nextMsg*1000);
  782.             }
  783.         }
  784.        
  785.         private void announce(long time)
  786.         {
  787.             if (time >= 3600 && time % 3600 == 0)
  788.             {
  789.                 if (XFactorEvent.isParticipating())
  790.                 {
  791.                     for (L2PcInstance onlinePlayer : myplayers)
  792.                     {
  793.                         CreatureSay message = new CreatureSay(0, 15, "XFactor Event", ""+ (time / 60 / 60) + " hour(s) until validation is over");
  794.                         onlinePlayer.sendPacket(message);
  795.                     }
  796.                    
  797.                 }
  798.                
  799.             }
  800.             else if (time >= 60)
  801.             {
  802.                 if (XFactorEvent.isParticipating())
  803.                 {
  804.                     for (L2PcInstance onlinePlayer : myplayers)
  805.                     {
  806.                         CreatureSay message = new CreatureSay(0, 15, "XFactor Event", ""+ (time / 60) + " minute(s) until validation is over!");
  807.                         onlinePlayer.sendPacket(message);
  808.                     }
  809.                 }
  810.                
  811.             }
  812.             else
  813.             {
  814.                 if (XFactorEvent.isParticipating())
  815.                 {
  816.                     for (L2PcInstance onlinePlayer : myplayers)
  817.                     {
  818.                         CreatureSay message = new CreatureSay(0, 15, "XFactor Event", ""+ time + " second(s) until validation is over!");
  819.                         onlinePlayer.sendPacket(message);
  820.                     }
  821.                 }
  822.                
  823.             }
  824.         }
  825.     }
  826. }
  827. Index: C:/l2j core/Shadow/java/net/sf/l2j/gameserver/model/entity/XFactorEventTeleporter.java
  828. ===================================================================
  829. --- C:/l2j core/Shadow/java/net/sf/l2j/gameserver/model/entity/XFactorEventTeleporter.java  (revision 0)
  830. +++ C:/l2j core/Shadow/java/net/sf/l2j/gameserver/model/entity/XFactorEventTeleporter.java  (revision 0)
  831. @@ -0,0 +1,98 @@
  832. /*
  833.  * This program is free software: you can redistribute it and/or modify it under
  834.  * the terms of the GNU General Public License as published by the Free Software
  835.  * Foundation, either version 3 of the License, or (at your option) any later
  836.  * version.
  837.  *
  838.  * This program is distributed in the hope that it will be useful, but WITHOUT
  839.  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  840.  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  841.  * details.
  842.  *
  843.  * You should have received a copy of the GNU General Public License along with
  844.  * this program. If not, see <http://www.gnu.org/licenses/>.
  845.  */
  846. package net.sf.l2j.gameserver.model.entity;
  847.  
  848. import net.sf.l2j.Config;
  849. import net.sf.l2j.gameserver.ThreadPoolManager;
  850. import net.sf.l2j.gameserver.datatables.SkillTable;
  851. import net.sf.l2j.gameserver.model.L2Skill;
  852. import net.sf.l2j.gameserver.model.actor.L2Summon;
  853. import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  854. import net.sf.l2j.util.Rnd;
  855.  
  856. public class XFactorEventTeleporter implements Runnable
  857. {
  858.  
  859.     private L2PcInstance _playerInstance = null;
  860.    
  861.     private int[] _coordinates = new int[3];
  862.    
  863.     private boolean _adminRemove = false;
  864.    
  865.    
  866.     public XFactorEventTeleporter(L2PcInstance playerInstance, int[] coordinates, boolean fastSchedule, boolean adminRemove)
  867.     {
  868.         _playerInstance = playerInstance;
  869.         _coordinates = coordinates;
  870.         _adminRemove = adminRemove;
  871.        
  872.         long delay = (XFactorEvent.isStarted() ? Config.XFactor_EVENT_RESPAWN_TELEPORT_DELAY : Config.XFactor_EVENT_START_LEAVE_TELEPORT_DELAY) * 1000;
  873.        
  874.         ThreadPoolManager.getInstance().scheduleGeneral(this, fastSchedule ? 0 : delay);
  875.     }
  876.    
  877.  
  878.     public void run()
  879.     {
  880.         if (_playerInstance == null)
  881.         {
  882.             return;
  883.         }
  884.        
  885.         L2Summon summon = _playerInstance.getPet();
  886.        
  887.         if (summon != null)
  888.         {
  889.             summon.unSummon(_playerInstance);
  890.         }
  891.        
  892.    
  893.  
  894.         L2Skill noblesse = SkillTable.getInstance().getInfo(1323, 1);
  895.         noblesse.getEffects(_playerInstance, _playerInstance);
  896.         _playerInstance.doRevive();
  897.         _playerInstance.setCurrentCp(_playerInstance.getMaxCp());
  898.         _playerInstance.setCurrentHp(_playerInstance.getMaxHp());
  899.         _playerInstance.setCurrentMp(_playerInstance.getMaxMp());
  900.         _playerInstance.setInstanceId(0);
  901.         /*if (XFactorEvent.isStarted() || XFactorEvent.isStarting())
  902.         {
  903.         _playerInstance.teleToLocation( _coordinates[ 0 ] + Rnd.get(1150)-50, _coordinates[ 1 ] + Rnd.get(1150)-50, _coordinates[ 2 ], false );
  904.         }
  905.         */
  906.    
  907.         if (XFactorEvent.isInactivating() || XFactorEvent.isRewarding() || XFactorEvent.isInactive())
  908.         {
  909.             _playerInstance.teleToLocation( _coordinates[ 0 ] + Rnd.get(101)-50, _coordinates[ 1 ] + Rnd.get(101)-50, _coordinates[ 2 ], false );
  910.         }
  911.         if (_playerInstance._XFactorstate == true)
  912.         {
  913.             _playerInstance.teleToLocation(45451 + Rnd.get(120)-50, 48530 + Rnd.get(120)-50, -3059, false );
  914.             _playerInstance.sendMessage("porting back to base due to a preperation period.");
  915.         }
  916.         if (XFactorEvent.isStarted() && !_adminRemove)
  917.         {
  918.             _playerInstance.setTeam(1);
  919.         }
  920.         else
  921.         {
  922.      _playerInstance.setTeam(0);
  923.         }
  924.    
  925.        
  926.         _playerInstance.broadcastStatusUpdate();
  927.         _playerInstance.broadcastUserInfo();
  928.     }
  929. }
  930. Index: C:/l2j core/Shadow/java/net/sf/l2j/gameserver/model/entity/XFactorEventTeam.java
  931. ===================================================================
  932. --- C:/l2j core/Shadow/java/net/sf/l2j/gameserver/model/entity/XFactorEventTeam.java    (revision 0)
  933. +++ C:/l2j core/Shadow/java/net/sf/l2j/gameserver/model/entity/XFactorEventTeam.java    (revision 0)
  934. @@ -0,0 +1,137 @@
  935. /*
  936.  * This program is free software: you can redistribute it and/or modify it under
  937.  * the terms of the GNU General Public License as published by the Free Software
  938.  * Foundation, either version 3 of the License, or (at your option) any later
  939.  * version.
  940.  *
  941.  * This program is distributed in the hope that it will be useful, but WITHOUT
  942.  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  943.  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  944.  * details.
  945.  *
  946.  * You should have received a copy of the GNU General Public License along with
  947.  * this program. If not, see <http://www.gnu.org/licenses/>.
  948.  */
  949. package net.sf.l2j.gameserver.model.entity;
  950.  
  951. import java.util.Map;
  952.  
  953. import javolution.util.FastMap;
  954. import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  955.  
  956.  
  957. public class XFactorEventTeam
  958. {
  959.  
  960.     private String _name;
  961.    
  962.     private int[] _coordinates = new int[3];
  963.  
  964.     private short _points;
  965.  
  966.     private Map<Integer, L2PcInstance> _participatedPlayers = new FastMap<Integer, L2PcInstance>();
  967.    
  968.  
  969.     public XFactorEventTeam(String name, int[] coordinates)
  970.     {
  971.         _name = name;
  972.         _coordinates = coordinates;
  973.         _points = 0;
  974.     }
  975.    
  976.  
  977.     public boolean addPlayer(L2PcInstance playerInstance)
  978.     {
  979.         if (playerInstance == null)
  980.         {
  981.             return false;
  982.         }
  983.        
  984.         synchronized (_participatedPlayers)
  985.         {
  986.             _participatedPlayers.put(playerInstance.getObjectId(), playerInstance);
  987.         }
  988.        
  989.         return true;
  990.     }
  991.    
  992.    
  993.     public void removePlayer(int playerObjectId)
  994.     {
  995.         synchronized (_participatedPlayers)
  996.         {
  997.             _participatedPlayers.remove(playerObjectId);
  998.         }
  999.     }
  1000.    
  1001.    
  1002.     public void increasePoints()
  1003.     {
  1004.         ++_points;
  1005.     }
  1006.    
  1007.    
  1008.     public void cleanMe()
  1009.     {
  1010.         _participatedPlayers.clear();
  1011.         _participatedPlayers = new FastMap<Integer, L2PcInstance>();
  1012.         _points = 0;
  1013.     }
  1014.    
  1015.    
  1016.     public boolean containsPlayer(int playerObjectId)
  1017.     {
  1018.         boolean containsPlayer;
  1019.        
  1020.         synchronized (_participatedPlayers)
  1021.         {
  1022.             containsPlayer = _participatedPlayers.containsKey(playerObjectId);
  1023.         }
  1024.        
  1025.         return containsPlayer;
  1026.     }
  1027.    
  1028.    
  1029.     public String getName()
  1030.     {
  1031.         return _name;
  1032.     }
  1033.    
  1034.    
  1035.     public int[] getCoordinates()
  1036.     {
  1037.         return _coordinates;
  1038.     }
  1039.    
  1040.    
  1041.     public short getPoints()
  1042.     {
  1043.         return _points;
  1044.     }
  1045.    
  1046.    
  1047.     public Map<Integer, L2PcInstance> getParticipatedPlayers()
  1048.     {
  1049.         Map<Integer, L2PcInstance> participatedPlayers = null;
  1050.        
  1051.         synchronized (_participatedPlayers)
  1052.         {
  1053.             participatedPlayers = _participatedPlayers;
  1054.         }
  1055.        
  1056.         return participatedPlayers;
  1057.     }
  1058.    
  1059.    
  1060.     public int getParticipatedPlayerCount()
  1061.     {
  1062.         int participatedPlayerCount;
  1063.        
  1064.         synchronized (_participatedPlayers)
  1065.         {
  1066.             participatedPlayerCount = _participatedPlayers.size();
  1067.         }
  1068.        
  1069.         return participatedPlayerCount;
  1070.     }
  1071. }
  1072. Index: C:/l2j core/Shadow/java/net/sf/l2j/gameserver/model/olympiad/Olympiad.java
  1073. ===================================================================
  1074. --- C:/l2j core/Shadow/java/net/sf/l2j/gameserver/model/olympiad/Olympiad.java  (revision 2944)
  1075. +++ C:/l2j core/Shadow/java/net/sf/l2j/gameserver/model/olympiad/Olympiad.java  (working copy)
  1076. import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  1077.  import net.sf.l2j.gameserver.model.entity.Hero;
  1078.  import net.sf.l2j.gameserver.model.entity.TvTEvent;
  1079. +import net.sf.l2j.gameserver.model.entity.XFactorEvent;
  1080.  import net.sf.l2j.gameserver.network.SystemMessageId;
  1081.  import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
  1082.  import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
  1083. @@ -870,13 +873,38 @@
  1084.             spectator.sendPacket(new SystemMessage(SystemMessageId.WHILE_YOU_ARE_ON_THE_WAITING_LIST_YOU_ARE_NOT_ALLOWED_TO_WATCH_THE_GAME));
  1085.             return;
  1086.         }
  1087. if (!XFactorEvent.isInactive()
  1088.                 && XFactorEvent.isPlayerParticipant(spectator.getObjectId()))
  1089.         {
  1090.             spectator.sendMessage("You can not observe games while registered for XFactor");
  1091.             return;
  1092.         }
  1093.         //Xfactor
  1094. ndex: C:/l2j core/Shadow/java/net/sf/l2j/gameserver/skills/l2skills/L2SkillMount.java
  1095. ===================================================================
  1096. --- C:/l2j core/Shadow/java/net/sf/l2j/gameserver/skills/l2skills/L2SkillMount.java (revision 2944)
  1097. +++ C:/l2j core/Shadow/java/net/sf/l2j/gameserver/skills/l2skills/L2SkillMount.java (working copy)
  1098. @@ -19,6 +19,9 @@
  1099. import net.sf.l2j.gameserver.model.actor.L2Character;
  1100.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  1101.  import net.sf.l2j.gameserver.model.entity.TvTEvent;
  1102. +import net.sf.l2j.gameserver.model.entity.XFactorEvent;
  1103.  import net.sf.l2j.gameserver.network.SystemMessageId;
  1104.  import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
  1105.  import net.sf.l2j.gameserver.templates.StatsSet;
  1106. @@ -43,7 +46,13 @@
  1107. if (!TvTEvent.onItemSummon(caster.getObjectId()))
  1108.             return;
  1109.         if (!XFactorEvent.onItemSummon(caster.getObjectId()))
  1110.             return;
  1111. Index: C:/l2j core/Shadow/java/net/sf/l2j/gameserver/GameServer.java
  1112. ===================================================================
  1113. --- C:/l2j core/Shadow/java/net/sf/l2j/gameserver/GameServer.java   (revision 2944)
  1114. +++ C:/l2j core/Shadow/java/net/sf/l2j/gameserver/GameServer.java   (working copy)
  1115. @@ -101,6 +101,9 @@
  1116.  import net.sf.l2j.gameserver.model.L2World;
  1117.  import net.sf.l2j.gameserver.model.entity.Hero;
  1118.  import net.sf.l2j.gameserver.model.entity.TvTManager;
  1119. +import net.sf.l2j.gameserver.model.entity.XFactorManager;
  1120.  import net.sf.l2j.gameserver.model.olympiad.Olympiad;
  1121.  import net.sf.l2j.gameserver.network.L2GameClient;
  1122.  import net.sf.l2j.gameserver.network.L2GamePacketHandler;
  1123. @@ -451,7 +454,11 @@
  1124.  
  1125. {
  1126.             _log.log(Level.WARNING, "DynamicExtension could not be loaded and initialized", ex);
  1127.         }
  1128. +       XFactorManager.getInstance();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement