Advertisement
VANPER

Party Farm

Feb 9th, 2020
1,941
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 18.50 KB | None | 0 0
  1. Index: java/net/sf/l2j/Config.java
  2. ===================================================================
  3. --- java/net/sf/l2j/Config.java (revision 84)
  4. +++ java/net/sf/l2j/Config.java (working copy)
  5.  
  6. -   public static final String GEOENGINE_FILE = "./config/geoengine.properties";
  7. +   public static final String GEOENGINE_FILE = "./config/geoengine.properties";
  8. +   public static final String PARTYFARM_FILE = "./config/Eventos/PartyFarm.properties";
  9.  
  10.  
  11.  
  12. +   /**
  13. +   * Loads Ptfarm settings.
  14. +   */
  15. +   private static final void loadPartyFarm()
  16. +   {
  17. +       final ExProperties PartyFarm = initProperties(PARTYFARM_FILE);
  18. +  
  19. +       NPC_LIST = PartyFarm.getProperty("NpcListPartyDrop", "22125,22126");
  20. +  
  21. +       PARTY_FARMANNONCER = PartyFarm.getProperty("TownAnnoncer", "Abandoned Camp");
  22. +      
  23. +       CHANCE_PARTY_DROP = Integer.parseInt(PartyFarm.getProperty("ChanceForDrops", "100"));
  24. +  
  25. +       String[] NpcList = NPC_LIST.split(",");
  26. +       NPC_LIST_SET = new int[NpcList.length];
  27. +       for (int i = 0; i < NpcList.length; i++)
  28. +           NPC_LIST_SET[i] = Integer.parseInt(NpcList[i]);
  29. +  
  30. +       String PARTY_DROP_REWARD_VALUE = PartyFarm.getProperty("PartyDropReward", "57,100000000;");
  31. +       String[] party_drop_reward_splitted_1 = PARTY_DROP_REWARD_VALUE.split(";");
  32. +       for (String i : party_drop_reward_splitted_1)
  33. +       {
  34. +           String[] party_drop_reward_splitted_2 = i.split(",");
  35. +           PARTY_DROP_REWARDS.put(Integer.parseInt(party_drop_reward_splitted_2[1]), Integer.parseInt(party_drop_reward_splitted_2[0]));
  36. +       }
  37. +  
  38. +       PARTY_FARM_MONSTER_DALAY = Integer.parseInt(PartyFarm.getProperty("MonsterDelay", "10"));
  39. +       PARTY_FARM_BY_TIME_OF_DAY = Boolean.parseBoolean(PartyFarm.getProperty("PartyFarmEventEnabled", "false"));
  40. +       START_PARTY = Boolean.parseBoolean(PartyFarm.getProperty("StartSpawnPartyFarm", "false"));
  41. +       NPC_SERVER_DELAY = PartyFarm.getProperty("npcServerDelay", 70);
  42. +  
  43. +       EVENT_BEST_FARM_TIME = Integer.parseInt(PartyFarm.getProperty("EventBestFarmTime", "1"));
  44. +       EVENT_BEST_FARM_INTERVAL_BY_TIME_OF_DAY = PartyFarm.getProperty("BestFarmStartTime", "20:00").split(",");
  45. +       PARTY_MESSAGE_ENABLED = Boolean.parseBoolean(PartyFarm.getProperty("ScreenPartyMessageEnable", "false"));
  46. +       PARTY_FARM_MESSAGE_TEXT = PartyFarm.getProperty("ScreenPartyFarmMessageText", "Welcome to l2j server!");
  47. +       PARTY_FARM_MESSAGE_TIME = Integer.parseInt(PartyFarm.getProperty("ScreenPartyFarmMessageTime", "10")) * 1000;
  48. +  
  49. +       String[] monsterLocs2 = PartyFarm.getProperty("MonsterLoc", "").split(";");
  50. +       String[] locSplit3 = null;
  51. +  
  52. +       monsterId = Integer.parseInt(PartyFarm.getProperty("MonsterId", "1"));
  53. +       PARTY_FARM_TITLE = PartyFarm.getProperty("PartyFarmTitle", "");
  54. +       PARTY_FARM_REWARD_ID = PartyFarm.getProperty("PartyFarmRewardID", 57);
  55. +       PARTY_FARM_REWARD_COUNT = PartyFarm.getProperty("PartyFarmRewardCount", 100);
  56. +  
  57. +       MONSTER_LOCS_COUNT = monsterLocs2.length;
  58. +       MONSTER_LOCS = new int[MONSTER_LOCS_COUNT][3];
  59. +       int g;
  60. +       for (int e = 0; e < MONSTER_LOCS_COUNT; e++)
  61. +       {
  62. +           locSplit3 = monsterLocs2[e].split(",");
  63. +           for (g = 0; g < 3; g++)
  64. +               MONSTER_LOCS[e][g] = Integer.parseInt(locSplit3[g].trim());
  65. +       }
  66. +  
  67. +   }
  68. +  
  69.  
  70.  
  71. Index: gameserver\config\eventos/PartyFarm.propertis
  72. ===================================================================
  73. --- gameserver\config\eventos/PartyFarm.propertis   (revision 84)
  74. +++ gameserver\config\eventos/PartyFarm.propertis   (working copy)
  75. @@ -1281,6 +1281,10 @@
  76.  
  77. +   #=========================================================
  78. +   #                  PARTY FARM ACCONCER Town
  79. +   #=========================================================
  80. +   TownAnnoncer = Abandoned Camp / Primavel Isle
  81. +  
  82. +   #=========================================================                  
  83. +   # Tempo em Segundos para o MOB aparecer apos ser morto
  84. +   # Default: 300 (5 minutos)
  85. +   MonsterDelay = 600
  86. +  
  87. +   # Id do Mob
  88. +   MonsterId = 88000
  89. +  
  90. +   # Tempo para aparecer os MOBS
  91. +   npcServerDelay = 0
  92. +  
  93. +   #Ativar o Party Farm Event por tempo igual TvT
  94. +   PartyFarmEventEnabled = true
  95. +  
  96. +   # Iniciar party farm ao ligar o server
  97. +   StartSpawnPartyFarm = False
  98. +  
  99. +   #=========================================================
  100. +   #                CONFIG START TIME EVENT            
  101. +   #=========================================================
  102. +   #minutos de evento
  103. +   # PartyFarmEventEnabled=11:00,15:00,19:00,23:00,
  104. +   EventBestFarmTime = 30
  105. +   BestFarmStartTime = 06:00,07:00,08:00,09:00,10:00,11:00,12:00,13:00,14:00,15:00,16:00,17:00,00:01,01:00,02:00,03:00,04:00,05:00,
  106. +  
  107. +   # Show screen Party message on character login
  108. +   # Default: False
  109. +   ScreenPartyMessageEnable = True
  110. +  
  111. +   # Screen Party Farm message text
  112. +   ScreenPartyFarmMessageText = Event Party Farm Teleport now.
  113. +   # Show screen PartyFarm message for x seconds.
  114. +   ScreenPartyFarmMessageTime = 6
  115. +  
  116. +   MonsterLoc = 10565, -23681, -3656;\
  117. +   9119,   -23577, -3716;\
  118. +   7392,   -20364, -3552;\
  119. +   7506,   -18819, -3674;\
  120. +   5955,   -20312, -3522;\
  121. +   4675,   -19989, -3548;\
  122. +   4348,   -18389, -3653;\
  123. +   2838,   -17173, -3574;\
  124. +   4309,   -15651, -3588;\
  125. +   -50324, 137542, -2871;\
  126. +   -49694, 138843, -2919;\
  127. +   -48580, 139801, -2930;\
  128. +   -51061, 139072, -2925;\
  129. +   -52648, 139600, -2937;\
  130. +   -52084, 137211, -2884;\
  131. +   -51885, 140437, -2859;\
  132. +   -51313, 141965, -2878;\
  133. +   -53470, 141986, -2858;\
  134. +   -54383, 139210, -2906;\
  135. +   -55321, 137909, -2911;\
  136. +   -57082, 138361, -2714;\
  137. +   -57845, 140766, -2649;\
  138. +   -56629, 143361, -2566;\
  139. +   -59379, 139309, -2466;\
  140. +   -60082, 137623, -2327;\
  141. +   -58639, 135770, -2457;\
  142. +   -56714, 135084, -2433;\
  143. +   -56715, 136673, -2789;\
  144. +   -56264, 141358, -2628;\
  145. +   -54986, 142629, -2839;\
  146. +   -53362, 143202, -2892;\
  147. +   -52410, 141770, -2925;\
  148. +   -50588, 143081, -2895;\
  149. +   -51088, 144450, -2893;\
  150. +   -50856, 145485, -2812;\
  151. +   -52172, 145466, -2820;\
  152. +   -54007, 145158, -2875;\
  153. +   -54325, 146502, -2877;\
  154. +   -52890, 144172, -2908;\
  155. +   -54113, 137140, -2752;\
  156. +   -51976, 138979, -2952;\
  157. +   -53666, 139817, -2857;\
  158. +   -52753, 137986, -2921;\
  159. +   -50593, 140423, -2855;\
  160. +   -51996, 143661, -2892;
  161.  
  162. Index: net.sf.l2j.gameserver.network.clientpackets;EnterWorld.java
  163. ===================================================================
  164. --- net.sf.l2j.gameserver.network.clientpackets;EnterWorld.java (revision 84)
  165. +++ net.sf.l2j.gameserver.network.clientpackets;EnterWorld.java (working copy)
  166. @@ -1281,6 +1281,10 @@
  167.  
  168. +   /import l2jban.events.PartyFarm;
  169.  
  170. -   AnnouncementData.getInstance().showAnnouncements(player, false);
  171. +   AnnouncementData.getInstance().showAnnouncements(player, false);
  172.  
  173. +       if (PartyFarm.is_started() && Config.PARTY_FARM_BY_TIME_OF_DAY)
  174. +           player.sendPacket(new CreatureSay(0, 3, ".", "" + Config.PARTY_FARM_MESSAGE_TEXT + " " + Config.PARTY_FARMANNONCER + " :."));  
  175.  
  176.  
  177.  
  178. ===================================================================
  179. --- java/net/sf/l2j/gameserver/gameserver.java  (revision 84)
  180. +++ java/net/sf/l2j/gameserver/gameserver.java  (working copy)
  181. @@ -25,6 +25,7 @@
  182.  
  183. +   import l2jban.events.PartyFarm;
  184.  
  185.  
  186. +   LOGGER.info("Evento Party Farm");
  187. +  
  188. +   if (Config.PARTY_FARM_BY_TIME_OF_DAY && !Config.START_PARTY)
  189. +   {
  190. +       l2jban.events.InitialPartyFarm.getInstance().StartCalculationOfNextEventTime();
  191. +       LOGGER.info("[Party Farm Time]: Enabled");
  192. +   }
  193. +   else if (Config.START_PARTY && !Config.PARTY_FARM_BY_TIME_OF_DAY)
  194. +   {
  195. +       LOGGER.info("[Start Spawn Party Farm]: Enabled");
  196. +       ThreadPool.schedule(new SpawnMonsters(), Config.NPC_SERVER_DELAY * 1000L);
  197. +   }
  198.        
  199.        
  200. Index: l2jban.events/InitialPartyFarm.java
  201. ===================================================================
  202. --- l2jban.events/InitialPartyFarm.java (revision 84)
  203. +++ l2jban.events/InitialPartyFarm.java (working copy)
  204. @@ -1281,6 +1281,10 @@
  205.        
  206. +   package l2jban.events;
  207. +  
  208. +   import java.text.SimpleDateFormat;
  209. +   import java.util.Calendar;
  210. +   import java.util.logging.Logger;
  211. +  
  212. +   import net.sf.l2j.commons.concurrent.ThreadPool;
  213. +  
  214. +   import net.sf.l2j.Config;
  215. +  
  216. +   public class InitialPartyFarm
  217. +   {
  218. +       private static InitialPartyFarm _instance = null;
  219. +       protected static final Logger _log = Logger.getLogger(InitialPartyFarm.class.getName());
  220. +       private Calendar NextEvent;
  221. +       private final SimpleDateFormat format = new SimpleDateFormat("HH:mm");
  222. +  
  223. +       public static InitialPartyFarm getInstance()
  224. +       {
  225. +           if (_instance == null)
  226. +               _instance = new InitialPartyFarm();
  227. +           return _instance;
  228. +       }
  229. +  
  230. +       public String getRestartNextTime()
  231. +       {
  232. +           if (NextEvent.getTime() != null)
  233. +               return format.format(NextEvent.getTime());
  234. +           return "Erro";
  235. +       }
  236. +  
  237. +       public void StartCalculationOfNextEventTime()
  238. +       {
  239. +           try
  240. +           {
  241. +               Calendar currentTime = Calendar.getInstance();
  242. +               Calendar testStartTime = null;
  243. +               long flush2 = 0L;
  244. +               long timeL = 0L;
  245. +               int count = 0;
  246. +               for (String timeOfDay : Config.EVENT_BEST_FARM_INTERVAL_BY_TIME_OF_DAY)
  247. +               {
  248. +                   testStartTime = Calendar.getInstance();
  249. +                   testStartTime.setLenient(true);
  250. +                   String[] splitTimeOfDay = timeOfDay.split(":");
  251. +                   testStartTime.set(11, Integer.parseInt(splitTimeOfDay[0]));
  252. +                   testStartTime.set(12, Integer.parseInt(splitTimeOfDay[1]));
  253. +                   testStartTime.set(13, 0);
  254. +                   if (testStartTime.getTimeInMillis() < currentTime.getTimeInMillis())
  255. +                       testStartTime.add(5, 1);
  256. +                   timeL = testStartTime.getTimeInMillis() - currentTime.getTimeInMillis();
  257. +                   if (count == 0)
  258. +                   {
  259. +                       flush2 = timeL;
  260. +                       NextEvent = testStartTime;
  261. +                   }
  262. +                   if (timeL < flush2)
  263. +                   {
  264. +                       flush2 = timeL;
  265. +                       NextEvent = testStartTime;
  266. +                   }
  267. +                   count++;
  268. +               }
  269. +               _log.info("[Party Farm]: Proximo Evento: " + NextEvent.getTime().toString());
  270. +               ThreadPool.schedule(new StartEventTask(), flush2);
  271. +           }
  272. +           catch (Exception e)
  273. +           {
  274. +               System.out.println("[Party Farm]: Algum erro nas config foi encontrado!");
  275. +           }
  276. +       }
  277. +  
  278. +       class StartEventTask implements Runnable
  279. +       {
  280. +           StartEventTask()
  281. +           {
  282. +           }
  283. +  
  284. +           @Override
  285. +           public void run()
  286. +           {
  287. +               InitialPartyFarm._log.info("[Party Farm]: Event Started.");
  288. +               PartyFarm.bossSpawnMonster();
  289. +           }
  290. +       }
  291. +   }
  292. +  
  293.  
  294. Index: l2jban.events/PartyFarm.java
  295. ===================================================================
  296. --- l2jban.events/PartyFarm.java    (revision 84)
  297. +++ l2jban.events/PartyFarm.java    (working copy)
  298. @@ -1281,6 +1281,10 @@
  299.  
  300. +   package l2jban.events;
  301. +  
  302. +   import java.util.ArrayList;
  303. +   import net.sf.l2j.Config;
  304. +   import net.sf.l2j.gameserver.data.sql.SpawnTable;
  305. +   import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminPartyFarm;
  306. +   import net.sf.l2j.gameserver.model.spawn.L2Spawn;
  307. +   import net.sf.l2j.gameserver.model.World;
  308. +   import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  309. +   import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUse;
  310. +   import net.sf.l2j.gameserver.data.xml.NpcData;
  311. +  
  312. +   public class PartyFarm
  313. +   {
  314. +       public static L2Spawn _monster;
  315. +       public static int _bossHeading = 0;
  316. +       public static String _eventName = "";
  317. +       public static boolean _started = false;
  318. +       public static boolean _aborted = false;
  319. +       protected static boolean _finish = false;
  320. +       static PartyFarm _instance;
  321. +  
  322. +       public static void bossSpawnMonster()
  323. +       {
  324. +           spawnMonsters();
  325. +           World.announceToOnlinePlayers("Teleport Now! " + Config.PARTY_FARMANNONCER);
  326. +           World.announceToOnlinePlayers("[Party Farm]: Duration: " + Config.EVENT_BEST_FARM_TIME + " minute(s)!");
  327. +  
  328. +           _aborted = false;
  329. +           _started = true;
  330. +  
  331. +           waiter(Config.EVENT_BEST_FARM_TIME * 60 * 1000);
  332. +           if (!_aborted)
  333. +               Finish_Event();
  334. +           unSpawnMonsters();
  335. +       }
  336. +  
  337. +       public static void Finish_Event()
  338. +       {
  339. +           unSpawnMonsters();
  340. +  
  341. +           _started = false;
  342. +           _finish = true;
  343. +  
  344. +           World.announceToOnlinePlayers("[Party Farm]: Finished!");
  345. +           if (!AdminPartyFarm._bestfarm_manual)
  346. +               InitialPartyFarm.getInstance().StartCalculationOfNextEventTime();
  347. +           else
  348. +               AdminPartyFarm._bestfarm_manual = false;
  349. +       }
  350. +  
  351. +       public static void spawnMonsters()
  352. +       {
  353. +           for (int i = 0; i < Config.MONSTER_LOCS_COUNT; i++)
  354. +           {
  355. +               int[] coord = Config.MONSTER_LOCS[i];
  356. +               monsters.add(spawnNPC(coord[0], coord[1], coord[2], Config.monsterId));
  357. +              
  358. +          
  359. +           }
  360. +       }
  361. +      
  362. +  
  363. +       public static boolean is_started()
  364. +       {
  365. +           return _started;
  366. +       }
  367. +  
  368. +       public static boolean is_finish()
  369. +       {
  370. +           return _finish;
  371. +       }
  372. +  
  373. +       protected static L2Spawn spawnNPC(int xPos, int yPos, int zPos, int npcId)
  374. +       {
  375. +           NpcTemplate template = NpcData.getInstance().getTemplate(npcId);
  376. +           try
  377. +           {
  378. +               L2Spawn spawn = new L2Spawn(template);
  379. +               spawn.setLoc(xPos, yPos, zPos, 0);
  380. +               spawn.setRespawnDelay(Config.PARTY_FARM_MONSTER_DALAY);
  381. +  
  382. +               SpawnTable.getInstance().addSpawn(spawn, false);
  383. +  
  384. +               spawn.setRespawnState(true);
  385. +               spawn.doSpawn(false);
  386. +               spawn.getNpc().isAggressive();
  387. +               spawn.getNpc().decayMe();
  388. +               spawn.getNpc().spawnMe(spawn.getNpc().getX(), spawn.getNpc().getY(), spawn.getNpc().getZ());
  389. +               spawn.getNpc().broadcastPacket(new MagicSkillUse(spawn.getNpc(), spawn.getNpc(), 1034, 1, 1, 1));
  390. +               return spawn;
  391. +           }
  392. +           catch (Exception e)
  393. +           {
  394. +           }
  395. +           return null;
  396. +       }
  397. +      
  398. +      
  399. +  
  400. +  
  401. +  
  402. +       protected static ArrayList<L2Spawn> monsters = new ArrayList<>();
  403. +  
  404. +       protected static void unSpawnMonsters()
  405. +       {
  406. +           for (L2Spawn s : monsters)
  407. +           {
  408. +               if (s == null)
  409. +               {
  410. +                   monsters.remove(s);
  411. +                   return;
  412. +               }
  413. +              
  414. +               s.getNpc().deleteMe();
  415. +               s.setRespawnState(false);
  416. +               SpawnTable.getInstance().deleteSpawn(s, true);
  417. +  
  418. +           }
  419. +       }
  420. +  
  421. +       protected static void waiter(long interval)
  422. +       {
  423. +           long startWaiterTime = System.currentTimeMillis();
  424. +           int seconds = (int) (interval / 1000L);
  425. +           while (startWaiterTime + interval > System.currentTimeMillis() && !_aborted)
  426. +           {
  427. +               seconds--;
  428. +               switch (seconds)
  429. +               {
  430. +                   case 3600:
  431. +                       if (_started)
  432. +                          
  433. +                           World.announceToOnlinePlayers("[Party Farm]: " + seconds / 60 / 60 + " Time event finish!");
  434. +                      
  435. +                       break;
  436. +                   case 60:
  437. +                   case 120:
  438. +                   case 180:
  439. +                   case 240:
  440. +                   case 300:
  441. +                   case 600:
  442. +                   case 900:
  443. +                   case 1800:
  444. +                       if (_started)
  445. +                           World.announceToOnlinePlayers("[Party Farm]: " + seconds / 60 + " minute(s) event finish!");
  446. +                       break;
  447. +                   case 1:
  448. +                   case 2:
  449. +                   case 3:
  450. +                   case 10:
  451. +                   case 15:
  452. +                   case 30:
  453. +                       if (_started)
  454. +                       World.announceToOnlinePlayers("[Party Farm]: " + seconds + " second(s) event finish!");
  455. +                      
  456. +                      
  457. +                      
  458. +                       break;
  459. +               }
  460. +               long startOneSecondWaiterStartTime = System.currentTimeMillis();
  461. +               while (startOneSecondWaiterStartTime + 1000L > System.currentTimeMillis())
  462. +                   try
  463. +               {
  464. +                       Thread.sleep(1L);
  465. +               }
  466. +               catch (InterruptedException ie)
  467. +               {
  468. +                   ie.printStackTrace();
  469. +               }
  470. +           }
  471. +       }
  472. +  
  473. +   }
  474. +  
  475.  
  476. Index: net.sf.l2j.gameserver.handler.admincommandhandlers;AdminPartyFarm.java
  477. ===================================================================
  478. --- net.sf.l2j.gameserver.handler.admincommandhandlers;AdminPartyFarm.java  (revision 84)
  479. +++ net.sf.l2j.gameserver.handler.admincommandhandlers;AdminPartyFarm.java
  480.  
  481. +   package net.sf.l2j.gameserver.handler.admincommandhandlers;
  482. +  
  483. +   import java.util.ArrayList;
  484. +   import java.util.logging.Logger;
  485. +  
  486. +   import net.sf.l2j.commons.concurrent.ThreadPool;
  487. +   import l2jban.events.PartyFarm;
  488. +  
  489. +   import net.sf.l2j.gameserver.data.sql.SpawnTable;
  490. +   import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
  491. +  
  492. +  
  493. +   import net.sf.l2j.gameserver.model.actor.Player;
  494. +   import net.sf.l2j.gameserver.model.spawn.L2Spawn;
  495. +  
  496. +   /**
  497. +    * L2jBan
  498. +    */
  499. +  
  500. +   public class AdminPartyFarm implements IAdminCommandHandler
  501. +   {
  502. +       public static L2Spawn _monster;
  503. +       private static final String[] ADMIN_COMMANDS =
  504. +       {
  505. +           "admin_ptfarm"
  506. +  
  507. +       };
  508. +      
  509. +       protected static final Logger _log = Logger.getLogger(AdminPartyFarm.class.getName());
  510. +       public static boolean _bestfarm_manual = true;
  511. +       public static boolean _arena_manual = false;
  512. +  
  513. +       @Override
  514. +       public boolean useAdminCommand(String command, Player activeChar)
  515. +       {
  516. +          
  517. +  
  518. +          
  519. +           if (command.startsWith("admin_ptfarm"))
  520. +               if (PartyFarm._started)
  521. +               {
  522. +                   _log.info("----------------------------------------------------------------------------");
  523. +                   _log.info("[Party Farm]: Event Finished.");
  524. +                   _log.info("----------------------------------------------------------------------------");
  525. +                   PartyFarm._aborted = true;
  526. +                   unSpawnMonsters();
  527. +                   finishEventPartyFarm();
  528. +  
  529. +                   activeChar.sendMessage("SYS: Voce Finalizou o Party Farm Manualmente..");
  530. +               }
  531. +               else
  532. +               {
  533. +                   _log.info("----------------------------------------------------------------------------");
  534. +                   _log.info("[Party Farm]: Event Started.");
  535. +                   _log.info("----------------------------------------------------------------------------");
  536. +                   initEventPartyFarm();
  537. +                   _bestfarm_manual = true;
  538. +                   activeChar.sendMessage("SYS: Voce ativou o Best Farm Manualmente..");
  539. +               }
  540. +           return true;
  541. +       }
  542. +  
  543. +  
  544. +  
  545. +       /**
  546. +        *
  547. +        */
  548. +       protected static ArrayList<L2Spawn> monsters = new ArrayList<>();
  549. +      
  550. +       private static void unSpawnMonsters()
  551. +       {
  552. +           for (L2Spawn s : monsters)
  553. +           {
  554. +               if (s == null)
  555. +               {
  556. +                   monsters.remove(s);
  557. +                   return;
  558. +               }
  559. +              
  560. +               s.getNpc().deleteMe();
  561. +               s.setRespawnState(false);
  562. +               SpawnTable.getInstance().deleteSpawn(s, true);
  563. +  
  564. +           }
  565. +          
  566. +       }
  567. +  
  568. +  
  569. +  
  570. +       private static void initEventPartyFarm()
  571. +       {
  572. +           ThreadPool.schedule(new Runnable()
  573. +           {
  574. +               @Override
  575. +               public void run()
  576. +               {
  577. +  
  578. +                   PartyFarm.bossSpawnMonster();
  579. +               }
  580. +           }, 1L);
  581. +       }
  582. +  
  583. +       private static void finishEventPartyFarm()
  584. +       {
  585. +           ThreadPool.schedule(new Runnable()
  586. +           {
  587. +               @Override
  588. +               public void run()
  589. +               {
  590. +  
  591. +                   PartyFarm.Finish_Event();
  592. +  
  593. +               }
  594. +           }, 1L);
  595. +       }
  596. +  
  597. +       @Override
  598. +       public String[] getAdminCommandList()
  599. +       {
  600. +           return ADMIN_COMMANDS;
  601. +       }
  602. +   }
  603. +  
  604.  
  605. Index: net.sf.l2j.gameserver.handler.admincommandhandlers;AdminPartyFarm.java
  606. ===================================================================
  607. --- net.sf.l2j.gameserver.handler;AdminCommandHandler.java  (revision 84)
  608. +++ net.sf.l2j.gameserver.handler;AdminCommandHandler.java
  609.  
  610. +   import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminPartyFarm;
  611.  
  612.  
  613. -   registerHandler(new AdminAdmin());
  614. +   registerHandler(new AdminAdmin());
  615. +   registerHandler(new AdminPartyFarm());
  616.  
  617.  
  618. Index: data/xml/adminCommands.xml
  619. ===================================================================
  620. --- data/xml/adminCommands.xml  (revision 84)
  621. +++ data/xml/adminCommands.xml
  622.  
  623. +   <!-- Eventos L2jBan -->
  624. +   <aCar name="admin_ptfarm" accessLevel="8"/>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement