Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P aCis_datapack
- Index: data/xml/admin_commands_rights.xml
- ===================================================================
- --- data/xml/admin_commands_rights.xml (revision 3)
- +++ data/xml/admin_commands_rights.xml (working copy)
- @@ -362,4 +362,9 @@
- <aCar name="admin_zone_visual" accessLevel="1" />
- <aCar name="admin_zone_visual_clear" accessLevel="1" />
- + <!-- AIO Buffer -->
- + <aCar name="admin_setaio" accessLevel="1" />
- + <aCar name="admin_removeaio" accessLevel="1" />
- + <aCar name="admin_showaio" accessLevel="1" />
- +
- </list>
- \ No newline at end of file
- Index: sql/characters.sql
- ===================================================================
- --- sql/characters.sql (revision 3)
- +++ sql/characters.sql (working copy)
- @@ -54,6 +54,8 @@
- `clan_join_expiry_time` BIGINT UNSIGNED NOT NULL DEFAULT 0,
- `clan_create_expiry_time` BIGINT UNSIGNED NOT NULL DEFAULT 0,
- `death_penalty_level` SMALLINT UNSIGNED NOT NULL DEFAULT 0,
- + `aio` decimal(1,0) NOT NULL DEFAULT 0,
- + `aio_end` decimal(20,0) NOT NULL DEFAULT 0,
- PRIMARY KEY (obj_Id),
- KEY `clanid` (`clanid`)
- );
- \ No newline at end of file
- Index: data/html/admin/aio.htm
- ===================================================================
- --- data/html/admin/aio.htm (nonexistent)
- +++ data/html/admin/aio.htm (working copy)
- @@ -0,0 +1,27 @@
- +<html>
- + <title>
- + AIO System
- + </title>
- +
- + <body>
- + <center>
- + AIO(s) <font color=00FF00>Online</font>
- + <br>
- + <img src=\"L2UI.SquareGray\" width=270 height=1>
- + <table bgcolor="000000">
- + <tr>
- + <td width=10></td>
- + <td width=20>No</td>
- + <td width=80>Name</td>
- + <td width=110>Loc</td>
- + <td width=50>Status</td>
- + </tr>
- + </table>
- + <img src=\"L2UI.SquareGray\" width=270 height=1>
- + <br>
- + <table bgcolor="000000">
- + %show_aio%
- + </table>
- + </center>
- + </body>
- +</html>
- \ No newline at end of file
- Index: data/xml/skills/7000-7099.xml
- ===================================================================
- --- data/xml/skills/7000-7099.xml (revision 3)
- +++ data/xml/skills/7000-7099.xml (working copy)
- @@ -212,4 +212,16 @@
- <set name="skillType" val="NOTDONE" />
- <set name="operateType" val="OP_PASSIVE" />
- </skill>
- + <skill id="7065" levels="1" name="AIO-Recovery">
- + <set name="target" val="TARGET_SELF"/>
- + <set name="skillType" val="BUFF"/>
- + <set name="operateType" val="OP_PASSIVE"/>
- + <for>
- + <add order="0x40" stat="maxMp" val="10000" />
- + <add order="0x40" stat="regMp" val="10000"/>
- + <add order="0x40" stat="mAtkSpd" val="1900"/>
- + <add order="0x40" stat="pAtkSpd" val="1900"/>
- + <add order="0x40" stat="runSpd" val="80"/>
- + </for>
- + </skill>
- </list>
- \ No newline at end of file
- Index: data/xml/items/9200-9299.xml
- ===================================================================
- --- data/xml/items/9200-9299.xml (revision 3)
- +++ data/xml/items/9200-9299.xml (working copy)
- @@ -102,4 +102,91 @@
- <set name="is_dropable" val="false" />
- <set name="is_sellable" val="false" />
- </item>
- + <item id="9209" type="Weapon" name="AIO-Duals">
- + <set name="default_action" val="equip" />
- + <set name="weapon_type" val="DUAL" />
- + <set name="bodypart" val="lrhand" />
- + <set name="random_damage" val="10" />
- + <set name="attack_range" val="40" />
- + <set name="damage_range" val="0;0;46;120" />
- + <set name="material" val="BONE" />
- + <set name="weight" val="1840" />
- + <set name="is_tradable" val="false" />
- + <set name="is_dropable" val="false" />
- + <set name="is_destroyable" val="false" />
- + <set name="is_sellable" val="false" />
- + <set name="is_depositable" val="false" />
- + <for>
- + <set order="0x08" stat="pAtk" val="361" />
- + <set order="0x08" stat="mAtk" val="137" />
- + <set order="0x08" stat="rCrit" val="8" />
- + <set order="0x08" stat="pAtkSpd" val="325" />
- + </for>
- + </item>
- + <item id="9210" type="Armor" name="AIO Helm">
- + <set name="default_action" val="equip" />
- + <set name="bodypart" val="head" />
- + <set name="crystal_type" val="A" />
- + <set name="material" val="CLOTH" />
- + <set name="weight" val="1" />
- + <set name="is_tradable" val="false" />
- + <set name="is_dropable" val="false" />
- + <set name="is_destroyable" val="false" />
- + <set name="is_sellable" val="false" />
- + <set name="is_depositable" val="false" />
- + <for>
- + <add order="0x10" stat="pDef" val="69" />
- + <enchant order="0x0C" stat="pDef" val="0" />
- + </for>
- + </item>
- + <item id="9211" type="Armor" name="AIO Doublet">
- + <set name="default_action" val="equip" />
- + <set name="armor_type" val="MAGIC" />
- + <set name="bodypart" val="fullarmor" />
- + <set name="crystal_type" val="A" />
- + <set name="material" val="LEATHER" />
- + <set name="weight" val="1" />
- + <set name="is_tradable" val="false" />
- + <set name="is_dropable" val="false" />
- + <set name="is_destroyable" val="false" />
- + <set name="is_sellable" val="false" />
- + <set name="is_depositable" val="false" />
- + <for>
- + <add order="0x10" stat="pDef" val="139" />
- + <add order="0x40" stat="maxMp" val="665" />
- + <enchant order="0x0C" stat="pDef" val="0" />
- + </for>
- + </item>
- + <item id="9212" type="Armor" name="AIO Silk Gloves">
- + <set name="default_action" val="equip" />
- + <set name="bodypart" val="gloves" />
- + <set name="crystal_type" val="A" />
- + <set name="material" val="LEATHER" />
- + <set name="weight" val="1" />
- + <set name="is_tradable" val="false" />
- + <set name="is_dropable" val="false" />
- + <set name="is_destroyable" val="false" />
- + <set name="is_sellable" val="false" />
- + <set name="is_depositable" val="false" />
- + <for>
- + <add order="0x10" stat="pDef" val="46" />
- + <enchant order="0x0C" stat="pDef" val="0" />
- + </for>
- + </item>
- + <item id="9213" type="Armor" name="AIO Sandals">
- + <set name="default_action" val="equip" />
- + <set name="bodypart" val="feet" />
- + <set name="crystal_type" val="A" />
- + <set name="material" val="BLOOD_STEEL" />
- + <set name="weight" val="1" />
- + <set name="is_tradable" val="false" />
- + <set name="is_dropable" val="false" />
- + <set name="is_destroyable" val="false" />
- + <set name="is_sellable" val="false" />
- + <set name="is_depositable" val="false" />
- + <for>
- + <add order="0x10" stat="pDef" val="46" />
- + <enchant order="0x0C" stat="pDef" val="0" />
- + </for>
- + </item>
- </list>
- \ No newline at end of file
- #P aCis_gameserver
- Index: java/net/sf/l2j/gameserver/network/serverpackets/UserInfo.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/serverpackets/UserInfo.java (revision 3)
- +++ java/net/sf/l2j/gameserver/network/serverpackets/UserInfo.java (working copy)
- @@ -256,7 +256,7 @@
- writeD(_activeChar.getClanCrestLargeId());
- writeC(_activeChar.isNoble() ? 1 : 0); // 0x01: symbol on char menu ctrl+I
- - writeC(_activeChar.isHero() || (_activeChar.isGM() && Config.GM_HERO_AURA) ? 1 : 0); // 0x01: Hero Aura
- + writeC(_activeChar.isHero() || (_activeChar.isGM() && Config.GM_HERO_AURA || (_activeChar.isAio() && Config.AIO_HERO_AURA_EFFECT)) ? 1 : 0); // 0x01: Hero Aura
- writeC(_activeChar.isFishing() ? 1 : 0); // Fishing Mode
- Index: java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAio.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAio.java (nonexistent)
- +++ java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAio.java (working copy)
- @@ -0,0 +1,300 @@
- +/*
- + * This program is free software; you can redistribute it and/or modify
- + * it under the terms of the GNU General Public License as published by
- + * the Free Software Foundation; either version 2, or (at your option)
- + * any later version.
- + *
- + * This program is distributed in the hope that it will be useful,
- + * but WITHOUT ANY WARRANTY; without even the implied warranty of
- + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + * GNU General Public License for more details.
- + *
- + * You should have received a copy of the GNU General Public License
- + * along with this program; if not, write to the Free Software
- + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- + * 02111-1307, USA.
- + *
- + * http://www.gnu.org/copyleft/gpl.html
- + */
- +package net.sf.l2j.gameserver.handler.admincommandhandlers;
- +
- +
- +import java.sql.Connection;
- +import java.sql.PreparedStatement;
- +import java.util.StringTokenizer;
- +import java.util.logging.Level;
- +import java.util.logging.Logger;
- +
- +import net.sf.l2j.Config;
- +import net.sf.l2j.L2DatabaseFactory;
- +import net.sf.l2j.gameserver.datatables.GmListTable;
- +import net.sf.l2j.gameserver.datatables.MapRegionTable;
- +import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
- +import net.sf.l2j.gameserver.model.L2Object;
- +import net.sf.l2j.gameserver.model.L2World;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- +import net.sf.l2j.gameserver.network.clientpackets.Say2;
- +import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
- +import net.sf.l2j.gameserver.network.serverpackets.InventoryUpdate;
- +import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
- +import net.sf.l2j.gameserver.network.serverpackets.StopMove;
- +
- +/**
- + * "//setaio" give aio status to player Changes name color and title color if enabled Uses: setaio [<player_name>] [<time_duration in days>]
- + * "//removeaio" Uses: removeaio [<player_name>] if <player_name> is not specified, the current target player is used.
- + * @author KhayrusS, SweeTs, Reynald0
- + */
- +public class AdminAio implements IAdminCommandHandler
- +{
- + private static String[] _adminCommands =
- + {
- + "admin_setaio",
- + "admin_removeaio",
- + "admin_showaio",
- + "admin_gift"
- + };
- + private static Logger _log = Logger.getLogger(MapRegionTable.class.getName());
- +
- + @Override
- + public boolean useAdminCommand(String command, L2PcInstance activeChar)
- + {
- + if (command.startsWith("admin_setaio"))
- + {
- + if(!Config.ENABLE_AIO_SYSTEM)
- + {
- + activeChar.sendMessage("AIO system disabled");
- + return false;
- + }
- +
- + StringTokenizer str = new StringTokenizer(command);
- +
- + L2Object target = activeChar.getTarget();
- + L2PcInstance player = null;
- +
- + if (target != null && target instanceof L2PcInstance)
- + player = (L2PcInstance) target;
- + else
- + player = activeChar;
- +
- + try
- + {
- + str.nextToken();
- + String time = str.nextToken();
- + if (str.hasMoreTokens())
- + {
- + String playername = time;
- + time = str.nextToken();
- + player = L2World.getInstance().getPlayer(playername);
- + doAio(activeChar, player, playername, time);
- + }
- + else
- + {
- + String playername = player.getName();
- + doAio(activeChar, player, playername, time);
- + }
- + }
- + catch (Exception e)
- + {
- + activeChar.sendMessage("Usage: //setaio <char_name> [time](in days)");
- + }
- +
- + player.broadcastUserInfo();
- +
- + if (player.isAio())
- + return true;
- + }
- + else if (command.startsWith("admin_removeaio"))
- + {
- + StringTokenizer str = new StringTokenizer(command);
- + L2Object target = activeChar.getTarget();
- + L2PcInstance player = null;
- +
- + if (target instanceof L2PcInstance)
- + player = (L2PcInstance) target;
- + else
- + player = activeChar;
- +
- + try
- + {
- + str.nextToken();
- +
- + if (str.hasMoreTokens())
- + {
- + String playername = str.nextToken();
- + player = L2World.getInstance().getPlayer(playername);
- + removeAio(activeChar, player, playername);
- + }
- + else
- + {
- + String playername = player.getName();
- + removeAio(activeChar, player, playername);
- + }
- + }
- + catch (Exception e)
- + {
- + activeChar.sendMessage("Usage: //removeaio <char_name>");
- + }
- + player.broadcastUserInfo();
- + }
- + else if (command.startsWith("admin_showaio"))
- + showAllAio(activeChar);
- + return false;
- + }
- +
- + public void doAio(L2PcInstance activeChar, L2PcInstance _player, String _playername, String _time)
- + {
- + int days = Integer.parseInt(_time);
- +
- + if (_player == null)
- + {
- + activeChar.sendMessage("Character not found.");
- + return;
- + }
- + if (_player.isAio())
- + {
- + activeChar.sendMessage("Player " + _playername + " is already an AIO.");
- + return;
- + }
- +
- + if (days > 0)
- + {
- + _player.getStat().addExp(_player.getStat().getExpForLevel(81));
- + _player.setClassId(_player.getClassId().getFirstClass().getId());
- + _player.lostAioSkills();
- + _player.setAio(true);
- + _player.setName("[AIO]-" + _player.getName());
- + _player.setTitle(".-=Special=-.");
- + _player.setEndTime("aio", days);
- + _player.sendPacket(new CreatureSay(0, Say2.PARTY, "System", "Dear player, you are now an AIO, congratulations."));
- +
- + try (Connection con = L2DatabaseFactory.getInstance().getConnection())
- + {
- + PreparedStatement statement = con.prepareStatement("UPDATE characters SET aio=1, aio_end=? WHERE obj_id=?");
- + statement.setLong(1, _player.getAioEndTime());
- + statement.setInt(2, _player.getObjectId());
- + statement.execute();
- + statement.close();
- +
- + if (Config.ALLOW_AIO_NCOLOR)
- + _player.getAppearance().setNameColor(Config.AIO_NCOLOR);
- +
- + if (Config.ALLOW_AIO_TCOLOR)
- + _player.getAppearance().setTitleColor(Config.AIO_TCOLOR);
- +
- + _player.rewardAioSkills();
- +
- + if (Config.ALLOW_AIO_ITEM)
- + {
- + StringTokenizer st = new StringTokenizer((Config.AIO_ITEMID), ",");
- + while (st.hasMoreElements())
- + {
- + int item_id = Integer.parseInt(st.nextToken());
- + _player.getInventory().addItem("", item_id, 1, _player, null);
- + _player.getInventory().equipItem(_player.getInventory().getItemByItemId(item_id));
- + }
- + }
- +
- + updateChar(_player);
- +
- + GmListTable.broadcastMessageToGMs("GM " + activeChar.getName() + " set an AIO status for player " + _playername + " for " + _time + " day(s)");
- + }
- + catch (Exception e)
- + {
- + _log.log(Level.WARNING, "Something went wrong, check log folder for details", e);
- + }
- + }
- + }
- +
- + public void removeAio(L2PcInstance activeChar, L2PcInstance _player, String _playername)
- + {
- + if (!_player.isAio() && activeChar != null)
- + {
- + activeChar.sendMessage("Player " + _playername + " is not an AIO.");
- + return;
- + }
- + //Paralyze player
- + _player.startAbnormalEffect(0x0800);
- + _player.setIsParalyzed(true);
- + _player.broadcastPacket(new StopMove(_player));
- + _player.lostAioSkills();
- + _player.setAioEndTime(0);
- + _player.setAio(false);
- +
- + try (Connection con = L2DatabaseFactory.getInstance().getConnection())
- + {
- + PreparedStatement statement = con.prepareStatement("UPDATE characters SET Aio=0, Aio_end=0 WHERE obj_id=?");
- + statement.setInt(1, _player.getObjectId());
- + statement.execute();
- + statement.close();
- +
- + if (Config.ALLOW_AIO_ITEM)
- + {
- + StringTokenizer st = new StringTokenizer((Config.AIO_ITEMID), ",");
- + while (st.hasMoreElements())
- + {
- + int item_id = Integer.parseInt(st.nextToken());
- + _player.destroyItemByItemId("aio", item_id, 1, null, true);
- + }
- + }
- + _player.removeExpAndSp(6299994999L, 0);
- + _player.setName(_player.getName().replace("[AIO]-", ""));
- + _player.setTitle("");
- + _player.getAppearance().setNameColor(0xFFFFFF);
- + _player.getAppearance().setTitleColor(0xFFFFFF);
- + updateChar(_player);
- +
- +
- + if(activeChar != null && _playername != "")
- + {
- + GmListTable.broadcastMessageToGMs("GM " + activeChar.getName() + " removed AIO status from " + _playername);
- + _player.sendPacket(new CreatureSay(0, Say2.PARTYROOM_COMMANDER, "System", "Your AIO period has been finished."));
- + }
- + else
- + _player.sendPacket(new CreatureSay(0, Say2.PARTYROOM_COMMANDER, "System", "Your AIO period ends."));
- + }
- + catch (Exception e)
- + {
- + _log.log(Level.WARNING, "Something went wrong, check log folder for details", e);
- + }
- + //Unparalyze player
- + _player.stopAbnormalEffect(0x0800);
- + _player.setIsParalyzed(false);
- + }
- +
- + public void updateChar(L2PcInstance player)
- + {
- + player.sendPacket(new InventoryUpdate());
- + player.broadcastUserInfo();
- + player.broadcastCharInfo();
- + player.sendSkillList();
- + player.store();
- + }
- +
- + public void showAllAio(L2PcInstance activeChar)
- + {
- + short num = 0;
- + NpcHtmlMessage html = new NpcHtmlMessage(0);
- + html.setFile("data/html/admin/aio.htm");
- + StringBuilder sb = new StringBuilder();
- + for (L2PcInstance player : L2World.getInstance().getAllPlayers().values())
- + {
- + if (player.isAio())
- + {
- + num++;
- + sb.append("<tr><td width=10></td>" +
- + "<td width=20>" + num + "</td>" +
- + "<td width=80><font color=\"LEVEL\">" + player.getName() + "</font></td>" +
- + "<td width=110>" + MapRegionTable.getInstance().getClosestTownName(player.getX(), player.getY()) + "</td>" +
- + "<td width=50><font color=\"00FF00\">ON</font></td></tr>");
- + }
- + }
- + html.replace("%show_aio%", num > 0 ? sb.toString() : "");
- + activeChar.sendPacket(html);
- + }
- +
- + @Override
- + public String[] getAdminCommandList()
- + {
- + return _adminCommands;
- + }
- +}
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/model/actor/instance/L2TeleporterInstance.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/actor/instance/L2TeleporterInstance.java (revision 3)
- +++ java/net/sf/l2j/gameserver/model/actor/instance/L2TeleporterInstance.java (working copy)
- @@ -27,7 +27,9 @@
- import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
- import net.sf.l2j.gameserver.model.zone.ZoneId;
- import net.sf.l2j.gameserver.network.SystemMessageId;
- +import net.sf.l2j.gameserver.network.clientpackets.Say2;
- import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
- +import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
- import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
- /**
- @@ -179,6 +181,20 @@
- }
- else if (player.isAlikeDead())
- return;
- + else if(player.isAio())
- + {
- + if (!Config.ALLOW_AIO_TELEPORT)
- + {
- + player.sendPacket(new CreatureSay(0, Say2.SHOUT, "System", "You cant teleport while being an AIO!"));
- + return;
- + }
- + else if (Config.ALLOW_AIO_TELEPORT && Config.ENABLE_AIO_FREE_TELEPORT)
- + {
- + player.sendPacket(new CreatureSay(0, Say2.PARTY, "System", "Free teleport!"));
- + player.teleToLocation(list.getLocX(), list.getLocY(), list.getLocZ(), 20);
- + return;
- + }
- + }
- Calendar cal = Calendar.getInstance();
- int price = list.getPrice();
- Index: java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (revision 3)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (working copy)
- @@ -14,6 +14,9 @@
- */
- package net.sf.l2j.gameserver.network.clientpackets;
- +import java.util.Calendar;
- +import java.util.Date;
- +
- import net.sf.l2j.Config;
- import net.sf.l2j.gameserver.communitybbs.Manager.MailBBSManager;
- import net.sf.l2j.gameserver.datatables.AdminCommandAccessRights;
- @@ -21,6 +24,7 @@
- import net.sf.l2j.gameserver.datatables.GmListTable;
- import net.sf.l2j.gameserver.datatables.MapRegionTable;
- import net.sf.l2j.gameserver.datatables.SkillTable.FrequentSkill;
- +import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminAio;
- import net.sf.l2j.gameserver.instancemanager.ClanHallManager;
- import net.sf.l2j.gameserver.instancemanager.CoupleManager;
- import net.sf.l2j.gameserver.instancemanager.DimensionalRiftManager;
- @@ -41,6 +45,7 @@
- import net.sf.l2j.gameserver.model.quest.QuestState;
- import net.sf.l2j.gameserver.model.zone.ZoneId;
- import net.sf.l2j.gameserver.network.SystemMessageId;
- +import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
- import net.sf.l2j.gameserver.network.serverpackets.Die;
- import net.sf.l2j.gameserver.network.serverpackets.EtcStatusUpdate;
- import net.sf.l2j.gameserver.network.serverpackets.ExMailArrived;
- @@ -201,6 +206,15 @@
- }
- activeChar.sendPacket(new QuestList(activeChar));
- + if (activeChar.isAio())
- + onEnterAio(activeChar);
- +
- + if (Config.ALLOW_AIO_NCOLOR && activeChar.isAio())
- + activeChar.getAppearance().setNameColor(Config.AIO_NCOLOR);
- +
- + if (Config.ALLOW_AIO_TCOLOR && activeChar.isAio())
- + activeChar.getAppearance().setTitleColor(Config.AIO_TCOLOR);
- +
- // Unread mails make a popup appears.
- if (Config.ENABLE_COMMUNITY_BOARD && MailBBSManager.getInstance().checkUnreadMail(activeChar) > 0)
- {
- @@ -250,6 +264,26 @@
- activeChar.teleToLocation(MapRegionTable.TeleportWhereType.Town);
- }
- + private static void onEnterAio(L2PcInstance activeChar)
- + {
- + if(activeChar.isAio() && !activeChar.isInsideZone(ZoneId.TOWN) && !activeChar.isInsideZone(ZoneId.PEACE))
- + {
- + activeChar.sendPacket(new CreatureSay(0, Say2.SHOUT, "System", "You can only teleport to another town while being an AIO!"));
- + activeChar.teleToLocation(MapRegionTable.TeleportWhereType.Town);
- + }
- +
- + long now = Calendar.getInstance().getTimeInMillis();
- + long endDay = activeChar.getAioEndTime();
- + if (now > endDay)
- + new AdminAio().removeAio(null, activeChar, "");
- + else
- + {
- + Date dt = new Date(endDay);
- + if (activeChar.isAio())
- + activeChar.sendPacket(new CreatureSay(0, Say2.ALLIANCE, "System", "Your AIO period ends at: " + dt));
- + }
- + }
- +
- private static void engage(L2PcInstance cha)
- {
- int _chaid = cha.getObjectId();
- Index: java/net/sf/l2j/gameserver/model/base/ClassId.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/base/ClassId.java (revision 3)
- +++ java/net/sf/l2j/gameserver/model/base/ClassId.java (working copy)
- @@ -205,6 +205,17 @@
- {
- return _race;
- }
- +
- + /**
- + * @return to the first class
- + */
- + public final ClassId getFirstClass()
- + {
- + if (_parent == null)
- + return this;
- +
- + return _parent.getFirstClass();
- + }
- /**
- * @param cid The parent ClassId to check
- Index: java/net/sf/l2j/gameserver/handler/AdminCommandHandler.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/AdminCommandHandler.java (revision 3)
- +++ java/net/sf/l2j/gameserver/handler/AdminCommandHandler.java (working copy)
- @@ -18,6 +18,7 @@
- import java.util.Map;
- import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminAdmin;
- +import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminAio;
- import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminAnnouncements;
- import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminBan;
- import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminBookmark;
- @@ -78,6 +79,7 @@
- protected AdminCommandHandler()
- {
- registerAdminCommandHandler(new AdminAdmin());
- + registerAdminCommandHandler(new AdminAio());
- registerAdminCommandHandler(new AdminAnnouncements());
- registerAdminCommandHandler(new AdminBan());
- registerAdminCommandHandler(new AdminBookmark());
- Index: config/AIO.properties
- ===================================================================
- --- config/AIO.properties (nonexistent)
- +++ config/AIO.properties (working copy)
- @@ -0,0 +1,42 @@
- +#=============================================================
- +# AIO System
- +#=============================================================
- +EnableAioSystem = True
- +
- +# Enable / Disable name color
- +AllowAioNameColor = True
- +#Hexadecimal code
- +AioNameColor = 88AA88
- +
- +# Enable / Disable title color
- +AllowAioTitleColor = True
- +#Hexadecimal code
- +AioTitleColor = 88AA88
- +
- +# List of Aio Skills
- +# Format : skillid,skilllvl;skillid2,skilllvl2;
- +AioSkills = 7065,1;1085,3;1304,3;1087,3;1354,1;1062,2;1243,6;1045,6;1048,6;1429,1;163,1;\
- +1311,6;213,8;1007,3;1309,3;1552,3;1006,3;1308,3;1253,3;1284,3;1392,3;1393,3;214,1;\
- +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;\
- +272,1;277,1;273,1;311,1;366,1;365,1;310,1;271,1;1242,3;1353,3;1391,3;1002,3;\
- +1352,1;229,7;228,3;1077,3;1218,33;1059,3;1219,33;1388,3;1389,3;1240,3;1413,1;\
- +1086,2;1036,2;1035,4;1068,3;1356,1;1355,1;1357,1;1307,3;1410,1;1409,1;1353,1;\
- +1044,3;1182,3;1191,3;1189,3;1259,4;1306,6;234,23;1040,3;364,1;264,1;306,1;\
- +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;\
- +1204,2;1268,4;4699,13;4700,13;4702,13;4703,13;1323,1;1251,2;1328,7;1329,9;1330,8
- +
- +# Allow / Do not receive special items to convert AIO
- +AllowAIOItem = True
- +
- +# ID of the item that will be given to AIO
- +ItemIdAio = 9209,9210,9211,9212,9213
- +
- +# AIO aura hero effect
- +AIOHeroEffect = True
- +
- +# Allow / Do not allow AIO teleport
- +# If true only allows teleport between towns
- +AllowAIOTeleport = True
- +
- +# Enable / Disable teleport cost
- +EnableFreeTeleport = False
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/GameServer.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/GameServer.java (revision 3)
- +++ java/net/sf/l2j/gameserver/GameServer.java (working copy)
- @@ -193,6 +193,10 @@
- PartyMatchRoomList.getInstance();
- RaidBossPointsManager.getInstance();
- + Util.printSection("AIO");
- + if (Config.ENABLE_AIO_SYSTEM)
- + _log.config(Config.ENABLE_AIO_SYSTEM ? "AIO: Enabled" : "Disabled");
- +
- Util.printSection("Community server");
- if (Config.ENABLE_COMMUNITY_BOARD) // Forums has to be loaded before clan data
- ForumsBBSManager.getInstance().initRoot();
- Index: java/net/sf/l2j/gameserver/network/serverpackets/CharInfo.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/serverpackets/CharInfo.java (revision 3)
- +++ java/net/sf/l2j/gameserver/network/serverpackets/CharInfo.java (working copy)
- @@ -201,7 +201,7 @@
- writeD(_activeChar.getClanCrestLargeId());
- writeC(_activeChar.isNoble() ? 1 : 0); // Symbol on char menu ctrl+I
- - writeC((_activeChar.isHero() || (_activeChar.isGM() && Config.GM_HERO_AURA)) ? 1 : 0); // Hero Aura
- + writeC((_activeChar.isHero() || (_activeChar.isGM() && Config.GM_HERO_AURA) || (_activeChar.isAio() && Config.AIO_HERO_AURA_EFFECT)) ? 1 : 0); // Hero Aura
- writeC(_activeChar.isFishing() ? 1 : 0); // 0x01: Fishing Mode (Cant be undone by setting back to 0)
- Index: java/net/sf/l2j/Config.java
- ===================================================================
- --- java/net/sf/l2j/Config.java (revision 3)
- +++ java/net/sf/l2j/Config.java (working copy)
- @@ -44,6 +44,7 @@
- {
- protected static final Logger _log = Logger.getLogger(Config.class.getName());
- + public static final String AIO_FILE = "./config/AIO.properties";
- public static final String CLANS_FILE = "./config/clans.properties";
- public static final String EVENTS_FILE = "./config/events.properties";
- public static final String FLOOD_PROTECTOR_FILE = "./config/floodprotector.properties";
- @@ -55,6 +56,19 @@
- public static final String SERVER_FILE = "./config/server.properties";
- public static final String SIEGE_FILE = "./config/siege.properties";
- + /** Aio System */
- + public static boolean ENABLE_AIO_SYSTEM;
- + public static Map<Integer, Integer> AIO_SKILLS;
- + public static boolean ALLOW_AIO_NCOLOR;
- + public static int AIO_NCOLOR;
- + public static boolean ALLOW_AIO_TCOLOR;
- + public static int AIO_TCOLOR;
- + public static boolean ALLOW_AIO_ITEM;
- + public static String AIO_ITEMID;
- + public static boolean AIO_HERO_AURA_EFFECT;
- + public static boolean ALLOW_AIO_TELEPORT;
- + public static boolean ENABLE_AIO_FREE_TELEPORT;
- +
- // --------------------------------------------------
- // Clans settings
- // --------------------------------------------------
- @@ -703,6 +717,44 @@
- _log.info("Loading gameserver configuration files.");
- + // AIO settings
- + ExProperties aio = load(AIO_FILE);
- + ENABLE_AIO_SYSTEM = aio.getProperty("EnableAioSystem", false);
- + ALLOW_AIO_NCOLOR = aio.getProperty("AllowAioNameColor", false);
- + AIO_NCOLOR = Integer.decode("0x" + aio.getProperty("AioNameColor", "88AA88"));
- + ALLOW_AIO_TCOLOR = aio.getProperty("AllowAioTitleColor", false);
- + AIO_TCOLOR = Integer.decode("0x" + aio.getProperty("AioTitleColor", "88AA88"));
- + ALLOW_AIO_ITEM = aio.getProperty("AllowAIOItem", false);
- + AIO_ITEMID = aio.getProperty("ItemIdAio", "9209,9210,9211,9212,9213");
- + AIO_HERO_AURA_EFFECT = aio.getProperty("AIOHeroEffect", false);
- + ALLOW_AIO_TELEPORT = aio.getProperty("AllowAIOTeleport", false);
- + ENABLE_AIO_FREE_TELEPORT = aio.getProperty("EnableFreeTeleport", false);
- +
- +
- + if (ENABLE_AIO_SYSTEM) // create map if system is enabled
- + {
- + String[] AioSkillsSplit = aio.getProperty("AioSkills", "").split(";");
- + AIO_SKILLS = new HashMap<>(AioSkillsSplit.length);
- + for (String skill : AioSkillsSplit)
- + {
- + String[] skillSplit = skill.split(",");
- + if (skillSplit.length != 2)
- + _log.info("[Aio System]: invalid config property in AIO.properties -> AioSkills \"" + skill + "\"");
- + else
- + {
- + try
- + {
- + AIO_SKILLS.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
- + }
- + catch (NumberFormatException nfe)
- + {
- + if (!skill.equals(""))
- + _log.info("[Aio System]: invalid config property in AIO.properties -> AioSkills \"" + skillSplit[0] + "\"" + skillSplit[1]);
- + }
- + }
- + }
- + }
- +
- // Clans settings
- ExProperties clans = load(CLANS_FILE);
- ALT_CLAN_JOIN_DAYS = clans.getProperty("DaysBeforeJoinAClan", 5);
- Index: java/net/sf/l2j/gameserver/model/actor/instance/L2ClassMasterInstance.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/actor/instance/L2ClassMasterInstance.java (revision 3)
- +++ java/net/sf/l2j/gameserver/model/actor/instance/L2ClassMasterInstance.java (working copy)
- @@ -67,6 +67,12 @@
- @Override
- public void onBypassFeedback(L2PcInstance player, String command)
- {
- + if (player.isAio())
- + {
- + player.sendMessage("You're not allowed to change your class.");
- + return;
- + }
- +
- if (!Config.ALLOW_CLASS_MASTERS)
- return;
- Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 3)
- +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy)
- @@ -157,12 +157,14 @@
- import net.sf.l2j.gameserver.model.zone.type.L2BossZone;
- import net.sf.l2j.gameserver.network.L2GameClient;
- import net.sf.l2j.gameserver.network.SystemMessageId;
- +import net.sf.l2j.gameserver.network.clientpackets.Say2;
- import net.sf.l2j.gameserver.network.serverpackets.AbstractNpcInfo;
- import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
- import net.sf.l2j.gameserver.network.serverpackets.ChairSit;
- import net.sf.l2j.gameserver.network.serverpackets.ChangeWaitType;
- import net.sf.l2j.gameserver.network.serverpackets.CharInfo;
- import net.sf.l2j.gameserver.network.serverpackets.ConfirmDlg;
- +import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
- import net.sf.l2j.gameserver.network.serverpackets.EtcStatusUpdate;
- import net.sf.l2j.gameserver.network.serverpackets.ExAutoSoulShot;
- import net.sf.l2j.gameserver.network.serverpackets.ExDuelUpdateUserInfo;
- @@ -262,8 +264,8 @@
- private static final String DELETE_SKILL_SAVE = "DELETE FROM character_skills_save WHERE char_obj_id=? AND class_index=?";
- 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 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
- - 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=?";
- - 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=?";
- + 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=?";
- + 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=?";
- 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";
- private static final String ADD_CHAR_SUBCLASS = "INSERT INTO character_subclasses (char_obj_id,class_id,exp,sp,level,class_index) VALUES (?,?,?,?,?,?)";
- @@ -481,6 +483,10 @@
- private boolean _noble = false;
- private boolean _hero = false;
- + /** Aio System */
- + private boolean _isAio = false;
- + private long _aio_endTime = 0;
- +
- private L2Npc _currentFolkNpc = null;
- private int _questNpcObject = 0;
- @@ -5555,6 +5561,9 @@
- player.setDeathPenaltyBuffLevel(rset.getInt("death_penalty_level"));
- + player.setAio(rset.getInt("aio") == 1 ? true : false);
- + player.setAioEndTime(rset.getLong("aio_end"));
- +
- // Set the x,y,z position of the L2PcInstance and make it invisible
- player.setXYZInvisible(rset.getInt("x"), rset.getInt("y"), rset.getInt("z"));
- @@ -5889,7 +5898,9 @@
- statement.setLong(47, getClanCreateExpiryTime());
- statement.setString(48, getName());
- statement.setLong(49, getDeathPenaltyBuffLevel());
- - statement.setInt(50, getObjectId());
- + statement.setInt(50, isAio() ? 1 : 0);
- + statement.setLong(51, getAioEndTime());
- + statement.setInt(52, getObjectId());
- statement.execute();
- statement.close();
- @@ -6694,6 +6705,12 @@
- return false;
- }
- + if (isAio() && !isGM() && !isInsideZone(ZoneId.TOWN))
- + {
- + sendPacket(ActionFailed.STATIC_PACKET);
- + return false;
- + }
- +
- // Cancels the use of skills when player uses a cursed weapon or is flying.
- if ((isCursedWeaponEquipped() && !skill.isDemonicSkill()) // If CW, allow ONLY demonic skills.
- || (getMountType() == 1 && !skill.isStriderSkill()) // If mounted, allow ONLY Strider skills.
- @@ -8211,6 +8228,9 @@
- if (isWearingFormalWear)
- isDisabled = true;
- + if (isAio() && !isGM() && !isInsideZone(ZoneId.TOWN))
- + isDisabled = true;
- +
- sl.addSkill(s.getId(), s.getLevel(), s.isPassive(), isDisabled);
- }
- sendPacket(sl);
- @@ -8824,6 +8844,12 @@
- // Force a revalidation
- revalidateZone(true);
- + if(isAio() && !isInsideZone(ZoneId.TOWN) && !isInsideZone(ZoneId.PEACE))
- + {
- + sendPacket(new CreatureSay(0, Say2.SHOUT, "System", "You can only teleport to another town while being an AIO!"));
- + teleToLocation(MapRegionTable.TeleportWhereType.Town);
- + }
- +
- if (Config.PLAYER_SPAWN_PROTECTION > 0)
- setProtection(true);
- @@ -9801,6 +9827,55 @@
- }
- }
- + public boolean isAio()
- + {
- + return _isAio;
- + }
- +
- + public void setAio(boolean val)
- + {
- + _isAio = val;
- + }
- +
- + public long getAioEndTime()
- + {
- + return _aio_endTime;
- + }
- +
- + public void setAioEndTime(long val)
- + {
- + _aio_endTime = val;
- + }
- +
- + public void rewardAioSkills()
- + {
- + L2Skill skill;
- + for (Integer skillid : Config.AIO_SKILLS.keySet())
- + {
- + int skilllvl = Config.AIO_SKILLS.get(skillid);
- + skill = SkillTable.getInstance().getInfo(skillid, skilllvl);
- + if (skill != null)
- + addSkill(skill, true);
- + }
- + }
- +
- + public void lostAioSkills()
- + {
- + for (L2Skill skill : this.getAllSkills())
- + this.removeSkill(skill);
- + }
- +
- + public void setEndTime(String process, int val)
- + {
- + Calendar calendar = Calendar.getInstance();
- + calendar.add(Calendar.DAY_OF_MONTH, val);
- + long end_day = calendar.getTimeInMillis();
- +
- + if (process.equals("aio"))
- + _aio_endTime = end_day;
- + }
- +
- +
- public int getPowerGrade()
- {
- return _powerGrade;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement