Advertisement
nasseka

oly.initial.patch.v1

May 16th, 2022 (edited)
879
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 98.83 KB | None | 0 0
  1. Index: java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadMatchList.java
  2. ===================================================================
  3. --- java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadMatchList.java  (nonexistent)
  4. +++ java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadMatchList.java  (working copy)
  5. @@ -0,0 +1,55 @@
  6. +/*
  7. + * This file is part of the L2J Mobius project.
  8. + *
  9. + * This program is free software: you can redistribute it and/or modify
  10. + * it under the terms of the GNU General Public License as published by
  11. + * the Free Software Foundation, either version 3 of the License, or
  12. + * (at your option) any later version.
  13. + *
  14. + * This program is distributed in the hope that it will be useful,
  15. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. + * General Public License for more details.
  18. + *
  19. + * You should have received a copy of the GNU General Public License
  20. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. + */
  22. +package org.l2jmobius.gameserver.network.clientpackets.olympiad;
  23. +
  24. +import org.l2jmobius.commons.network.PacketReader;
  25. +import org.l2jmobius.gameserver.handler.BypassHandler;
  26. +import org.l2jmobius.gameserver.handler.IBypassHandler;
  27. +import org.l2jmobius.gameserver.model.actor.Player;
  28. +import org.l2jmobius.gameserver.network.GameClient;
  29. +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
  30. +
  31. +/**
  32. + * format ch c: (id) 0xD0 h: (subid) 0x13
  33. + * @author -Wooden-
  34. + */
  35. +public class RequestOlympiadMatchList implements IClientIncomingPacket
  36. +{
  37. +   private static final String COMMAND = "arenalist";
  38. +  
  39. +   @Override
  40. +   public boolean read(GameClient client, PacketReader packet)
  41. +   {
  42. +       return true;
  43. +   }
  44. +  
  45. +   @Override
  46. +   public void run(GameClient client)
  47. +   {
  48. +       final Player player = client.getPlayer();
  49. +       if ((player == null) || !player.inObserverMode())
  50. +       {
  51. +           return;
  52. +       }
  53. +      
  54. +       final IBypassHandler handler = BypassHandler.getInstance().getHandler(COMMAND);
  55. +       if (handler != null)
  56. +       {
  57. +           handler.useBypass(COMMAND, player, null);
  58. +       }
  59. +   }
  60. +}
  61. \ No newline at end of file
  62. Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchMakingResult.java
  63. ===================================================================
  64. --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchMakingResult.java   (nonexistent)
  65. +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchMakingResult.java   (working copy)
  66. @@ -0,0 +1,43 @@
  67. +/*
  68. + * This file is part of the L2J Mobius project.
  69. + *
  70. + * This program is free software: you can redistribute it and/or modify
  71. + * it under the terms of the GNU General Public License as published by
  72. + * the Free Software Foundation, either version 3 of the License, or
  73. + * (at your option) any later version.
  74. + *
  75. + * This program is distributed in the hope that it will be useful,
  76. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  77. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  78. + * General Public License for more details.
  79. + *
  80. + * You should have received a copy of the GNU General Public License
  81. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  82. + */
  83. +package org.l2jmobius.gameserver.network.serverpackets.olympiad;
  84. +
  85. +import org.l2jmobius.commons.network.PacketWriter;
  86. +import org.l2jmobius.gameserver.model.actor.Player;
  87. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  88. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  89. +
  90. +public class ExOlympiadMatchMakingResult implements IClientOutgoingPacket
  91. +{
  92. +   private final int _cGameRuleType;
  93. +   private final int _type;
  94. +  
  95. +   public ExOlympiadMatchMakingResult(Player player, int cGameRuleType, int type)
  96. +   {
  97. +       _cGameRuleType = 0;
  98. +       _type = type;
  99. +   }
  100. +  
  101. +   @Override
  102. +   public boolean write(PacketWriter packet)
  103. +   {
  104. +       OutgoingPackets.EX_OLYMPIAD_INFO.writeId(packet);
  105. +       packet.writeC(_type);
  106. +       packet.writeD(_cGameRuleType);
  107. +       return true;
  108. +   }
  109. +}
  110. Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfo.java
  111. ===================================================================
  112. --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfo.java   (nonexistent)
  113. +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfo.java   (working copy)
  114. @@ -0,0 +1,53 @@
  115. +/*
  116. + * This file is part of the L2J Mobius project.
  117. + *
  118. + * This program is free software: you can redistribute it and/or modify
  119. + * it under the terms of the GNU General Public License as published by
  120. + * the Free Software Foundation, either version 3 of the License, or
  121. + * (at your option) any later version.
  122. + *
  123. + * This program is distributed in the hope that it will be useful,
  124. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  125. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  126. + * General Public License for more details.
  127. + *
  128. + * You should have received a copy of the GNU General Public License
  129. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  130. + */
  131. +package org.l2jmobius.gameserver.network.serverpackets.olympiad;
  132. +
  133. +import org.l2jmobius.commons.network.PacketWriter;
  134. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  135. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  136. +
  137. +public class ExOlympiadMatchInfo implements IClientOutgoingPacket
  138. +{
  139. +   private final String _szTeam1Name;
  140. +   private final String _szTeam2Name;
  141. +   private final int _nTeam1WinCount;
  142. +   private final int _nTeam2WinCount;
  143. +   private final int _round;
  144. +  
  145. +   public ExOlympiadMatchInfo(String szTeam1Name, String szTeam2Name, int nTeam1WinCount, int nTeam2WinCount, int round)
  146. +   {
  147. +       _szTeam1Name = szTeam1Name;
  148. +       _szTeam2Name = szTeam2Name;
  149. +       _nTeam1WinCount = nTeam1WinCount;
  150. +       _nTeam2WinCount = nTeam2WinCount;
  151. +       _round = round;
  152. +   }
  153. +  
  154. +   @Override
  155. +   public boolean write(PacketWriter packet)
  156. +   {
  157. +       OutgoingPackets.EX_OLYMPIAD_MATCH_INFO.writeId(packet);
  158. +      
  159. +       packet.writeS(String.format("%1$-" + 23 + "s", _szTeam2Name)); // Name 2
  160. +       packet.writeD(_nTeam2WinCount); // Wins 2
  161. +       packet.writeS(String.format("%1$-" + 23 + "s", _szTeam1Name)); // Name 1
  162. +       packet.writeD(_nTeam1WinCount); // Wins 1
  163. +       packet.writeD(_round); // Round
  164. +       packet.writeD(100); // Seconds
  165. +       return true;
  166. +   }
  167. +}
  168. Index: java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMaking.java
  169. ===================================================================
  170. --- java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMaking.java   (nonexistent)
  171. +++ java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMaking.java   (working copy)
  172. @@ -0,0 +1,32 @@
  173. +package org.l2jmobius.gameserver.network.clientpackets.olympiad;
  174. +
  175. +import org.l2jmobius.commons.network.PacketReader;
  176. +import org.l2jmobius.gameserver.model.actor.Player;
  177. +import org.l2jmobius.gameserver.network.GameClient;
  178. +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
  179. +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchMakingResult;
  180. +
  181. +public class OlympiadMatchMaking implements IClientIncomingPacket
  182. +{
  183. +  
  184. +   private byte _cGameRuleType;
  185. +  
  186. +   @Override
  187. +   public boolean read(GameClient client, PacketReader packet)
  188. +   {
  189. +       _cGameRuleType = (byte) packet.readC(); // _cGameRuleType
  190. +       return true;
  191. +   }
  192. +  
  193. +   @Override
  194. +   public void run(GameClient client)
  195. +   {
  196. +       final Player player = client.getPlayer();
  197. +       if (player == null)
  198. +       {
  199. +           return;
  200. +       }
  201. +      
  202. +       player.sendPacket(new ExOlympiadMatchMakingResult(player, _cGameRuleType, 1));
  203. +   }
  204. +}
  205. \ No newline at end of file
  206. Index: java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMakingCancel.java
  207. ===================================================================
  208. --- java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMakingCancel.java (nonexistent)
  209. +++ java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMakingCancel.java (working copy)
  210. @@ -0,0 +1,32 @@
  211. +package org.l2jmobius.gameserver.network.clientpackets.olympiad;
  212. +
  213. +import org.l2jmobius.commons.network.PacketReader;
  214. +import org.l2jmobius.gameserver.model.actor.Player;
  215. +import org.l2jmobius.gameserver.network.GameClient;
  216. +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
  217. +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchMakingResult;
  218. +
  219. +public class OlympiadMatchMakingCancel implements IClientIncomingPacket
  220. +{
  221. +  
  222. +   private byte _cGameRuleType;
  223. +  
  224. +   @Override
  225. +   public boolean read(GameClient client, PacketReader packet)
  226. +   {
  227. +       _cGameRuleType = (byte) packet.readC(); // _cGameRuleType
  228. +       return true;
  229. +   }
  230. +  
  231. +   @Override
  232. +   public void run(GameClient client)
  233. +   {
  234. +       final Player player = client.getPlayer();
  235. +       if (player == null)
  236. +       {
  237. +           return;
  238. +       }
  239. +      
  240. +       player.sendPacket(new ExOlympiadMatchMakingResult(player, _cGameRuleType, 0));
  241. +   }
  242. +}
  243. \ No newline at end of file
  244. Index: java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadUI.java
  245. ===================================================================
  246. --- java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadUI.java    (nonexistent)
  247. +++ java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadUI.java    (working copy)
  248. @@ -0,0 +1,48 @@
  249. +/*
  250. + * This file is part of the L2J Mobius project.
  251. + *
  252. + * This program is free software: you can redistribute it and/or modify
  253. + * it under the terms of the GNU General Public License as published by
  254. + * the Free Software Foundation, either version 3 of the License, or
  255. + * (at your option) any later version.
  256. + *
  257. + * This program is distributed in the hope that it will be useful,
  258. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  259. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  260. + * General Public License for more details.
  261. + *
  262. + * You should have received a copy of the GNU General Public License
  263. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  264. + */
  265. +package org.l2jmobius.gameserver.network.clientpackets.olympiad;
  266. +
  267. +import org.l2jmobius.commons.network.PacketReader;
  268. +import org.l2jmobius.gameserver.model.actor.Player;
  269. +import org.l2jmobius.gameserver.network.GameClient;
  270. +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
  271. +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadRecord;
  272. +
  273. +public class OlympiadUI implements IClientIncomingPacket
  274. +{
  275. +   private byte _cGameRuleType;
  276. +   private int _type;
  277. +  
  278. +   @Override
  279. +   public boolean read(GameClient client, PacketReader packet)
  280. +   {
  281. +       _cGameRuleType = (byte) packet.readC(); // _cGameRuleType
  282. +       _type = packet.readD();
  283. +       return true;
  284. +   }
  285. +  
  286. +   @Override
  287. +   public void run(GameClient client)
  288. +   {
  289. +       final Player player = client.getPlayer();
  290. +       if (player == null)
  291. +       {
  292. +           return;
  293. +       }
  294. +       player.sendPacket(new ExOlympiadRecord(player, _cGameRuleType, _type));
  295. +   }
  296. +}
  297. \ No newline at end of file
  298. Index: java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestExOlympiadMatchListRefresh.java
  299. ===================================================================
  300. --- java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestExOlympiadMatchListRefresh.java (nonexistent)
  301. +++ java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestExOlympiadMatchListRefresh.java (working copy)
  302. @@ -0,0 +1,48 @@
  303. +/*
  304. + * This file is part of the L2J Mobius project.
  305. + *
  306. + * This program is free software: you can redistribute it and/or modify
  307. + * it under the terms of the GNU General Public License as published by
  308. + * the Free Software Foundation, either version 3 of the License, or
  309. + * (at your option) any later version.
  310. + *
  311. + * This program is distributed in the hope that it will be useful,
  312. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  313. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  314. + * General Public License for more details.
  315. + *
  316. + * You should have received a copy of the GNU General Public License
  317. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  318. + */
  319. +package org.l2jmobius.gameserver.network.clientpackets.olympiad;
  320. +
  321. +import org.l2jmobius.commons.network.PacketReader;
  322. +import org.l2jmobius.gameserver.model.actor.Player;
  323. +import org.l2jmobius.gameserver.network.GameClient;
  324. +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
  325. +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchList;
  326. +
  327. +/**
  328. + * Format: (ch)d d: unknown (always 0?)
  329. + * @author mrTJO
  330. + */
  331. +public class RequestExOlympiadMatchListRefresh implements IClientIncomingPacket
  332. +{
  333. +   @Override
  334. +   public boolean read(GameClient client, PacketReader packet)
  335. +   {
  336. +       return true;
  337. +   }
  338. +  
  339. +   @Override
  340. +   public void run(GameClient client)
  341. +   {
  342. +       final Player player = client.getPlayer();
  343. +       if (player == null)
  344. +       {
  345. +           return;
  346. +       }
  347. +      
  348. +       player.sendPacket(new ExOlympiadMatchList());
  349. +   }
  350. +}
  351. \ No newline at end of file
  352. Index: java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadMatchList.java
  353. ===================================================================
  354. --- java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadMatchList.java  (nonexistent)
  355. +++ java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadMatchList.java  (working copy)
  356. @@ -0,0 +1,55 @@
  357. +/*
  358. + * This file is part of the L2J Mobius project.
  359. + *
  360. + * This program is free software: you can redistribute it and/or modify
  361. + * it under the terms of the GNU General Public License as published by
  362. + * the Free Software Foundation, either version 3 of the License, or
  363. + * (at your option) any later version.
  364. + *
  365. + * This program is distributed in the hope that it will be useful,
  366. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  367. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  368. + * General Public License for more details.
  369. + *
  370. + * You should have received a copy of the GNU General Public License
  371. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  372. + */
  373. +package org.l2jmobius.gameserver.network.clientpackets.olympiad;
  374. +
  375. +import org.l2jmobius.commons.network.PacketReader;
  376. +import org.l2jmobius.gameserver.handler.BypassHandler;
  377. +import org.l2jmobius.gameserver.handler.IBypassHandler;
  378. +import org.l2jmobius.gameserver.model.actor.Player;
  379. +import org.l2jmobius.gameserver.network.GameClient;
  380. +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
  381. +
  382. +/**
  383. + * format ch c: (id) 0xD0 h: (subid) 0x13
  384. + * @author -Wooden-
  385. + */
  386. +public class RequestOlympiadMatchList implements IClientIncomingPacket
  387. +{
  388. +   private static final String COMMAND = "arenalist";
  389. +  
  390. +   @Override
  391. +   public boolean read(GameClient client, PacketReader packet)
  392. +   {
  393. +       return true;
  394. +   }
  395. +  
  396. +   @Override
  397. +   public void run(GameClient client)
  398. +   {
  399. +       final Player player = client.getPlayer();
  400. +       if ((player == null) || !player.inObserverMode())
  401. +       {
  402. +           return;
  403. +       }
  404. +      
  405. +       final IBypassHandler handler = BypassHandler.getInstance().getHandler(COMMAND);
  406. +       if (handler != null)
  407. +       {
  408. +           handler.useBypass(COMMAND, player, null);
  409. +       }
  410. +   }
  411. +}
  412. \ No newline at end of file
  413. Index: java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadObserverEnd.java
  414. ===================================================================
  415. --- java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadObserverEnd.java    (nonexistent)
  416. +++ java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadObserverEnd.java    (working copy)
  417. @@ -0,0 +1,50 @@
  418. +/*
  419. + * This file is part of the L2J Mobius project.
  420. + *
  421. + * This program is free software: you can redistribute it and/or modify
  422. + * it under the terms of the GNU General Public License as published by
  423. + * the Free Software Foundation, either version 3 of the License, or
  424. + * (at your option) any later version.
  425. + *
  426. + * This program is distributed in the hope that it will be useful,
  427. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  428. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  429. + * General Public License for more details.
  430. + *
  431. + * You should have received a copy of the GNU General Public License
  432. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  433. + */
  434. +package org.l2jmobius.gameserver.network.clientpackets.olympiad;
  435. +
  436. +import org.l2jmobius.commons.network.PacketReader;
  437. +import org.l2jmobius.gameserver.model.actor.Player;
  438. +import org.l2jmobius.gameserver.network.GameClient;
  439. +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
  440. +
  441. +/**
  442. + * format ch c: (id) 0xD0 h: (subid) 0x12
  443. + * @author -Wooden-
  444. + */
  445. +public class RequestOlympiadObserverEnd implements IClientIncomingPacket
  446. +{
  447. +   @Override
  448. +   public boolean read(GameClient client, PacketReader packet)
  449. +   {
  450. +       return true;
  451. +   }
  452. +  
  453. +   @Override
  454. +   public void run(GameClient client)
  455. +   {
  456. +       final Player player = client.getPlayer();
  457. +       if (player == null)
  458. +       {
  459. +           return;
  460. +       }
  461. +      
  462. +       if (player.inObserverMode())
  463. +       {
  464. +           player.leaveOlympiadObserverMode();
  465. +       }
  466. +   }
  467. +}
  468. \ No newline at end of file
  469. Index: java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMakingCancel.java
  470. ===================================================================
  471. --- java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMakingCancel.java (nonexistent)
  472. +++ java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMakingCancel.java (working copy)
  473. @@ -0,0 +1,32 @@
  474. +package org.l2jmobius.gameserver.network.clientpackets.olympiad;
  475. +
  476. +import org.l2jmobius.commons.network.PacketReader;
  477. +import org.l2jmobius.gameserver.model.actor.Player;
  478. +import org.l2jmobius.gameserver.network.GameClient;
  479. +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
  480. +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchMakingResult;
  481. +
  482. +public class OlympiadMatchMakingCancel implements IClientIncomingPacket
  483. +{
  484. +  
  485. +   private byte _cGameRuleType;
  486. +  
  487. +   @Override
  488. +   public boolean read(GameClient client, PacketReader packet)
  489. +   {
  490. +       _cGameRuleType = (byte) packet.readC(); // _cGameRuleType
  491. +       return true;
  492. +   }
  493. +  
  494. +   @Override
  495. +   public void run(GameClient client)
  496. +   {
  497. +       final Player player = client.getPlayer();
  498. +       if (player == null)
  499. +       {
  500. +           return;
  501. +       }
  502. +      
  503. +       player.sendPacket(new ExOlympiadMatchMakingResult(player, _cGameRuleType, 0));
  504. +   }
  505. +}
  506. \ No newline at end of file
  507. Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfoEnd.java
  508. ===================================================================
  509. --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfoEnd.java    (nonexistent)
  510. +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfoEnd.java    (working copy)
  511. @@ -0,0 +1,37 @@
  512. +/*
  513. + * This file is part of the L2J Mobius project.
  514. + *
  515. + * This program is free software: you can redistribute it and/or modify
  516. + * it under the terms of the GNU General Public License as published by
  517. + * the Free Software Foundation, either version 3 of the License, or
  518. + * (at your option) any later version.
  519. + *
  520. + * This program is distributed in the hope that it will be useful,
  521. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  522. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  523. + * General Public License for more details.
  524. + *
  525. + * You should have received a copy of the GNU General Public License
  526. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  527. + */
  528. +package org.l2jmobius.gameserver.network.serverpackets.olympiad;
  529. +
  530. +import org.l2jmobius.commons.network.PacketWriter;
  531. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  532. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  533. +
  534. +public class ExOlympiadMatchInfoEnd implements IClientOutgoingPacket
  535. +{
  536. +  
  537. +   public ExOlympiadMatchInfoEnd()
  538. +   {
  539. +   }
  540. +  
  541. +   @Override
  542. +   public boolean write(PacketWriter packet)
  543. +   {
  544. +       OutgoingPackets.EX_OLYMPIAD_MATCH_INFO.writeId(packet);
  545. +      
  546. +       return true;
  547. +   }
  548. +}
  549. Index: java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestExOlympiadMatchListRefresh.java
  550. ===================================================================
  551. --- java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestExOlympiadMatchListRefresh.java (nonexistent)
  552. +++ java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestExOlympiadMatchListRefresh.java (working copy)
  553. @@ -0,0 +1,48 @@
  554. +/*
  555. + * This file is part of the L2J Mobius project.
  556. + *
  557. + * This program is free software: you can redistribute it and/or modify
  558. + * it under the terms of the GNU General Public License as published by
  559. + * the Free Software Foundation, either version 3 of the License, or
  560. + * (at your option) any later version.
  561. + *
  562. + * This program is distributed in the hope that it will be useful,
  563. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  564. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  565. + * General Public License for more details.
  566. + *
  567. + * You should have received a copy of the GNU General Public License
  568. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  569. + */
  570. +package org.l2jmobius.gameserver.network.clientpackets.olympiad;
  571. +
  572. +import org.l2jmobius.commons.network.PacketReader;
  573. +import org.l2jmobius.gameserver.model.actor.Player;
  574. +import org.l2jmobius.gameserver.network.GameClient;
  575. +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
  576. +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchList;
  577. +
  578. +/**
  579. + * Format: (ch)d d: unknown (always 0?)
  580. + * @author mrTJO
  581. + */
  582. +public class RequestExOlympiadMatchListRefresh implements IClientIncomingPacket
  583. +{
  584. +   @Override
  585. +   public boolean read(GameClient client, PacketReader packet)
  586. +   {
  587. +       return true;
  588. +   }
  589. +  
  590. +   @Override
  591. +   public void run(GameClient client)
  592. +   {
  593. +       final Player player = client.getPlayer();
  594. +       if (player == null)
  595. +       {
  596. +           return;
  597. +       }
  598. +      
  599. +       player.sendPacket(new ExOlympiadMatchList());
  600. +   }
  601. +}
  602. \ No newline at end of file
  603. Index: java/org/l2jmobius/gameserver/network/ExIncomingPackets.java
  604. ===================================================================
  605. --- java/org/l2jmobius/gameserver/network/ExIncomingPackets.java    (revision 10239)
  606. +++ java/org/l2jmobius/gameserver/network/ExIncomingPackets.java    (working copy)
  607. @@ -122,6 +122,12 @@
  608.  import org.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeWaitingList;
  609.  import org.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMentorCancel;
  610.  import org.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMentorList;
  611. +import org.l2jmobius.gameserver.network.clientpackets.olympiad.OlympiadMatchMaking;
  612. +import org.l2jmobius.gameserver.network.clientpackets.olympiad.OlympiadMatchMakingCancel;
  613. +import org.l2jmobius.gameserver.network.clientpackets.olympiad.OlympiadUI;
  614. +import org.l2jmobius.gameserver.network.clientpackets.olympiad.RequestExOlympiadMatchListRefresh;
  615. +import org.l2jmobius.gameserver.network.clientpackets.olympiad.RequestOlympiadMatchList;
  616. +import org.l2jmobius.gameserver.network.clientpackets.olympiad.RequestOlympiadObserverEnd;
  617.  import org.l2jmobius.gameserver.network.clientpackets.pk.RequestExPkPenaltyList;
  618.  import org.l2jmobius.gameserver.network.clientpackets.pk.RequestExPkPenaltyListOnlyLoc;
  619.  import org.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeAnnounce;
  620. @@ -553,8 +559,8 @@
  621.     EX_PAYBACK_LIST(0x175, null, ConnectionState.IN_GAME),
  622.     EX_PAYBACK_GIVE_REWARD(0x176, null, ConnectionState.IN_GAME),
  623.     EX_AUTOPLAY_SETTING(0x177, ExAutoPlaySetting::new, ConnectionState.IN_GAME),
  624. -   EX_OLYMPIAD_MATCH_MAKING(0x178, null, ConnectionState.IN_GAME),
  625. -   EX_OLYMPIAD_MATCH_MAKING_CANCEL(0x179, null, ConnectionState.IN_GAME),
  626. +   EX_OLYMPIAD_MATCH_MAKING(0x178, OlympiadMatchMaking::new, ConnectionState.IN_GAME),
  627. +   EX_OLYMPIAD_MATCH_MAKING_CANCEL(0x179, OlympiadMatchMakingCancel::new, ConnectionState.IN_GAME),
  628.     EX_FESTIVAL_BM_INFO(0x17A, null, ConnectionState.IN_GAME),
  629.     EX_FESTIVAL_BM_GAME(0x17B, null, ConnectionState.IN_GAME),
  630.     EX_GACHA_SHOP_INFO(0x17C, null, ConnectionState.IN_GAME),
  631. @@ -593,7 +599,7 @@
  632.     EX_CRAFT_RANDOM_MAKE(0x19D, null, ConnectionState.IN_GAME),
  633.     EX_MULTI_SELL_LIST(0x19E, null, ConnectionState.IN_GAME),
  634.     EX_SAVE_ITEM_ANNOUNCE_SETTING(0x19F, null, ConnectionState.IN_GAME),
  635. -   EX_OLYMPIAD_UI(0x1A0, null, ConnectionState.IN_GAME),
  636. +   EX_OLYMPIAD_UI(0x1A0, OlympiadUI::new, ConnectionState.IN_GAME),
  637.     // 270
  638.     EX_SHARED_POSITION_SHARING_UI(0x1A1, null, ConnectionState.IN_GAME),
  639.     EX_SHARED_POSITION_TELEPORT_UI(0x1A2, null, ConnectionState.IN_GAME),
  640. Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchList.java
  641. ===================================================================
  642. --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchList.java   (nonexistent)
  643. +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchList.java   (working copy)
  644. @@ -0,0 +1,92 @@
  645. +/*
  646. + * This file is part of the L2J Mobius project.
  647. + *
  648. + * This program is free software: you can redistribute it and/or modify
  649. + * it under the terms of the GNU General Public License as published by
  650. + * the Free Software Foundation, either version 3 of the License, or
  651. + * (at your option) any later version.
  652. + *
  653. + * This program is distributed in the hope that it will be useful,
  654. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  655. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  656. + * General Public License for more details.
  657. + *
  658. + * You should have received a copy of the GNU General Public License
  659. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  660. + */
  661. +package org.l2jmobius.gameserver.network.serverpackets.olympiad;
  662. +
  663. +import java.util.ArrayList;
  664. +import java.util.List;
  665. +
  666. +import org.l2jmobius.commons.network.PacketWriter;
  667. +import org.l2jmobius.gameserver.model.olympiad.AbstractOlympiadGame;
  668. +import org.l2jmobius.gameserver.model.olympiad.OlympiadGameClassed;
  669. +import org.l2jmobius.gameserver.model.olympiad.OlympiadGameManager;
  670. +import org.l2jmobius.gameserver.model.olympiad.OlympiadGameNonClassed;
  671. +import org.l2jmobius.gameserver.model.olympiad.OlympiadGameTask;
  672. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  673. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  674. +
  675. +/**
  676. + * @author mrTJO
  677. + */
  678. +public class ExOlympiadMatchList implements IClientOutgoingPacket
  679. +{
  680. +   private final List<OlympiadGameTask> _games = new ArrayList<>();
  681. +  
  682. +   public ExOlympiadMatchList()
  683. +   {
  684. +       OlympiadGameTask task;
  685. +       for (int i = 0; i < OlympiadGameManager.getInstance().getNumberOfStadiums(); i++)
  686. +       {
  687. +           task = OlympiadGameManager.getInstance().getOlympiadTask(i);
  688. +           if (task != null)
  689. +           {
  690. +               if (!task.isGameStarted() || task.isBattleFinished())
  691. +               {
  692. +                   continue; // initial or finished state not shown
  693. +               }
  694. +               _games.add(task);
  695. +           }
  696. +       }
  697. +   }
  698. +  
  699. +   @Override
  700. +   public boolean write(PacketWriter packet)
  701. +   {
  702. +       OutgoingPackets.EX_RECEIVE_OLYMPIAD.writeId(packet);
  703. +      
  704. +       packet.writeD(0); // Type 0 = Match List, 1 = Match Result
  705. +      
  706. +       packet.writeD(_games.size());
  707. +       packet.writeD(0);
  708. +      
  709. +       for (OlympiadGameTask curGame : _games)
  710. +       {
  711. +           final AbstractOlympiadGame game = curGame.getGame();
  712. +           if (game != null)
  713. +           {
  714. +               packet.writeD(game.getStadiumId()); // Stadium Id (Arena 1 = 0)
  715. +              
  716. +               if (game instanceof OlympiadGameNonClassed)
  717. +               {
  718. +                   packet.writeD(1);
  719. +               }
  720. +               else if (game instanceof OlympiadGameClassed)
  721. +               {
  722. +                   packet.writeD(2);
  723. +               }
  724. +               else
  725. +               {
  726. +                   packet.writeD(0);
  727. +               }
  728. +              
  729. +               packet.writeD(curGame.isRunning() ? 2 : 1); // (1 = Standby, 2 = Playing)
  730. +               packet.writeS(game.getPlayerNames()[0]); // Player 1 Name
  731. +               packet.writeS(game.getPlayerNames()[1]); // Player 2 Name
  732. +           }
  733. +       }
  734. +       return true;
  735. +   }
  736. +}
  737. Index: java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java
  738. ===================================================================
  739. --- java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java   (revision 10239)
  740. +++ java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java   (working copy)
  741. @@ -32,10 +32,10 @@
  742.  import org.l2jmobius.gameserver.model.zone.ZoneId;
  743.  import org.l2jmobius.gameserver.model.zone.type.OlympiadStadiumZone;
  744.  import org.l2jmobius.gameserver.network.SystemMessageId;
  745. -import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMatchEnd;
  746. -import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadUserInfo;
  747.  import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  748.  import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
  749. +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchEnd;
  750. +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadUserInfo;
  751.  
  752.  /**
  753.   * @author JIV
  754. Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMode.java
  755. ===================================================================
  756. --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMode.java    (nonexistent)
  757. +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMode.java    (working copy)
  758. @@ -0,0 +1,46 @@
  759. +/*
  760. + * This file is part of the L2J Mobius project.
  761. + *
  762. + * This program is free software: you can redistribute it and/or modify
  763. + * it under the terms of the GNU General Public License as published by
  764. + * the Free Software Foundation, either version 3 of the License, or
  765. + * (at your option) any later version.
  766. + *
  767. + * This program is distributed in the hope that it will be useful,
  768. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  769. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  770. + * General Public License for more details.
  771. + *
  772. + * You should have received a copy of the GNU General Public License
  773. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  774. + */
  775. +package org.l2jmobius.gameserver.network.serverpackets.olympiad;
  776. +
  777. +import org.l2jmobius.commons.network.PacketWriter;
  778. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  779. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  780. +
  781. +/**
  782. + * @author godson
  783. + */
  784. +public class ExOlympiadMode implements IClientOutgoingPacket
  785. +{
  786. +   private final int _mode;
  787. +  
  788. +   /**
  789. +    * @param mode (0 = return, 3 = spectate)
  790. +    */
  791. +   public ExOlympiadMode(int mode)
  792. +   {
  793. +       _mode = mode;
  794. +   }
  795. +  
  796. +   @Override
  797. +   public boolean write(PacketWriter packet)
  798. +   {
  799. +       OutgoingPackets.EX_OLYMPIAD_MODE.writeId(packet);
  800. +      
  801. +       packet.writeC(_mode);
  802. +       return true;
  803. +   }
  804. +}
  805. Index: java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
  806. ===================================================================
  807. --- java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java (revision 10239)
  808. +++ java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java (working copy)
  809. @@ -55,6 +55,7 @@
  810.  import org.l2jmobius.gameserver.model.item.instance.Item;
  811.  import org.l2jmobius.gameserver.model.item.type.EtcItemType;
  812.  import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
  813. +import org.l2jmobius.gameserver.model.olympiad.Olympiad;
  814.  import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
  815.  import org.l2jmobius.gameserver.model.punishment.PunishmentType;
  816.  import org.l2jmobius.gameserver.model.quest.Quest;
  817. @@ -121,6 +122,7 @@
  818.  import org.l2jmobius.gameserver.network.serverpackets.homunculus.ExHomunculusReady;
  819.  import org.l2jmobius.gameserver.network.serverpackets.homunculus.ExShowHomunculusBirthInfo;
  820.  import org.l2jmobius.gameserver.network.serverpackets.limitshop.ExBloodyCoinCount;
  821. +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadInfo;
  822.  import org.l2jmobius.gameserver.util.BuilderUtil;
  823.  
  824.  /**
  825. @@ -643,6 +645,12 @@
  826.             player.sendMessage("Experience gain is disabled.");
  827.         }
  828.        
  829. +       // Send packet that olympiad is opened.
  830. +       if (Config.ALT_OLY_ENABLE_OLYMPIAD && Olympiad.getInstance().inCompPeriod())
  831. +       {
  832. +           player.sendPacket(new ExOlympiadInfo(player, 1));
  833. +       }
  834. +      
  835.         player.updateSymbolSealSkills();
  836.        
  837.         player.broadcastUserInfo();
  838. Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadSpelledInfo.java
  839. ===================================================================
  840. --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadSpelledInfo.java (nonexistent)
  841. +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadSpelledInfo.java (working copy)
  842. @@ -0,0 +1,84 @@
  843. +/*
  844. + * This file is part of the L2J Mobius project.
  845. + *
  846. + * This program is free software: you can redistribute it and/or modify
  847. + * it under the terms of the GNU General Public License as published by
  848. + * the Free Software Foundation, either version 3 of the License, or
  849. + * (at your option) any later version.
  850. + *
  851. + * This program is distributed in the hope that it will be useful,
  852. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  853. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  854. + * General Public License for more details.
  855. + *
  856. + * You should have received a copy of the GNU General Public License
  857. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  858. + */
  859. +package org.l2jmobius.gameserver.network.serverpackets.olympiad;
  860. +
  861. +import java.util.ArrayList;
  862. +import java.util.List;
  863. +
  864. +import org.l2jmobius.commons.network.PacketWriter;
  865. +import org.l2jmobius.gameserver.model.actor.Player;
  866. +import org.l2jmobius.gameserver.model.skill.BuffInfo;
  867. +import org.l2jmobius.gameserver.model.skill.Skill;
  868. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  869. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  870. +
  871. +/**
  872. + * @author godson
  873. + */
  874. +public class ExOlympiadSpelledInfo implements IClientOutgoingPacket
  875. +{
  876. +   private final int _playerId;
  877. +   private final List<BuffInfo> _effects = new ArrayList<>();
  878. +   private final List<Skill> _effects2 = new ArrayList<>();
  879. +  
  880. +   public ExOlympiadSpelledInfo(Player player)
  881. +   {
  882. +       _playerId = player.getObjectId();
  883. +   }
  884. +  
  885. +   public void addSkill(BuffInfo info)
  886. +   {
  887. +       _effects.add(info);
  888. +   }
  889. +  
  890. +   public void addSkill(Skill skill)
  891. +   {
  892. +       _effects2.add(skill);
  893. +   }
  894. +  
  895. +   @Override
  896. +   public boolean write(PacketWriter packet)
  897. +   {
  898. +       OutgoingPackets.EX_OLYMPIAD_SPELLED_INFO.writeId(packet);
  899. +      
  900. +       packet.writeD(_playerId);
  901. +       packet.writeD(_effects.size() + _effects2.size());
  902. +       for (BuffInfo info : _effects)
  903. +       {
  904. +           if ((info != null) && info.isInUse())
  905. +           {
  906. +               packet.writeD(info.getSkill().getDisplayId());
  907. +               packet.writeH(info.getSkill().getDisplayLevel());
  908. +               packet.writeH(0x00); // Sub level
  909. +               packet.writeD(info.getSkill().getAbnormalType().getClientId());
  910. +               writeOptionalD(packet, info.getSkill().isAura() ? -1 : info.getTime());
  911. +           }
  912. +       }
  913. +       for (Skill skill : _effects2)
  914. +       {
  915. +           if (skill != null)
  916. +           {
  917. +               packet.writeD(skill.getDisplayId());
  918. +               packet.writeH(skill.getDisplayLevel());
  919. +               packet.writeH(0x00); // Sub level
  920. +               packet.writeD(skill.getAbnormalType().getClientId());
  921. +               packet.writeH(-1);
  922. +           }
  923. +       }
  924. +       return true;
  925. +   }
  926. +}
  927. Index: java/org/l2jmobius/gameserver/model/actor/Player.java
  928. ===================================================================
  929. --- java/org/l2jmobius/gameserver/model/actor/Player.java   (revision 10239)
  930. +++ java/org/l2jmobius/gameserver/model/actor/Player.java   (working copy)
  931. @@ -307,7 +307,6 @@
  932.  import org.l2jmobius.gameserver.network.serverpackets.ExGetBookMarkInfoPacket;
  933.  import org.l2jmobius.gameserver.network.serverpackets.ExGetOnAirShip;
  934.  import org.l2jmobius.gameserver.network.serverpackets.ExMagicAttackInfo;
  935. -import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMode;
  936.  import org.l2jmobius.gameserver.network.serverpackets.ExPledgeCoinInfo;
  937.  import org.l2jmobius.gameserver.network.serverpackets.ExPledgeCount;
  938.  import org.l2jmobius.gameserver.network.serverpackets.ExPrivateStoreSetWholeMsg;
  939. @@ -364,6 +363,7 @@
  940.  import org.l2jmobius.gameserver.network.serverpackets.commission.ExResponseCommissionInfo;
  941.  import org.l2jmobius.gameserver.network.serverpackets.friend.FriendStatus;
  942.  import org.l2jmobius.gameserver.network.serverpackets.limitshop.ExBloodyCoinCount;
  943. +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMode;
  944.  import org.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
  945.  import org.l2jmobius.gameserver.taskmanager.AutoPlayTaskManager;
  946.  import org.l2jmobius.gameserver.taskmanager.AutoUseTaskManager;
  947. Index: java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
  948. ===================================================================
  949. --- java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java    (revision 10239)
  950. +++ java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java    (working copy)
  951. @@ -36,10 +36,10 @@
  952.  import org.l2jmobius.gameserver.model.events.impl.olympiad.OnOlympiadMatchResult;
  953.  import org.l2jmobius.gameserver.model.instancezone.Instance;
  954.  import org.l2jmobius.gameserver.network.SystemMessageId;
  955. -import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMatchResult;
  956. -import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadUserInfo;
  957.  import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  958.  import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
  959. +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchResult;
  960. +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadUserInfo;
  961.  
  962.  /**
  963.   * @author GodKratos, Pere, DS
  964. Index: java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadUI.java
  965. ===================================================================
  966. --- java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadUI.java    (nonexistent)
  967. +++ java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadUI.java    (working copy)
  968. @@ -0,0 +1,48 @@
  969. +/*
  970. + * This file is part of the L2J Mobius project.
  971. + *
  972. + * This program is free software: you can redistribute it and/or modify
  973. + * it under the terms of the GNU General Public License as published by
  974. + * the Free Software Foundation, either version 3 of the License, or
  975. + * (at your option) any later version.
  976. + *
  977. + * This program is distributed in the hope that it will be useful,
  978. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  979. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  980. + * General Public License for more details.
  981. + *
  982. + * You should have received a copy of the GNU General Public License
  983. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  984. + */
  985. +package org.l2jmobius.gameserver.network.clientpackets.olympiad;
  986. +
  987. +import org.l2jmobius.commons.network.PacketReader;
  988. +import org.l2jmobius.gameserver.model.actor.Player;
  989. +import org.l2jmobius.gameserver.network.GameClient;
  990. +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
  991. +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadRecord;
  992. +
  993. +public class OlympiadUI implements IClientIncomingPacket
  994. +{
  995. +   private byte _cGameRuleType;
  996. +   private int _type;
  997. +  
  998. +   @Override
  999. +   public boolean read(GameClient client, PacketReader packet)
  1000. +   {
  1001. +       _cGameRuleType = (byte) packet.readC(); // _cGameRuleType
  1002. +       _type = packet.readD();
  1003. +       return true;
  1004. +   }
  1005. +  
  1006. +   @Override
  1007. +   public void run(GameClient client)
  1008. +   {
  1009. +       final Player player = client.getPlayer();
  1010. +       if (player == null)
  1011. +       {
  1012. +           return;
  1013. +       }
  1014. +       player.sendPacket(new ExOlympiadRecord(player, _cGameRuleType, _type));
  1015. +   }
  1016. +}
  1017. \ No newline at end of file
  1018. Index: java/org/l2jmobius/gameserver/GameServer.java
  1019. ===================================================================
  1020. --- java/org/l2jmobius/gameserver/GameServer.java   (revision 10239)
  1021. +++ java/org/l2jmobius/gameserver/GameServer.java   (working copy)
  1022. @@ -354,8 +354,15 @@
  1023.         InstanceManager.getInstance();
  1024.        
  1025.         printSection("Olympiad");
  1026. -       Olympiad.getInstance();
  1027. -       Hero.getInstance();
  1028. +       if (Config.ALT_OLY_ENABLE_OLYMPIAD)
  1029. +       {
  1030. +           Olympiad.getInstance();
  1031. +           Hero.getInstance();
  1032. +       }
  1033. +       else
  1034. +       {
  1035. +           printSection("Olympiad is disabled.");
  1036. +       }
  1037.        
  1038.         // Call to load caches
  1039.         printSection("Cache");
  1040. Index: java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
  1041. ===================================================================
  1042. --- java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java  (revision 10239)
  1043. +++ java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java  (working copy)
  1044. @@ -39,11 +39,11 @@
  1045.  import org.l2jmobius.gameserver.model.siege.Fort;
  1046.  import org.l2jmobius.gameserver.model.skill.Skill;
  1047.  import org.l2jmobius.gameserver.network.SystemMessageId;
  1048. -import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMode;
  1049.  import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  1050.  import org.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
  1051.  import org.l2jmobius.gameserver.network.serverpackets.SkillCoolTime;
  1052.  import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
  1053. +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMode;
  1054.  
  1055.  /**
  1056.   * @author godson, GodKratos, Pere, DS
  1057. Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadInfo.java
  1058. ===================================================================
  1059. --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadInfo.java    (nonexistent)
  1060. +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadInfo.java    (working copy)
  1061. @@ -0,0 +1,43 @@
  1062. +/*
  1063. + * This file is part of the L2J Mobius project.
  1064. + *
  1065. + * This program is free software: you can redistribute it and/or modify
  1066. + * it under the terms of the GNU General Public License as published by
  1067. + * the Free Software Foundation, either version 3 of the License, or
  1068. + * (at your option) any later version.
  1069. + *
  1070. + * This program is distributed in the hope that it will be useful,
  1071. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1072. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1073. + * General Public License for more details.
  1074. + *
  1075. + * You should have received a copy of the GNU General Public License
  1076. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  1077. + */
  1078. +package org.l2jmobius.gameserver.network.serverpackets.olympiad;
  1079. +
  1080. +import org.l2jmobius.commons.network.PacketWriter;
  1081. +import org.l2jmobius.gameserver.model.actor.Player;
  1082. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  1083. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  1084. +
  1085. +public class ExOlympiadInfo implements IClientOutgoingPacket
  1086. +{
  1087. +   private static int _open;
  1088. +  
  1089. +   public ExOlympiadInfo(Player player, int open)
  1090. +   {
  1091. +       _open = open;
  1092. +   }
  1093. +  
  1094. +   @Override
  1095. +   public boolean write(PacketWriter packet)
  1096. +   {
  1097. +       OutgoingPackets.EX_OLYMPIAD_INFO.writeId(packet);
  1098. +       packet.writeC(_open); // bOpen
  1099. +       packet.writeD(0); // nRemainTime
  1100. +       packet.writeC(1); // cGameRuleType
  1101. +      
  1102. +       return true;
  1103. +   }
  1104. +}
  1105. Index: dist/game/config/Olympiad.ini
  1106. ===================================================================
  1107. --- dist/game/config/Olympiad.ini   (revision 10239)
  1108. +++ dist/game/config/Olympiad.ini   (working copy)
  1109. @@ -9,6 +9,10 @@
  1110.  # Also please understand what you are changing before you do so on a live server.
  1111.  # ---------------------------------------------------------------------------
  1112.  
  1113. +# Enable/Disable Olympiad
  1114. +# Default: True
  1115. +AltOlyEnableOlympiad = True
  1116. +
  1117.  # Olympiad Start Time in Military hours Default 8pm (20)
  1118.  # Default: 20
  1119.  AltOlyStartTime = 20
  1120. @@ -22,9 +26,9 @@
  1121.  # Default: 14400000
  1122.  AltOlyCPeriod = 14400000
  1123.  
  1124. -# Olympiad Battle Period, Default 5 minutes.
  1125. -# Default: 300000
  1126. -AltOlyBattle = 300000
  1127. +# Olympiad Battle Period, Default 100 seconds.
  1128. +# Default: 100000
  1129. +AltOlyBattle = 100000
  1130.  
  1131.  # Olympiad Weekly Period, Default 1 week
  1132.  # Used for adding points to nobles
  1133. @@ -36,13 +40,9 @@
  1134.  AltOlyVPeriod = 86400000
  1135.  
  1136.  # Points for reaching Noblesse for the first time
  1137. -# Default: 10
  1138. -AltOlyStartPoints = 10
  1139. +# Default: 1000
  1140. +AltOlyStartPoints = 1000
  1141.  
  1142. -# Points every week
  1143. -# Default: 10
  1144. -AltOlyWeeklyPoints = 10
  1145. -
  1146.  # Required number of participants for the class based games
  1147.  # Default: 20
  1148.  AltOlyClassedParticipants = 20
  1149. @@ -133,8 +133,8 @@
  1150.  AltOlyDividerNonClassed = 5
  1151.  
  1152.  # Maximum number of matches a Noblesse character can join per week
  1153. -# Default: 30
  1154. -AltOlyMaxWeeklyMatches = 30
  1155. +# Default: 25
  1156. +AltOlyMaxWeeklyMatches = 25
  1157.  
  1158.  # Enable competitions only on specific days. Usage: 1,2,3,4,5,6,7 (SUNDAY,MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY,SATURDAY)
  1159.  # Default: 6,7 (FRIDAY,SATURDAY)
  1160. Index: java/org/l2jmobius/gameserver/model/EffectList.java
  1161. ===================================================================
  1162. --- java/org/l2jmobius/gameserver/model/EffectList.java (revision 10239)
  1163. +++ java/org/l2jmobius/gameserver/model/EffectList.java (working copy)
  1164. @@ -47,9 +47,9 @@
  1165.  import org.l2jmobius.gameserver.model.skill.SkillBuffType;
  1166.  import org.l2jmobius.gameserver.network.serverpackets.AbnormalStatusUpdate;
  1167.  import org.l2jmobius.gameserver.network.serverpackets.ExAbnormalStatusUpdateFromTarget;
  1168. -import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadSpelledInfo;
  1169.  import org.l2jmobius.gameserver.network.serverpackets.PartySpelled;
  1170.  import org.l2jmobius.gameserver.network.serverpackets.ShortBuffStatusUpdate;
  1171. +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadSpelledInfo;
  1172.  
  1173.  /**
  1174.   * Effect lists.<br>
  1175. Index: java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMaking.java
  1176. ===================================================================
  1177. --- java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMaking.java   (nonexistent)
  1178. +++ java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMaking.java   (working copy)
  1179. @@ -0,0 +1,32 @@
  1180. +package org.l2jmobius.gameserver.network.clientpackets.olympiad;
  1181. +
  1182. +import org.l2jmobius.commons.network.PacketReader;
  1183. +import org.l2jmobius.gameserver.model.actor.Player;
  1184. +import org.l2jmobius.gameserver.network.GameClient;
  1185. +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
  1186. +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchMakingResult;
  1187. +
  1188. +public class OlympiadMatchMaking implements IClientIncomingPacket
  1189. +{
  1190. +  
  1191. +   private byte _cGameRuleType;
  1192. +  
  1193. +   @Override
  1194. +   public boolean read(GameClient client, PacketReader packet)
  1195. +   {
  1196. +       _cGameRuleType = (byte) packet.readC(); // _cGameRuleType
  1197. +       return true;
  1198. +   }
  1199. +  
  1200. +   @Override
  1201. +   public void run(GameClient client)
  1202. +   {
  1203. +       final Player player = client.getPlayer();
  1204. +       if (player == null)
  1205. +       {
  1206. +           return;
  1207. +       }
  1208. +      
  1209. +       player.sendPacket(new ExOlympiadMatchMakingResult(player, _cGameRuleType, 1));
  1210. +   }
  1211. +}
  1212. \ No newline at end of file
  1213. Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadRecord.java
  1214. ===================================================================
  1215. --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadRecord.java  (nonexistent)
  1216. +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadRecord.java  (working copy)
  1217. @@ -0,0 +1,69 @@
  1218. +/*
  1219. + * This file is part of the L2J Mobius project.
  1220. + *
  1221. + * This program is free software: you can redistribute it and/or modify
  1222. + * it under the terms of the GNU General Public License as published by
  1223. + * the Free Software Foundation, either version 3 of the License, or
  1224. + * (at your option) any later version.
  1225. + *
  1226. + * This program is distributed in the hope that it will be useful,
  1227. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1228. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1229. + * General Public License for more details.
  1230. + *
  1231. + * You should have received a copy of the GNU General Public License
  1232. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  1233. + */
  1234. +package org.l2jmobius.gameserver.network.serverpackets.olympiad;
  1235. +
  1236. +import java.util.Calendar;
  1237. +
  1238. +import org.l2jmobius.commons.network.PacketWriter;
  1239. +import org.l2jmobius.gameserver.model.actor.Player;
  1240. +import org.l2jmobius.gameserver.model.olympiad.Olympiad;
  1241. +import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
  1242. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  1243. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  1244. +
  1245. +public class ExOlympiadRecord implements IClientOutgoingPacket
  1246. +{
  1247. +   private final Player _player;
  1248. +   private final int _cGameRuleType;
  1249. +   private final int _type;
  1250. +  
  1251. +   public ExOlympiadRecord(Player player, int cGameRuleType, int type)
  1252. +   {
  1253. +       _player = player;
  1254. +       _cGameRuleType = cGameRuleType;
  1255. +       _type = OlympiadManager.getInstance().isRegistered(player) ? 1 : 0; //
  1256. +   }
  1257. +  
  1258. +   @Override
  1259. +   public boolean write(PacketWriter packet)
  1260. +   {
  1261. +       OutgoingPackets.EX_OLYMPIAD_RECORD.writeId(packet);
  1262. +       packet.writeD(Olympiad.getInstance().getNoblePoints(_player)); // nPoint
  1263. +       packet.writeD(Olympiad.getInstance().getCompetitionWon(_player.getObjectId())); // nWinCount
  1264. +       packet.writeD(Olympiad.getInstance().getCompetitionLost(_player.getObjectId())); // nLoseCount
  1265. +       packet.writeD(Olympiad.getInstance().getRemainingWeeklyMatches(_player.getObjectId())); // nMatchCount
  1266. +       // Previous Cycle
  1267. +       packet.writeD(149); // nPrevClassType
  1268. +       packet.writeD(1); // nPrevRank in all servers
  1269. +       packet.writeD(2); // nPrevRankCount number of participants with 25+ matches
  1270. +       packet.writeD(3); // nPrevClassRank in all servers
  1271. +       packet.writeD(4); // nPrevClassRankCount number of participants with 25+ matches
  1272. +       packet.writeD(5); // nPrevClassRankByServer in current server
  1273. +       packet.writeD(6); // nPrevClassRankByServerCount number of participants with 25+ matches
  1274. +       packet.writeD(1500); // nPrevPoint
  1275. +       packet.writeD(7); // nPrevWinCount
  1276. +       packet.writeD(8); // nPrevLoseCount
  1277. +       packet.writeD(9); // nPrevGrade
  1278. +       packet.writeD(Calendar.getInstance().get(Calendar.YEAR)); // nSeasonYear
  1279. +       packet.writeD(Calendar.getInstance().get(Calendar.MONTH) + 1); // nSeasonMonth
  1280. +       packet.writeC(Olympiad.getInstance().inCompPeriod() ? 0x00 : 0x01); // bMatchOpen
  1281. +       packet.writeD(Olympiad.getInstance().getCurrentCycle()); // nSeason
  1282. +       packet.writeC(_type); // bRegistered
  1283. +       packet.writeD(_cGameRuleType); // cGameRuleType
  1284. +       return true;
  1285. +   }
  1286. +}
  1287. Index: java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java
  1288. ===================================================================
  1289. --- java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java   (revision 10239)
  1290. +++ java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java   (working copy)
  1291. @@ -299,7 +299,7 @@
  1292.             packet.writeC(_player.getPvpFlag());
  1293.             packet.writeD(_player.getReputation()); // Reputation
  1294.             packet.writeC(_player.getNobleLevel());
  1295. -           packet.writeC(_player.isHero() || (_player.isGM() && Config.GM_HERO_AURA) ? 2 : 0); // 152 - Value for enabled changed to 2?
  1296. +           packet.writeC(_player.isHero() || (_player.isGM() && Config.GM_HERO_AURA) ? 2 : 0); // 152 - Value for enabled changed to 2? 4 = legend
  1297.             packet.writeC(_player.getPledgeClass());
  1298.             packet.writeD(_player.getPkKills());
  1299.             packet.writeD(_player.getPvpKills());
  1300. Index: java/org/l2jmobius/gameserver/model/olympiad/Olympiad.java
  1301. ===================================================================
  1302. --- java/org/l2jmobius/gameserver/model/olympiad/Olympiad.java  (revision 10239)
  1303. +++ java/org/l2jmobius/gameserver/model/olympiad/Olympiad.java  (working copy)
  1304. @@ -94,7 +94,6 @@
  1305.     protected static final long VALIDATION_PERIOD = Config.ALT_OLY_VPERIOD; // 24 hours
  1306.    
  1307.     public static final int DEFAULT_POINTS = Config.ALT_OLY_START_POINTS;
  1308. -   protected static final int WEEKLY_POINTS = Config.ALT_OLY_WEEKLY_POINTS;
  1309.    
  1310.     public static final String CHAR_ID = "charId";
  1311.     public static final String CLASS_ID = "class_id";
  1312. @@ -769,8 +768,6 @@
  1313.     {
  1314.         _scheduledWeeklyTask = ThreadPool.scheduleAtFixedRate(() ->
  1315.         {
  1316. -           addWeeklyPoints();
  1317. -           LOGGER.info("Olympiad System: Added weekly points to nobles");
  1318.             resetWeeklyMatches();
  1319.             LOGGER.info("Olympiad System: Reset weekly matches to nobles");
  1320.            
  1321. @@ -778,22 +775,6 @@
  1322.         }, getMillisToWeekChange(), WEEKLY_PERIOD);
  1323.     }
  1324.    
  1325. -   protected synchronized void addWeeklyPoints()
  1326. -   {
  1327. -       if (_period == 1)
  1328. -       {
  1329. -           return;
  1330. -       }
  1331. -      
  1332. -       int currentPoints;
  1333. -       for (StatSet nobleInfo : NOBLES.values())
  1334. -       {
  1335. -           currentPoints = nobleInfo.getInt(POINTS);
  1336. -           currentPoints += WEEKLY_POINTS;
  1337. -           nobleInfo.set(POINTS, currentPoints);
  1338. -       }
  1339. -   }
  1340. -  
  1341.     /**
  1342.      * Resets number of matches, classed matches, non classed matches, team matches done by noble characters in the week.
  1343.      */
  1344. Index: java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
  1345. ===================================================================
  1346. --- java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java  (revision 10239)
  1347. +++ java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java  (working copy)
  1348. @@ -261,6 +261,8 @@
  1349.                 // Beginning of the battle
  1350.                 case BATTLE_STARTED:
  1351.                 {
  1352. +                   final SystemMessage sm = new SystemMessage(SystemMessageId.HIDDEN_MSG_START_OLYMPIAD);
  1353. +                   _stadium.broadcastPacket(sm);
  1354.                     _countDown = 0;
  1355.                     _state = OlympiadGameState.BATTLE_IN_PROGRESS; // set state first, used in zone update
  1356.                     if (!startBattle())
  1357. Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadInfo.java
  1358. ===================================================================
  1359. --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadInfo.java    (nonexistent)
  1360. +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadInfo.java    (working copy)
  1361. @@ -0,0 +1,43 @@
  1362. +/*
  1363. + * This file is part of the L2J Mobius project.
  1364. + *
  1365. + * This program is free software: you can redistribute it and/or modify
  1366. + * it under the terms of the GNU General Public License as published by
  1367. + * the Free Software Foundation, either version 3 of the License, or
  1368. + * (at your option) any later version.
  1369. + *
  1370. + * This program is distributed in the hope that it will be useful,
  1371. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1372. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1373. + * General Public License for more details.
  1374. + *
  1375. + * You should have received a copy of the GNU General Public License
  1376. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  1377. + */
  1378. +package org.l2jmobius.gameserver.network.serverpackets.olympiad;
  1379. +
  1380. +import org.l2jmobius.commons.network.PacketWriter;
  1381. +import org.l2jmobius.gameserver.model.actor.Player;
  1382. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  1383. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  1384. +
  1385. +public class ExOlympiadInfo implements IClientOutgoingPacket
  1386. +{
  1387. +   private static int _open;
  1388. +  
  1389. +   public ExOlympiadInfo(Player player, int open)
  1390. +   {
  1391. +       _open = open;
  1392. +   }
  1393. +  
  1394. +   @Override
  1395. +   public boolean write(PacketWriter packet)
  1396. +   {
  1397. +       OutgoingPackets.EX_OLYMPIAD_INFO.writeId(packet);
  1398. +       packet.writeC(_open); // bOpen
  1399. +       packet.writeD(0); // nRemainTime
  1400. +       packet.writeC(1); // cGameRuleType
  1401. +      
  1402. +       return true;
  1403. +   }
  1404. +}
  1405. Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchEnd.java
  1406. ===================================================================
  1407. --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchEnd.java    (nonexistent)
  1408. +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchEnd.java    (working copy)
  1409. @@ -0,0 +1,41 @@
  1410. +/*
  1411. + * This file is part of the L2J Mobius project.
  1412. + *
  1413. + * This program is free software: you can redistribute it and/or modify
  1414. + * it under the terms of the GNU General Public License as published by
  1415. + * the Free Software Foundation, either version 3 of the License, or
  1416. + * (at your option) any later version.
  1417. + *
  1418. + * This program is distributed in the hope that it will be useful,
  1419. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1420. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1421. + * General Public License for more details.
  1422. + *
  1423. + * You should have received a copy of the GNU General Public License
  1424. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  1425. + */
  1426. +package org.l2jmobius.gameserver.network.serverpackets.olympiad;
  1427. +
  1428. +import org.l2jmobius.commons.network.PacketWriter;
  1429. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  1430. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  1431. +
  1432. +/**
  1433. + * @author GodKratos
  1434. + */
  1435. +public class ExOlympiadMatchEnd implements IClientOutgoingPacket
  1436. +{
  1437. +   public static final ExOlympiadMatchEnd STATIC_PACKET = new ExOlympiadMatchEnd();
  1438. +  
  1439. +   private ExOlympiadMatchEnd()
  1440. +   {
  1441. +   }
  1442. +  
  1443. +   @Override
  1444. +   public boolean write(PacketWriter packet)
  1445. +   {
  1446. +       OutgoingPackets.EX_OLYMPIAD_MATCH_END.writeId(packet);
  1447. +      
  1448. +       return true;
  1449. +   }
  1450. +}
  1451. \ No newline at end of file
  1452. Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfo.java
  1453. ===================================================================
  1454. --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfo.java   (nonexistent)
  1455. +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfo.java   (working copy)
  1456. @@ -0,0 +1,53 @@
  1457. +/*
  1458. + * This file is part of the L2J Mobius project.
  1459. + *
  1460. + * This program is free software: you can redistribute it and/or modify
  1461. + * it under the terms of the GNU General Public License as published by
  1462. + * the Free Software Foundation, either version 3 of the License, or
  1463. + * (at your option) any later version.
  1464. + *
  1465. + * This program is distributed in the hope that it will be useful,
  1466. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1467. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1468. + * General Public License for more details.
  1469. + *
  1470. + * You should have received a copy of the GNU General Public License
  1471. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  1472. + */
  1473. +package org.l2jmobius.gameserver.network.serverpackets.olympiad;
  1474. +
  1475. +import org.l2jmobius.commons.network.PacketWriter;
  1476. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  1477. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  1478. +
  1479. +public class ExOlympiadMatchInfo implements IClientOutgoingPacket
  1480. +{
  1481. +   private final String _szTeam1Name;
  1482. +   private final String _szTeam2Name;
  1483. +   private final int _nTeam1WinCount;
  1484. +   private final int _nTeam2WinCount;
  1485. +   private final int _round;
  1486. +  
  1487. +   public ExOlympiadMatchInfo(String szTeam1Name, String szTeam2Name, int nTeam1WinCount, int nTeam2WinCount, int round)
  1488. +   {
  1489. +       _szTeam1Name = szTeam1Name;
  1490. +       _szTeam2Name = szTeam2Name;
  1491. +       _nTeam1WinCount = nTeam1WinCount;
  1492. +       _nTeam2WinCount = nTeam2WinCount;
  1493. +       _round = round;
  1494. +   }
  1495. +  
  1496. +   @Override
  1497. +   public boolean write(PacketWriter packet)
  1498. +   {
  1499. +       OutgoingPackets.EX_OLYMPIAD_MATCH_INFO.writeId(packet);
  1500. +      
  1501. +       packet.writeS(String.format("%1$-" + 23 + "s", _szTeam2Name)); // Name 2
  1502. +       packet.writeD(_nTeam2WinCount); // Wins 2
  1503. +       packet.writeS(String.format("%1$-" + 23 + "s", _szTeam1Name)); // Name 1
  1504. +       packet.writeD(_nTeam1WinCount); // Wins 1
  1505. +       packet.writeD(_round); // Round
  1506. +       packet.writeD(100); // Seconds
  1507. +       return true;
  1508. +   }
  1509. +}
  1510. Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfoEnd.java
  1511. ===================================================================
  1512. --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfoEnd.java    (nonexistent)
  1513. +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfoEnd.java    (working copy)
  1514. @@ -0,0 +1,37 @@
  1515. +/*
  1516. + * This file is part of the L2J Mobius project.
  1517. + *
  1518. + * This program is free software: you can redistribute it and/or modify
  1519. + * it under the terms of the GNU General Public License as published by
  1520. + * the Free Software Foundation, either version 3 of the License, or
  1521. + * (at your option) any later version.
  1522. + *
  1523. + * This program is distributed in the hope that it will be useful,
  1524. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1525. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1526. + * General Public License for more details.
  1527. + *
  1528. + * You should have received a copy of the GNU General Public License
  1529. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  1530. + */
  1531. +package org.l2jmobius.gameserver.network.serverpackets.olympiad;
  1532. +
  1533. +import org.l2jmobius.commons.network.PacketWriter;
  1534. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  1535. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  1536. +
  1537. +public class ExOlympiadMatchInfoEnd implements IClientOutgoingPacket
  1538. +{
  1539. +  
  1540. +   public ExOlympiadMatchInfoEnd()
  1541. +   {
  1542. +   }
  1543. +  
  1544. +   @Override
  1545. +   public boolean write(PacketWriter packet)
  1546. +   {
  1547. +       OutgoingPackets.EX_OLYMPIAD_MATCH_INFO.writeId(packet);
  1548. +      
  1549. +       return true;
  1550. +   }
  1551. +}
  1552. Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchList.java
  1553. ===================================================================
  1554. --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchList.java   (nonexistent)
  1555. +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchList.java   (working copy)
  1556. @@ -0,0 +1,92 @@
  1557. +/*
  1558. + * This file is part of the L2J Mobius project.
  1559. + *
  1560. + * This program is free software: you can redistribute it and/or modify
  1561. + * it under the terms of the GNU General Public License as published by
  1562. + * the Free Software Foundation, either version 3 of the License, or
  1563. + * (at your option) any later version.
  1564. + *
  1565. + * This program is distributed in the hope that it will be useful,
  1566. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1567. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1568. + * General Public License for more details.
  1569. + *
  1570. + * You should have received a copy of the GNU General Public License
  1571. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  1572. + */
  1573. +package org.l2jmobius.gameserver.network.serverpackets.olympiad;
  1574. +
  1575. +import java.util.ArrayList;
  1576. +import java.util.List;
  1577. +
  1578. +import org.l2jmobius.commons.network.PacketWriter;
  1579. +import org.l2jmobius.gameserver.model.olympiad.AbstractOlympiadGame;
  1580. +import org.l2jmobius.gameserver.model.olympiad.OlympiadGameClassed;
  1581. +import org.l2jmobius.gameserver.model.olympiad.OlympiadGameManager;
  1582. +import org.l2jmobius.gameserver.model.olympiad.OlympiadGameNonClassed;
  1583. +import org.l2jmobius.gameserver.model.olympiad.OlympiadGameTask;
  1584. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  1585. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  1586. +
  1587. +/**
  1588. + * @author mrTJO
  1589. + */
  1590. +public class ExOlympiadMatchList implements IClientOutgoingPacket
  1591. +{
  1592. +   private final List<OlympiadGameTask> _games = new ArrayList<>();
  1593. +  
  1594. +   public ExOlympiadMatchList()
  1595. +   {
  1596. +       OlympiadGameTask task;
  1597. +       for (int i = 0; i < OlympiadGameManager.getInstance().getNumberOfStadiums(); i++)
  1598. +       {
  1599. +           task = OlympiadGameManager.getInstance().getOlympiadTask(i);
  1600. +           if (task != null)
  1601. +           {
  1602. +               if (!task.isGameStarted() || task.isBattleFinished())
  1603. +               {
  1604. +                   continue; // initial or finished state not shown
  1605. +               }
  1606. +               _games.add(task);
  1607. +           }
  1608. +       }
  1609. +   }
  1610. +  
  1611. +   @Override
  1612. +   public boolean write(PacketWriter packet)
  1613. +   {
  1614. +       OutgoingPackets.EX_RECEIVE_OLYMPIAD.writeId(packet);
  1615. +      
  1616. +       packet.writeD(0); // Type 0 = Match List, 1 = Match Result
  1617. +      
  1618. +       packet.writeD(_games.size());
  1619. +       packet.writeD(0);
  1620. +      
  1621. +       for (OlympiadGameTask curGame : _games)
  1622. +       {
  1623. +           final AbstractOlympiadGame game = curGame.getGame();
  1624. +           if (game != null)
  1625. +           {
  1626. +               packet.writeD(game.getStadiumId()); // Stadium Id (Arena 1 = 0)
  1627. +              
  1628. +               if (game instanceof OlympiadGameNonClassed)
  1629. +               {
  1630. +                   packet.writeD(1);
  1631. +               }
  1632. +               else if (game instanceof OlympiadGameClassed)
  1633. +               {
  1634. +                   packet.writeD(2);
  1635. +               }
  1636. +               else
  1637. +               {
  1638. +                   packet.writeD(0);
  1639. +               }
  1640. +              
  1641. +               packet.writeD(curGame.isRunning() ? 2 : 1); // (1 = Standby, 2 = Playing)
  1642. +               packet.writeS(game.getPlayerNames()[0]); // Player 1 Name
  1643. +               packet.writeS(game.getPlayerNames()[1]); // Player 2 Name
  1644. +           }
  1645. +       }
  1646. +       return true;
  1647. +   }
  1648. +}
  1649. Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchMakingResult.java
  1650. ===================================================================
  1651. --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchMakingResult.java   (nonexistent)
  1652. +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchMakingResult.java   (working copy)
  1653. @@ -0,0 +1,43 @@
  1654. +/*
  1655. + * This file is part of the L2J Mobius project.
  1656. + *
  1657. + * This program is free software: you can redistribute it and/or modify
  1658. + * it under the terms of the GNU General Public License as published by
  1659. + * the Free Software Foundation, either version 3 of the License, or
  1660. + * (at your option) any later version.
  1661. + *
  1662. + * This program is distributed in the hope that it will be useful,
  1663. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1664. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1665. + * General Public License for more details.
  1666. + *
  1667. + * You should have received a copy of the GNU General Public License
  1668. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  1669. + */
  1670. +package org.l2jmobius.gameserver.network.serverpackets.olympiad;
  1671. +
  1672. +import org.l2jmobius.commons.network.PacketWriter;
  1673. +import org.l2jmobius.gameserver.model.actor.Player;
  1674. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  1675. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  1676. +
  1677. +public class ExOlympiadMatchMakingResult implements IClientOutgoingPacket
  1678. +{
  1679. +   private final int _cGameRuleType;
  1680. +   private final int _type;
  1681. +  
  1682. +   public ExOlympiadMatchMakingResult(Player player, int cGameRuleType, int type)
  1683. +   {
  1684. +       _cGameRuleType = 0;
  1685. +       _type = type;
  1686. +   }
  1687. +  
  1688. +   @Override
  1689. +   public boolean write(PacketWriter packet)
  1690. +   {
  1691. +       OutgoingPackets.EX_OLYMPIAD_INFO.writeId(packet);
  1692. +       packet.writeC(_type);
  1693. +       packet.writeD(_cGameRuleType);
  1694. +       return true;
  1695. +   }
  1696. +}
  1697. Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchResult.java
  1698. ===================================================================
  1699. --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchResult.java (nonexistent)
  1700. +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchResult.java (working copy)
  1701. @@ -0,0 +1,93 @@
  1702. +/*
  1703. + * This file is part of the L2J Mobius project.
  1704. + *
  1705. + * This program is free software: you can redistribute it and/or modify
  1706. + * it under the terms of the GNU General Public License as published by
  1707. + * the Free Software Foundation, either version 3 of the License, or
  1708. + * (at your option) any later version.
  1709. + *
  1710. + * This program is distributed in the hope that it will be useful,
  1711. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1712. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1713. + * General Public License for more details.
  1714. + *
  1715. + * You should have received a copy of the GNU General Public License
  1716. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  1717. + */
  1718. +package org.l2jmobius.gameserver.network.serverpackets.olympiad;
  1719. +
  1720. +import java.util.List;
  1721. +
  1722. +import org.l2jmobius.commons.network.PacketWriter;
  1723. +import org.l2jmobius.gameserver.model.olympiad.OlympiadInfo;
  1724. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  1725. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  1726. +
  1727. +/**
  1728. + * @author JIV
  1729. + */
  1730. +public class ExOlympiadMatchResult implements IClientOutgoingPacket
  1731. +{
  1732. +   private final boolean _tie;
  1733. +   private int _winTeam; // 1,2
  1734. +   private int _loseTeam = 2;
  1735. +   private final List<OlympiadInfo> _winnerList;
  1736. +   private final List<OlympiadInfo> _loserList;
  1737. +  
  1738. +   public ExOlympiadMatchResult(boolean tie, int winTeam, List<OlympiadInfo> winnerList, List<OlympiadInfo> loserList)
  1739. +   {
  1740. +       _tie = tie;
  1741. +       _winTeam = winTeam;
  1742. +       _winnerList = winnerList;
  1743. +       _loserList = loserList;
  1744. +       if (_winTeam == 2)
  1745. +       {
  1746. +           _loseTeam = 1;
  1747. +       }
  1748. +       else if (_winTeam == 0)
  1749. +       {
  1750. +           _winTeam = 1;
  1751. +       }
  1752. +   }
  1753. +  
  1754. +   @Override
  1755. +   public boolean write(PacketWriter packet)
  1756. +   {
  1757. +       OutgoingPackets.EX_RECEIVE_OLYMPIAD.writeId(packet);
  1758. +       packet.writeD(2); // Type 0 = Match List, 1 = Match Result, 2 = New Oly look, 3 = 3v3
  1759. +       packet.writeD(_tie ? 1 : 0); // 0 - win, 1 - tie
  1760. +       packet.writeS(_winnerList.get(0).getName());
  1761. +       packet.writeD(_winTeam);
  1762. +       packet.writeD(_winnerList.size());
  1763. +       for (OlympiadInfo info : _winnerList)
  1764. +       {
  1765. +           packet.writeS(info.getName());
  1766. +           packet.writeS(info.getClanName());
  1767. +           packet.writeD(info.getClanId());
  1768. +           packet.writeD(info.getClassId());
  1769. +           packet.writeD(info.getDamage());
  1770. +           packet.writeD(info.getCurrentPoints());
  1771. +           packet.writeD(info.getDiffPoints());
  1772. +           packet.writeD(0); // Helios
  1773. +       }
  1774. +       packet.writeD(_loseTeam);
  1775. +       packet.writeD(_loserList.size());
  1776. +       for (OlympiadInfo info : _loserList)
  1777. +       {
  1778. +           packet.writeS(info.getName());
  1779. +           packet.writeS(info.getClanName());
  1780. +           packet.writeD(info.getClanId());
  1781. +           packet.writeD(info.getClassId());
  1782. +           packet.writeD(info.getDamage());
  1783. +           packet.writeD(info.getCurrentPoints());
  1784. +           packet.writeD(info.getDiffPoints());
  1785. +           packet.writeD(0); // Helios
  1786. +       }
  1787. +       packet.writeC(3); // Round 1 outcome
  1788. +       packet.writeC(2); // Round 2 outcome
  1789. +       packet.writeC(3); // Round 3 outcome
  1790. +       packet.writeD(15); // Bonus Reward
  1791. +       packet.writeD(0); // Bonus Reward for looser
  1792. +       return true;
  1793. +   }
  1794. +}
  1795. Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMode.java
  1796. ===================================================================
  1797. --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMode.java    (nonexistent)
  1798. +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMode.java    (working copy)
  1799. @@ -0,0 +1,46 @@
  1800. +/*
  1801. + * This file is part of the L2J Mobius project.
  1802. + *
  1803. + * This program is free software: you can redistribute it and/or modify
  1804. + * it under the terms of the GNU General Public License as published by
  1805. + * the Free Software Foundation, either version 3 of the License, or
  1806. + * (at your option) any later version.
  1807. + *
  1808. + * This program is distributed in the hope that it will be useful,
  1809. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1810. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1811. + * General Public License for more details.
  1812. + *
  1813. + * You should have received a copy of the GNU General Public License
  1814. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  1815. + */
  1816. +package org.l2jmobius.gameserver.network.serverpackets.olympiad;
  1817. +
  1818. +import org.l2jmobius.commons.network.PacketWriter;
  1819. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  1820. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  1821. +
  1822. +/**
  1823. + * @author godson
  1824. + */
  1825. +public class ExOlympiadMode implements IClientOutgoingPacket
  1826. +{
  1827. +   private final int _mode;
  1828. +  
  1829. +   /**
  1830. +    * @param mode (0 = return, 3 = spectate)
  1831. +    */
  1832. +   public ExOlympiadMode(int mode)
  1833. +   {
  1834. +       _mode = mode;
  1835. +   }
  1836. +  
  1837. +   @Override
  1838. +   public boolean write(PacketWriter packet)
  1839. +   {
  1840. +       OutgoingPackets.EX_OLYMPIAD_MODE.writeId(packet);
  1841. +      
  1842. +       packet.writeC(_mode);
  1843. +       return true;
  1844. +   }
  1845. +}
  1846. Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadRecord.java
  1847. ===================================================================
  1848. --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadRecord.java  (nonexistent)
  1849. +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadRecord.java  (working copy)
  1850. @@ -0,0 +1,69 @@
  1851. +/*
  1852. + * This file is part of the L2J Mobius project.
  1853. + *
  1854. + * This program is free software: you can redistribute it and/or modify
  1855. + * it under the terms of the GNU General Public License as published by
  1856. + * the Free Software Foundation, either version 3 of the License, or
  1857. + * (at your option) any later version.
  1858. + *
  1859. + * This program is distributed in the hope that it will be useful,
  1860. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1861. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1862. + * General Public License for more details.
  1863. + *
  1864. + * You should have received a copy of the GNU General Public License
  1865. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  1866. + */
  1867. +package org.l2jmobius.gameserver.network.serverpackets.olympiad;
  1868. +
  1869. +import java.util.Calendar;
  1870. +
  1871. +import org.l2jmobius.commons.network.PacketWriter;
  1872. +import org.l2jmobius.gameserver.model.actor.Player;
  1873. +import org.l2jmobius.gameserver.model.olympiad.Olympiad;
  1874. +import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
  1875. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  1876. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  1877. +
  1878. +public class ExOlympiadRecord implements IClientOutgoingPacket
  1879. +{
  1880. +   private final Player _player;
  1881. +   private final int _cGameRuleType;
  1882. +   private final int _type;
  1883. +  
  1884. +   public ExOlympiadRecord(Player player, int cGameRuleType, int type)
  1885. +   {
  1886. +       _player = player;
  1887. +       _cGameRuleType = cGameRuleType;
  1888. +       _type = OlympiadManager.getInstance().isRegistered(player) ? 1 : 0; //
  1889. +   }
  1890. +  
  1891. +   @Override
  1892. +   public boolean write(PacketWriter packet)
  1893. +   {
  1894. +       OutgoingPackets.EX_OLYMPIAD_RECORD.writeId(packet);
  1895. +       packet.writeD(Olympiad.getInstance().getNoblePoints(_player)); // nPoint
  1896. +       packet.writeD(Olympiad.getInstance().getCompetitionWon(_player.getObjectId())); // nWinCount
  1897. +       packet.writeD(Olympiad.getInstance().getCompetitionLost(_player.getObjectId())); // nLoseCount
  1898. +       packet.writeD(Olympiad.getInstance().getRemainingWeeklyMatches(_player.getObjectId())); // nMatchCount
  1899. +       // Previous Cycle
  1900. +       packet.writeD(149); // nPrevClassType
  1901. +       packet.writeD(1); // nPrevRank in all servers
  1902. +       packet.writeD(2); // nPrevRankCount number of participants with 25+ matches
  1903. +       packet.writeD(3); // nPrevClassRank in all servers
  1904. +       packet.writeD(4); // nPrevClassRankCount number of participants with 25+ matches
  1905. +       packet.writeD(5); // nPrevClassRankByServer in current server
  1906. +       packet.writeD(6); // nPrevClassRankByServerCount number of participants with 25+ matches
  1907. +       packet.writeD(1500); // nPrevPoint
  1908. +       packet.writeD(7); // nPrevWinCount
  1909. +       packet.writeD(8); // nPrevLoseCount
  1910. +       packet.writeD(9); // nPrevGrade
  1911. +       packet.writeD(Calendar.getInstance().get(Calendar.YEAR)); // nSeasonYear
  1912. +       packet.writeD(Calendar.getInstance().get(Calendar.MONTH) + 1); // nSeasonMonth
  1913. +       packet.writeC(Olympiad.getInstance().inCompPeriod() ? 0x00 : 0x01); // bMatchOpen
  1914. +       packet.writeD(Olympiad.getInstance().getCurrentCycle()); // nSeason
  1915. +       packet.writeC(_type); // bRegistered
  1916. +       packet.writeD(_cGameRuleType); // cGameRuleType
  1917. +       return true;
  1918. +   }
  1919. +}
  1920. Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadSpelledInfo.java
  1921. ===================================================================
  1922. --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadSpelledInfo.java (nonexistent)
  1923. +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadSpelledInfo.java (working copy)
  1924. @@ -0,0 +1,84 @@
  1925. +/*
  1926. + * This file is part of the L2J Mobius project.
  1927. + *
  1928. + * This program is free software: you can redistribute it and/or modify
  1929. + * it under the terms of the GNU General Public License as published by
  1930. + * the Free Software Foundation, either version 3 of the License, or
  1931. + * (at your option) any later version.
  1932. + *
  1933. + * This program is distributed in the hope that it will be useful,
  1934. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1935. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1936. + * General Public License for more details.
  1937. + *
  1938. + * You should have received a copy of the GNU General Public License
  1939. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  1940. + */
  1941. +package org.l2jmobius.gameserver.network.serverpackets.olympiad;
  1942. +
  1943. +import java.util.ArrayList;
  1944. +import java.util.List;
  1945. +
  1946. +import org.l2jmobius.commons.network.PacketWriter;
  1947. +import org.l2jmobius.gameserver.model.actor.Player;
  1948. +import org.l2jmobius.gameserver.model.skill.BuffInfo;
  1949. +import org.l2jmobius.gameserver.model.skill.Skill;
  1950. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  1951. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  1952. +
  1953. +/**
  1954. + * @author godson
  1955. + */
  1956. +public class ExOlympiadSpelledInfo implements IClientOutgoingPacket
  1957. +{
  1958. +   private final int _playerId;
  1959. +   private final List<BuffInfo> _effects = new ArrayList<>();
  1960. +   private final List<Skill> _effects2 = new ArrayList<>();
  1961. +  
  1962. +   public ExOlympiadSpelledInfo(Player player)
  1963. +   {
  1964. +       _playerId = player.getObjectId();
  1965. +   }
  1966. +  
  1967. +   public void addSkill(BuffInfo info)
  1968. +   {
  1969. +       _effects.add(info);
  1970. +   }
  1971. +  
  1972. +   public void addSkill(Skill skill)
  1973. +   {
  1974. +       _effects2.add(skill);
  1975. +   }
  1976. +  
  1977. +   @Override
  1978. +   public boolean write(PacketWriter packet)
  1979. +   {
  1980. +       OutgoingPackets.EX_OLYMPIAD_SPELLED_INFO.writeId(packet);
  1981. +      
  1982. +       packet.writeD(_playerId);
  1983. +       packet.writeD(_effects.size() + _effects2.size());
  1984. +       for (BuffInfo info : _effects)
  1985. +       {
  1986. +           if ((info != null) && info.isInUse())
  1987. +           {
  1988. +               packet.writeD(info.getSkill().getDisplayId());
  1989. +               packet.writeH(info.getSkill().getDisplayLevel());
  1990. +               packet.writeH(0x00); // Sub level
  1991. +               packet.writeD(info.getSkill().getAbnormalType().getClientId());
  1992. +               writeOptionalD(packet, info.getSkill().isAura() ? -1 : info.getTime());
  1993. +           }
  1994. +       }
  1995. +       for (Skill skill : _effects2)
  1996. +       {
  1997. +           if (skill != null)
  1998. +           {
  1999. +               packet.writeD(skill.getDisplayId());
  2000. +               packet.writeH(skill.getDisplayLevel());
  2001. +               packet.writeH(0x00); // Sub level
  2002. +               packet.writeD(skill.getAbnormalType().getClientId());
  2003. +               packet.writeH(-1);
  2004. +           }
  2005. +       }
  2006. +       return true;
  2007. +   }
  2008. +}
  2009. Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadUserInfo.java
  2010. ===================================================================
  2011. --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadUserInfo.java    (nonexistent)
  2012. +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadUserInfo.java    (working copy)
  2013. @@ -0,0 +1,102 @@
  2014. +/*
  2015. + * This file is part of the L2J Mobius project.
  2016. + *
  2017. + * This program is free software: you can redistribute it and/or modify
  2018. + * it under the terms of the GNU General Public License as published by
  2019. + * the Free Software Foundation, either version 3 of the License, or
  2020. + * (at your option) any later version.
  2021. + *
  2022. + * This program is distributed in the hope that it will be useful,
  2023. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2024. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  2025. + * General Public License for more details.
  2026. + *
  2027. + * You should have received a copy of the GNU General Public License
  2028. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  2029. + */
  2030. +package org.l2jmobius.gameserver.network.serverpackets.olympiad;
  2031. +
  2032. +import org.l2jmobius.commons.network.PacketWriter;
  2033. +import org.l2jmobius.gameserver.model.actor.Player;
  2034. +import org.l2jmobius.gameserver.model.olympiad.Participant;
  2035. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  2036. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  2037. +
  2038. +/**
  2039. + * @author godson
  2040. + */
  2041. +public class ExOlympiadUserInfo implements IClientOutgoingPacket
  2042. +{
  2043. +   private final Player _player;
  2044. +   private Participant _par = null;
  2045. +   private int _curHp;
  2046. +   private int _maxHp;
  2047. +   private int _curCp;
  2048. +   private int _maxCp;
  2049. +  
  2050. +   public ExOlympiadUserInfo(Player player)
  2051. +   {
  2052. +       _player = player;
  2053. +       if (_player != null)
  2054. +       {
  2055. +           _curHp = (int) _player.getCurrentHp();
  2056. +           _maxHp = _player.getMaxHp();
  2057. +           _curCp = (int) _player.getCurrentCp();
  2058. +           _maxCp = _player.getMaxCp();
  2059. +       }
  2060. +       else
  2061. +       {
  2062. +           _curHp = 0;
  2063. +           _maxHp = 100;
  2064. +           _curCp = 0;
  2065. +           _maxCp = 100;
  2066. +       }
  2067. +   }
  2068. +  
  2069. +   public ExOlympiadUserInfo(Participant par)
  2070. +   {
  2071. +       _par = par;
  2072. +       _player = par.getPlayer();
  2073. +       if (_player != null)
  2074. +       {
  2075. +           _curHp = (int) _player.getCurrentHp();
  2076. +           _maxHp = _player.getMaxHp();
  2077. +           _curCp = (int) _player.getCurrentCp();
  2078. +           _maxCp = _player.getMaxCp();
  2079. +       }
  2080. +       else
  2081. +       {
  2082. +           _curHp = 0;
  2083. +           _maxHp = 100;
  2084. +           _curCp = 0;
  2085. +           _maxCp = 100;
  2086. +       }
  2087. +   }
  2088. +  
  2089. +   @Override
  2090. +   public boolean write(PacketWriter packet)
  2091. +   {
  2092. +       OutgoingPackets.EX_OLYMPIAD_USER_INFO.writeId(packet);
  2093. +      
  2094. +       if (_player != null)
  2095. +       {
  2096. +           packet.writeC(_player.getOlympiadSide());
  2097. +           packet.writeD(_player.getObjectId());
  2098. +           packet.writeS(_player.getName());
  2099. +           packet.writeD(_player.getClassId().getId());
  2100. +       }
  2101. +       else
  2102. +       {
  2103. +           packet.writeC(_par.getSide());
  2104. +           packet.writeD(_par.getObjectId());
  2105. +           packet.writeS(_par.getName());
  2106. +           packet.writeD(_par.getBaseClass());
  2107. +       }
  2108. +      
  2109. +       packet.writeD(_curHp);
  2110. +       packet.writeD(_maxHp);
  2111. +       packet.writeD(_curCp);
  2112. +       packet.writeD(_maxCp);
  2113. +       return true;
  2114. +   }
  2115. +}
  2116. Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchResult.java
  2117. ===================================================================
  2118. --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchResult.java (nonexistent)
  2119. +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchResult.java (working copy)
  2120. @@ -0,0 +1,93 @@
  2121. +/*
  2122. + * This file is part of the L2J Mobius project.
  2123. + *
  2124. + * This program is free software: you can redistribute it and/or modify
  2125. + * it under the terms of the GNU General Public License as published by
  2126. + * the Free Software Foundation, either version 3 of the License, or
  2127. + * (at your option) any later version.
  2128. + *
  2129. + * This program is distributed in the hope that it will be useful,
  2130. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2131. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  2132. + * General Public License for more details.
  2133. + *
  2134. + * You should have received a copy of the GNU General Public License
  2135. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  2136. + */
  2137. +package org.l2jmobius.gameserver.network.serverpackets.olympiad;
  2138. +
  2139. +import java.util.List;
  2140. +
  2141. +import org.l2jmobius.commons.network.PacketWriter;
  2142. +import org.l2jmobius.gameserver.model.olympiad.OlympiadInfo;
  2143. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  2144. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  2145. +
  2146. +/**
  2147. + * @author JIV
  2148. + */
  2149. +public class ExOlympiadMatchResult implements IClientOutgoingPacket
  2150. +{
  2151. +   private final boolean _tie;
  2152. +   private int _winTeam; // 1,2
  2153. +   private int _loseTeam = 2;
  2154. +   private final List<OlympiadInfo> _winnerList;
  2155. +   private final List<OlympiadInfo> _loserList;
  2156. +  
  2157. +   public ExOlympiadMatchResult(boolean tie, int winTeam, List<OlympiadInfo> winnerList, List<OlympiadInfo> loserList)
  2158. +   {
  2159. +       _tie = tie;
  2160. +       _winTeam = winTeam;
  2161. +       _winnerList = winnerList;
  2162. +       _loserList = loserList;
  2163. +       if (_winTeam == 2)
  2164. +       {
  2165. +           _loseTeam = 1;
  2166. +       }
  2167. +       else if (_winTeam == 0)
  2168. +       {
  2169. +           _winTeam = 1;
  2170. +       }
  2171. +   }
  2172. +  
  2173. +   @Override
  2174. +   public boolean write(PacketWriter packet)
  2175. +   {
  2176. +       OutgoingPackets.EX_RECEIVE_OLYMPIAD.writeId(packet);
  2177. +       packet.writeD(2); // Type 0 = Match List, 1 = Match Result, 2 = New Oly look, 3 = 3v3
  2178. +       packet.writeD(_tie ? 1 : 0); // 0 - win, 1 - tie
  2179. +       packet.writeS(_winnerList.get(0).getName());
  2180. +       packet.writeD(_winTeam);
  2181. +       packet.writeD(_winnerList.size());
  2182. +       for (OlympiadInfo info : _winnerList)
  2183. +       {
  2184. +           packet.writeS(info.getName());
  2185. +           packet.writeS(info.getClanName());
  2186. +           packet.writeD(info.getClanId());
  2187. +           packet.writeD(info.getClassId());
  2188. +           packet.writeD(info.getDamage());
  2189. +           packet.writeD(info.getCurrentPoints());
  2190. +           packet.writeD(info.getDiffPoints());
  2191. +           packet.writeD(0); // Helios
  2192. +       }
  2193. +       packet.writeD(_loseTeam);
  2194. +       packet.writeD(_loserList.size());
  2195. +       for (OlympiadInfo info : _loserList)
  2196. +       {
  2197. +           packet.writeS(info.getName());
  2198. +           packet.writeS(info.getClanName());
  2199. +           packet.writeD(info.getClanId());
  2200. +           packet.writeD(info.getClassId());
  2201. +           packet.writeD(info.getDamage());
  2202. +           packet.writeD(info.getCurrentPoints());
  2203. +           packet.writeD(info.getDiffPoints());
  2204. +           packet.writeD(0); // Helios
  2205. +       }
  2206. +       packet.writeC(3); // Round 1 outcome
  2207. +       packet.writeC(2); // Round 2 outcome
  2208. +       packet.writeC(3); // Round 3 outcome
  2209. +       packet.writeD(15); // Bonus Reward
  2210. +       packet.writeD(0); // Bonus Reward for looser
  2211. +       return true;
  2212. +   }
  2213. +}
  2214. Index: dist/game/data/scripts/ai/others/OlyManager/OlyManager.java
  2215. ===================================================================
  2216. --- dist/game/data/scripts/ai/others/OlyManager/OlyManager.java (revision 10239)
  2217. +++ dist/game/data/scripts/ai/others/OlyManager/OlyManager.java (working copy)
  2218. @@ -42,7 +42,7 @@
  2219.  import org.l2jmobius.gameserver.model.olympiad.OlympiadGameTask;
  2220.  import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
  2221.  import org.l2jmobius.gameserver.network.SystemMessageId;
  2222. -import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMatchList;
  2223. +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchList;
  2224.  
  2225.  import ai.AbstractNpcAI;
  2226.  
  2227. Index: dist/game/data/scripts/handlers/usercommandhandlers/OlympiadStat.java
  2228. ===================================================================
  2229. --- dist/game/data/scripts/handlers/usercommandhandlers/OlympiadStat.java   (revision 10239)
  2230. +++ dist/game/data/scripts/handlers/usercommandhandlers/OlympiadStat.java   (working copy)
  2231. @@ -16,12 +16,15 @@
  2232.   */
  2233.  package handlers.usercommandhandlers;
  2234.  
  2235. +import org.l2jmobius.Config;
  2236.  import org.l2jmobius.gameserver.handler.IUserCommandHandler;
  2237.  import org.l2jmobius.gameserver.model.WorldObject;
  2238.  import org.l2jmobius.gameserver.model.actor.Player;
  2239.  import org.l2jmobius.gameserver.model.olympiad.Olympiad;
  2240. +import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
  2241.  import org.l2jmobius.gameserver.network.SystemMessageId;
  2242.  import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
  2243. +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadRecord;
  2244.  
  2245.  /**
  2246.   * Olympiad Stat user command.
  2247. @@ -37,6 +40,11 @@
  2248.     @Override
  2249.     public boolean useUserCommand(int id, Player player)
  2250.     {
  2251. +       if (!Config.ALT_OLY_ENABLE_OLYMPIAD)
  2252. +       {
  2253. +           player.sendMessage("Olympiad is disabled. Please try again later.");
  2254. +           return false;
  2255. +       }
  2256.         if (id != COMMAND_IDS[0])
  2257.         {
  2258.             return false;
  2259. @@ -43,9 +51,14 @@
  2260.         }
  2261.        
  2262.         final int nobleObjId = player.getObjectId();
  2263. -       final WorldObject target = player.getTarget();
  2264. -       if ((target == null) || !target.isPlayer() || (target.getActingPlayer().getNobleLevel() == 0))
  2265. +       WorldObject target = player.getTarget();
  2266. +       if ((target == null) || !target.isPlayer())
  2267.         {
  2268. +           player.sendPacket(new ExOlympiadRecord(player, 1, OlympiadManager.getInstance().isRegistered(player) ? 1 : 0));
  2269. +           return true;
  2270. +       }
  2271. +       else if ((target.getActingPlayer().getNobleLevel() == 0))
  2272. +       {
  2273.             player.sendPacket(SystemMessageId.THIS_COMMAND_CAN_ONLY_BE_USED_WHEN_THE_TARGET_IS_AN_AWAKENED_NOBLESSE_EXALTED);
  2274.             return false;
  2275.         }
  2276. @@ -60,6 +73,7 @@
  2277.         final SystemMessage sm2 = new SystemMessage(SystemMessageId.THIS_WEEK_YOU_CAN_PARTICIPATE_IN_A_TOTAL_OF_S1_MATCHES);
  2278.         sm2.addInt(Olympiad.getInstance().getRemainingWeeklyMatches(nobleObjId));
  2279.         player.sendPacket(sm2);
  2280. +       player.sendPacket(new ExOlympiadRecord(player, 1, OlympiadManager.getInstance().isRegistered(player) ? 1 : 0));
  2281.         return true;
  2282.     }
  2283.    
  2284. Index: java/org/l2jmobius/Config.java
  2285. ===================================================================
  2286. --- java/org/l2jmobius/Config.java  (revision 10239)
  2287. +++ java/org/l2jmobius/Config.java  (working copy)
  2288. @@ -516,6 +516,7 @@
  2289.     public static int WORLD_CHAT_MIN_LEVEL;
  2290.     public static int WORLD_CHAT_POINTS_PER_DAY;
  2291.     public static Duration WORLD_CHAT_INTERVAL;
  2292. +   public static boolean ALT_OLY_ENABLE_OLYMPIAD;
  2293.     public static int ALT_OLY_START_TIME;
  2294.     public static int ALT_OLY_MIN;
  2295.     public static long ALT_OLY_CPERIOD;
  2296. @@ -523,7 +524,6 @@
  2297.     public static long ALT_OLY_WPERIOD;
  2298.     public static long ALT_OLY_VPERIOD;
  2299.     public static int ALT_OLY_START_POINTS;
  2300. -   public static int ALT_OLY_WEEKLY_POINTS;
  2301.     public static int ALT_OLY_CLASSED;
  2302.     public static int ALT_OLY_NONCLASSED;
  2303.     public static List<ItemHolder> ALT_OLY_WINNER_REWARD;
  2304. @@ -2431,6 +2431,7 @@
  2305.            
  2306.             // Load Olympiad config file (if exists)
  2307.             final PropertiesParser olympiadConfig = new PropertiesParser(OLYMPIAD_CONFIG_FILE);
  2308. +           ALT_OLY_ENABLE_OLYMPIAD = olympiadConfig.getBoolean("AltOlyEnableOlympiad", true);
  2309.             ALT_OLY_START_TIME = olympiadConfig.getInt("AltOlyStartTime", 20);
  2310.             ALT_OLY_MIN = olympiadConfig.getInt("AltOlyMin", 0);
  2311.             ALT_OLY_CPERIOD = olympiadConfig.getLong("AltOlyCPeriod", 14400000);
  2312. @@ -2437,8 +2438,7 @@
  2313.             ALT_OLY_BATTLE = olympiadConfig.getLong("AltOlyBattle", 300000);
  2314.             ALT_OLY_WPERIOD = olympiadConfig.getLong("AltOlyWPeriod", 604800000);
  2315.             ALT_OLY_VPERIOD = olympiadConfig.getLong("AltOlyVPeriod", 86400000);
  2316. -           ALT_OLY_START_POINTS = olympiadConfig.getInt("AltOlyStartPoints", 10);
  2317. -           ALT_OLY_WEEKLY_POINTS = olympiadConfig.getInt("AltOlyWeeklyPoints", 10);
  2318. +           ALT_OLY_START_POINTS = olympiadConfig.getInt("AltOlyStartPoints", 1000);
  2319.             ALT_OLY_CLASSED = olympiadConfig.getInt("AltOlyClassedParticipants", 10);
  2320.             ALT_OLY_NONCLASSED = olympiadConfig.getInt("AltOlyNonClassedParticipants", 20);
  2321.             ALT_OLY_WINNER_REWARD = parseItemsList(olympiadConfig.getString("AltOlyWinReward", "45584,12"));
  2322. @@ -2455,7 +2455,7 @@
  2323.             ALT_OLY_MAX_POINTS = olympiadConfig.getInt("AltOlyMaxPoints", 10);
  2324.             ALT_OLY_DIVIDER_CLASSED = olympiadConfig.getInt("AltOlyDividerClassed", 5);
  2325.             ALT_OLY_DIVIDER_NON_CLASSED = olympiadConfig.getInt("AltOlyDividerNonClassed", 5);
  2326. -           ALT_OLY_MAX_WEEKLY_MATCHES = olympiadConfig.getInt("AltOlyMaxWeeklyMatches", 30);
  2327. +           ALT_OLY_MAX_WEEKLY_MATCHES = olympiadConfig.getInt("AltOlyMaxWeeklyMatches", 25);
  2328.             ALT_OLY_LOG_FIGHTS = olympiadConfig.getBoolean("AltOlyLogFights", false);
  2329.             ALT_OLY_SHOW_MONTHLY_WINNERS = olympiadConfig.getBoolean("AltOlyShowMonthlyWinners", true);
  2330.             ALT_OLY_ANNOUNCE_GAMES = olympiadConfig.getBoolean("AltOlyAnnounceGames", true);
  2331. Index: java/org/l2jmobius/gameserver/model/zone/type/OlympiadStadiumZone.java
  2332. ===================================================================
  2333. --- java/org/l2jmobius/gameserver/model/zone/type/OlympiadStadiumZone.java  (revision 10239)
  2334. +++ java/org/l2jmobius/gameserver/model/zone/type/OlympiadStadiumZone.java  (working copy)
  2335. @@ -34,7 +34,7 @@
  2336.  import org.l2jmobius.gameserver.model.zone.ZoneId;
  2337.  import org.l2jmobius.gameserver.model.zone.ZoneRespawn;
  2338.  import org.l2jmobius.gameserver.network.SystemMessageId;
  2339. -import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMatchEnd;
  2340. +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchEnd;
  2341.  
  2342.  /**
  2343.   * An olympiad stadium
  2344. Index: java/org/l2jmobius/gameserver/network/clientpackets/RequestExOlympiadMatchListRefresh.java
  2345. ===================================================================
  2346. --- java/org/l2jmobius/gameserver/network/clientpackets/RequestExOlympiadMatchListRefresh.java  (revision 10239)
  2347. +++ java/org/l2jmobius/gameserver/network/clientpackets/RequestExOlympiadMatchListRefresh.java  (working copy)
  2348. @@ -19,7 +19,7 @@
  2349.  import org.l2jmobius.commons.network.PacketReader;
  2350.  import org.l2jmobius.gameserver.model.actor.Player;
  2351.  import org.l2jmobius.gameserver.network.GameClient;
  2352. -import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMatchList;
  2353. +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchList;
  2354.  
  2355.  /**
  2356.   * Format: (ch)d d: unknown (always 0?)
  2357. Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchEnd.java
  2358. ===================================================================
  2359. --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchEnd.java    (nonexistent)
  2360. +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchEnd.java    (working copy)
  2361. @@ -0,0 +1,41 @@
  2362. +/*
  2363. + * This file is part of the L2J Mobius project.
  2364. + *
  2365. + * This program is free software: you can redistribute it and/or modify
  2366. + * it under the terms of the GNU General Public License as published by
  2367. + * the Free Software Foundation, either version 3 of the License, or
  2368. + * (at your option) any later version.
  2369. + *
  2370. + * This program is distributed in the hope that it will be useful,
  2371. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2372. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  2373. + * General Public License for more details.
  2374. + *
  2375. + * You should have received a copy of the GNU General Public License
  2376. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  2377. + */
  2378. +package org.l2jmobius.gameserver.network.serverpackets.olympiad;
  2379. +
  2380. +import org.l2jmobius.commons.network.PacketWriter;
  2381. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  2382. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  2383. +
  2384. +/**
  2385. + * @author GodKratos
  2386. + */
  2387. +public class ExOlympiadMatchEnd implements IClientOutgoingPacket
  2388. +{
  2389. +   public static final ExOlympiadMatchEnd STATIC_PACKET = new ExOlympiadMatchEnd();
  2390. +  
  2391. +   private ExOlympiadMatchEnd()
  2392. +   {
  2393. +   }
  2394. +  
  2395. +   @Override
  2396. +   public boolean write(PacketWriter packet)
  2397. +   {
  2398. +       OutgoingPackets.EX_OLYMPIAD_MATCH_END.writeId(packet);
  2399. +      
  2400. +       return true;
  2401. +   }
  2402. +}
  2403. \ No newline at end of file
  2404. Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadUserInfo.java
  2405. ===================================================================
  2406. --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadUserInfo.java    (nonexistent)
  2407. +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadUserInfo.java    (working copy)
  2408. @@ -0,0 +1,102 @@
  2409. +/*
  2410. + * This file is part of the L2J Mobius project.
  2411. + *
  2412. + * This program is free software: you can redistribute it and/or modify
  2413. + * it under the terms of the GNU General Public License as published by
  2414. + * the Free Software Foundation, either version 3 of the License, or
  2415. + * (at your option) any later version.
  2416. + *
  2417. + * This program is distributed in the hope that it will be useful,
  2418. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2419. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  2420. + * General Public License for more details.
  2421. + *
  2422. + * You should have received a copy of the GNU General Public License
  2423. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  2424. + */
  2425. +package org.l2jmobius.gameserver.network.serverpackets.olympiad;
  2426. +
  2427. +import org.l2jmobius.commons.network.PacketWriter;
  2428. +import org.l2jmobius.gameserver.model.actor.Player;
  2429. +import org.l2jmobius.gameserver.model.olympiad.Participant;
  2430. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  2431. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  2432. +
  2433. +/**
  2434. + * @author godson
  2435. + */
  2436. +public class ExOlympiadUserInfo implements IClientOutgoingPacket
  2437. +{
  2438. +   private final Player _player;
  2439. +   private Participant _par = null;
  2440. +   private int _curHp;
  2441. +   private int _maxHp;
  2442. +   private int _curCp;
  2443. +   private int _maxCp;
  2444. +  
  2445. +   public ExOlympiadUserInfo(Player player)
  2446. +   {
  2447. +       _player = player;
  2448. +       if (_player != null)
  2449. +       {
  2450. +           _curHp = (int) _player.getCurrentHp();
  2451. +           _maxHp = _player.getMaxHp();
  2452. +           _curCp = (int) _player.getCurrentCp();
  2453. +           _maxCp = _player.getMaxCp();
  2454. +       }
  2455. +       else
  2456. +       {
  2457. +           _curHp = 0;
  2458. +           _maxHp = 100;
  2459. +           _curCp = 0;
  2460. +           _maxCp = 100;
  2461. +       }
  2462. +   }
  2463. +  
  2464. +   public ExOlympiadUserInfo(Participant par)
  2465. +   {
  2466. +       _par = par;
  2467. +       _player = par.getPlayer();
  2468. +       if (_player != null)
  2469. +       {
  2470. +           _curHp = (int) _player.getCurrentHp();
  2471. +           _maxHp = _player.getMaxHp();
  2472. +           _curCp = (int) _player.getCurrentCp();
  2473. +           _maxCp = _player.getMaxCp();
  2474. +       }
  2475. +       else
  2476. +       {
  2477. +           _curHp = 0;
  2478. +           _maxHp = 100;
  2479. +           _curCp = 0;
  2480. +           _maxCp = 100;
  2481. +       }
  2482. +   }
  2483. +  
  2484. +   @Override
  2485. +   public boolean write(PacketWriter packet)
  2486. +   {
  2487. +       OutgoingPackets.EX_OLYMPIAD_USER_INFO.writeId(packet);
  2488. +      
  2489. +       if (_player != null)
  2490. +       {
  2491. +           packet.writeC(_player.getOlympiadSide());
  2492. +           packet.writeD(_player.getObjectId());
  2493. +           packet.writeS(_player.getName());
  2494. +           packet.writeD(_player.getClassId().getId());
  2495. +       }
  2496. +       else
  2497. +       {
  2498. +           packet.writeC(_par.getSide());
  2499. +           packet.writeD(_par.getObjectId());
  2500. +           packet.writeS(_par.getName());
  2501. +           packet.writeD(_par.getBaseClass());
  2502. +       }
  2503. +      
  2504. +       packet.writeD(_curHp);
  2505. +       packet.writeD(_maxHp);
  2506. +       packet.writeD(_curCp);
  2507. +       packet.writeD(_maxCp);
  2508. +       return true;
  2509. +   }
  2510. +}
  2511. Index: java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadObserverEnd.java
  2512. ===================================================================
  2513. --- java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadObserverEnd.java    (nonexistent)
  2514. +++ java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadObserverEnd.java    (working copy)
  2515. @@ -0,0 +1,50 @@
  2516. +/*
  2517. + * This file is part of the L2J Mobius project.
  2518. + *
  2519. + * This program is free software: you can redistribute it and/or modify
  2520. + * it under the terms of the GNU General Public License as published by
  2521. + * the Free Software Foundation, either version 3 of the License, or
  2522. + * (at your option) any later version.
  2523. + *
  2524. + * This program is distributed in the hope that it will be useful,
  2525. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2526. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  2527. + * General Public License for more details.
  2528. + *
  2529. + * You should have received a copy of the GNU General Public License
  2530. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  2531. + */
  2532. +package org.l2jmobius.gameserver.network.clientpackets.olympiad;
  2533. +
  2534. +import org.l2jmobius.commons.network.PacketReader;
  2535. +import org.l2jmobius.gameserver.model.actor.Player;
  2536. +import org.l2jmobius.gameserver.network.GameClient;
  2537. +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
  2538. +
  2539. +/**
  2540. + * format ch c: (id) 0xD0 h: (subid) 0x12
  2541. + * @author -Wooden-
  2542. + */
  2543. +public class RequestOlympiadObserverEnd implements IClientIncomingPacket
  2544. +{
  2545. +   @Override
  2546. +   public boolean read(GameClient client, PacketReader packet)
  2547. +   {
  2548. +       return true;
  2549. +   }
  2550. +  
  2551. +   @Override
  2552. +   public void run(GameClient client)
  2553. +   {
  2554. +       final Player player = client.getPlayer();
  2555. +       if (player == null)
  2556. +       {
  2557. +           return;
  2558. +       }
  2559. +      
  2560. +       if (player.inObserverMode())
  2561. +       {
  2562. +           player.leaveOlympiadObserverMode();
  2563. +       }
  2564. +   }
  2565. +}
  2566. \ No newline at end of file
  2567.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement