Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P L2JHellasC
- Index: java/com/l2jhellas/gameserver/model/actor/instance/L2PcInstance.java
- ===================================================================
- --- java/com/l2jhellas/gameserver/model/actor/instance/L2PcInstance.java (revision 515)
- +++ java/com/l2jhellas/gameserver/model/actor/instance/L2PcInstance.java (working copy)
- @@ -269,8 +269,8 @@
- private static final String DELETE_SKILL_SAVE = "DELETE FROM character_skills_save WHERE char_obj_id=? AND class_index=?";
- // Character Character
- - private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?, maxHp=?, curHp=?, maxCp=?, curCp=?, maxMp=?, curMp=?, str=?, con=?, dex=?, _int=?, men=?, wit=?, face=?, hairStyle=?, hairColor=?, heading=?, x=?, y=?, z=?, exp=?, expBeforeDeath=?, sp=?, karma=?, pvpkills=?, pkkills=?, rec_have=?, rec_left=?, clanid=?, maxload=?, race=?, classid=?, deletetime=?, title=?, accesslevel=?, online=?, isin7sdungeon=?, clan_privs=?, wantspeace=?, base_class=?, onlinetime=?, in_jail=?, jail_timer=?, newbie=?, 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=?, chat_filter_count=?,hitman_target=?, event_points=? WHERE obj_id=?";
- - private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, maxload, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, in_jail, jail_timer, newbie, 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, hero, donator, chatban_timer, chatban_reason, chat_filter_count,hitman_target, email, emailcode, hasSubEmail, answer, secCode, emailchangecode, hasSubSec, lastVoteHopzone, lastVoteTopzone, hasVotedHop, hasVotedTop, monthVotes, totalVotes, tries, event_points FROM characters WHERE obj_Id=?";
- + private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?, maxHp=?, curHp=?, maxCp=?, curCp=?, maxMp=?, curMp=?, str=?, con=?, dex=?, _int=?, men=?, wit=?, face=?, hairStyle=?, hairColor=?, heading=?, x=?, y=?, z=?, exp=?, expBeforeDeath=?, sp=?, karma=?, pvpkills=?, pkkills=?, rec_have=?, rec_left=?, clanid=?, maxload=?, race=?, classid=?, deletetime=?, title=?, accesslevel=?, online=?, isin7sdungeon=?, clan_privs=?, wantspeace=?, base_class=?, onlinetime=?, in_jail=?, jail_timer=?, newbie=?, 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=?, chat_filter_count=?,hitman_target=?, event_points=?, 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, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, maxload, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, in_jail, jail_timer, newbie, 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, hero, donator, chatban_timer, chatban_reason, chat_filter_count,hitman_target, email, emailcode, hasSubEmail, answer, secCode, emailchangecode, hasSubSec, lastVoteHopzone, lastVoteTopzone, hasVotedHop, hasVotedTop, monthVotes, totalVotes, tries, event_points, 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 INSERT_CHARACTER = "INSERT INTO characters (account_name,obj_Id,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp,acc,crit,evasion,mAtk,mDef,mSpd,pAtk,pDef,pSpd,runSpd,walkSpd,str,con,dex,_int,men,wit,face,hairStyle,hairColor,sex,movement_multiplier,attack_speed_multiplier,colRad,colHeight,exp,sp,karma,pvpkills,pkkills,clanid,maxload,race,classid,deletetime,cancraft,title,accesslevel,online,isin7sdungeon,clan_privs,wantspeace,base_class,newbie,nobless,power_grade,last_recom_date) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
- @@ -627,6 +627,10 @@
- private boolean _noble = false;
- private boolean _hero = false;
- +
- + /** AIO System */
- + private boolean _isAio = false;
- + private long _aio_endTime = 0;
- /** Account Manager */
- private String _email = null;
- @@ -7372,6 +7376,9 @@
- player.setAllianceWithVarkaKetra(rset.getInt("varka_ketra_ally"));
- player.setDeathPenaltyBuffLevel(rset.getInt("death_penalty_level"));
- +
- + player.setAio(rset.getInt("aio") == 1 ? true : false);
- + player.setAioEndTime(rset.getLong("aio_end"));
- player.setChatFilterCount(rset.getInt("chat_filter_count"));
- player.setHitmanTarget(rset.getInt("hitman_target"));
- @@ -7752,7 +7759,9 @@
- statement.setInt(57, getChatFilterCount());
- statement.setInt(58, getHitmanTarget());
- statement.setInt(59, getEventPoints());
- - statement.setInt(60, getObjectId());
- + statement.setInt(60, isAio() ? 1 : 0);
- + statement.setLong(61, getAioEndTime());
- + statement.setInt(62, getObjectId());
- statement.execute();
- statement.close();
- @@ -8075,7 +8084,7 @@
- */
- public void checkAllowedSkills()
- {
- - if (isGM())
- + if (isGM() || isAio())
- return;
- Collection<L2SkillLearn> skillTree = SkillTreeData.getInstance().getAllowedSkills(getClassId());
- @@ -12620,6 +12629,56 @@
- }
- }
- + 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;
- Index: java/com/l2jhellas/Config.java
- ===================================================================
- --- java/com/l2jhellas/Config.java (revision 515)
- +++ java/com/l2jhellas/Config.java (working copy)
- @@ -81,6 +81,7 @@
- private static final String EVENT_RAID_CONFIG_FILE = "./config/Events/Raid.ini";
- private static final String EVENT_WEDDING_CONFIG_FILE = "./config/Events/Wedding.ini";
- // Mods Folder
- + private static final String AIO_SYSTEM_CONFIG_FILE = "./config/Mods/AioSystem.ini";
- private static final String MOD_CHAMPIONS_CONFIG_FILE = "./config/Mods/Champions.ini";
- private static final String MOD_L2JHellas_CONFIG_FILE = "./config/Mods/L2JHellas.ini";
- private static final String MOD_RANK_CONFIG_FILE = "./config/Mods/Rank PvP System.ini";
- @@ -347,6 +348,18 @@
- public static boolean CHAMPION_ENABLE;
- /**
- + * Aio System Config File
- + */
- + 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 int AIO_ITEMID;
- +
- + /**
- * PvP Config File
- */
- public static boolean REMOVE_BUFFS_ON_DIE;
- @@ -1592,6 +1605,54 @@
- CHAMPION_SPCL_LVL_DIFF = Integer.parseInt(ChampionSettings.getProperty("ChampionSpecialItemLevelDiff", "0"));
- /**
- + * Aio System
- + */
- + Properties AioSystemSettings = new Properties();
- + try (InputStream is = new FileInputStream(new File(AIO_SYSTEM_CONFIG_FILE)))
- + {
- + AioSystemSettings.load(is);
- + }
- + catch (Exception e)
- + {
- + _log.severe(Config.class.getName() + ": Error while loading " + AIO_SYSTEM_CONFIG_FILE + " settings!");
- + }
- + ENABLE_AIO_SYSTEM = Boolean.parseBoolean(AioSystemSettings.getProperty("EnableAioSystem", "True"));
- + ALLOW_AIO_NCOLOR = Boolean.parseBoolean(AioSystemSettings.getProperty("AllowAioNameColor", "True"));
- + AIO_NCOLOR = Integer.decode("0x" + AioSystemSettings.getProperty("AioNameColor", "88AA88"));
- + ALLOW_AIO_TCOLOR = Boolean.parseBoolean(AioSystemSettings.getProperty("AllowAioTitleColor", "True"));
- + AIO_TCOLOR = Integer.decode("0x" + AioSystemSettings.getProperty("AioTitleColor", "88AA88"));
- + AIO_ITEMID = Integer.parseInt(AioSystemSettings.getProperty("ItemIdAio", "9945"));
- + ALLOW_AIO_ITEM = Boolean.parseBoolean(AioSystemSettings.getProperty("AllowAIOItem", "False"));
- +
- + if(ENABLE_AIO_SYSTEM) //create map if system is enabled
- + {
- + String[] AioSkillsSplit = AioSystemSettings.getProperty("AioSkills", "").split(";");
- + AIO_SKILLS = new HashMap<>(AioSkillsSplit.length);
- + for (String skill : AioSkillsSplit)
- + {
- + String[] skillSplit = skill.split(",");
- + if (skillSplit.length != 2)
- + {
- + System.out.println("[AIO System]: invalid config property in triunfo.properties -> AioSkills \"" + skill + "\"");
- + }
- + else
- + {
- + try
- + {
- + AIO_SKILLS.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
- + }
- + catch (NumberFormatException nfe)
- + {
- + if (!skill.equals(""))
- + {
- + System.out.println("[AIO System]: invalid config property in players.props -> AioSkills \"" + skillSplit[0] + "\"" + skillSplit[1]);
- + }
- + }
- + }
- + }
- + }
- +
- + /**
- * PvP
- */
- Properties PvPSettings = new Properties();
- Index: java/com/l2jhellas/gameserver/network/clientpackets/EnterWorld.java
- ===================================================================
- --- java/com/l2jhellas/gameserver/network/clientpackets/EnterWorld.java (revision 515)
- +++ java/com/l2jhellas/gameserver/network/clientpackets/EnterWorld.java (working copy)
- @@ -12,8 +12,13 @@
- */
- package com.l2jhellas.gameserver.network.clientpackets;
- +import java.util.Calendar;
- +import java.util.Date;
- +
- +import com.l2jhellas.Config;
- import com.l2jhellas.gameserver.TaskPriority;
- import com.l2jhellas.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jhellas.gameserver.network.serverpackets.CreatureSay;
- /**
- * Enter World Packet Handler
- @@ -46,7 +51,41 @@
- return;
- }
- activeChar.checks();
- +
- + // Aio System
- + 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);
- + }
- +
- }
- +
- + private static void onEnterAio(L2PcInstance activeChar) {
- + long now = Calendar.getInstance().getTimeInMillis();
- + long endDay = activeChar.getAioEndTime();
- + if(now > endDay) {
- + activeChar.setAio(false);
- + activeChar.setAioEndTime(0);
- + activeChar.lostAioSkills();
- + if(Config.ALLOW_AIO_ITEM) {
- + activeChar.getInventory().destroyItemByItemId("", Config.AIO_ITEMID, 1, activeChar, null);
- + activeChar.getWarehouse().destroyItemByItemId("", Config.AIO_ITEMID, 1, activeChar, null);
- + }
- + activeChar.sendPacket(new CreatureSay(0,Say2.HERO_VOICE,"System","Your AIO period ends."));
- + } else {
- + Date dt = new Date(endDay);
- + if(activeChar.isAio()) {
- + activeChar.sendMessage("Your AIO period ends at: " + dt);
- + }
- + }
- + }
- @Override
- public String getType()
- Index: java/com/l2jhellas/gameserver/handler/AdminCommandHandler.java
- ===================================================================
- --- java/com/l2jhellas/gameserver/handler/AdminCommandHandler.java (revision 515)
- +++ java/com/l2jhellas/gameserver/handler/AdminCommandHandler.java (working copy)
- @@ -17,6 +17,8 @@
- import java.util.HashMap;
- import java.util.Map;
- +import com.l2jhellas.gameserver.handler.admincommandhandlers.AdminAio;
- +
- public class AdminCommandHandler implements IHandler<IAdminCommandHandler, String>
- {
- private final Map<String, IAdminCommandHandler> _datatable;
- @@ -24,6 +26,7 @@
- protected AdminCommandHandler()
- {
- _datatable = new HashMap<>();
- + registerHandler(new AdminAio());
- }
- @Override
- Index: config/Mods/AioSystem.ini
- ===================================================================
- --- config/Mods/AioSystem.ini (revision 0)
- +++ config/Mods/AioSystem.ini (working copy)
- @@ -0,0 +1,31 @@
- +#=============================================================
- +# AIO System
- +#=============================================================
- +EnableAioSystem = True
- +
- +# Enable / Disable Name Color
- +AllowAioNameColor = True
- +AioNameColor = FF0000
- +
- +# Enable / Disable Title Color
- +AllowAioTitleColor = True
- +AioTitleColor = FF0000
- +
- +# List of Aio Skills
- +# Format : skillid,skilllvl;skillid2,skilllvl2;
- +AioSkills = 1353,1;1329,9;4702,8;1304,3;1043,1;1259,4;4551,4;4552,4;4553,4;4554,4;1374,1;1353,3;1252,3;1085,3;1410,1;1251,2;1261,2;1305,5;1306,6;1364,1;1365,1;1415,1;1416,1;1414,1;1393,3;1392,3;1087,3;1354,1;1062,2;1005,3;1243,6;1045,6;1048,6;\
- +1311,6;168,3;213,8;1007,3;1309,3;1552,3;1006,3;1229,15;1308,3;1253,3;1284,3;\
- +1009,3;1310,4;1363,1;1362,1;1397,3;1292,6;1078,6;307,1;276,1;309,1;274,1;275,1;\
- +272,1;277,1;273,1;311,1;366,1;365,1;310,1;271,1;1242,3;1257,3;1353,3;1391,3;\
- +1352,1;229,7;228,3;1077,3;1218,33;1059,3;1219,33;1388,3;1389,3;1240,3;\
- +1086,2;1032,3;1073,2;1036,2;1035,4;1068,3;1003,3;1282,2;1356,1;1355,1;1357,33;\
- +1044,3;1182,3;1191,3;1033,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;1413,1;4699,8;4700,8;4703,8;\
- +
- +# Custom item for AIO
- +AllowAIOItem = True
- +
- +# ID of the item that will be given to AIO
- +# Default: Keshanberk*Keshanberk
- +ItemIdAio = 5233
- \ No newline at end of file
- Index: java/com/l2jhellas/gameserver/handler/admincommandhandlers/AdminAio.java
- ===================================================================
- --- java/com/l2jhellas/gameserver/handler/admincommandhandlers/AdminAio.java (revision 0)
- +++ java/com/l2jhellas/gameserver/handler/admincommandhandlers/AdminAio.java (working copy)
- @@ -0,0 +1,236 @@
- +/*
- + * 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 com.l2jhellas.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 com.l2jhellas.Config;
- +import com.l2jhellas.util.database.L2DatabaseFactory;
- +import com.l2jhellas.gameserver.datatables.xml.AdminData;
- +import com.l2jhellas.gameserver.handler.IAdminCommandHandler;
- +import com.l2jhellas.gameserver.model.L2Object;
- +import com.l2jhellas.gameserver.model.L2World;
- +import com.l2jhellas.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jhellas.gameserver.network.clientpackets.Say2;
- +import com.l2jhellas.gameserver.network.serverpackets.CreatureSay;
- +
- +/**
- + * Give / remove aio status to player
- + * Changes name color and title color if enabled
- + *
- + * Uses:
- + * setaio [<player_name>] [<time_duration in days>]
- + *
- + * If <player_name> is not specified, the current target player is used.
- + *
- + * @author Danilo Nascimento
- + *
- + */
- +public class AdminAio implements IAdminCommandHandler
- +{
- + private static String[] _adminCommands = { "admin_setaio", "admin_removeaio" };
- + private final static Logger _log = Logger.getLogger(AdminAio.class.getName());
- +
- + @Override
- + public boolean useAdminCommand(String command, L2PcInstance activeChar)
- + {
- + if (command.startsWith("admin_setaio"))
- + {
- + 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();
- +
- + if(player.isAio())
- + return false;
- + }
- + 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.lostAioSkills();
- + _player.setAio(true);
- + _player.setEndTime("aio", days);
- + _player.sendPacket(new CreatureSay(0,Say2.HERO_VOICE,"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)
- + {
- + _player.getInventory().addItem("", Config.AIO_ITEMID, 1, _player, null);
- + _player.getInventory().equipItem(_player.getInventory().getItemByItemId(Config.AIO_ITEMID));
- +
- + }
- + _player.broadcastUserInfo();
- + _player.sendSkillList();
- +
- + AdminData.getInstance().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.sendMessage("Player " + _playername + " is not an AIO.");
- + return;
- + }
- +
- + _player.setAio(false);
- + _player.setAioEndTime(0);
- +
- + 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();
- +
- + _player.lostAioSkills();
- +
- + if(Config.ALLOW_AIO_ITEM)
- + {
- + _player.getInventory().destroyItemByItemId("", Config.AIO_ITEMID, 1, _player, null);
- + _player.getWarehouse().destroyItemByItemId("", Config.AIO_ITEMID, 1, _player, null);
- + }
- + _player.getAppearance().setNameColor(0xFFFF77);
- + _player.getAppearance().setTitleColor(0xFFFF77);
- + _player.broadcastUserInfo();
- + _player.sendSkillList();
- +
- + AdminData.getInstance().broadcastMessageToGMs("GM "+activeChar.getName()+" removed Aio status of player "+ _playername);
- + }
- + catch (Exception e)
- + {
- + _log.log(Level.WARNING,"Something went wrong, check log folder for details", e);
- + }
- + }
- +
- + @Override
- + public String[] getAdminCommandList()
- + {
- + return _adminCommands;
- + }
- +}
Advertisement
Add Comment
Please, Sign In to add comment