Advertisement
Reynald0

AIO System aCis_340

Dec 16th, 2015
662
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 38.16 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P aCis_datapack
  3. Index: data/xml/admin_commands_rights.xml
  4. ===================================================================
  5. --- data/xml/admin_commands_rights.xml  (revision 3)
  6. +++ data/xml/admin_commands_rights.xml  (working copy)
  7. @@ -362,4 +362,9 @@
  8.     <aCar name="admin_zone_visual" accessLevel="1" />
  9.     <aCar name="admin_zone_visual_clear" accessLevel="1" />
  10.    
  11. +   <!-- AIO Buffer -->
  12. +   <aCar name="admin_setaio" accessLevel="1" />
  13. +   <aCar name="admin_removeaio" accessLevel="1" />
  14. +   <aCar name="admin_showaio" accessLevel="1" />
  15. +  
  16.  </list>
  17. \ No newline at end of file
  18. Index: sql/characters.sql
  19. ===================================================================
  20. --- sql/characters.sql  (revision 3)
  21. +++ sql/characters.sql  (working copy)
  22. @@ -54,6 +54,8 @@
  23.    `clan_join_expiry_time` BIGINT UNSIGNED NOT NULL DEFAULT 0,
  24.    `clan_create_expiry_time` BIGINT UNSIGNED NOT NULL DEFAULT 0,
  25.    `death_penalty_level` SMALLINT UNSIGNED NOT NULL DEFAULT 0,
  26. +  `aio` decimal(1,0) NOT NULL DEFAULT 0,
  27. +  `aio_end` decimal(20,0) NOT NULL DEFAULT 0,
  28.    PRIMARY KEY (obj_Id),
  29.    KEY `clanid` (`clanid`)
  30.  );
  31. \ No newline at end of file
  32. Index: data/html/admin/aio.htm
  33. ===================================================================
  34. --- data/html/admin/aio.htm (nonexistent)
  35. +++ data/html/admin/aio.htm (working copy)
  36. @@ -0,0 +1,27 @@
  37. +<html>
  38. +   <title>
  39. +       AIO System
  40. +   </title>
  41. +
  42. +   <body>
  43. +   <center>
  44. +       AIO(s) <font color=00FF00>Online</font>
  45. +       <br>
  46. +       <img src=\"L2UI.SquareGray\" width=270 height=1>
  47. +       <table bgcolor="000000">
  48. +           <tr>
  49. +               <td width=10></td>
  50. +               <td width=20>No</td>
  51. +               <td width=80>Name</td>
  52. +               <td width=110>Loc</td>
  53. +               <td width=50>Status</td>
  54. +           </tr>
  55. +       </table>
  56. +       <img src=\"L2UI.SquareGray\" width=270 height=1>
  57. +       <br>
  58. +       <table bgcolor="000000">
  59. +               %show_aio%
  60. +       </table>
  61. +   </center>
  62. +   </body>
  63. +</html>
  64. \ No newline at end of file
  65. Index: data/xml/skills/7000-7099.xml
  66. ===================================================================
  67. --- data/xml/skills/7000-7099.xml   (revision 3)
  68. +++ data/xml/skills/7000-7099.xml   (working copy)
  69. @@ -212,4 +212,16 @@
  70.         <set name="skillType" val="NOTDONE" />
  71.         <set name="operateType" val="OP_PASSIVE" />
  72.     </skill>
  73. +   <skill id="7065" levels="1" name="AIO-Recovery">
  74. +   <set name="target" val="TARGET_SELF"/>
  75. +   <set name="skillType" val="BUFF"/>
  76. +   <set name="operateType" val="OP_PASSIVE"/>
  77. +   <for>
  78. +       <add order="0x40" stat="maxMp" val="10000" />
  79. +       <add order="0x40" stat="regMp" val="10000"/>
  80. +       <add order="0x40" stat="mAtkSpd" val="1900"/>
  81. +       <add order="0x40" stat="pAtkSpd" val="1900"/>
  82. +       <add order="0x40" stat="runSpd" val="80"/>
  83. +   </for>
  84. +   </skill>
  85.  </list>
  86. \ No newline at end of file
  87. Index: data/xml/items/9200-9299.xml
  88. ===================================================================
  89. --- data/xml/items/9200-9299.xml    (revision 3)
  90. +++ data/xml/items/9200-9299.xml    (working copy)
  91. @@ -102,4 +102,91 @@
  92.         <set name="is_dropable" val="false" />
  93.         <set name="is_sellable" val="false" />
  94.     </item>
  95. +       <item id="9209" type="Weapon" name="AIO-Duals">
  96. +       <set name="default_action" val="equip" />
  97. +       <set name="weapon_type" val="DUAL" />
  98. +       <set name="bodypart" val="lrhand" />
  99. +       <set name="random_damage" val="10" />
  100. +       <set name="attack_range" val="40" />
  101. +       <set name="damage_range" val="0;0;46;120" />
  102. +       <set name="material" val="BONE" />
  103. +       <set name="weight" val="1840" />
  104. +       <set name="is_tradable" val="false" />
  105. +       <set name="is_dropable" val="false" />
  106. +       <set name="is_destroyable" val="false" />
  107. +       <set name="is_sellable" val="false" />
  108. +       <set name="is_depositable" val="false" />
  109. +       <for>
  110. +           <set order="0x08" stat="pAtk" val="361" />
  111. +           <set order="0x08" stat="mAtk" val="137" />
  112. +           <set order="0x08" stat="rCrit" val="8" />
  113. +           <set order="0x08" stat="pAtkSpd" val="325" />
  114. +       </for>
  115. +   </item>
  116. +   <item id="9210" type="Armor" name="AIO Helm">
  117. +       <set name="default_action" val="equip" />
  118. +       <set name="bodypart" val="head" />
  119. +       <set name="crystal_type" val="A" />
  120. +       <set name="material" val="CLOTH" />
  121. +       <set name="weight" val="1" />
  122. +       <set name="is_tradable" val="false" />
  123. +       <set name="is_dropable" val="false" />
  124. +       <set name="is_destroyable" val="false" />
  125. +       <set name="is_sellable" val="false" />
  126. +       <set name="is_depositable" val="false" />
  127. +       <for>
  128. +           <add order="0x10" stat="pDef" val="69" />
  129. +           <enchant order="0x0C" stat="pDef" val="0" />
  130. +       </for>
  131. +   </item>
  132. +       <item id="9211" type="Armor" name="AIO Doublet">
  133. +       <set name="default_action" val="equip" />
  134. +       <set name="armor_type" val="MAGIC" />
  135. +       <set name="bodypart" val="fullarmor" />
  136. +       <set name="crystal_type" val="A" />
  137. +       <set name="material" val="LEATHER" />
  138. +       <set name="weight" val="1" />
  139. +       <set name="is_tradable" val="false" />
  140. +       <set name="is_dropable" val="false" />
  141. +       <set name="is_destroyable" val="false" />
  142. +       <set name="is_sellable" val="false" />
  143. +       <set name="is_depositable" val="false" />
  144. +       <for>
  145. +           <add order="0x10" stat="pDef" val="139" />
  146. +           <add order="0x40" stat="maxMp" val="665" />
  147. +           <enchant order="0x0C" stat="pDef" val="0" />
  148. +       </for>
  149. +   </item>
  150. +   <item id="9212" type="Armor" name="AIO Silk Gloves">
  151. +       <set name="default_action" val="equip" />
  152. +       <set name="bodypart" val="gloves" />
  153. +       <set name="crystal_type" val="A" />
  154. +       <set name="material" val="LEATHER" />
  155. +       <set name="weight" val="1" />
  156. +       <set name="is_tradable" val="false" />
  157. +       <set name="is_dropable" val="false" />
  158. +       <set name="is_destroyable" val="false" />
  159. +       <set name="is_sellable" val="false" />
  160. +       <set name="is_depositable" val="false" />
  161. +       <for>
  162. +           <add order="0x10" stat="pDef" val="46" />
  163. +           <enchant order="0x0C" stat="pDef" val="0" />
  164. +       </for>
  165. +   </item>
  166. +   <item id="9213" type="Armor" name="AIO Sandals">
  167. +       <set name="default_action" val="equip" />
  168. +       <set name="bodypart" val="feet" />
  169. +       <set name="crystal_type" val="A" />
  170. +       <set name="material" val="BLOOD_STEEL" />
  171. +       <set name="weight" val="1" />
  172. +       <set name="is_tradable" val="false" />
  173. +       <set name="is_dropable" val="false" />
  174. +       <set name="is_destroyable" val="false" />
  175. +       <set name="is_sellable" val="false" />
  176. +       <set name="is_depositable" val="false" />
  177. +       <for>
  178. +           <add order="0x10" stat="pDef" val="46" />
  179. +           <enchant order="0x0C" stat="pDef" val="0" />
  180. +       </for>
  181. +   </item>
  182.  </list>
  183. \ No newline at end of file
  184. #P aCis_gameserver
  185. Index: java/net/sf/l2j/gameserver/network/serverpackets/UserInfo.java
  186. ===================================================================
  187. --- java/net/sf/l2j/gameserver/network/serverpackets/UserInfo.java  (revision 3)
  188. +++ java/net/sf/l2j/gameserver/network/serverpackets/UserInfo.java  (working copy)
  189. @@ -256,7 +256,7 @@
  190.            
  191.         writeD(_activeChar.getClanCrestLargeId());
  192.         writeC(_activeChar.isNoble() ? 1 : 0); // 0x01: symbol on char menu ctrl+I
  193. -       writeC(_activeChar.isHero() || (_activeChar.isGM() && Config.GM_HERO_AURA) ? 1 : 0); // 0x01: Hero Aura
  194. +       writeC(_activeChar.isHero() || (_activeChar.isGM() && Config.GM_HERO_AURA || (_activeChar.isAio() && Config.AIO_HERO_AURA_EFFECT)) ? 1 : 0); // 0x01: Hero Aura
  195.        
  196.         writeC(_activeChar.isFishing() ? 1 : 0); // Fishing Mode
  197.        
  198. Index: java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAio.java
  199. ===================================================================
  200. --- java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAio.java   (nonexistent)
  201. +++ java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAio.java   (working copy)
  202. @@ -0,0 +1,300 @@
  203. +/*
  204. + * This program is free software; you can redistribute it and/or modify
  205. + * it under the terms of the GNU General Public License as published by
  206. + * the Free Software Foundation; either version 2, or (at your option)
  207. + * any later version.
  208. + *
  209. + * This program is distributed in the hope that it will be useful,
  210. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  211. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  212. + * GNU General Public License for more details.
  213. + *
  214. + * You should have received a copy of the GNU General Public License
  215. + * along with this program; if not, write to the Free Software
  216. + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  217. + * 02111-1307, USA.
  218. + *
  219. + * http://www.gnu.org/copyleft/gpl.html
  220. + */
  221. +package net.sf.l2j.gameserver.handler.admincommandhandlers;
  222. +
  223. +
  224. +import java.sql.Connection;
  225. +import java.sql.PreparedStatement;
  226. +import java.util.StringTokenizer;
  227. +import java.util.logging.Level;
  228. +import java.util.logging.Logger;
  229. +
  230. +import net.sf.l2j.Config;
  231. +import net.sf.l2j.L2DatabaseFactory;
  232. +import net.sf.l2j.gameserver.datatables.GmListTable;
  233. +import net.sf.l2j.gameserver.datatables.MapRegionTable;
  234. +import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
  235. +import net.sf.l2j.gameserver.model.L2Object;
  236. +import net.sf.l2j.gameserver.model.L2World;
  237. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  238. +import net.sf.l2j.gameserver.network.clientpackets.Say2;
  239. +import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
  240. +import net.sf.l2j.gameserver.network.serverpackets.InventoryUpdate;
  241. +import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
  242. +import net.sf.l2j.gameserver.network.serverpackets.StopMove;
  243. +
  244. +/**
  245. + *  "//setaio" give aio status to player Changes name color and title color if enabled Uses: setaio [<player_name>] [<time_duration in days>]
  246. + *  "//removeaio"  Uses: removeaio [<player_name>] if <player_name> is not specified, the current target player is used.
  247. + * @author KhayrusS, SweeTs, Reynald0
  248. + */
  249. +public class AdminAio implements IAdminCommandHandler
  250. +{
  251. +   private static String[] _adminCommands =
  252. +   {
  253. +       "admin_setaio",
  254. +       "admin_removeaio",
  255. +       "admin_showaio",
  256. +       "admin_gift"
  257. +   };
  258. +   private static Logger _log = Logger.getLogger(MapRegionTable.class.getName());
  259. +  
  260. +   @Override
  261. +   public boolean useAdminCommand(String command, L2PcInstance activeChar)
  262. +   {
  263. +       if (command.startsWith("admin_setaio"))
  264. +       {
  265. +           if(!Config.ENABLE_AIO_SYSTEM)
  266. +           {
  267. +               activeChar.sendMessage("AIO system disabled");
  268. +               return false;
  269. +           }
  270. +          
  271. +           StringTokenizer str = new StringTokenizer(command);
  272. +          
  273. +           L2Object target = activeChar.getTarget();
  274. +           L2PcInstance player = null;
  275. +          
  276. +           if (target != null && target instanceof L2PcInstance)
  277. +               player = (L2PcInstance) target;
  278. +           else
  279. +               player = activeChar;
  280. +          
  281. +           try
  282. +           {
  283. +               str.nextToken();
  284. +               String time = str.nextToken();
  285. +               if (str.hasMoreTokens())
  286. +               {
  287. +                   String playername = time;
  288. +                   time = str.nextToken();
  289. +                   player = L2World.getInstance().getPlayer(playername);
  290. +                   doAio(activeChar, player, playername, time);
  291. +               }
  292. +               else
  293. +               {
  294. +                   String playername = player.getName();
  295. +                   doAio(activeChar, player, playername, time);
  296. +               }
  297. +           }
  298. +           catch (Exception e)
  299. +           {
  300. +               activeChar.sendMessage("Usage: //setaio <char_name> [time](in days)");
  301. +           }
  302. +          
  303. +           player.broadcastUserInfo();
  304. +          
  305. +           if (player.isAio())
  306. +               return true;
  307. +       }
  308. +       else if (command.startsWith("admin_removeaio"))
  309. +       {
  310. +           StringTokenizer str = new StringTokenizer(command);
  311. +           L2Object target = activeChar.getTarget();
  312. +           L2PcInstance player = null;
  313. +          
  314. +           if (target instanceof L2PcInstance)
  315. +               player = (L2PcInstance) target;
  316. +           else
  317. +               player = activeChar;
  318. +          
  319. +           try
  320. +           {
  321. +               str.nextToken();
  322. +              
  323. +               if (str.hasMoreTokens())
  324. +               {
  325. +                   String playername = str.nextToken();
  326. +                   player = L2World.getInstance().getPlayer(playername);
  327. +                   removeAio(activeChar, player, playername);
  328. +               }
  329. +               else
  330. +               {
  331. +                   String playername = player.getName();
  332. +                   removeAio(activeChar, player, playername);
  333. +               }
  334. +           }
  335. +           catch (Exception e)
  336. +           {
  337. +               activeChar.sendMessage("Usage: //removeaio <char_name>");
  338. +           }
  339. +           player.broadcastUserInfo();
  340. +       }
  341. +       else if (command.startsWith("admin_showaio"))
  342. +           showAllAio(activeChar);
  343. +       return false;
  344. +   }
  345. +  
  346. +   public void doAio(L2PcInstance activeChar, L2PcInstance _player, String _playername, String _time)
  347. +   {
  348. +       int days = Integer.parseInt(_time);
  349. +      
  350. +       if (_player == null)
  351. +       {
  352. +           activeChar.sendMessage("Character not found.");
  353. +           return;
  354. +       }
  355. +       if (_player.isAio())
  356. +       {
  357. +           activeChar.sendMessage("Player " + _playername + " is already an AIO.");
  358. +           return;
  359. +       }
  360. +      
  361. +       if (days > 0)
  362. +       {
  363. +           _player.getStat().addExp(_player.getStat().getExpForLevel(81));
  364. +           _player.setClassId(_player.getClassId().getFirstClass().getId());
  365. +           _player.lostAioSkills();
  366. +           _player.setAio(true);
  367. +           _player.setName("[AIO]-" + _player.getName());
  368. +           _player.setTitle(".-=Special=-.");
  369. +           _player.setEndTime("aio", days);
  370. +           _player.sendPacket(new CreatureSay(0, Say2.PARTY, "System", "Dear player, you are now an AIO, congratulations."));
  371. +          
  372. +           try (Connection con = L2DatabaseFactory.getInstance().getConnection())
  373. +           {
  374. +               PreparedStatement statement = con.prepareStatement("UPDATE characters SET aio=1, aio_end=? WHERE obj_id=?");
  375. +               statement.setLong(1, _player.getAioEndTime());
  376. +               statement.setInt(2, _player.getObjectId());
  377. +               statement.execute();
  378. +               statement.close();
  379. +              
  380. +               if (Config.ALLOW_AIO_NCOLOR)
  381. +                   _player.getAppearance().setNameColor(Config.AIO_NCOLOR);
  382. +              
  383. +               if (Config.ALLOW_AIO_TCOLOR)
  384. +                   _player.getAppearance().setTitleColor(Config.AIO_TCOLOR);
  385. +              
  386. +               _player.rewardAioSkills();
  387. +              
  388. +               if (Config.ALLOW_AIO_ITEM)
  389. +               {
  390. +                   StringTokenizer st = new StringTokenizer((Config.AIO_ITEMID), ",");
  391. +                   while (st.hasMoreElements())
  392. +                   {
  393. +                       int item_id = Integer.parseInt(st.nextToken());
  394. +                       _player.getInventory().addItem("", item_id, 1, _player, null);
  395. +                       _player.getInventory().equipItem(_player.getInventory().getItemByItemId(item_id));
  396. +                   }
  397. +               }
  398. +
  399. +               updateChar(_player);
  400. +              
  401. +               GmListTable.broadcastMessageToGMs("GM " + activeChar.getName() + " set an AIO status for player " + _playername + " for " + _time + " day(s)");
  402. +           }
  403. +           catch (Exception e)
  404. +           {
  405. +               _log.log(Level.WARNING, "Something went wrong, check log folder for details", e);
  406. +           }
  407. +       }
  408. +   }
  409. +  
  410. +   public void removeAio(L2PcInstance activeChar, L2PcInstance _player, String _playername)
  411. +   {
  412. +       if (!_player.isAio() && activeChar != null)
  413. +       {
  414. +           activeChar.sendMessage("Player " + _playername + " is not an AIO.");
  415. +           return;
  416. +       }
  417. +       //Paralyze player
  418. +       _player.startAbnormalEffect(0x0800);
  419. +       _player.setIsParalyzed(true);
  420. +       _player.broadcastPacket(new StopMove(_player));
  421. +       _player.lostAioSkills();
  422. +       _player.setAioEndTime(0);
  423. +       _player.setAio(false);
  424. +      
  425. +       try (Connection con = L2DatabaseFactory.getInstance().getConnection())
  426. +       {
  427. +           PreparedStatement statement = con.prepareStatement("UPDATE characters SET Aio=0, Aio_end=0 WHERE obj_id=?");
  428. +           statement.setInt(1, _player.getObjectId());
  429. +           statement.execute();
  430. +           statement.close();
  431. +          
  432. +           if (Config.ALLOW_AIO_ITEM)
  433. +           {
  434. +               StringTokenizer st = new StringTokenizer((Config.AIO_ITEMID), ",");
  435. +               while (st.hasMoreElements())
  436. +               {
  437. +                   int item_id = Integer.parseInt(st.nextToken());
  438. +                   _player.destroyItemByItemId("aio", item_id, 1, null, true);
  439. +               }
  440. +           }
  441. +           _player.removeExpAndSp(6299994999L, 0);
  442. +           _player.setName(_player.getName().replace("[AIO]-", ""));
  443. +           _player.setTitle("");
  444. +           _player.getAppearance().setNameColor(0xFFFFFF);
  445. +           _player.getAppearance().setTitleColor(0xFFFFFF);
  446. +           updateChar(_player);
  447. +          
  448. +          
  449. +           if(activeChar != null && _playername != "")
  450. +           {
  451. +               GmListTable.broadcastMessageToGMs("GM " + activeChar.getName() + " removed AIO status from " + _playername);
  452. +               _player.sendPacket(new CreatureSay(0, Say2.PARTYROOM_COMMANDER, "System", "Your AIO period has been finished."));
  453. +           }
  454. +           else
  455. +               _player.sendPacket(new CreatureSay(0, Say2.PARTYROOM_COMMANDER, "System", "Your AIO period ends."));
  456. +       }
  457. +       catch (Exception e)
  458. +       {
  459. +           _log.log(Level.WARNING, "Something went wrong, check log folder for details", e);
  460. +       }
  461. +       //Unparalyze player
  462. +       _player.stopAbnormalEffect(0x0800);
  463. +       _player.setIsParalyzed(false);
  464. +   }
  465. +  
  466. +   public void updateChar(L2PcInstance player)
  467. +   {
  468. +       player.sendPacket(new InventoryUpdate());
  469. +       player.broadcastUserInfo();
  470. +       player.broadcastCharInfo();
  471. +       player.sendSkillList();
  472. +       player.store();
  473. +   }
  474. +  
  475. +   public void showAllAio(L2PcInstance activeChar)
  476. +   {
  477. +       short num = 0;
  478. +       NpcHtmlMessage html = new NpcHtmlMessage(0);
  479. +       html.setFile("data/html/admin/aio.htm");
  480. +       StringBuilder sb = new StringBuilder();
  481. +       for (L2PcInstance player : L2World.getInstance().getAllPlayers().values())
  482. +       {
  483. +           if (player.isAio())
  484. +           {
  485. +               num++;
  486. +               sb.append("<tr><td width=10></td>" +
  487. +                   "<td width=20>" + num + "</td>" +
  488. +                   "<td width=80><font color=\"LEVEL\">" + player.getName() + "</font></td>" +
  489. +                   "<td width=110>" + MapRegionTable.getInstance().getClosestTownName(player.getX(), player.getY()) + "</td>" +
  490. +                   "<td width=50><font color=\"00FF00\">ON</font></td></tr>");
  491. +           }
  492. +       }
  493. +       html.replace("%show_aio%", num > 0 ? sb.toString() : "");
  494. +       activeChar.sendPacket(html);
  495. +   }
  496. +  
  497. +   @Override
  498. +   public String[] getAdminCommandList()
  499. +   {
  500. +       return _adminCommands;
  501. +   }
  502. +}
  503. \ No newline at end of file
  504. Index: java/net/sf/l2j/gameserver/model/actor/instance/L2TeleporterInstance.java
  505. ===================================================================
  506. --- java/net/sf/l2j/gameserver/model/actor/instance/L2TeleporterInstance.java   (revision 3)
  507. +++ java/net/sf/l2j/gameserver/model/actor/instance/L2TeleporterInstance.java   (working copy)
  508. @@ -27,7 +27,9 @@
  509.  import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  510.  import net.sf.l2j.gameserver.model.zone.ZoneId;
  511.  import net.sf.l2j.gameserver.network.SystemMessageId;
  512. +import net.sf.l2j.gameserver.network.clientpackets.Say2;
  513.  import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
  514. +import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
  515.  import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
  516.  
  517.  /**
  518. @@ -179,6 +181,20 @@
  519.             }
  520.             else if (player.isAlikeDead())
  521.                 return;
  522. +           else if(player.isAio())
  523. +           {
  524. +               if (!Config.ALLOW_AIO_TELEPORT)
  525. +               {
  526. +                   player.sendPacket(new CreatureSay(0, Say2.SHOUT, "System", "You cant teleport while being an AIO!"));
  527. +                   return;
  528. +               }
  529. +               else if (Config.ALLOW_AIO_TELEPORT && Config.ENABLE_AIO_FREE_TELEPORT)
  530. +               {
  531. +                   player.sendPacket(new CreatureSay(0, Say2.PARTY, "System", "Free teleport!"));
  532. +                   player.teleToLocation(list.getLocX(), list.getLocY(), list.getLocZ(), 20);
  533. +                   return;
  534. +               }
  535. +           }
  536.            
  537.             Calendar cal = Calendar.getInstance();
  538.             int price = list.getPrice();
  539. Index: java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
  540. ===================================================================
  541. --- java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java    (revision 3)
  542. +++ java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java    (working copy)
  543. @@ -14,6 +14,9 @@
  544.   */
  545.  package net.sf.l2j.gameserver.network.clientpackets;
  546.  
  547. +import java.util.Calendar;
  548. +import java.util.Date;
  549. +
  550.  import net.sf.l2j.Config;
  551.  import net.sf.l2j.gameserver.communitybbs.Manager.MailBBSManager;
  552.  import net.sf.l2j.gameserver.datatables.AdminCommandAccessRights;
  553. @@ -21,6 +24,7 @@
  554.  import net.sf.l2j.gameserver.datatables.GmListTable;
  555.  import net.sf.l2j.gameserver.datatables.MapRegionTable;
  556.  import net.sf.l2j.gameserver.datatables.SkillTable.FrequentSkill;
  557. +import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminAio;
  558.  import net.sf.l2j.gameserver.instancemanager.ClanHallManager;
  559.  import net.sf.l2j.gameserver.instancemanager.CoupleManager;
  560.  import net.sf.l2j.gameserver.instancemanager.DimensionalRiftManager;
  561. @@ -41,6 +45,7 @@
  562.  import net.sf.l2j.gameserver.model.quest.QuestState;
  563.  import net.sf.l2j.gameserver.model.zone.ZoneId;
  564.  import net.sf.l2j.gameserver.network.SystemMessageId;
  565. +import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
  566.  import net.sf.l2j.gameserver.network.serverpackets.Die;
  567.  import net.sf.l2j.gameserver.network.serverpackets.EtcStatusUpdate;
  568.  import net.sf.l2j.gameserver.network.serverpackets.ExMailArrived;
  569. @@ -201,6 +206,15 @@
  570.         }
  571.         activeChar.sendPacket(new QuestList(activeChar));
  572.        
  573. +       if (activeChar.isAio())
  574. +           onEnterAio(activeChar);
  575. +          
  576. +       if (Config.ALLOW_AIO_NCOLOR && activeChar.isAio())
  577. +           activeChar.getAppearance().setNameColor(Config.AIO_NCOLOR);
  578. +                  
  579. +       if (Config.ALLOW_AIO_TCOLOR && activeChar.isAio())
  580. +           activeChar.getAppearance().setTitleColor(Config.AIO_TCOLOR);
  581. +      
  582.         // Unread mails make a popup appears.
  583.         if (Config.ENABLE_COMMUNITY_BOARD && MailBBSManager.getInstance().checkUnreadMail(activeChar) > 0)
  584.         {
  585. @@ -250,6 +264,26 @@
  586.             activeChar.teleToLocation(MapRegionTable.TeleportWhereType.Town);
  587.     }
  588.    
  589. +   private static void onEnterAio(L2PcInstance activeChar)
  590. +   {
  591. +       if(activeChar.isAio() && !activeChar.isInsideZone(ZoneId.TOWN) && !activeChar.isInsideZone(ZoneId.PEACE))
  592. +       {
  593. +           activeChar.sendPacket(new CreatureSay(0, Say2.SHOUT, "System", "You can only teleport to another town while being an AIO!"));
  594. +           activeChar.teleToLocation(MapRegionTable.TeleportWhereType.Town);
  595. +       }
  596. +      
  597. +       long now = Calendar.getInstance().getTimeInMillis();
  598. +       long endDay = activeChar.getAioEndTime();
  599. +       if (now > endDay)
  600. +           new AdminAio().removeAio(null, activeChar, "");
  601. +       else
  602. +       {
  603. +           Date dt = new Date(endDay);
  604. +           if (activeChar.isAio())
  605. +               activeChar.sendPacket(new CreatureSay(0, Say2.ALLIANCE, "System", "Your AIO period ends at: " + dt));
  606. +       }
  607. +   }
  608. +      
  609.     private static void engage(L2PcInstance cha)
  610.     {
  611.         int _chaid = cha.getObjectId();
  612. Index: java/net/sf/l2j/gameserver/model/base/ClassId.java
  613. ===================================================================
  614. --- java/net/sf/l2j/gameserver/model/base/ClassId.java  (revision 3)
  615. +++ java/net/sf/l2j/gameserver/model/base/ClassId.java  (working copy)
  616. @@ -205,6 +205,17 @@
  617.     {
  618.         return _race;
  619.     }
  620. +
  621. +   /**
  622. +   * @return to the first class
  623. +   */
  624. +   public final ClassId getFirstClass()
  625. +   {
  626. +       if (_parent == null)
  627. +           return this;
  628. +          
  629. +       return _parent.getFirstClass();
  630. +   }
  631.    
  632.     /**
  633.      * @param cid The parent ClassId to check
  634. Index: java/net/sf/l2j/gameserver/handler/AdminCommandHandler.java
  635. ===================================================================
  636. --- java/net/sf/l2j/gameserver/handler/AdminCommandHandler.java (revision 3)
  637. +++ java/net/sf/l2j/gameserver/handler/AdminCommandHandler.java (working copy)
  638. @@ -18,6 +18,7 @@
  639.  import java.util.Map;
  640.  
  641.  import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminAdmin;
  642. +import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminAio;
  643.  import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminAnnouncements;
  644.  import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminBan;
  645.  import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminBookmark;
  646. @@ -78,6 +79,7 @@
  647.     protected AdminCommandHandler()
  648.     {
  649.         registerAdminCommandHandler(new AdminAdmin());
  650. +       registerAdminCommandHandler(new AdminAio());
  651.         registerAdminCommandHandler(new AdminAnnouncements());
  652.         registerAdminCommandHandler(new AdminBan());
  653.         registerAdminCommandHandler(new AdminBookmark());
  654. Index: config/AIO.properties
  655. ===================================================================
  656. --- config/AIO.properties   (nonexistent)
  657. +++ config/AIO.properties   (working copy)
  658. @@ -0,0 +1,42 @@
  659. +#=============================================================
  660. +#                        AIO System
  661. +#=============================================================
  662. +EnableAioSystem = True
  663. +
  664. +# Enable / Disable name color
  665. +AllowAioNameColor = True
  666. +#Hexadecimal code
  667. +AioNameColor = 88AA88
  668. +
  669. +# Enable / Disable title color
  670. +AllowAioTitleColor = True
  671. +#Hexadecimal code
  672. +AioTitleColor = 88AA88
  673. +
  674. +# List of Aio Skills
  675. +# Format : skillid,skilllvl;skillid2,skilllvl2;
  676. +AioSkills = 7065,1;1085,3;1304,3;1087,3;1354,1;1062,2;1243,6;1045,6;1048,6;1429,1;163,1;\
  677. +1311,6;213,8;1007,3;1309,3;1552,3;1006,3;1308,3;1253,3;1284,3;1392,3;1393,3;214,1;\
  678. +1009,3;1310,4;1363,1;1362,1;1397,3;1292,6;1078,6;307,1;276,1;309,1;274,1;275,1;164,3;\
  679. +272,1;277,1;273,1;311,1;366,1;365,1;310,1;271,1;1242,3;1353,3;1391,3;1002,3;\
  680. +1352,1;229,7;228,3;1077,3;1218,33;1059,3;1219,33;1388,3;1389,3;1240,3;1413,1;\
  681. +1086,2;1036,2;1035,4;1068,3;1356,1;1355,1;1357,1;1307,3;1410,1;1409,1;1353,1;\
  682. +1044,3;1182,3;1191,3;1189,3;1259,4;1306,6;234,23;1040,3;364,1;264,1;306,1;\
  683. +269,1;270,1;265,1;363,1;349,1;308,1;305,1;304,1;267,1;266,1;268,1;1390,3;1303,2;\
  684. +1204,2;1268,4;4699,13;4700,13;4702,13;4703,13;1323,1;1251,2;1328,7;1329,9;1330,8
  685. +
  686. +# Allow / Do not receive special items to convert AIO
  687. +AllowAIOItem = True
  688. +
  689. +# ID of the item that will be given to AIO
  690. +ItemIdAio = 9209,9210,9211,9212,9213
  691. +
  692. +# AIO aura hero effect
  693. +AIOHeroEffect = True
  694. +
  695. +# Allow / Do not allow AIO teleport
  696. +# If true only allows teleport between towns
  697. +AllowAIOTeleport = True
  698. +
  699. +# Enable / Disable teleport cost
  700. +EnableFreeTeleport = False
  701. \ No newline at end of file
  702. Index: java/net/sf/l2j/gameserver/GameServer.java
  703. ===================================================================
  704. --- java/net/sf/l2j/gameserver/GameServer.java  (revision 3)
  705. +++ java/net/sf/l2j/gameserver/GameServer.java  (working copy)
  706. @@ -193,6 +193,10 @@
  707.         PartyMatchRoomList.getInstance();
  708.         RaidBossPointsManager.getInstance();
  709.        
  710. +       Util.printSection("AIO");
  711. +       if (Config.ENABLE_AIO_SYSTEM)
  712. +           _log.config(Config.ENABLE_AIO_SYSTEM ? "AIO: Enabled" : "Disabled");
  713. +      
  714.         Util.printSection("Community server");
  715.         if (Config.ENABLE_COMMUNITY_BOARD) // Forums has to be loaded before clan data
  716.             ForumsBBSManager.getInstance().initRoot();
  717. Index: java/net/sf/l2j/gameserver/network/serverpackets/CharInfo.java
  718. ===================================================================
  719. --- java/net/sf/l2j/gameserver/network/serverpackets/CharInfo.java  (revision 3)
  720. +++ java/net/sf/l2j/gameserver/network/serverpackets/CharInfo.java  (working copy)
  721. @@ -201,7 +201,7 @@
  722.            
  723.         writeD(_activeChar.getClanCrestLargeId());
  724.         writeC(_activeChar.isNoble() ? 1 : 0); // Symbol on char menu ctrl+I
  725. -       writeC((_activeChar.isHero() || (_activeChar.isGM() && Config.GM_HERO_AURA)) ? 1 : 0); // Hero Aura
  726. +       writeC((_activeChar.isHero() || (_activeChar.isGM() && Config.GM_HERO_AURA) || (_activeChar.isAio() && Config.AIO_HERO_AURA_EFFECT)) ? 1 : 0); // Hero Aura
  727.        
  728.         writeC(_activeChar.isFishing() ? 1 : 0); // 0x01: Fishing Mode (Cant be undone by setting back to 0)
  729.        
  730. Index: java/net/sf/l2j/Config.java
  731. ===================================================================
  732. --- java/net/sf/l2j/Config.java (revision 3)
  733. +++ java/net/sf/l2j/Config.java (working copy)
  734. @@ -44,6 +44,7 @@
  735.  {
  736.     protected static final Logger _log = Logger.getLogger(Config.class.getName());
  737.    
  738. +   public static final String AIO_FILE = "./config/AIO.properties";
  739.     public static final String CLANS_FILE = "./config/clans.properties";
  740.     public static final String EVENTS_FILE = "./config/events.properties";
  741.     public static final String FLOOD_PROTECTOR_FILE = "./config/floodprotector.properties";
  742. @@ -55,6 +56,19 @@
  743.     public static final String SERVER_FILE = "./config/server.properties";
  744.     public static final String SIEGE_FILE = "./config/siege.properties";
  745.    
  746. +   /** Aio System */
  747. +   public static boolean ENABLE_AIO_SYSTEM;
  748. +   public static Map<Integer, Integer> AIO_SKILLS;
  749. +   public static boolean ALLOW_AIO_NCOLOR;
  750. +   public static int AIO_NCOLOR;
  751. +   public static boolean ALLOW_AIO_TCOLOR;
  752. +   public static int AIO_TCOLOR;
  753. +   public static boolean ALLOW_AIO_ITEM;
  754. +   public static String AIO_ITEMID;
  755. +   public static boolean AIO_HERO_AURA_EFFECT;
  756. +   public static boolean ALLOW_AIO_TELEPORT;
  757. +   public static boolean ENABLE_AIO_FREE_TELEPORT;
  758. +
  759.     // --------------------------------------------------
  760.     // Clans settings
  761.     // --------------------------------------------------
  762. @@ -703,6 +717,44 @@
  763.            
  764.             _log.info("Loading gameserver configuration files.");
  765.            
  766. +           // AIO settings
  767. +           ExProperties aio = load(AIO_FILE);
  768. +           ENABLE_AIO_SYSTEM = aio.getProperty("EnableAioSystem", false);
  769. +           ALLOW_AIO_NCOLOR = aio.getProperty("AllowAioNameColor", false);
  770. +           AIO_NCOLOR = Integer.decode("0x" + aio.getProperty("AioNameColor", "88AA88"));
  771. +           ALLOW_AIO_TCOLOR = aio.getProperty("AllowAioTitleColor", false);
  772. +           AIO_TCOLOR = Integer.decode("0x" + aio.getProperty("AioTitleColor", "88AA88"));
  773. +           ALLOW_AIO_ITEM = aio.getProperty("AllowAIOItem", false);
  774. +           AIO_ITEMID = aio.getProperty("ItemIdAio", "9209,9210,9211,9212,9213");
  775. +           AIO_HERO_AURA_EFFECT = aio.getProperty("AIOHeroEffect", false);
  776. +           ALLOW_AIO_TELEPORT = aio.getProperty("AllowAIOTeleport", false);
  777. +           ENABLE_AIO_FREE_TELEPORT = aio.getProperty("EnableFreeTeleport", false);
  778. +          
  779. +          
  780. +           if (ENABLE_AIO_SYSTEM) // create map if system is enabled
  781. +           {
  782. +               String[] AioSkillsSplit = aio.getProperty("AioSkills", "").split(";");
  783. +               AIO_SKILLS = new HashMap<>(AioSkillsSplit.length);
  784. +               for (String skill : AioSkillsSplit)
  785. +               {
  786. +                   String[] skillSplit = skill.split(",");
  787. +                   if (skillSplit.length != 2)
  788. +                       _log.info("[Aio System]: invalid config property in AIO.properties -> AioSkills \"" + skill + "\"");
  789. +                   else
  790. +                   {
  791. +                       try
  792. +                       {
  793. +                           AIO_SKILLS.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
  794. +                       }
  795. +                       catch (NumberFormatException nfe)
  796. +                       {
  797. +                           if (!skill.equals(""))
  798. +                               _log.info("[Aio System]: invalid config property in AIO.properties -> AioSkills \"" + skillSplit[0] + "\"" + skillSplit[1]);
  799. +                       }
  800. +                   }
  801. +               }
  802. +           }
  803. +          
  804.             // Clans settings
  805.             ExProperties clans = load(CLANS_FILE);
  806.             ALT_CLAN_JOIN_DAYS = clans.getProperty("DaysBeforeJoinAClan", 5);
  807. Index: java/net/sf/l2j/gameserver/model/actor/instance/L2ClassMasterInstance.java
  808. ===================================================================
  809. --- java/net/sf/l2j/gameserver/model/actor/instance/L2ClassMasterInstance.java  (revision 3)
  810. +++ java/net/sf/l2j/gameserver/model/actor/instance/L2ClassMasterInstance.java  (working copy)
  811. @@ -67,6 +67,12 @@
  812.     @Override
  813.     public void onBypassFeedback(L2PcInstance player, String command)
  814.     {
  815. +       if (player.isAio())
  816. +       {
  817. +           player.sendMessage("You're not allowed to change your class.");
  818. +           return;
  819. +       }
  820. +      
  821.         if (!Config.ALLOW_CLASS_MASTERS)
  822.             return;
  823.        
  824. Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
  825. ===================================================================
  826. --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (revision 3)
  827. +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (working copy)
  828. @@ -157,12 +157,14 @@
  829.  import net.sf.l2j.gameserver.model.zone.type.L2BossZone;
  830.  import net.sf.l2j.gameserver.network.L2GameClient;
  831.  import net.sf.l2j.gameserver.network.SystemMessageId;
  832. +import net.sf.l2j.gameserver.network.clientpackets.Say2;
  833.  import net.sf.l2j.gameserver.network.serverpackets.AbstractNpcInfo;
  834.  import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
  835.  import net.sf.l2j.gameserver.network.serverpackets.ChairSit;
  836.  import net.sf.l2j.gameserver.network.serverpackets.ChangeWaitType;
  837.  import net.sf.l2j.gameserver.network.serverpackets.CharInfo;
  838.  import net.sf.l2j.gameserver.network.serverpackets.ConfirmDlg;
  839. +import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
  840.  import net.sf.l2j.gameserver.network.serverpackets.EtcStatusUpdate;
  841.  import net.sf.l2j.gameserver.network.serverpackets.ExAutoSoulShot;
  842.  import net.sf.l2j.gameserver.network.serverpackets.ExDuelUpdateUserInfo;
  843. @@ -262,8 +264,8 @@
  844.     private static final String DELETE_SKILL_SAVE = "DELETE FROM character_skills_save WHERE char_obj_id=? AND class_index=?";
  845.    
  846.     private static final String INSERT_CHARACTER = "INSERT INTO characters (account_name,obj_Id,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp,face,hairStyle,hairColor,sex,exp,sp,karma,pvpkills,pkkills,clanid,race,classid,deletetime,cancraft,title,accesslevel,online,isin7sdungeon,clan_privs,wantspeace,base_class,nobless,power_grade,last_recom_date) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
  847. -   private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,punish_level=?,punish_timer=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=? WHERE obj_id=?";
  848. -   private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, punish_level, punish_timer, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level FROM characters WHERE obj_id=?";
  849. +   private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,punish_level=?,punish_timer=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,aio=?,aio_end=? WHERE obj_id=?";
  850. +   private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, punish_level, punish_timer, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,aio,aio_end FROM characters WHERE obj_id=?";  
  851.    
  852.     private static final String RESTORE_CHAR_SUBCLASSES = "SELECT class_id,exp,sp,level,class_index FROM character_subclasses WHERE char_obj_id=? ORDER BY class_index ASC";
  853.     private static final String ADD_CHAR_SUBCLASS = "INSERT INTO character_subclasses (char_obj_id,class_id,exp,sp,level,class_index) VALUES (?,?,?,?,?,?)";
  854. @@ -481,6 +483,10 @@
  855.     private boolean _noble = false;
  856.     private boolean _hero = false;
  857.    
  858. +   /** Aio System */
  859. +   private boolean _isAio = false;
  860. +   private long _aio_endTime = 0;
  861. +  
  862.     private L2Npc _currentFolkNpc = null;
  863.    
  864.     private int _questNpcObject = 0;
  865. @@ -5555,6 +5561,9 @@
  866.                
  867.                 player.setDeathPenaltyBuffLevel(rset.getInt("death_penalty_level"));
  868.                
  869. +               player.setAio(rset.getInt("aio") == 1 ? true : false);
  870. +               player.setAioEndTime(rset.getLong("aio_end"));
  871. +              
  872.                 // Set the x,y,z position of the L2PcInstance and make it invisible
  873.                 player.setXYZInvisible(rset.getInt("x"), rset.getInt("y"), rset.getInt("z"));
  874.                
  875. @@ -5889,7 +5898,9 @@
  876.             statement.setLong(47, getClanCreateExpiryTime());
  877.             statement.setString(48, getName());
  878.             statement.setLong(49, getDeathPenaltyBuffLevel());
  879. -           statement.setInt(50, getObjectId());
  880. +           statement.setInt(50, isAio() ? 1 : 0);
  881. +           statement.setLong(51, getAioEndTime());
  882. +           statement.setInt(52, getObjectId());
  883.            
  884.             statement.execute();
  885.             statement.close();
  886. @@ -6694,6 +6705,12 @@
  887.             return false;
  888.         }
  889.        
  890. +       if (isAio() && !isGM() && !isInsideZone(ZoneId.TOWN))
  891. +       {
  892. +           sendPacket(ActionFailed.STATIC_PACKET);
  893. +           return false;
  894. +       }
  895. +      
  896.         // Cancels the use of skills when player uses a cursed weapon or is flying.
  897.         if ((isCursedWeaponEquipped() && !skill.isDemonicSkill()) // If CW, allow ONLY demonic skills.
  898.             || (getMountType() == 1 && !skill.isStriderSkill()) // If mounted, allow ONLY Strider skills.
  899. @@ -8211,6 +8228,9 @@
  900.             if (isWearingFormalWear)
  901.                 isDisabled = true;
  902.            
  903. +           if (isAio() && !isGM() && !isInsideZone(ZoneId.TOWN))
  904. +               isDisabled = true;
  905. +          
  906.             sl.addSkill(s.getId(), s.getLevel(), s.isPassive(), isDisabled);
  907.         }
  908.         sendPacket(sl);
  909. @@ -8824,6 +8844,12 @@
  910.         // Force a revalidation
  911.         revalidateZone(true);
  912.        
  913. +       if(isAio() && !isInsideZone(ZoneId.TOWN) && !isInsideZone(ZoneId.PEACE))
  914. +       {
  915. +           sendPacket(new CreatureSay(0, Say2.SHOUT, "System", "You can only teleport to another town while being an AIO!"));
  916. +           teleToLocation(MapRegionTable.TeleportWhereType.Town);
  917. +       }
  918. +      
  919.         if (Config.PLAYER_SPAWN_PROTECTION > 0)
  920.             setProtection(true);
  921.        
  922. @@ -9801,6 +9827,55 @@
  923.         }
  924.     }
  925.    
  926. +   public boolean isAio()
  927. +   {
  928. +       return _isAio;
  929. +   }
  930. +      
  931. +   public void setAio(boolean val)
  932. +   {
  933. +       _isAio = val;
  934. +   }
  935. +      
  936. +   public long getAioEndTime()
  937. +   {
  938. +       return _aio_endTime;
  939. +   }
  940. +      
  941. +   public void setAioEndTime(long val)
  942. +   {
  943. +       _aio_endTime = val;
  944. +   }
  945. +      
  946. +   public void rewardAioSkills()
  947. +   {
  948. +       L2Skill skill;
  949. +       for (Integer skillid : Config.AIO_SKILLS.keySet())
  950. +       {
  951. +           int skilllvl = Config.AIO_SKILLS.get(skillid);
  952. +           skill = SkillTable.getInstance().getInfo(skillid, skilllvl);
  953. +           if (skill != null)
  954. +               addSkill(skill, true);
  955. +       }
  956. +   }
  957. +      
  958. +   public void lostAioSkills()
  959. +   {
  960. +       for (L2Skill skill : this.getAllSkills())
  961. +           this.removeSkill(skill);
  962. +   }
  963. +  
  964. +   public void setEndTime(String process, int val)
  965. +   {
  966. +       Calendar calendar = Calendar.getInstance();
  967. +       calendar.add(Calendar.DAY_OF_MONTH, val);
  968. +       long end_day = calendar.getTimeInMillis();
  969. +      
  970. +       if (process.equals("aio"))
  971. +           _aio_endTime = end_day;
  972. +   }
  973. +  
  974. +  
  975.     public int getPowerGrade()
  976.     {
  977.         return _powerGrade;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement