Advertisement
Guest User

Nightwolf shared , l2jhellas , i just reshare cause its lock

a guest
Jan 12th, 2019
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 70.02 KB | None | 0 0
  1. Shared by Nightw0lf at
  2. https://maxcheaters.com/topic/225148-zodiac-event-engine-acis-370/
  3.  
  4.  
  5.  
  6. ### Eclipse Workspace Patch 1.0
  7. #P aCis_datapack
  8. diff --git data/html/mods/zodiac/CaptureThem.htm data/html/mods/zodiac/CaptureThem.htm
  9. new file mode 100644
  10. index 0000000..ccfd04a
  11. --- /dev/null
  12. +++ data/html/mods/zodiac/CaptureThem.htm
  13. @@ -0,0 +1,3 @@
  14. +<html><title>CaptureThem</title><body>Jail:<br>
  15. +You will be teleported in 20 seconds.<br>
  16. +</body></html>
  17. \ No newline at end of file
  18. diff --git data/html/mods/zodiac/CastleTutorial.htm data/html/mods/zodiac/CastleTutorial.htm
  19. new file mode 100644
  20. index 0000000..0812ad2
  21. --- /dev/null
  22. +++ data/html/mods/zodiac/CastleTutorial.htm
  23. @@ -0,0 +1,14 @@
  24. +<html><title>CastleWars Tutorial</title><body>Jail:<br>
  25. +Once the Event starts:<br>
  26. +-If you are a defender:<br>
  27. +You need to defend all of the castle's flags<br>
  28. +2 in the artifact's rooms<br>
  29. +1 on the roof top<br>
  30. +If you succeed for 10 minutes you win the event<br>
  31. +<br>
  32. +-If you are an attacker:
  33. +You need to kill all the flags in the castle<br>
  34. +2 in the artifact's rooms<br>
  35. +1 on the roof top<br>
  36. +If you kill all 3 flags the event ends!<br>
  37. +</body></html>
  38. \ No newline at end of file
  39. diff --git data/html/mods/zodiac/ProtectTuto.htm data/html/mods/zodiac/ProtectTuto.htm
  40. new file mode 100644
  41. index 0000000..74c7aff
  42. --- /dev/null
  43. +++ data/html/mods/zodiac/ProtectTuto.htm
  44. @@ -0,0 +1,7 @@
  45. +<html><title>Protect The Leader</title><body>Jail:<br>
  46. +PLEASE READ!<br>
  47. +You will be teleported with the rest of your team<br>
  48. +in a stadium,There a rb will be spawned next to you<br>
  49. +protect it at all costs.In front of you is the enemy team<br>
  50. +Kill their rb first and you win!<br>
  51. +</body></html>
  52. \ No newline at end of file
  53. diff --git data/html/mods/zodiac/Treasure.htm data/html/mods/zodiac/Treasure.htm
  54. new file mode 100644
  55. index 0000000..072add7
  56. --- /dev/null
  57. +++ data/html/mods/zodiac/Treasure.htm
  58. @@ -0,0 +1,7 @@
  59. +<html><title>Treasure Chest</title><body>Jail:<br>
  60. +You are Registered for Treasure Chest Event.<br>
  61. +During this event you will have to kill treasure chests<br>
  62. +as quickly as you can only one of them is the lucky one!<br>
  63. +Killing players is not allowed so you WILL take karma<br>
  64. +if you kill any other player!!!<br>
  65. +</body></html>
  66. \ No newline at end of file
  67. diff --git data/html/mods/zodiac/Tutorial.htm data/html/mods/zodiac/Tutorial.htm
  68. new file mode 100644
  69. index 0000000..b2a20b5
  70. --- /dev/null
  71. +++ data/html/mods/zodiac/Tutorial.htm
  72. @@ -0,0 +1,10 @@
  73. +<html><title>CaptureThem</title><body>Jail:<br>
  74. +You are Registered for captureThem Event.<br>
  75. +During this event you will have the chance to<br>
  76. +fight othe rplayers for points that can be<br>
  77. +obtainned by<br>
  78. +1)killing players(1 point)<br>
  79. +2)Killing flags(10 points)<br>
  80. +NOTE: Flags don't respawn so you better<br>
  81. +choose your targets wiselly<br>
  82. +</body></html>
  83. \ No newline at end of file
  84. diff --git data/html/mods/zodiac/TutorialPelo.htm data/html/mods/zodiac/TutorialPelo.htm
  85. new file mode 100644
  86. index 0000000..e916af3
  87. --- /dev/null
  88. +++ data/html/mods/zodiac/TutorialPelo.htm
  89. @@ -0,0 +1,8 @@
  90. +<html><title>Peloponnesian War</title><body>Jail:<br>
  91. +How this works:<br>
  92. +There are 2 teams.Athenians and Spartans.
  93. +Once you get with your team in an arena<br>
  94. +you will fight each other,the one that survives<br>
  95. + will fight the other race's survivor<br>
  96. + The representative that wins gets<br> rewards for everybody in his team!
  97. +</body></html>
  98. \ No newline at end of file
  99.  
  100.  
  101. ### Eclipse Workspace Patch 1.0
  102. #P aCis_gameserver
  103. diff --git config/events.properties config/events.properties
  104. index fb2c293..2da2d2b 100644
  105. --- config/events.properties
  106. +++ config/events.properties
  107. @@ -235,4 +235,25 @@
  108. AltFishChampionshipReward2 = 500000
  109. AltFishChampionshipReward3 = 300000
  110. AltFishChampionshipReward4 = 200000
  111. -AltFishChampionshipReward5 = 100000
  112. \ No newline at end of file
  113. +AltFishChampionshipReward5 = 100000
  114. +
  115. +#=============================================================
  116. +#                       Zodiac Engine
  117. +#=============================================================
  118. +# Enable the events
  119. +# Default: False
  120. +Zodiace = False
  121. +
  122. +# Reward ID and Reward Count
  123. +ZodiadReward = 3470
  124. +ZodiadRewardc = 1
  125. +
  126. +# Same IP Protection
  127. +# Default: False
  128. +SameIpProtection = False
  129. +
  130. +# Engine start with server after XX Seconds
  131. +MinutesInitial = 10
  132. +
  133. +# Engine repeats events in XX minutes
  134. +MinutesAfterEvent = 60
  135. diff --git java/net/sf/l2j/Config.java java/net/sf/l2j/Config.java
  136. index e27eec0..f82522d 100644
  137. --- java/net/sf/l2j/Config.java
  138. +++ java/net/sf/l2j/Config.java
  139. @@ -206,6 +206,14 @@
  140.     public static int ALT_FISH_CHAMPIONSHIP_REWARD_4;
  141.     public static int ALT_FISH_CHAMPIONSHIP_REWARD_5;
  142.    
  143. +   /** Zodiac Engine */
  144. +   public static boolean ZODIAC_ENABLE;
  145. +   public static int ZODIAC_REWARD;
  146. +   public static int ZODIAC_REWARD_COUN;
  147. +   public static boolean SAME_IP_ZODIAC;
  148. +   public static int INITIAL_START;
  149. +   public static int BETWEEN_EVENTS;
  150. +  
  151.     // --------------------------------------------------
  152.     // GeoEngine
  153.     // --------------------------------------------------
  154. @@ -878,6 +886,13 @@
  155.         ALT_FISH_CHAMPIONSHIP_REWARD_3 = events.getProperty("AltFishChampionshipReward3", 300000);
  156.         ALT_FISH_CHAMPIONSHIP_REWARD_4 = events.getProperty("AltFishChampionshipReward4", 200000);
  157.         ALT_FISH_CHAMPIONSHIP_REWARD_5 = events.getProperty("AltFishChampionshipReward5", 100000);
  158. +      
  159. +       ZODIAC_ENABLE = events.getProperty("Zodiace", true);
  160. +       ZODIAC_REWARD = events.getProperty("ZodiadReward", 3470);
  161. +       ZODIAC_REWARD_COUN = events.getProperty("ZodiadRewardc", 1);
  162. +       SAME_IP_ZODIAC = events.getProperty("SameIpProtection", true);
  163. +       INITIAL_START = events.getProperty("MinutesInitial", 10);
  164. +       BETWEEN_EVENTS = events.getProperty("MinutesAfterEvent", 60);
  165.     }
  166.    
  167.     /**
  168. diff --git java/net/sf/l2j/gameserver/GameServer.java java/net/sf/l2j/gameserver/GameServer.java
  169. index 9375025..48f5689 100644
  170. --- java/net/sf/l2j/gameserver/GameServer.java
  171. +++ java/net/sf/l2j/gameserver/GameServer.java
  172. @@ -57,6 +57,7 @@
  173. import net.sf.l2j.gameserver.handler.ItemHandler;
  174. import net.sf.l2j.gameserver.handler.SkillHandler;
  175. import net.sf.l2j.gameserver.handler.UserCommandHandler;
  176. +import net.sf.l2j.gameserver.handler.VoicedCommandHandler;
  177. import net.sf.l2j.gameserver.idfactory.IdFactory;
  178. import net.sf.l2j.gameserver.instancemanager.AuctionManager;
  179. import net.sf.l2j.gameserver.instancemanager.AutoSpawnManager;
  180. @@ -81,6 +82,7 @@
  181. import net.sf.l2j.gameserver.instancemanager.games.MonsterRace;
  182. import net.sf.l2j.gameserver.model.World;
  183. import net.sf.l2j.gameserver.model.entity.Hero;
  184. +import net.sf.l2j.gameserver.model.entity.engines.ZodiacMain;
  185. import net.sf.l2j.gameserver.model.olympiad.Olympiad;
  186. import net.sf.l2j.gameserver.model.olympiad.OlympiadGameManager;
  187. import net.sf.l2j.gameserver.model.partymatching.PartyMatchRoomList;
  188. @@ -266,6 +268,7 @@
  189.        
  190.         StringUtil.printSection("Events");
  191.         MonsterRace.getInstance();
  192. +       ZodiacMain.ZodiacIn();
  193.        
  194.         if (Config.ALLOW_WEDDING)
  195.             CoupleManager.getInstance();
  196. @@ -280,6 +283,7 @@
  197.         _log.config("ItemHandler: Loaded " + ItemHandler.getInstance().size() + " handlers.");
  198.         _log.config("SkillHandler: Loaded " + SkillHandler.getInstance().size() + " handlers.");
  199.         _log.config("UserCommandHandler: Loaded " + UserCommandHandler.getInstance().size() + " handlers.");
  200. +       _log.config("VoicedCommandHandler: Loaded " + VoicedCommandHandler.getInstance().size() + " handlers.");
  201.        
  202.         StringUtil.printSection("System");
  203.         Runtime.getRuntime().addShutdownHook(Shutdown.getInstance());
  204. diff --git java/net/sf/l2j/gameserver/handler/IVoicedCommandHandler.java java/net/sf/l2j/gameserver/handler/IVoicedCommandHandler.java
  205. new file mode 100644
  206. index 0000000..4c5db06
  207. --- /dev/null
  208. +++ java/net/sf/l2j/gameserver/handler/IVoicedCommandHandler.java
  209. @@ -0,0 +1,10 @@
  210. +package net.sf.l2j.gameserver.handler;
  211. +
  212. +import net.sf.l2j.gameserver.model.actor.instance.Player;
  213. +
  214. +public interface IVoicedCommandHandler
  215. +{
  216. +       public boolean useVoicedCommand(String command, Player activeChar, String params);
  217. +
  218. +       public String[] getVoicedCommandList();
  219. +}
  220. \ No newline at end of file
  221. diff --git java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java
  222. new file mode 100644
  223. index 0000000..b1601b3
  224. --- /dev/null
  225. +++ java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java
  226. @@ -0,0 +1,49 @@
  227. +package net.sf.l2j.gameserver.handler;
  228. +
  229. +import java.util.HashMap;
  230. +import java.util.Map;
  231. +
  232. +import net.sf.l2j.gameserver.handler.voicedcommandhandlers.ZodiacRegistrationCMD;
  233. +
  234. +public class VoicedCommandHandler
  235. +{
  236. +   private final Map<Integer, IVoicedCommandHandler> _datatable = new HashMap<>();
  237. +  
  238. +   public static VoicedCommandHandler getInstance()
  239. +   {
  240. +       return SingletonHolder._instance;
  241. +   }
  242. +  
  243. +   protected VoicedCommandHandler()
  244. +   {
  245. +       registerHandler(new ZodiacRegistrationCMD());
  246. +   }
  247. +  
  248. +   public void registerHandler(IVoicedCommandHandler handler)
  249. +   {
  250. +       String[] ids = handler.getVoicedCommandList();
  251. +      
  252. +       for (int i = 0; i < ids.length; i++)
  253. +           _datatable.put(ids[i].hashCode(), handler);
  254. +   }
  255. +  
  256. +   public IVoicedCommandHandler getHandler(String voicedCommand)
  257. +   {
  258. +       String command = voicedCommand;
  259. +      
  260. +       if (voicedCommand.indexOf(" ") != -1)
  261. +           command = voicedCommand.substring(0, voicedCommand.indexOf(" "));
  262. +      
  263. +       return _datatable.get(command.hashCode());
  264. +   }
  265. +  
  266. +   public int size()
  267. +   {
  268. +       return _datatable.size();
  269. +   }
  270. +  
  271. +   private static class SingletonHolder
  272. +   {
  273. +       protected static final VoicedCommandHandler _instance = new VoicedCommandHandler();
  274. +   }
  275. +}
  276. \ No newline at end of file
  277. diff --git java/net/sf/l2j/gameserver/handler/chathandlers/ChatAll.java java/net/sf/l2j/gameserver/handler/chathandlers/ChatAll.java
  278. index 5bf1f90..8aa5b69 100644
  279. --- java/net/sf/l2j/gameserver/handler/chathandlers/ChatAll.java
  280. +++ java/net/sf/l2j/gameserver/handler/chathandlers/ChatAll.java
  281. @@ -1,11 +1,15 @@
  282. package net.sf.l2j.gameserver.handler.chathandlers;
  283.  
  284. +import java.util.StringTokenizer;
  285. +
  286. import net.sf.l2j.gameserver.handler.IChatHandler;
  287. +import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
  288. +import net.sf.l2j.gameserver.handler.VoicedCommandHandler;
  289. import net.sf.l2j.gameserver.model.BlockList;
  290. import net.sf.l2j.gameserver.model.actor.instance.Player;
  291. -import net.sf.l2j.gameserver.network.FloodProtectors;
  292. -import net.sf.l2j.gameserver.network.FloodProtectors.Action;
  293. +import net.sf.l2j.gameserver.model.zone.ZoneId;
  294. import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
  295. +import net.sf.l2j.gameserver.network.serverpackets.SocialAction;
  296.  
  297. public class ChatAll implements IChatHandler
  298. {
  299. @@ -17,16 +21,51 @@
  300.     @Override
  301.     public void handleChat(int type, Player activeChar, String params, String text)
  302.     {
  303. -       if (!FloodProtectors.performAction(activeChar.getClient(), Action.GLOBAL_CHAT))
  304. -           return;
  305. -      
  306. -       final CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text);
  307. -       for (Player player : activeChar.getKnownTypeInRadius(Player.class, 1250))
  308. +       boolean vcd_used = false;
  309. +       if (text.startsWith("."))
  310.         {
  311. -           if (!BlockList.isBlocked(player, activeChar))
  312. -               player.sendPacket(cs);
  313. +           StringTokenizer st = new StringTokenizer(text);
  314. +           IVoicedCommandHandler vch;
  315. +           String command = "";
  316. +           if (st.countTokens() > 1)
  317. +           {
  318. +               command = st.nextToken().substring(1);
  319. +               params = text.substring(command.length() + 2);
  320. +               vch = VoicedCommandHandler.getInstance().getHandler(command);
  321. +           }
  322. +           else
  323. +           {
  324. +               command = text.substring(1);
  325. +               vch = VoicedCommandHandler.getInstance().getHandler(command);
  326. +           }
  327. +          
  328. +           if (vch != null)
  329. +           {
  330. +               vch.useVoicedCommand(command, activeChar, params);
  331. +               vcd_used = true;
  332. +           }
  333.         }
  334. -       activeChar.sendPacket(cs);
  335. +       if (!vcd_used)
  336. +       {
  337. +           if (text.startsWith("lol") && activeChar.isInsideZone(ZoneId.TOWN))
  338. +               activeChar.broadcastPacket(new SocialAction(activeChar, 10));
  339. +          
  340. +           if (text.startsWith("hi") && activeChar.isInsideZone(ZoneId.TOWN))
  341. +               activeChar.broadcastPacket(new SocialAction(activeChar, 2));
  342. +          
  343. +           if (text.startsWith("haha") && activeChar.isInsideZone(ZoneId.TOWN))
  344. +               activeChar.broadcastPacket(new SocialAction(activeChar, 10));
  345. +          
  346. +           if (text.startsWith("yes") && activeChar.isInsideZone(ZoneId.TOWN))
  347. +               activeChar.broadcastPacket(new SocialAction(activeChar, 6));
  348. +          
  349. +           if (text.startsWith("no") && activeChar.isInsideZone(ZoneId.TOWN))
  350. +               activeChar.broadcastPacket(new SocialAction(activeChar, 5));
  351. +          
  352. +           final CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text);
  353. +           activeChar.getKnownTypeInRadius(Player.class, 1250).stream().filter(p -> !BlockList.isBlocked(p, activeChar)).forEach(p -> p.sendPacket(cs));
  354. +           activeChar.sendPacket(cs);
  355. +       }
  356.     }
  357.    
  358.     @Override
  359. diff --git java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/ZodiacRegistrationCMD.java java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/ZodiacRegistrationCMD.java
  360. new file mode 100644
  361. index 0000000..2d9a370
  362. --- /dev/null
  363. +++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/ZodiacRegistrationCMD.java
  364. @@ -0,0 +1,78 @@
  365. +package net.sf.l2j.gameserver.handler.voicedcommandhandlers;
  366. +
  367. +import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
  368. +import net.sf.l2j.gameserver.model.actor.instance.Player;
  369. +import net.sf.l2j.gameserver.model.entity.engines.CaptureThem;
  370. +import net.sf.l2j.gameserver.model.entity.engines.CastleWars;
  371. +import net.sf.l2j.gameserver.model.entity.engines.PeloponnesianWar;
  372. +import net.sf.l2j.gameserver.model.entity.engines.ProtectTheLdr;
  373. +import net.sf.l2j.gameserver.model.entity.engines.TreasureChest;
  374. +import net.sf.l2j.gameserver.model.entity.engines.ZodiacMain;
  375. +import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
  376. +
  377. +/**
  378. + * @author Boorinio
  379. + */
  380. +public class ZodiacRegistrationCMD implements IVoicedCommandHandler
  381. +{
  382. +   private static final String[] VOICED_COMMANDS =
  383. +   {
  384. +       "join",
  385. +       "leave"
  386. +   };
  387. +  
  388. +   @Override
  389. +   public boolean useVoicedCommand(String command, Player activeChar, String params)
  390. +   {
  391. +       if (activeChar == null)
  392. +           return false;
  393. +      
  394. +       String Ip = activeChar.getClient().getConnection().getInetAddress().getHostAddress();
  395. +      
  396. +       if (command.startsWith(VOICED_COMMANDS[0]) && ZodiacMain.isEligible(activeChar, Ip))
  397. +       {
  398. +           activeChar.isinZodiac = true;
  399. +           activeChar.sendMessage("You are now registered!");
  400. +           ZodiacMain.Ips.add(Ip);
  401. +
  402. +           //final StringBuilder sb = new StringBuilder();
  403. +           final NpcHtmlMessage html = new NpcHtmlMessage(0);
  404. +
  405. +           if (CastleWars.CastleWarsRunning)
  406. +           {
  407. +               html.setFile("data/html/mods/zodiac/CastleTutorial.htm");
  408. +               //html.replace("%name%", activeChar.getName());
  409. +           }
  410. +           else if (CaptureThem.CaptureThemRunning)
  411. +           {
  412. +               html.setFile("data/html/mods/zodiac/Tutorial.htm");
  413. +           }
  414. +           else if (PeloponnesianWar.PeloRunning)
  415. +           {
  416. +               html.setFile("data/html/mods/zodiac/TutorialPelo.htm");
  417. +           }
  418. +           else if (ProtectTheLdr.ProtectisRunning)
  419. +           {
  420. +               html.setFile("data/html/mods/zodiac/ProtectTuto.htm");
  421. +           }
  422. +           else if (TreasureChest.TreasureRunning)
  423. +           {
  424. +               html.setFile("data/html/mods/zodiac/Treasure.htm");
  425. +           }
  426. +           activeChar.sendPacket(html);
  427. +       }
  428. +       if ((command.startsWith(VOICED_COMMANDS[1]) && activeChar.isinZodiac))
  429. +       {
  430. +           activeChar.isinZodiac = false;
  431. +           activeChar.sendMessage("You are now unregistered!");
  432. +           ZodiacMain.Ips.remove(Ip);
  433. +       }
  434. +       return false;
  435. +   }
  436. +  
  437. +   @Override
  438. +   public String[] getVoicedCommandList()
  439. +   {
  440. +       return VOICED_COMMANDS;
  441. +   }
  442. +}
  443. \ No newline at end of file
  444. diff --git java/net/sf/l2j/gameserver/model/actor/Npc.java java/net/sf/l2j/gameserver/model/actor/Npc.java
  445. index 7cb912e..6da4b4f 100644
  446. --- java/net/sf/l2j/gameserver/model/actor/Npc.java
  447. +++ java/net/sf/l2j/gameserver/model/actor/Npc.java
  448. @@ -40,6 +40,10 @@
  449. import net.sf.l2j.gameserver.model.actor.template.NpcTemplate.Race;
  450. import net.sf.l2j.gameserver.model.actor.template.NpcTemplate.SkillType;
  451. import net.sf.l2j.gameserver.model.entity.Castle;
  452. +import net.sf.l2j.gameserver.model.entity.engines.CaptureThem;
  453. +import net.sf.l2j.gameserver.model.entity.engines.CastleWars;
  454. +import net.sf.l2j.gameserver.model.entity.engines.ProtectTheLdr;
  455. +import net.sf.l2j.gameserver.model.entity.engines.TreasureChest;
  456. import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  457. import net.sf.l2j.gameserver.model.item.kind.Item;
  458. import net.sf.l2j.gameserver.model.item.kind.Weapon;
  459. @@ -1269,6 +1273,28 @@
  460.         if (!super.doDie(killer))
  461.             return false;
  462.        
  463. +       if (getNpcId() == 18286 && TreasureChest.TreasureRunning)
  464. +       {
  465. +           TreasureChest.LuckyOne((Player) killer);
  466. +       }
  467. +       if (getNpcId() == 36006)
  468. +       {
  469. +           if (!CastleWars.isFinished && CastleWars.CastleWarsRunning)
  470. +           {
  471. +               CastleWars.flagskilled++;
  472. +               CastleWars.attackersWin();
  473. +           }
  474. +           if (CaptureThem.CaptureThemRunning)
  475. +               ((Player) killer).ZodiacPoints = ((Player) killer).ZodiacPoints + 10;
  476. +       }
  477. +       if (getNpcId() == 36007 && ProtectTheLdr.ProtectisRunning)
  478. +       {
  479. +           ProtectTheLdr.team2wins();
  480. +       }
  481. +       if (getNpcId() == 36008 && ProtectTheLdr.ProtectisRunning)
  482. +       {
  483. +           ProtectTheLdr.team1wins();
  484. +       }
  485.         _currentLHandId = getTemplate().getLeftHand();
  486.         _currentRHandId = getTemplate().getRightHand();
  487.         _currentEnchant = getTemplate().getEnchantEffect();
  488. diff --git java/net/sf/l2j/gameserver/model/actor/instance/Gatekeeper.java java/net/sf/l2j/gameserver/model/actor/instance/Gatekeeper.java
  489. index f5ba1b9..e3566ca 100644
  490. --- java/net/sf/l2j/gameserver/model/actor/instance/Gatekeeper.java
  491. +++ java/net/sf/l2j/gameserver/model/actor/instance/Gatekeeper.java
  492. @@ -48,6 +48,12 @@
  493.                 if (list == null)
  494.                     return;
  495.                
  496. +               if (player.isinZodiac)
  497. +               {
  498. +                   player.sendMessage("You cannot teleport while in Zodiac's Event's");
  499. +                   return;
  500. +               }
  501. +              
  502.                 final Siege siegeOnTeleportLocation = CastleManager.getInstance().getSiege(list.getX(), list.getY(), list.getZ());
  503.                 if (siegeOnTeleportLocation != null && siegeOnTeleportLocation.isInProgress())
  504.                 {
  505. diff --git java/net/sf/l2j/gameserver/model/actor/instance/Player.java java/net/sf/l2j/gameserver/model/actor/instance/Player.java
  506. index 82f58e2..0775fe5 100644
  507. --- java/net/sf/l2j/gameserver/model/actor/instance/Player.java
  508. +++ java/net/sf/l2j/gameserver/model/actor/instance/Player.java
  509. @@ -106,6 +106,10 @@
  510. import net.sf.l2j.gameserver.model.entity.Hero;
  511. import net.sf.l2j.gameserver.model.entity.Siege;
  512. import net.sf.l2j.gameserver.model.entity.Siege.SiegeSide;
  513. +import net.sf.l2j.gameserver.model.entity.engines.CaptureThem;
  514. +import net.sf.l2j.gameserver.model.entity.engines.CastleWars;
  515. +import net.sf.l2j.gameserver.model.entity.engines.PeloponnesianWar;
  516. +import net.sf.l2j.gameserver.model.entity.engines.ProtectTheLdr;
  517. import net.sf.l2j.gameserver.model.group.CommandChannel;
  518. import net.sf.l2j.gameserver.model.group.Party;
  519. import net.sf.l2j.gameserver.model.group.Party.LootRule;
  520. @@ -3944,6 +3948,20 @@
  521.                     // if the area isn't an arena
  522.                     if (!isInArena())
  523.                     {
  524. +                       if (pk != null && CastleWars.CastleWarsRunning && (isinZodiac && pk.isinZodiac))
  525. +                       {
  526. +                           sendMessage("You will be revived in your spot");
  527. +                       }
  528. +                       if (pk != null && (pk.isinZodiac && pk.isinZodiac) && CaptureThem.CaptureThemRunning)
  529. +                           pk.ZodiacPoints++;
  530. +                       if (isinZodiac && PeloponnesianWar.PeloRunning)
  531. +                       {
  532. +                           isinZodiac = false;
  533. +                           teleToLocation(82698, 148638, -3473, 0);
  534. +                           getAppearance().setNameColor(0xFFFFFF);
  535. +                           setTitle("");
  536. +                           broadcastUserInfo();
  537. +                       }
  538.                         // if both victim and attacker got clans & aren't academicians
  539.                         if (pk != null && pk.getClan() != null && getClan() != null && !isAcademyMember() && !pk.isAcademyMember())
  540.                         {
  541. @@ -8504,6 +8522,36 @@
  542.         _reviveRequested = 0;
  543.         _revivePower = 0;
  544.        
  545. +       if (CastleWars.CastleWarsRunning)
  546. +       {
  547. +           if (CastleWars.isattacker(this))
  548. +               teleToLocation(CastleWars.attackersx, CastleWars.attackersy, CastleWars.attackersz,0);
  549. +           if (CastleWars.isdefender(this))
  550. +               teleToLocation(CastleWars.defendersx, CastleWars.defendersy, CastleWars.defendersz,0);
  551. +       }
  552. +       if (isinZodiac && CaptureThem.CaptureThemRunning)
  553. +       {
  554. +           getStatus().setCurrentHp(getMaxHp());
  555. +           getStatus().setCurrentMp(getMaxMp());
  556. +           getStatus().setCurrentCp(getMaxCp());
  557. +           teleToLocation(149722, 46700, -3413,0);
  558. +           L2Skill skill;
  559. +           skill = SkillTable.getInstance().getInfo(1323, 1);
  560. +           skill.getEffects(this, this);
  561. +       }
  562. +       if (isinZodiac && ProtectTheLdr.ProtectisRunning)
  563. +       {
  564. +           getStatus().setCurrentHp(getMaxHp());
  565. +           getStatus().setCurrentMp(getMaxMp());
  566. +           getStatus().setCurrentCp(getMaxCp());
  567. +           L2Skill skill;
  568. +           skill = SkillTable.getInstance().getInfo(1323, 1);
  569. +           skill.getEffects(this, this);
  570. +           if (ProtectTheLdr._Team1.containsKey(getObjectId()))
  571. +               teleToLocation(ProtectTheLdr.team1x, ProtectTheLdr.team1y, ProtectTheLdr.team1z, 0);
  572. +           if (ProtectTheLdr._Team2.containsKey(getObjectId()))
  573. +               teleToLocation(ProtectTheLdr.team2x, ProtectTheLdr.team2y, ProtectTheLdr.team2z, 0);
  574. +       }
  575.         if (isMounted())
  576.             startFeed(_mountNpcId);
  577.        
  578. @@ -10536,4 +10584,8 @@
  579.             }
  580.         }
  581.     }
  582. +  
  583. +   public boolean isinZodiac;
  584. +   public int ZodiacPoints;
  585. +   public int CountIps;
  586.  }
  587. \ No newline at end of file
  588. diff --git java/net/sf/l2j/gameserver/model/entity/engines/CaptureThem.java java/net/sf/l2j/gameserver/model/entity/engines/CaptureThem.java
  589. new file mode 100644
  590. index 0000000..1abc82e
  591. --- /dev/null
  592. +++ java/net/sf/l2j/gameserver/model/entity/engines/CaptureThem.java
  593. @@ -0,0 +1,239 @@
  594. +package net.sf.l2j.gameserver.model.entity.engines;
  595. +
  596. +import java.util.ArrayList;
  597. +import java.util.HashMap;
  598. +import java.util.List;
  599. +import java.util.Map;
  600. +import java.util.logging.Logger;
  601. +
  602. +import net.sf.l2j.commons.concurrent.ThreadPool;
  603. +import net.sf.l2j.commons.random.Rnd;
  604. +
  605. +import net.sf.l2j.Config;
  606. +import net.sf.l2j.gameserver.data.DoorTable;
  607. +import net.sf.l2j.gameserver.data.NpcTable;
  608. +import net.sf.l2j.gameserver.data.SkillTable;
  609. +import net.sf.l2j.gameserver.model.L2Skill;
  610. +import net.sf.l2j.gameserver.model.L2Spawn;
  611. +import net.sf.l2j.gameserver.model.World;
  612. +import net.sf.l2j.gameserver.model.actor.Npc;
  613. +import net.sf.l2j.gameserver.model.actor.instance.Player;
  614. +import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  615. +import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
  616. +import net.sf.l2j.gameserver.util.Broadcast;
  617. +
  618. +/**
  619. + * @author Boorinio
  620. + */
  621. +public class CaptureThem
  622. +{
  623. +   protected static final Logger _log = Logger.getLogger(CaptureThem.class.getName());
  624. +   public static boolean CaptureThemRunning;
  625. +   private static int i;
  626. +   private final static Map<Integer, Player> _players = new HashMap<>();
  627. +   private static List<Npc> _flags = new ArrayList<>();
  628. +   private static int flagId = 36006;
  629. +   private static int MostPoints = 0;
  630. +   public static Player MostPointsPlayer;
  631. +   private static int[] flagsx =
  632. +   {
  633. +       149506,
  634. +       149412,
  635. +       150025,
  636. +       148741,
  637. +       149999,
  638. +       150110,
  639. +       150121,
  640. +       149550,
  641. +       149235,
  642. +   };
  643. +   private static int[] flagsy =
  644. +   {
  645. +       47471,
  646. +       46144,
  647. +       46670,
  648. +       46750,
  649. +       46221,
  650. +       46464,
  651. +       46872,
  652. +       47105,
  653. +       47871,
  654. +   };
  655. +   private static int flagsz = -3413;
  656. +  
  657. +   public static void openRegistration()
  658. +   {
  659. +       CaptureThemRunning = true;
  660. +       ZodiacMain.ZodiacRegisterActive = true;
  661. +       Broadcast.announceToOnlinePlayers("CaptureThem Event has Started!");
  662. +       Broadcast.announceToOnlinePlayers("Type .join to enter or .leave to leave!");
  663. +       Broadcast.announceToOnlinePlayers("You have 5 minutes to register!");
  664. +       ThreadPool.schedule(() -> {
  665. +           Broadcast.announceToOnlinePlayers("You have 4 minutes to register!");
  666. +       }, 60 * 1000);
  667. +       ThreadPool.schedule(() -> {
  668. +           Broadcast.announceToOnlinePlayers("You have 3 minutes to register!");
  669. +       }, 120 * 1000);
  670. +       ThreadPool.schedule(() -> {
  671. +           Broadcast.announceToOnlinePlayers("You have 2 minutes to register!");
  672. +       }, 180 * 1000);
  673. +       ThreadPool.schedule(() -> {
  674. +           Broadcast.announceToOnlinePlayers("You have 1 minutes to register!");
  675. +       }, 240 * 1000);
  676. +       ThreadPool.schedule(() -> {
  677. +           stopRegistration();
  678. +       }, 300 * 1000);
  679. +   }
  680. +  
  681. +   public static void stopRegistration()
  682. +   {
  683. +       Broadcast.announceToOnlinePlayers("CaptureThem Registration is Over!");
  684. +       for (Player player : World.getInstance().getPlayers())
  685. +       {
  686. +           if (player == null)
  687. +               continue;
  688. +          
  689. +           ZodiacMain.ZodiacRegisterActive = false;
  690. +           if (player.isinZodiac)
  691. +           {
  692. +               final NpcHtmlMessage html = new NpcHtmlMessage(0);
  693. +               html.setFile("data/html/mods/zodiac/CaptureThem.htm");
  694. +               player.sendPacket(html);
  695. +               _players.putIfAbsent(player.getObjectId(), player);
  696. +           }
  697. +       }
  698. +       ThreadPool.schedule(() -> {
  699. +           if (_players.size() > 1)
  700. +               StartEvent();
  701. +           else
  702. +           {
  703. +               Broadcast.announceToOnlinePlayers("The event was canceled due to lack of players!");
  704. +               CaptureThemRunning = false;
  705. +           }
  706. +       }, 10 * 1000);
  707. +      
  708. +   }
  709. +  
  710. +   public static void StartEvent()
  711. +   {
  712. +       DoorTable.getInstance().getDoor(24190001).closeMe();
  713. +       DoorTable.getInstance().getDoor(24190002).closeMe();
  714. +       DoorTable.getInstance().getDoor(24190003).closeMe();
  715. +       DoorTable.getInstance().getDoor(24190004).closeMe();
  716. +       Npc flags = null;
  717. +       for (i = 0; i < 9; i++)
  718. +       {
  719. +           flags = addSpawn(flagId, flagsx[i], flagsy[i], flagsz, 0, false, 600, true);
  720. +           _flags.add(flags);
  721. +       }
  722. +       for (Player player : _players.values())
  723. +       {
  724. +           if (player == null)
  725. +               continue;
  726. +           player.ZodiacPoints = 0;
  727. +           player.getAppearance().setNameColor(0xFF0000);
  728. +           player.setTitle("CaptureThem");
  729. +           L2Skill skill;
  730. +           skill = SkillTable.getInstance().getInfo(1323, 1);
  731. +           skill.getEffects(player, player);
  732. +           player.broadcastUserInfo();
  733. +           player.teleToLocation(149527, 46684, -3413,0);
  734. +           player.sendMessage("The Event has Started! And will finish in 10 minutes");
  735. +       }
  736. +       Broadcast.announceToOnlinePlayers("You have 10 minutes until the event is over!");
  737. +       ThreadPool.schedule(() -> {
  738. +           Broadcast.announceToOnlinePlayers("You have 5 minutes until the event is over!");
  739. +       }, 300 * 1000);
  740. +       ThreadPool.schedule(() -> {
  741. +           Broadcast.announceToOnlinePlayers("You have 4 minutes until the event is over!");
  742. +       }, 360 * 1000);
  743. +       ThreadPool.schedule(() -> {
  744. +           Broadcast.announceToOnlinePlayers("You have 3 minutes until the event is over!");
  745. +       }, 420 * 1000);
  746. +       ThreadPool.schedule(() -> {
  747. +           Broadcast.announceToOnlinePlayers("You have 2 minutes until the event is over!");
  748. +       }, 480 * 1000);
  749. +       ThreadPool.schedule(() -> {
  750. +           Broadcast.announceToOnlinePlayers("You have 1 minutes until the event is over!");
  751. +       }, 540 * 1000);
  752. +       ThreadPool.schedule(() -> {
  753. +           StopClean();
  754. +       }, 600 * 1000);
  755. +   }
  756. +  
  757. +   public static void StopClean()
  758. +   {
  759. +       for (Player player : _players.values())
  760. +       {
  761. +           if (player == null)
  762. +               continue;
  763. +           if (player.ZodiacPoints > MostPoints)
  764. +           {
  765. +               MostPointsPlayer = player;
  766. +               MostPoints = player.ZodiacPoints;
  767. +           }
  768. +       }
  769. +       if (MostPointsPlayer != null)
  770. +       {
  771. +           MostPointsPlayer.addItem("Reward", Config.ZODIAC_REWARD, Config.ZODIAC_REWARD_COUN, MostPointsPlayer, true);
  772. +           Broadcast.announceToOnlinePlayers("Winner of the event " + MostPointsPlayer + " With " + MostPoints + " Points!");
  773. +       }
  774. +       for (Player player : _players.values())
  775. +       {
  776. +           if (player == null)
  777. +               continue;
  778. +           player.getAppearance().setNameColor(0xFFFFFF);
  779. +           player.setTitle("");
  780. +           player.broadcastUserInfo();
  781. +           player.teleToLocation(82698, 148638, -3473,0);
  782. +           player.broadcastUserInfo();
  783. +           player.isinZodiac = false;
  784. +           player.sendMessage("The Event is officially finished!");
  785. +       }
  786. +       for (Npc flag : _flags)
  787. +       {
  788. +           if (flag == null)
  789. +               continue;
  790. +           flag.deleteMe();
  791. +          
  792. +       }
  793. +       DoorTable.getInstance().getDoor(24190001).openMe();
  794. +       DoorTable.getInstance().getDoor(24190002).openMe();
  795. +       DoorTable.getInstance().getDoor(24190003).openMe();
  796. +       DoorTable.getInstance().getDoor(24190004).openMe();
  797. +       _players.clear();
  798. +       _flags.clear();
  799. +       CaptureThemRunning = false;
  800. +   }
  801. +  
  802. +   public static Npc addSpawn(int npcId, int x, int y, int z, int heading, boolean randomOffset, long despawnDelay, boolean isSummonSpawn)
  803. +   {
  804. +       try
  805. +       {
  806. +           final NpcTemplate template = NpcTable.getInstance().getTemplate(npcId);
  807. +           if (template == null)
  808. +               return null;
  809. +          
  810. +           if (randomOffset)
  811. +           {
  812. +               x += Rnd.get(-100, 100);
  813. +               y += Rnd.get(-100, 100);
  814. +           }
  815. +          
  816. +           final L2Spawn spawn = new L2Spawn(template);
  817. +           spawn.setLoc(x, y, z + 20, heading);
  818. +           spawn.setRespawnState(false);
  819. +          
  820. +           final Npc npc = spawn.doSpawn(isSummonSpawn);
  821. +           if (despawnDelay > 0)
  822. +               npc.scheduleDespawn(despawnDelay);
  823. +          
  824. +           return npc;
  825. +       }
  826. +       catch (Exception e1)
  827. +       {
  828. +           _log.warning("Zodiac Engine: Could not spawn Npc " + npcId);
  829. +           return null;
  830. +       }
  831. +   }
  832. +}
  833. \ No newline at end of file
  834. diff --git java/net/sf/l2j/gameserver/model/entity/engines/CastleWars.java java/net/sf/l2j/gameserver/model/entity/engines/CastleWars.java
  835. new file mode 100644
  836. index 0000000..0eaadaa
  837. --- /dev/null
  838. +++ java/net/sf/l2j/gameserver/model/entity/engines/CastleWars.java
  839. @@ -0,0 +1,317 @@
  840. +package net.sf.l2j.gameserver.model.entity.engines;
  841. +
  842. +import java.util.ArrayList;
  843. +import java.util.HashMap;
  844. +import java.util.List;
  845. +import java.util.Map;
  846. +import java.util.logging.Logger;
  847. +
  848. +import net.sf.l2j.commons.concurrent.ThreadPool;
  849. +import net.sf.l2j.commons.random.Rnd;
  850. +
  851. +import net.sf.l2j.Config;
  852. +import net.sf.l2j.gameserver.data.DoorTable;
  853. +import net.sf.l2j.gameserver.data.NpcTable;
  854. +import net.sf.l2j.gameserver.model.L2Spawn;
  855. +import net.sf.l2j.gameserver.model.World;
  856. +import net.sf.l2j.gameserver.model.actor.Npc;
  857. +import net.sf.l2j.gameserver.model.actor.instance.Player;
  858. +import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  859. +import net.sf.l2j.gameserver.util.Broadcast;
  860. +
  861. +/**
  862. + * @author Boorinio
  863. + */
  864. +public class CastleWars
  865. +{
  866. +   protected static final Logger _log = Logger.getLogger(CastleWars.class.getName());
  867. +   private final static Map<Integer, Player> _defenders = new HashMap<>();
  868. +   private final static Map<Integer, Player> _attackers = new HashMap<>();
  869. +   private static List<Npc> _flags = new ArrayList<>();
  870. +   public static boolean isFinished;
  871. +   public static boolean CastleWarsRunning;
  872. +   private static boolean alaksokolies = false;
  873. +   private static int i;
  874. +   public static int flagskilled = 0;
  875. +   public static int defendersx = 77566;
  876. +   public static int defendersy = -152128;
  877. +   public static int defendersz = -545;
  878. +   public static int attackersx = 84303;
  879. +   public static int attackersy = -140727;
  880. +   public static int attackersz = -1568;
  881. +   public static int[] flagslocx =
  882. +   {
  883. +       77545,
  884. +       76663,
  885. +       78446,
  886. +   };
  887. +   private static int[] flagslocy =
  888. +   {
  889. +       -149937,
  890. +       -154522,
  891. +       -154524,
  892. +   };
  893. +   private static int[] flagslocz =
  894. +   {
  895. +       345,
  896. +       128,
  897. +       235,
  898. +   };
  899. +  
  900. +   public static void openRegi()
  901. +   {
  902. +       ZodiacMain.ZodiacRegisterActive = true;
  903. +       Broadcast.announceToOnlinePlayers("CastleWars Event has Started!");
  904. +       Broadcast.announceToOnlinePlayers("Type .join to enter or .leave to leave!");
  905. +       Broadcast.announceToOnlinePlayers("You have 5 minutes to register!");
  906. +       ThreadPool.schedule(() -> {
  907. +           Broadcast.announceToOnlinePlayers("You have 4 minutes to register!");
  908. +       }, 60 * 1000);
  909. +       ThreadPool.schedule(() -> {
  910. +           Broadcast.announceToOnlinePlayers("You have 3 minutes to register!");
  911. +       }, 120 * 1000);
  912. +       ThreadPool.schedule(() -> {
  913. +           Broadcast.announceToOnlinePlayers("You have 2 minutes to register!");
  914. +       }, 180 * 1000);
  915. +       ThreadPool.schedule(() -> {
  916. +           Broadcast.announceToOnlinePlayers("You have 1 minutes to register!");
  917. +       }, 240 * 1000);
  918. +       ThreadPool.schedule(() -> {
  919. +           if (_defenders.size() == 0 || _attackers.size() == 0)
  920. +           {
  921. +               Broadcast.announceToOnlinePlayers("Event cancelled due to lack of participation.");
  922. +               isFinished = true;
  923. +               cleanevent();
  924. +               return;
  925. +           }
  926. +           CastleWarsRunning = true;
  927. +           ZodiacMain.ZodiacRegisterActive = false;
  928. +           isFinished = false;
  929. +           preparecastle();
  930. +           shufflePlayers();
  931. +           teleportThem();
  932. +           if (!isFinished)
  933. +               Broadcast.announceToOnlinePlayers("You have 10 minutes until the event is over!");
  934. +           ThreadPool.schedule(() -> {
  935. +               if (!isFinished)
  936. +                   Broadcast.announceToOnlinePlayers("You have 5 minutes until the event is over!");
  937. +           }, 300 * 1000);
  938. +           ThreadPool.schedule(() -> {
  939. +               if (!isFinished)
  940. +                   Broadcast.announceToOnlinePlayers("You have 4 minutes until the event is over!");
  941. +           }, 360 * 1000);
  942. +           ThreadPool.schedule(() -> {
  943. +               if (!isFinished)
  944. +                   Broadcast.announceToOnlinePlayers("You have 3 minutes until the event is over!");
  945. +           }, 420 * 1000);
  946. +           ThreadPool.schedule(() -> {
  947. +               if (!isFinished)
  948. +                   Broadcast.announceToOnlinePlayers("You have 2 minutes until the event is over!");
  949. +           }, 480 * 1000);
  950. +           ThreadPool.schedule(() -> {
  951. +               if (!isFinished)
  952. +                   Broadcast.announceToOnlinePlayers("You have 1 minutes until the event is over!");
  953. +           }, 540 * 1000);
  954. +           ThreadPool.schedule(() -> {
  955. +               if (!isFinished)
  956. +                   defendersWin();
  957. +           }, 600 * 1000);
  958. +       }, 300 * 1000);
  959. +   }
  960. +  
  961. +   public static void preparecastle()
  962. +   {
  963. +       DoorTable.getInstance().getDoor(22130001).openMe();
  964. +       DoorTable.getInstance().getDoor(22130002).openMe();
  965. +       DoorTable.getInstance().getDoor(22130003).openMe();
  966. +       DoorTable.getInstance().getDoor(22130004).openMe();
  967. +       DoorTable.getInstance().getDoor(22130005).openMe();
  968. +       DoorTable.getInstance().getDoor(22130010).openMe();
  969. +       DoorTable.getInstance().getDoor(22130007).openMe();
  970. +       DoorTable.getInstance().getDoor(22130011).openMe();
  971. +       DoorTable.getInstance().getDoor(22130009).openMe();
  972. +       DoorTable.getInstance().getDoor(22130008).openMe();
  973. +       DoorTable.getInstance().getDoor(22130010).openMe();
  974. +       DoorTable.getInstance().getDoor(22130006).openMe();
  975. +       Npc flags = null;
  976. +       for (i = 0; i < 3; i++)
  977. +       {
  978. +           flags = addSpawn(36006, flagslocx[i], flagslocy[i], flagslocz[i], 0, false, 600, true);
  979. +           _flags.add(flags);
  980. +       }
  981. +   }
  982. +  
  983. +   public static void cleanevent()
  984. +   {
  985. +       for (Player defender : _defenders.values())
  986. +       {
  987. +           if (defender == null)
  988. +               continue;
  989. +           defender.getAppearance().setNameColor(0xFFFFFF);
  990. +           defender.setTitle("");
  991. +           defender.broadcastUserInfo();
  992. +           defender.teleToLocation(82724, 148307, -3469, 0);
  993. +           defender.isinZodiac = false;
  994. +       }
  995. +       for (Player attacker : _attackers.values())
  996. +       {
  997. +           if (attacker == null)
  998. +               continue;
  999. +           attacker.getAppearance().setNameColor(0xFFFFFF);
  1000. +           attacker.setTitle("");
  1001. +           attacker.broadcastUserInfo();
  1002. +           attacker.teleToLocation(82724, 148307, -3469, 0);
  1003. +           attacker.isinZodiac = false;
  1004. +       }
  1005. +       for (Npc flags : _flags)
  1006. +       {
  1007. +           flags.deleteMe();
  1008. +          
  1009. +       }
  1010. +       flagskilled = 0;
  1011. +       _flags.clear();
  1012. +       _defenders.clear();
  1013. +       _attackers.clear();
  1014. +       DoorTable.getInstance().getDoor(22130001).closeMe();
  1015. +       DoorTable.getInstance().getDoor(22130002).closeMe();
  1016. +       DoorTable.getInstance().getDoor(22130003).closeMe();
  1017. +       DoorTable.getInstance().getDoor(22130004).closeMe();
  1018. +       DoorTable.getInstance().getDoor(22130005).closeMe();
  1019. +       DoorTable.getInstance().getDoor(22130010).closeMe();
  1020. +       DoorTable.getInstance().getDoor(22130007).closeMe();
  1021. +       DoorTable.getInstance().getDoor(22130011).closeMe();
  1022. +       DoorTable.getInstance().getDoor(22130009).closeMe();
  1023. +       DoorTable.getInstance().getDoor(22130008).closeMe();
  1024. +       DoorTable.getInstance().getDoor(22130010).closeMe();
  1025. +       DoorTable.getInstance().getDoor(22130006).closeMe();
  1026. +   }
  1027. +  
  1028. +   public static void defendersWin()
  1029. +   {
  1030. +       Broadcast.announceToOnlinePlayers("Defenders Won the event they protected the flags!");
  1031. +       for (Player defender : _defenders.values())
  1032. +       {
  1033. +           if (defender == null)
  1034. +               continue;
  1035. +           defender.sendMessage("Congratulations! Here is a reward for your effort!");
  1036. +           defender.addItem("Reward", Config.ZODIAC_REWARD, Config.ZODIAC_REWARD_COUN, defender, true);
  1037. +       }
  1038. +       isFinished = true;
  1039. +       cleanevent();
  1040. +   }
  1041. +  
  1042. +   public static boolean isattacker(Player player)
  1043. +   {
  1044. +       if (_attackers.containsKey(player.getObjectId()))
  1045. +       {
  1046. +           return true;
  1047. +       }
  1048. +       return false;
  1049. +   }
  1050. +  
  1051. +   public static boolean isdefender(Player player)
  1052. +   {
  1053. +       if (_defenders.containsKey(player.getObjectId()))
  1054. +       {
  1055. +           return true;
  1056. +       }
  1057. +       return false;
  1058. +   }
  1059. +  
  1060. +   public static void attackersWin()
  1061. +   {
  1062. +       if (flagskilled == 3)
  1063. +       {
  1064. +           Broadcast.announceToOnlinePlayers("Attackers Won the event they killed all the flags!");
  1065. +           for (Player attacker : _attackers.values())
  1066. +           {
  1067. +               if (attacker == null)
  1068. +                   continue;
  1069. +               attacker.sendMessage("Congratulations! Here is a reward for your effort!");
  1070. +               attacker.addItem("Reward", Config.ZODIAC_REWARD, Config.ZODIAC_REWARD_COUN, attacker, true);
  1071. +           }
  1072. +           isFinished = true;
  1073. +           cleanevent();
  1074. +       }
  1075. +   }
  1076. +  
  1077. +   public static void teleportThem()
  1078. +   {
  1079. +       for (Player defender : _defenders.values())
  1080. +       {
  1081. +           if (defender == null)
  1082. +               continue;
  1083. +           defender.teleToLocation(defendersx, defendersy, defendersz, 0);
  1084. +       }
  1085. +       for (Player attacker : _attackers.values())
  1086. +       {
  1087. +           if (attacker == null)
  1088. +               continue;
  1089. +           attacker.teleToLocation(attackersx, attackersy, attackersz, 0);
  1090. +       }
  1091. +   }
  1092. +  
  1093. +   public static void openRegistration()
  1094. +   {
  1095. +       Broadcast.announceToOnlinePlayers("Registrations are now over!");
  1096. +   }
  1097. +  
  1098. +   public static void shufflePlayers()
  1099. +   {
  1100. +       for (Player player : World.getInstance().getPlayers())
  1101. +       {
  1102. +           if (player == null)
  1103. +               continue;
  1104. +           if (player.isinZodiac)
  1105. +           {
  1106. +               if (alaksokolies)
  1107. +               {
  1108. +                   _defenders.putIfAbsent(player.getObjectId(), player);
  1109. +                   player.getAppearance().setNameColor(0xFF0000);
  1110. +                   player.setTitle("Defender");
  1111. +                   player.broadcastUserInfo();
  1112. +                   alaksokolies = false;
  1113. +               }
  1114. +               else
  1115. +               {
  1116. +                   _attackers.putIfAbsent(player.getObjectId(), player);
  1117. +                   player.getAppearance().setNameColor(0x0000FF);
  1118. +                   player.setTitle("Attacker");
  1119. +                   player.broadcastUserInfo();
  1120. +                   alaksokolies = true;
  1121. +               }
  1122. +           }
  1123. +       }
  1124. +   }
  1125. +  
  1126. +   public static Npc addSpawn(int npcId, int x, int y, int z, int heading, boolean randomOffset, long despawnDelay, boolean isSummonSpawn)
  1127. +   {
  1128. +       try
  1129. +       {
  1130. +           final NpcTemplate template = NpcTable.getInstance().getTemplate(npcId);
  1131. +           if (template == null)
  1132. +               return null;
  1133. +          
  1134. +           if (randomOffset)
  1135. +           {
  1136. +               x += Rnd.get(-100, 100);
  1137. +               y += Rnd.get(-100, 100);
  1138. +           }
  1139. +          
  1140. +           final L2Spawn spawn = new L2Spawn(template);
  1141. +           spawn.setLoc(x, y, z + 20, heading);
  1142. +           spawn.setRespawnState(false);
  1143. +          
  1144. +           final Npc npc = spawn.doSpawn(isSummonSpawn);
  1145. +           if (despawnDelay > 0)
  1146. +               npc.scheduleDespawn(despawnDelay);
  1147. +          
  1148. +           return npc;
  1149. +       }
  1150. +       catch (Exception e1)
  1151. +       {
  1152. +           _log.warning("Zodiac Engine: Could not spawn Npc " + npcId);
  1153. +           return null;
  1154. +       }
  1155. +   }
  1156. +}
  1157. \ No newline at end of file
  1158. diff --git java/net/sf/l2j/gameserver/model/entity/engines/PeloponnesianWar.java java/net/sf/l2j/gameserver/model/entity/engines/PeloponnesianWar.java
  1159. new file mode 100644
  1160. index 0000000..f7e7925
  1161. --- /dev/null
  1162. +++ java/net/sf/l2j/gameserver/model/entity/engines/PeloponnesianWar.java
  1163. @@ -0,0 +1,349 @@
  1164. +package net.sf.l2j.gameserver.model.entity.engines;
  1165. +
  1166. +import java.util.ArrayList;
  1167. +import java.util.HashMap;
  1168. +import java.util.List;
  1169. +import java.util.Map;
  1170. +import java.util.logging.Logger;
  1171. +
  1172. +import net.sf.l2j.commons.concurrent.ThreadPool;
  1173. +import net.sf.l2j.commons.random.Rnd;
  1174. +
  1175. +import net.sf.l2j.Config;
  1176. +import net.sf.l2j.gameserver.data.NpcTable;
  1177. +import net.sf.l2j.gameserver.model.L2Spawn;
  1178. +import net.sf.l2j.gameserver.model.World;
  1179. +import net.sf.l2j.gameserver.model.actor.Npc;
  1180. +import net.sf.l2j.gameserver.model.actor.instance.Player;
  1181. +import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  1182. +import net.sf.l2j.gameserver.util.Broadcast;
  1183. +
  1184. +/**
  1185. + * @author Boorinio
  1186. + */
  1187. +public class PeloponnesianWar
  1188. +{
  1189. +   protected static final Logger _log = Logger.getLogger(PeloponnesianWar.class.getName());
  1190. +   private static boolean alaksokolies = true;
  1191. +   public static boolean PeloRunning, continuez, continuez2;
  1192. +   private static int i, countA, countS;
  1193. +   private final static Map<Integer, Player> _participants = new HashMap<>();
  1194. +   private final static Map<Integer, Player> _athenians = new HashMap<>();
  1195. +   private final static Map<Integer, Player> _spartans = new HashMap<>();
  1196. +   private static List<Npc> _protectors = new ArrayList<>();
  1197. +   private static int athenianx = 72923;
  1198. +   private static int atheniany = 142764;
  1199. +   private static int athenianz = -3773;
  1200. +   private static int spartanx = -87891;
  1201. +   private static int spartany = 142198;
  1202. +   private static int spartanz = -3646;
  1203. +   private static int protectors = 30627;
  1204. +   private static int[] protectorsx =
  1205. +   {
  1206. +       72931,
  1207. +       72995,
  1208. +       73011,
  1209. +       73070,
  1210. +       -87921,
  1211. +       -87998,
  1212. +       -87908,
  1213. +       -87836,
  1214. +   };
  1215. +   private static int[] protectorsy =
  1216. +   {
  1217. +       143270,
  1218. +       143250,
  1219. +       142272,
  1220. +       142282,
  1221. +       142707,
  1222. +       142679,
  1223. +       141758,
  1224. +       141777,
  1225. +   };
  1226. +   private static int[] protectorsz =
  1227. +   {
  1228. +       -3773,
  1229. +       -3773,
  1230. +       -3773,
  1231. +       -3773,
  1232. +       -3646,
  1233. +       -3646,
  1234. +       -3646,
  1235. +       -3646,
  1236. +   };
  1237. +  
  1238. +   public static void startevent()
  1239. +   {
  1240. +       PeloRunning = true;
  1241. +       ZodiacMain.ZodiacRegisterActive = true;
  1242. +       Broadcast.announceToOnlinePlayers("Peloponnesian War Event has Started!");
  1243. +       Broadcast.announceToOnlinePlayers("Type .join to enter or .leave to leave!");
  1244. +       Broadcast.announceToOnlinePlayers("You have 5 minutes to register!");
  1245. +       ThreadPool.schedule(() -> {
  1246. +           Broadcast.announceToOnlinePlayers("You have 4 minutes to register!");
  1247. +       }, 60 * 1000);
  1248. +      
  1249. +       ThreadPool.schedule(() -> {
  1250. +           Broadcast.announceToOnlinePlayers("You have 3 minutes to register!");
  1251. +       }, 120 * 1000);
  1252. +      
  1253. +       ThreadPool.schedule(() -> {
  1254. +           Broadcast.announceToOnlinePlayers("You have 2 minutes to register!");
  1255. +       }, 180 * 1000);
  1256. +      
  1257. +       ThreadPool.schedule(() -> {
  1258. +           Broadcast.announceToOnlinePlayers("You have 1 minutes to register!");
  1259. +       }, 240 * 1000);
  1260. +       ThreadPool.schedule(() -> {
  1261. +           Broadcast.announceToOnlinePlayers("Registrations closed!");
  1262. +           if (_participants.size() == 0 ||  _athenians.size() == 0  ||_spartans.size() == 0)
  1263. +           {
  1264. +               Broadcast.announceToOnlinePlayers("Event cancelled due to lack of participation.");
  1265. +               cleanthemess();
  1266. +               return;
  1267. +           }
  1268. +           ZodiacMain.ZodiacRegisterActive = false;
  1269. +           for (Player player : World.getInstance().getPlayers())
  1270. +           {
  1271. +               if (player == null)
  1272. +                   continue;
  1273. +               if (player.isinZodiac)
  1274. +               {
  1275. +                   _participants.putIfAbsent(player.getObjectId(), player);
  1276. +                   if (alaksokolies)
  1277. +                   {
  1278. +                       _spartans.putIfAbsent(player.getObjectId(), player);
  1279. +                       player.setTitle("Spartan");
  1280. +                       player.getAppearance().setNameColor(0x0000FF);
  1281. +                       player.broadcastUserInfo();
  1282. +                       alaksokolies = false;
  1283. +                   }
  1284. +                   else
  1285. +                   {
  1286. +                       _athenians.putIfAbsent(player.getObjectId(), player);
  1287. +                       player.setTitle("Athenian");
  1288. +                       player.getAppearance().setNameColor(0xFF0000);
  1289. +                       player.broadcastUserInfo();
  1290. +                       alaksokolies = true;
  1291. +                   }
  1292. +                  
  1293. +               }
  1294. +           }
  1295. +           spawnProtectors();
  1296. +           teleportplayers();
  1297. +           Broadcast.announceToOnlinePlayers("Civil War round started!");
  1298. +           Broadcast.announceToOnlinePlayers("You have 3 minutes the one who survive will face the opponent race!!");
  1299. +           ThreadPool.schedule(() -> {
  1300. +               for (Player finals : _athenians.values())
  1301. +               {
  1302. +                   if (finals == null)
  1303. +                       continue;
  1304. +                   if (finals.isinZodiac)
  1305. +                       countA++;
  1306. +               }
  1307. +               for (Player finals : _spartans.values())
  1308. +               {
  1309. +                   if (finals == null)
  1310. +                       continue;
  1311. +                   if (finals.isinZodiac)
  1312. +                       countS++;
  1313. +               }
  1314. +               if (countA > 1)
  1315. +               {
  1316. +                   Broadcast.announceToOnlinePlayers("Athenians cheated and tried to send more than two players Spartans won!");
  1317. +                   reward(false);
  1318. +               }
  1319. +               else if (countS > 1)
  1320. +               {
  1321. +                   Broadcast.announceToOnlinePlayers("Spartans cheated and tried to send more than two players Athenians won!");
  1322. +                   reward(true);
  1323. +               }
  1324. +               else
  1325. +               {
  1326. +                   finalround();
  1327. +                   Broadcast.announceToOnlinePlayers("Spartan and Athenian representative have 2 minutes to face each other");
  1328. +                   ThreadPool.schedule(() -> {
  1329. +                       checkwhowon();
  1330. +                   }, 120 * 1000);
  1331. +               }
  1332. +              
  1333. +           }, 180 * 1000);
  1334. +       }, 300 * 1000);
  1335. +   }
  1336. +  
  1337. +   public static void cleanthemess()
  1338. +   {
  1339. +       for (Player participant : _participants.values())
  1340. +       {
  1341. +           if (participant == null)
  1342. +               continue;
  1343. +           if (participant.isinZodiac)
  1344. +           {
  1345. +               participant.setTitle("");
  1346. +               participant.getAppearance().setNameColor(0xFFFFFF);
  1347. +               participant.broadcastUserInfo();
  1348. +               participant.teleToLocation(82698, 148638, -3473, 0);
  1349. +           }
  1350. +           participant.isinZodiac = false;
  1351. +       }
  1352. +       for (Npc protectors : _protectors)
  1353. +       {
  1354. +           if (protectors == null)
  1355. +               continue;
  1356. +           protectors.deleteMe();
  1357. +       }
  1358. +       continuez = false;
  1359. +       continuez2 = false;
  1360. +       PeloRunning = false;
  1361. +       _protectors.clear();
  1362. +       _participants.clear();
  1363. +       _athenians.clear();
  1364. +       _spartans.clear();
  1365. +   }
  1366. +  
  1367. +   private static void reward(boolean Athenians)
  1368. +   {
  1369. +       if (Athenians)
  1370. +       {
  1371. +           for (Player athenians : _athenians.values())
  1372. +           {
  1373. +              
  1374. +               if (athenians == null)
  1375. +                   continue;
  1376. +               athenians.addItem("Reward", Config.ZODIAC_REWARD, Config.ZODIAC_REWARD_COUN, athenians, true);
  1377. +              
  1378. +           }
  1379. +       }
  1380. +       else
  1381. +       {
  1382. +           for (Player spartans : _spartans.values())
  1383. +           {
  1384. +              
  1385. +               if (spartans == null)
  1386. +                   continue;
  1387. +               spartans.addItem("Reward", Config.ZODIAC_REWARD, Config.ZODIAC_REWARD_COUN, spartans, true);
  1388. +              
  1389. +           }
  1390. +       }
  1391. +   }
  1392. +  
  1393. +   public static void checkwhowon()
  1394. +   {
  1395. +       for (Player winner : _participants.values())
  1396. +       {
  1397. +           if (winner == null)
  1398. +               continue;
  1399. +           if (winner.isinZodiac && _athenians.containsKey(winner.getObjectId()))
  1400. +               continuez = true;
  1401. +           if (winner.isinZodiac && _spartans.containsKey(winner.getObjectId()))
  1402. +               continuez2 = true;
  1403. +           if (continuez && continuez2)
  1404. +               Broadcast.announceToOnlinePlayers("Both representatives are alive blame them for not getting a reward!");
  1405. +           else if (continuez)
  1406. +           {
  1407. +               Broadcast.announceToOnlinePlayers("Athenians won!");
  1408. +               reward(true);
  1409. +           }
  1410. +           else if (continuez2)
  1411. +           {
  1412. +               Broadcast.announceToOnlinePlayers("Spartans won!");
  1413. +               reward(false);
  1414. +           }
  1415. +       }
  1416. +       cleanthemess();
  1417. +   }
  1418. +  
  1419. +   public static void finalround()
  1420. +   {
  1421. +       for (Player athenian : _athenians.values())
  1422. +       {
  1423. +           if (athenian == null)
  1424. +               continue;
  1425. +           if (athenian.isinZodiac)
  1426. +           {
  1427. +               athenian.sendMessage("You are the best athenian you will face the best spartan");
  1428. +               athenian.setTitle("Final Athenian");
  1429. +               athenian.setCurrentHp(athenian.getMaxHp());
  1430. +               athenian.setCurrentMp(athenian.getMaxMp());
  1431. +               athenian.setCurrentCp(athenian.getMaxCp());
  1432. +               athenian.addItem("Reward", Config.ZODIAC_REWARD, Config.ZODIAC_REWARD_COUN, athenian, true);
  1433. +               athenian.broadcastUserInfo();
  1434. +               athenian.teleToLocation(-21754, -20955, -3026, 0);
  1435. +           }
  1436. +       }
  1437. +       for (Player spartan : _spartans.values())
  1438. +       {
  1439. +           if (spartan == null)
  1440. +               continue;
  1441. +           if (spartan.isinZodiac)
  1442. +           {
  1443. +               spartan.sendMessage("You are the best spartan you will face the best athenian");
  1444. +               spartan.setTitle("Final Spartan");
  1445. +               spartan.setCurrentHp(spartan.getMaxHp());
  1446. +               spartan.setCurrentMp(spartan.getMaxMp());
  1447. +               spartan.setCurrentCp(spartan.getMaxCp());
  1448. +               spartan.addItem("Reward", Config.ZODIAC_REWARD, Config.ZODIAC_REWARD_COUN, spartan, true);
  1449. +               spartan.broadcastUserInfo();
  1450. +               spartan.teleToLocation(-19821, -20988, -3026, 0);
  1451. +           }
  1452. +       }
  1453. +   }
  1454. +  
  1455. +   public static void teleportplayers()
  1456. +   {
  1457. +       for (Player player : _participants.values())
  1458. +       {
  1459. +           if (player == null)
  1460. +               continue;
  1461. +           if (_athenians.containsKey(player.getObjectId()))
  1462. +           {
  1463. +               player.teleToLocation(athenianx, atheniany, athenianz, 0);
  1464. +           }
  1465. +           else
  1466. +           {
  1467. +               player.teleToLocation(spartanx, spartany, spartanz, 0);
  1468. +           }
  1469. +       }
  1470. +   }
  1471. +  
  1472. +   public static void spawnProtectors()
  1473. +   {
  1474. +       Npc protector = null;
  1475. +       for (i = 0; i < 8; i++)
  1476. +       {
  1477. +           protector = addSpawn(protectors, protectorsx[i], protectorsy[i], protectorsz[i], 0, false, 600, true);
  1478. +           _protectors.add(protector);
  1479. +       }
  1480. +   }
  1481. +  
  1482. +   public static Npc addSpawn(int npcId, int x, int y, int z, int heading, boolean randomOffset, long despawnDelay, boolean isSummonSpawn)
  1483. +   {
  1484. +       try
  1485. +       {
  1486. +           final NpcTemplate template = NpcTable.getInstance().getTemplate(npcId);
  1487. +           if (template == null)
  1488. +               return null;
  1489. +          
  1490. +           if (randomOffset)
  1491. +           {
  1492. +               x += Rnd.get(-100, 100);
  1493. +               y += Rnd.get(-100, 100);
  1494. +           }
  1495. +          
  1496. +           final L2Spawn spawn = new L2Spawn(template);
  1497. +           spawn.setLoc(x, y, z + 20, heading);
  1498. +           spawn.setRespawnState(false);
  1499. +          
  1500. +           final Npc npc = spawn.doSpawn(isSummonSpawn);
  1501. +           if (despawnDelay > 0)
  1502. +               npc.scheduleDespawn(despawnDelay);
  1503. +          
  1504. +           return npc;
  1505. +       }
  1506. +       catch (Exception e1)
  1507. +       {
  1508. +           _log.warning("Zodiac Engine: Could not spawn Npc " + npcId);
  1509. +           return null;
  1510. +       }
  1511. +   }
  1512. +}
  1513. \ No newline at end of file
  1514. diff --git java/net/sf/l2j/gameserver/model/entity/engines/ProtectTheLdr.java java/net/sf/l2j/gameserver/model/entity/engines/ProtectTheLdr.java
  1515. new file mode 100644
  1516. index 0000000..77bb276
  1517. --- /dev/null
  1518. +++ java/net/sf/l2j/gameserver/model/entity/engines/ProtectTheLdr.java
  1519. @@ -0,0 +1,211 @@
  1520. +package net.sf.l2j.gameserver.model.entity.engines;
  1521. +
  1522. +import java.util.ArrayList;
  1523. +import java.util.HashMap;
  1524. +import java.util.List;
  1525. +import java.util.Map;
  1526. +import java.util.logging.Logger;
  1527. +
  1528. +import net.sf.l2j.commons.concurrent.ThreadPool;
  1529. +import net.sf.l2j.commons.random.Rnd;
  1530. +
  1531. +import net.sf.l2j.Config;
  1532. +import net.sf.l2j.gameserver.data.NpcTable;
  1533. +import net.sf.l2j.gameserver.model.L2Spawn;
  1534. +import net.sf.l2j.gameserver.model.World;
  1535. +import net.sf.l2j.gameserver.model.actor.Npc;
  1536. +import net.sf.l2j.gameserver.model.actor.instance.Player;
  1537. +import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  1538. +import net.sf.l2j.gameserver.util.Broadcast;
  1539. +
  1540. +/**
  1541. + * @author Boorinio
  1542. + */
  1543. +public class ProtectTheLdr
  1544. +{
  1545. +   protected static final Logger _log = Logger.getLogger(ProtectTheLdr.class.getName());
  1546. +   public final static Map<Integer, Player> _Team1 = new HashMap<>();
  1547. +   public final static Map<Integer, Player> _Team2 = new HashMap<>();
  1548. +   public static int team1x = -19790;
  1549. +   public static int team1y = -21023;
  1550. +   public static int team1z = -3025;
  1551. +   private static int leader1 = 36007;
  1552. +   public static int team2x = -21780, team2y = -20976, team2z = -3027, leader2 = 36008;
  1553. +   private static int leader2x = -21717, leader2y = -20859, leader2z = -3027;
  1554. +   private static int leader1x = -19846, leader1y = -20859, leader1z = -3027;
  1555. +   public static boolean ProtectisRunning, alaksokolies;
  1556. +   private static List<Npc> _leaders = new ArrayList<>();
  1557. +  
  1558. +   public static void startevent()
  1559. +   {
  1560. +       ZodiacMain.ZodiacRegisterActive = true;
  1561. +       Broadcast.announceToOnlinePlayers("ProtectTheLeader Event has Started!");
  1562. +       Broadcast.announceToOnlinePlayers("Type .join to enter or .leave to leave!");
  1563. +       Broadcast.announceToOnlinePlayers("You have 5 minutes to register!");
  1564. +       ThreadPool.schedule(() -> {
  1565. +           Broadcast.announceToOnlinePlayers("You have 4 minutes to register!");
  1566. +       }, 60 * 1000);
  1567. +      
  1568. +       ThreadPool.schedule(() -> {
  1569. +           Broadcast.announceToOnlinePlayers("You have 3 minutes to register!");
  1570. +       }, 120 * 1000);
  1571. +      
  1572. +       ThreadPool.schedule(() -> {
  1573. +           Broadcast.announceToOnlinePlayers("You have 2 minutes to register!");
  1574. +       }, 180 * 1000);
  1575. +      
  1576. +       ThreadPool.schedule(() -> {
  1577. +           Broadcast.announceToOnlinePlayers("You have 1 minutes to register!");
  1578. +       }, 240 * 1000);
  1579. +       ThreadPool.schedule(() -> {
  1580. +           if (_Team1.size() == 0 || _Team2.size() == 0)
  1581. +           {
  1582. +               Broadcast.announceToOnlinePlayers("Event cancelled due to lack of participation.");
  1583. +               cleanthemess();
  1584. +               return;
  1585. +           }
  1586. +           ZodiacMain.ZodiacRegisterActive = false;
  1587. +           ProtectisRunning = true;
  1588. +           Broadcast.announceToOnlinePlayers("Registrations are now over!");
  1589. +           shufflePlayers();
  1590. +           teleportplayers();
  1591. +           Npc spawn1 = null;
  1592. +           Npc spawn2 = null;
  1593. +           spawn1 =  addSpawn(leader1, leader1x, leader1y, leader1z, 0, false, 600, true);
  1594. +           spawn2 = addSpawn(leader2, leader2x, leader2y, leader2z, 0, false, 600, true);
  1595. +           _leaders.add(spawn1);
  1596. +           _leaders.add(spawn2);
  1597. +           Broadcast.announceToOnlinePlayers("Go kill the enemy's Leader rb!");
  1598. +       }, 300 * 1000);
  1599. +   }
  1600. +  
  1601. +   public static void team1wins()
  1602. +   {
  1603. +       Broadcast.announceToOnlinePlayers("Team 1 won team's 2 leader is dead!");
  1604. +       for (Player member : _Team1.values())
  1605. +       {
  1606. +           if (member == null)
  1607. +               continue;
  1608. +           member.sendMessage("Congratulations! The enemy leader is dead!");
  1609. +           member.addItem("Reward", Config.ZODIAC_REWARD, Config.ZODIAC_REWARD_COUN, member, true);
  1610. +       }
  1611. +       cleanthemess();
  1612. +   }
  1613. +  
  1614. +   public static void team2wins()
  1615. +   {
  1616. +       Broadcast.announceToOnlinePlayers("Team 2 won team's 1 leader is dead!");
  1617. +       for (Player member : _Team2.values())
  1618. +       {
  1619. +           if (member == null)
  1620. +               continue;
  1621. +           member.sendMessage("Congratulations! The enemy leader is dead!");
  1622. +           member.addItem("Reward", Config.ZODIAC_REWARD, Config.ZODIAC_REWARD_COUN, member, true);
  1623. +       }
  1624. +       cleanthemess();
  1625. +   }
  1626. +  
  1627. +   public static void cleanthemess()
  1628. +   {
  1629. +       for (Player member : _Team1.values())
  1630. +       {
  1631. +           if (member == null)
  1632. +               continue;
  1633. +           member.getAppearance().setNameColor(0xFFFFFF);
  1634. +           member.setTitle("");
  1635. +           member.broadcastUserInfo();
  1636. +           member.isinZodiac = false;
  1637. +           member.teleToLocation(82743, 148219, -3470, 0);
  1638. +       }
  1639. +       for (Player member : _Team2.values())
  1640. +       {
  1641. +           if (member == null)
  1642. +               continue;
  1643. +           member.getAppearance().setNameColor(0xFFFFFF);
  1644. +           member.setTitle("");
  1645. +           member.broadcastUserInfo();
  1646. +           member.isinZodiac = false;
  1647. +           member.teleToLocation(82743, 148219, -3470, 0);
  1648. +       }
  1649. +       for (Npc leader : _leaders)
  1650. +       {
  1651. +           leader.deleteMe();
  1652. +       }
  1653. +       ProtectisRunning = false;
  1654. +   }
  1655. +  
  1656. +   public static void teleportplayers()
  1657. +   {
  1658. +       for (Player member : _Team1.values())
  1659. +       {
  1660. +           if (member == null)
  1661. +               continue;
  1662. +           member.teleToLocation(team1x, team1y, team1z, 0);
  1663. +       }
  1664. +       for (Player member : _Team2.values())
  1665. +       {
  1666. +           if (member == null)
  1667. +               continue;
  1668. +           member.teleToLocation(team2x, team2y, team2z, 0);
  1669. +       }
  1670. +   }
  1671. +  
  1672. +   public static void shufflePlayers()
  1673. +   {
  1674. +       for (Player player : World.getInstance().getPlayers())
  1675. +       {
  1676. +           if (player == null)
  1677. +               continue;
  1678. +           if (player.isinZodiac)
  1679. +           {
  1680. +               if (alaksokolies)
  1681. +               {
  1682. +                   _Team1.putIfAbsent(player.getObjectId(), player);
  1683. +                   player.getAppearance().setNameColor(0xFF0000);
  1684. +                   player.setTitle("Team1");
  1685. +                   player.broadcastUserInfo();
  1686. +                   alaksokolies = false;
  1687. +               }
  1688. +               else
  1689. +               {
  1690. +                   _Team2.putIfAbsent(player.getObjectId(), player);
  1691. +                   player.getAppearance().setNameColor(0x0000FF);
  1692. +                   player.setTitle("Team2");
  1693. +                   player.broadcastUserInfo();
  1694. +                   alaksokolies = true;
  1695. +               }
  1696. +           }
  1697. +       }
  1698. +   }
  1699. +  
  1700. +   public static Npc addSpawn(int npcId, int x, int y, int z, int heading, boolean randomOffset, long despawnDelay, boolean isSummonSpawn)
  1701. +   {
  1702. +       try
  1703. +       {
  1704. +           final NpcTemplate template = NpcTable.getInstance().getTemplate(npcId);
  1705. +           if (template == null)
  1706. +               return null;
  1707. +          
  1708. +           if (randomOffset)
  1709. +           {
  1710. +               x += Rnd.get(-100, 100);
  1711. +               y += Rnd.get(-100, 100);
  1712. +           }
  1713. +          
  1714. +           final L2Spawn spawn = new L2Spawn(template);
  1715. +           spawn.setLoc(x, y, z + 20, heading);
  1716. +           spawn.setRespawnState(false);
  1717. +          
  1718. +           final Npc npc = spawn.doSpawn(isSummonSpawn);
  1719. +           if (despawnDelay > 0)
  1720. +               npc.scheduleDespawn(despawnDelay);
  1721. +          
  1722. +           return npc;
  1723. +       }
  1724. +       catch (Exception e1)
  1725. +       {
  1726. +           _log.warning("Zodiac Engine: Could not spawn Npc " + npcId);
  1727. +           return null;
  1728. +       }
  1729. +   }
  1730. +}
  1731. \ No newline at end of file
  1732. diff --git java/net/sf/l2j/gameserver/model/entity/engines/TreasureChest.java java/net/sf/l2j/gameserver/model/entity/engines/TreasureChest.java
  1733. new file mode 100644
  1734. index 0000000..8a37a6b
  1735. --- /dev/null
  1736. +++ java/net/sf/l2j/gameserver/model/entity/engines/TreasureChest.java
  1737. @@ -0,0 +1,144 @@
  1738. +package net.sf.l2j.gameserver.model.entity.engines;
  1739. +
  1740. +import java.util.ArrayList;
  1741. +import java.util.HashMap;
  1742. +import java.util.List;
  1743. +import java.util.Map;
  1744. +import java.util.logging.Logger;
  1745. +
  1746. +import net.sf.l2j.commons.concurrent.ThreadPool;
  1747. +import net.sf.l2j.commons.random.Rnd;
  1748. +
  1749. +import net.sf.l2j.Config;
  1750. +import net.sf.l2j.gameserver.data.NpcTable;
  1751. +import net.sf.l2j.gameserver.model.L2Spawn;
  1752. +import net.sf.l2j.gameserver.model.World;
  1753. +import net.sf.l2j.gameserver.model.actor.Npc;
  1754. +import net.sf.l2j.gameserver.model.actor.instance.Player;
  1755. +import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  1756. +import net.sf.l2j.gameserver.util.Broadcast;
  1757. +
  1758. +/**
  1759. + * @author Boorinio
  1760. + */
  1761. +public class TreasureChest
  1762. +{
  1763. +   protected static final Logger _log = Logger.getLogger(TreasureChest.class.getName());
  1764. +   public static boolean TreasureRunning;
  1765. +   private final static Map<Integer, Player> _players = new HashMap<>();
  1766. +   private static List<Npc> _Npcs = new ArrayList<>();
  1767. +   private static int x = 87377, y = 20459, z = -5270, i;
  1768. +  
  1769. +   public static void registration()
  1770. +   {
  1771. +       ZodiacMain.ZodiacRegisterActive = true;
  1772. +       Broadcast.announceToOnlinePlayers("TreasureChest Event has Started!");
  1773. +       Broadcast.announceToOnlinePlayers("Type .join to enter or .leave to leave!");
  1774. +       Broadcast.announceToOnlinePlayers("You have 5 minutes to register!");
  1775. +       ThreadPool.schedule(() -> {
  1776. +           Broadcast.announceToOnlinePlayers("You have 4 minutes to register!");
  1777. +       }, 60 * 1000);
  1778. +      
  1779. +       ThreadPool.schedule(() -> {
  1780. +           Broadcast.announceToOnlinePlayers("You have 3 minutes to register!");
  1781. +       }, 120 * 1000);
  1782. +      
  1783. +       ThreadPool.schedule(() -> {
  1784. +           Broadcast.announceToOnlinePlayers("You have 2 minutes to register!");
  1785. +       }, 180 * 1000);
  1786. +      
  1787. +       ThreadPool.schedule(() -> {
  1788. +           Broadcast.announceToOnlinePlayers("You have 1 minutes to register!");
  1789. +       }, 240 * 1000);
  1790. +      
  1791. +       ThreadPool.schedule(() -> {
  1792. +           for (Player player : World.getInstance().getPlayers())
  1793. +           {
  1794. +               if (player == null)
  1795. +                   continue;
  1796. +               if (player.isinZodiac)
  1797. +               {
  1798. +                   _players.putIfAbsent(player.getObjectId(), player);
  1799. +               }
  1800. +           }
  1801. +           if (_players.size() > 0)
  1802. +               startevent();
  1803. +           else
  1804. +               Broadcast.announceToOnlinePlayers("Event was cancelled cause no one registered!");
  1805. +       }, 300 * 1000);
  1806. +      
  1807. +   }
  1808. +  
  1809. +   public static void startevent()
  1810. +   {
  1811. +       ZodiacMain.ZodiacRegisterActive = false;
  1812. +       TreasureRunning = true;
  1813. +       for (Player players : _players.values())
  1814. +       {
  1815. +           players.teleToLocation(x, y, z, 0);
  1816. +           players.sendMessage("Kill as many chest as you can!");
  1817. +       }
  1818. +       Npc npcs = null;
  1819. +       for (i = 0; i < 40; i++)
  1820. +       {
  1821. +           npcs = addSpawn(18286, x + Rnd.get(-750, +750), y + Rnd.get(-750, +750), z, 0, false, 600, true);
  1822. +           _Npcs.add(npcs);
  1823. +       }
  1824. +   }
  1825. +  
  1826. +   public static void LuckyOne(Player killer)
  1827. +   {
  1828. +       if (Rnd.get(50) == 2)
  1829. +       {
  1830. +           Broadcast.announceToOnlinePlayers(killer + " killed the lucky chest!");
  1831. +           killer.addItem("Reward", Config.ZODIAC_REWARD, Config.ZODIAC_REWARD_COUN, killer, true);
  1832. +           cleanthemess();
  1833. +       }
  1834. +   }
  1835. +  
  1836. +   public static void cleanthemess()
  1837. +   {
  1838. +       for (Player players : _players.values())
  1839. +       {
  1840. +           players.teleToLocation(83225, 148068, -3430, 0);
  1841. +       }
  1842. +       for (Npc npc : _Npcs)
  1843. +       {
  1844. +           npc.deleteMe();
  1845. +       }
  1846. +       TreasureRunning = false;
  1847. +       _players.clear();
  1848. +       _Npcs.clear();
  1849. +   }
  1850. +  
  1851. +   public static Npc addSpawn(int npcId, int x, int y, int z, int heading, boolean randomOffset, long despawnDelay, boolean isSummonSpawn)
  1852. +   {
  1853. +       try
  1854. +       {
  1855. +           final NpcTemplate template = NpcTable.getInstance().getTemplate(npcId);
  1856. +           if (template == null)
  1857. +               return null;
  1858. +          
  1859. +           if (randomOffset)
  1860. +           {
  1861. +               x += Rnd.get(-100, 100);
  1862. +               y += Rnd.get(-100, 100);
  1863. +           }
  1864. +          
  1865. +           final L2Spawn spawn = new L2Spawn(template);
  1866. +           spawn.setLoc(x, y, z + 20, heading);
  1867. +           spawn.setRespawnState(false);
  1868. +          
  1869. +           final Npc npc = spawn.doSpawn(isSummonSpawn);
  1870. +           if (despawnDelay > 0)
  1871. +               npc.scheduleDespawn(despawnDelay);
  1872. +          
  1873. +           return npc;
  1874. +       }
  1875. +       catch (Exception e1)
  1876. +       {
  1877. +           _log.warning("Zodiac Engine: Could not spawn Npc " + npcId);
  1878. +           return null;
  1879. +       }
  1880. +   }
  1881. +}
  1882. \ No newline at end of file
  1883. diff --git java/net/sf/l2j/gameserver/model/entity/engines/ZodiacMain.java java/net/sf/l2j/gameserver/model/entity/engines/ZodiacMain.java
  1884. new file mode 100644
  1885. index 0000000..c8bf8ae
  1886. --- /dev/null
  1887. +++ java/net/sf/l2j/gameserver/model/entity/engines/ZodiacMain.java
  1888. @@ -0,0 +1,222 @@
  1889. +package net.sf.l2j.gameserver.model.entity.engines;
  1890. +
  1891. +import java.util.ArrayList;
  1892. +import java.util.List;
  1893. +
  1894. +import net.sf.l2j.commons.concurrent.ThreadPool;
  1895. +
  1896. +import net.sf.l2j.Config;
  1897. +import net.sf.l2j.gameserver.model.World;
  1898. +import net.sf.l2j.gameserver.model.actor.instance.Player;
  1899. +import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
  1900. +import net.sf.l2j.gameserver.util.Broadcast;
  1901. +
  1902. +/**
  1903. + * @author Boorinio
  1904. + */
  1905. +public class ZodiacMain
  1906. +{
  1907. +   public static List<String> Ips = new ArrayList<>();
  1908. +   public static boolean ZodiacRegisterActive;
  1909. +   public static int i, max;
  1910. +   public static int[] count =
  1911. +   {
  1912. +       0,
  1913. +       0,
  1914. +       0,
  1915. +       0,
  1916. +       0
  1917. +   };
  1918. +   public static boolean voting;
  1919. +  
  1920. +   public static void ZodiacIn()
  1921. +   {
  1922. +       ThreadPool.scheduleAtFixedRate(() -> {
  1923. +           if (!ZodiacRegisterActive)
  1924. +               startVoting();
  1925. +       }, Config.INITIAL_START * 1000, Config.BETWEEN_EVENTS * 1000);
  1926. +   }
  1927. +  
  1928. +   public static void startVoting()
  1929. +   {
  1930. +       voting = true;
  1931. +       for (Player player : World.getInstance().getPlayers())
  1932. +       {
  1933. +           if (player == null)
  1934. +               continue;
  1935. +          
  1936. +           showHtmlWindow(player);
  1937. +       }
  1938. +       Broadcast.announceToOnlinePlayers("You have 5 minutes to vote for the event you like!");
  1939. +       ThreadPool.schedule(() -> {
  1940. +           Broadcast.announceToOnlinePlayers("You have 4 minutes to vote for the event you like!");
  1941. +       }, 60 * 1000);
  1942. +       ThreadPool.schedule(() -> {
  1943. +           Broadcast.announceToOnlinePlayers("You have 3 minutes to vote for the event you like!");
  1944. +       }, 120 * 1000);
  1945. +       ThreadPool.schedule(() -> {
  1946. +           Broadcast.announceToOnlinePlayers("You have 2 minutes to vote for the event you like!");
  1947. +       }, 180 * 1000);
  1948. +       ThreadPool.schedule(() -> {
  1949. +           Broadcast.announceToOnlinePlayers("You have 1 minute to vote for the event you like!");
  1950. +       }, 240 * 1000);
  1951. +       ThreadPool.schedule(() -> {
  1952. +           voting = false;
  1953. +           endit();
  1954. +       }, 500 * 1000);
  1955. +   }
  1956. +  
  1957. +   public static void showHtmlWindow(Player activeChar)
  1958. +   {
  1959. +       NpcHtmlMessage nhm = new NpcHtmlMessage(5);
  1960. +       StringBuilder tb = new StringBuilder("");
  1961. +       tb.append("<html><head><title>Zodiac Event Voting</title></head><body>");
  1962. +       tb.append("<center>");
  1963. +       tb.append("<td valign=\"top\"><font color=\"FF6600\">Vote for the event you want to play!</font>");
  1964. +       tb.append("<br>");
  1965. +       tb.append("<img src=\"SSQ_dungeon_T.SSQ_fire1_e013\" width=256 height=64>");
  1966. +       tb.append("<br1>");
  1967. +       tb.append("<img src=\"L2UI.SquareWhite\" width=194 height=1>");
  1968. +       tb.append("<table bgcolor=333333 width=204>");
  1969. +       tb.append("<tr>");
  1970. +       tb.append("<td><center><button value=\"CaptureThem\" action=\"bypass -h CaptureThem\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></center></td>");
  1971. +       tb.append("</tr>");
  1972. +       tb.append(" <tr>");
  1973. +       tb.append("<td><center><button value=\"Peloponnesian\" action=\"bypass -h PeloponnesianWar\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></center></td>");
  1974. +       tb.append("</tr>");
  1975. +       tb.append("<tr>");
  1976. +       tb.append("<td><center><button value=\"CastleWars\" action=\"bypass -h CastleWars\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></center></td>");
  1977. +       tb.append("</tr>");
  1978. +       tb.append("<tr>");
  1979. +       tb.append("<td><center><button value=\"ProtectTheLdr\" action=\"bypass -h ProtectTheLdr\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></center></td>");
  1980. +       tb.append("</tr>");
  1981. +       tb.append("<tr>");
  1982. +       tb.append("<td><center><button value=\"TreasureChest\" action=\"bypass -h TreasureChest\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></center></td>");
  1983. +       tb.append("</tr>");
  1984. +       tb.append("</table>");
  1985. +       tb.append("<font color=\"FF6600\">By Boorinio!</font>");
  1986. +       tb.append("</center>");
  1987. +       tb.append("</body></html>");
  1988. +       nhm.setHtml(tb.toString());
  1989. +       activeChar.sendPacket(nhm);
  1990. +   }
  1991. +  
  1992. +   public static void showFinalWindow(Player player)
  1993. +   {
  1994. +       NpcHtmlMessage nhm = new NpcHtmlMessage(5);
  1995. +       StringBuilder tb = new StringBuilder("");
  1996. +       tb.append("<html><title>Zodiac Event Engine</title><body>Current Votes:<br>");
  1997. +       tb.append("Current Votes:<br><br>");
  1998. +       tb.append("Peloponnesian War: " + count[0] + "<br>");
  1999. +       tb.append("Capture Them: " + count[1] + "<br>");
  2000. +       tb.append("Castle Wars: " + count[2] + "<br>");
  2001. +       tb.append("Treasure Chests: " + count[4] + "<br>");
  2002. +       tb.append("Protect The Leader: " + count[3] + "<br><br>");
  2003. +       tb.append("</body></html>");
  2004. +       nhm.setHtml(tb.toString());
  2005. +       player.sendPacket(nhm);
  2006. +   }
  2007. +  
  2008. +   public static void endit()
  2009. +   {
  2010. +       max = 0;
  2011. +       for (i = 0; i < 5; i++)
  2012. +       {
  2013. +           if (count[i] > max)
  2014. +               max = i;
  2015. +       }
  2016. +       if (max == 0)
  2017. +       {
  2018. +           Broadcast.announceToOnlinePlayers("Peloponnesian Event has the most votes!");
  2019. +           Broadcast.announceToOnlinePlayers("In 10 seconds the registration will open!");
  2020. +           ThreadPool.schedule(() -> {
  2021. +               PeloponnesianWar.startevent();
  2022. +           }, 10 * 1000);
  2023. +       }
  2024. +       else if (max == 1)
  2025. +       {
  2026. +           Broadcast.announceToOnlinePlayers("CaptureThem Event has the most votes!");
  2027. +           Broadcast.announceToOnlinePlayers("In 10 seconds the registration will open!");
  2028. +           ThreadPool.schedule(() -> {
  2029. +               CaptureThem.openRegistration();
  2030. +           }, 10 * 1000);
  2031. +       }
  2032. +       else if (max == 2)
  2033. +       {
  2034. +           Broadcast.announceToOnlinePlayers("CastleWars Event has the most votes!");
  2035. +           Broadcast.announceToOnlinePlayers("In 10 seconds the registration will open!");
  2036. +           ThreadPool.schedule(() -> {
  2037. +               CastleWars.openRegistration();
  2038. +           }, 10 * 1000);
  2039. +          
  2040. +       }
  2041. +       else if (max == 3)
  2042. +       {
  2043. +           Broadcast.announceToOnlinePlayers("ProtectTheLeader Event has the most votes!");
  2044. +           Broadcast.announceToOnlinePlayers("In 10 seconds the registration will open!");
  2045. +           ThreadPool.schedule(() -> {
  2046. +               ProtectTheLdr.startevent();
  2047. +           }, 10 * 1000);
  2048. +       }
  2049. +       else if (max == 4)
  2050. +       {
  2051. +           Broadcast.announceToOnlinePlayers("Treasure Chest Event has the most votes!");
  2052. +           Broadcast.announceToOnlinePlayers("In 10 seconds the registration will open!");
  2053. +           ThreadPool.schedule(() -> {
  2054. +               TreasureChest.registration();
  2055. +           }, 10 * 1000);
  2056. +       }
  2057. +       else
  2058. +       {
  2059. +           Broadcast.announceToOnlinePlayers("No votes event canceled!");
  2060. +       }
  2061. +       max = 0;
  2062. +       for (i = 0; i < 4; i++)
  2063. +       {
  2064. +           count[i] = 0;
  2065. +       }
  2066. +   }
  2067. +  
  2068. +   public static boolean isEligible(Player player, String ip)
  2069. +   {
  2070. +      
  2071. +       if (player.isinZodiac)
  2072. +       {
  2073. +           player.sendMessage("You are Already in Zodiac");
  2074. +           return false;
  2075. +       }
  2076. +       if (!ZodiacRegisterActive)
  2077. +       {
  2078. +           player.sendMessage("Zodiac's Registrations are offline!");
  2079. +           return false;
  2080. +       }
  2081. +       if (player.getLevel() < 76)
  2082. +       {
  2083. +           player.sendMessage("You are lower than 76 lvl");
  2084. +           return false;
  2085. +       }
  2086. +       if (player.isInJail())
  2087. +       {
  2088. +           player.sendMessage("You are in jail...daah");
  2089. +           return false;
  2090. +       }
  2091. +       if (player.isInOlympiadMode())
  2092. +       {
  2093. +           player.sendMessage("You are in olympiad mode");
  2094. +           return false;
  2095. +       }
  2096. +       if (hasbots(ip) && Config.SAME_IP_ZODIAC)
  2097. +       {
  2098. +           player.sendMessage("You have already joinned with that ip");
  2099. +           return false;
  2100. +       }
  2101. +       return true;
  2102. +   }
  2103. +  
  2104. +   public static boolean hasbots(String ip)
  2105. +   {
  2106. +       if (Ips.contains(ip))
  2107. +           return true;
  2108. +       return false;
  2109. +   }
  2110. +}
  2111. \ No newline at end of file
  2112. diff --git java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java
  2113. index f43c397..2347db8 100644
  2114. --- java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java
  2115. +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java
  2116. @@ -15,6 +15,7 @@
  2117.  import net.sf.l2j.gameserver.model.actor.instance.OlympiadManagerNpc;
  2118.  import net.sf.l2j.gameserver.model.actor.instance.Player;
  2119.  import net.sf.l2j.gameserver.model.entity.Hero;
  2120. +import net.sf.l2j.gameserver.model.entity.engines.ZodiacMain;
  2121.  import net.sf.l2j.gameserver.model.olympiad.OlympiadManager;
  2122.  import net.sf.l2j.gameserver.network.FloodProtectors;
  2123.  import net.sf.l2j.gameserver.network.FloodProtectors.Action;
  2124. @@ -169,6 +170,36 @@
  2125.                 final int arenaId = Integer.parseInt(_command.substring(12).trim());
  2126.                 activeChar.enterOlympiadObserverMode(arenaId);
  2127.             }
  2128. +           else if (_command.startsWith("PeloponnesianWar") && ZodiacMain.voting)
  2129. +           {
  2130. +               activeChar.sendMessage("You have voted for PeloponnesianWar!");
  2131. +               ZodiacMain.count[0]++;
  2132. +               ZodiacMain.showFinalWindow(activeChar);
  2133. +           }
  2134. +           else if (_command.startsWith("CaptureThem") && ZodiacMain.voting)
  2135. +           {
  2136. +               activeChar.sendMessage("You have voted for CaptureThem!");
  2137. +               ZodiacMain.count[1]++;
  2138. +               ZodiacMain.showFinalWindow(activeChar);
  2139. +           }
  2140. +           else if (_command.startsWith("CastleWars") && ZodiacMain.voting)
  2141. +           {
  2142. +               activeChar.sendMessage("You have voted for CastleWars!");
  2143. +               ZodiacMain.count[2]++;
  2144. +               ZodiacMain.showFinalWindow(activeChar);
  2145. +           }
  2146. +           else if (_command.startsWith("ProtectTheLdr") && ZodiacMain.voting)
  2147. +           {
  2148. +               activeChar.sendMessage("You have voted for ProtectTheLeader!");
  2149. +               ZodiacMain.count[3]++;
  2150. +               ZodiacMain.showFinalWindow(activeChar);
  2151. +           }
  2152. +           else if (_command.startsWith("TreasureChest") && ZodiacMain.voting)
  2153. +           {
  2154. +               activeChar.sendMessage("You have voted for TreasureChest!");
  2155. +               ZodiacMain.count[4]++;
  2156. +               ZodiacMain.showFinalWindow(activeChar);
  2157. +           }
  2158.         }
  2159.         catch (Exception e)
  2160.         {
  2161. diff --git java/net/sf/l2j/gameserver/network/clientpackets/RequestRestart.java java/net/sf/l2j/gameserver/network/clientpackets/RequestRestart.java
  2162. index accc86d..86fb870 100644
  2163. --- java/net/sf/l2j/gameserver/network/clientpackets/RequestRestart.java
  2164. +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestRestart.java
  2165. @@ -30,6 +30,12 @@
  2166.             return;
  2167.         }
  2168.        
  2169. +       if (player.isinZodiac)
  2170. +       {
  2171. +           player.sendMessage("You cant logout while in zodiac");
  2172. +           return;
  2173. +       }
  2174. +      
  2175.         if (player.isInsideZone(ZoneId.NO_RESTART))
  2176.         {
  2177.             player.sendPacket(SystemMessageId.NO_RESTART_HERE);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement