Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P aCis_datapack
- Index: tools/database_installer.sh
- ===================================================================
- --- tools/database_installer.sh (revision 6)
- +++ tools/database_installer.sh (working copy)
- @@ -88,6 +88,8 @@
- $MYG < ../sql/character_hennas.sql &> /dev/null
- $MYG < ../sql/character_macroses.sql &> /dev/null
- $MYG < ../sql/character_mail.sql &> /dev/null
- +$MYG < ../sql/character_offline_trade_items.sql &> /dev/null
- +$MYG < ../sql/character_offline_trade.sql &> /dev/null
- $MYG < ../sql/character_quests.sql &> /dev/null
- $MYG < ../sql/character_raid_points.sql &> /dev/null
- $MYG < ../sql/character_recipebook.sql &> /dev/null
- Index: sql/characters.sql
- ===================================================================
- --- sql/characters.sql (revision 9)
- +++ sql/characters.sql (working copy)
- @@ -56,6 +56,8 @@
- `death_penalty_level` SMALLINT UNSIGNED NOT NULL DEFAULT 0,
- `pvpzone_kills` SMALLINT UNSIGNED DEFAULT NULL,
- `topkiller` TINYINT UNSIGNED NOT NULL DEFAULT 0,
- + `aio` TINYINT UNSIGNED NOT NULL DEFAULT 0,
- + `vip` TINYINT UNSIGNED NOT NULL DEFAULT 0,
- PRIMARY KEY (obj_Id),
- KEY `clanid` (`clanid`)
- );
- \ No newline at end of file
- Index: tools/database_installer.bat
- ===================================================================
- --- tools/database_installer.bat (revision 6)
- +++ tools/database_installer.bat (working copy)
- @@ -67,6 +67,8 @@
- %mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/character_hennas.sql
- %mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/character_macroses.sql
- %mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/character_mail.sql
- +%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/character_offline_trade_items.sql
- +%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/character_offline_trade.sql
- %mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/character_quests.sql
- %mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/character_raid_points.sql
- %mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/character_recipebook.sql
- Index: sql/character_offline_trade.sql
- ===================================================================
- --- sql/character_offline_trade.sql (revision 0)
- +++ sql/character_offline_trade.sql (revision 0)
- @@ -0,0 +1,7 @@
- +CREATE TABLE IF NOT EXISTS `character_offline_trade` (
- + `charId` int(10) unsigned NOT NULL,
- + `time` bigint(13) unsigned NOT NULL DEFAULT '0',
- + `type` tinyint(4) NOT NULL DEFAULT '0',
- + `title` varchar(50) DEFAULT NULL,
- + PRIMARY KEY (`charId`)
- +);
- \ No newline at end of file
- Index: sql/character_offline_trade_items.sql
- ===================================================================
- --- sql/character_offline_trade_items.sql (revision 0)
- +++ sql/character_offline_trade_items.sql (revision 0)
- @@ -0,0 +1,6 @@
- +CREATE TABLE IF NOT EXISTS `character_offline_trade_items` (
- + `charId` int(10) unsigned NOT NULL,
- + `item` int(10) unsigned NOT NULL DEFAULT '0', -- itemId(for buy) & ObjectId(for sell)
- + `count` bigint(20) unsigned NOT NULL DEFAULT '0',
- + `price` bigint(20) unsigned NOT NULL DEFAULT '0'
- +);
- \ No newline at end of file
- Index: tools/full_install.sql
- ===================================================================
- --- tools/full_install.sql (revision 6)
- +++ tools/full_install.sql (working copy)
- @@ -11,6 +11,8 @@
- DROP TABLE IF EXISTS character_hennas;
- DROP TABLE IF EXISTS character_macroses;
- DROP TABLE IF EXISTS character_mail;
- +DROP TABLE IF EXISTS character_offline_trade_items;
- +DROP TABLE IF EXISTS character_offline_trade;
- DROP TABLE IF EXISTS character_quests;
- DROP TABLE IF EXISTS character_raid_points;
- DROP TABLE IF EXISTS character_recipebook;
- #P aCis_gameserver
- Index: java/net/sf/l2j/gameserver/model/actor/L2Attackable.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/actor/L2Attackable.java (revision 3)
- +++ java/net/sf/l2j/gameserver/model/actor/L2Attackable.java (working copy)
- @@ -660,6 +660,17 @@
- sp *= Config.CHAMPION_REWARDS;
- }
- + if (attacker instanceof L2PcInstance)
- + {
- + L2PcInstance a = (L2PcInstance)attacker;
- +
- + if (a.isVip())
- + {
- + exp *= Config.VIP_XP_SP_RATE;
- + sp *= Config.VIP_XP_SP_RATE;
- + }
- + }
- +
- // Check for an over-hit enabled strike
- if (attacker instanceof L2PcInstance)
- {
- @@ -770,6 +781,17 @@
- exp = tmp[0];
- sp = tmp[1];
- + if (attacker instanceof L2PcInstance)
- + {
- + L2PcInstance a = (L2PcInstance)attacker;
- +
- + if (a.isVip())
- + {
- + exp *= Config.VIP_XP_SP_RATE;
- + sp *= Config.VIP_XP_SP_RATE;
- + }
- + }
- +
- if (Config.CHAMPION_ENABLE && isChampion())
- {
- exp *= Config.CHAMPION_REWARDS;
- @@ -1084,11 +1106,29 @@
- // Applies Drop rates
- if (drop.getItemId() == 57)
- + {
- dropChance *= Config.RATE_DROP_ADENA;
- + if (lastAttacker.isVip())
- + {
- + dropChance *= Config.VIP_ADENA_RATE;
- + }
- + }
- else if (isSweep)
- + {
- dropChance *= Config.RATE_DROP_SPOIL;
- + if (lastAttacker.isVip())
- + {
- + dropChance *= Config.VIP_SPOIL_RATE;
- + }
- + }
- else
- + {
- dropChance *= isRaid() && !isRaidMinion() ? Config.RATE_DROP_ITEMS_BY_RAID : Config.RATE_DROP_ITEMS;
- + if (lastAttacker.isVip())
- + {
- + dropChance *= Config.VIP_DROP_RATE;
- + }
- + }
- if (Config.CHAMPION_ENABLE && isChampion())
- dropChance *= Config.CHAMPION_REWARDS;
- @@ -1202,9 +1242,21 @@
- int dropChance = drop.getChance();
- if (drop.getItemId() == 57)
- + {
- dropChance *= Config.RATE_DROP_ADENA;
- + if (lastAttacker.isVip())
- + {
- + dropChance *= Config.VIP_ADENA_RATE;
- + }
- + }
- else
- + {
- dropChance *= isRaid() && !isRaidMinion() ? Config.RATE_DROP_ITEMS_BY_RAID : Config.RATE_DROP_ITEMS;
- + if (lastAttacker.isVip())
- + {
- + dropChance *= Config.VIP_DROP_RATE;
- + }
- + }
- if (Config.CHAMPION_ENABLE && isChampion())
- dropChance *= Config.CHAMPION_REWARDS;
- Index: java/net/sf/l2j/gameserver/model/actor/L2Character.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/actor/L2Character.java (revision 8)
- +++ java/net/sf/l2j/gameserver/model/actor/L2Character.java (working copy)
- @@ -40,6 +40,7 @@
- import net.sf.l2j.gameserver.datatables.DoorTable;
- import net.sf.l2j.gameserver.datatables.MapRegionTable;
- import net.sf.l2j.gameserver.datatables.MapRegionTable.TeleportWhereType;
- +import net.sf.l2j.gameserver.datatables.SkillTable;
- import net.sf.l2j.gameserver.datatables.SkillTable.FrequentSkill;
- import net.sf.l2j.gameserver.handler.ISkillHandler;
- import net.sf.l2j.gameserver.handler.SkillHandler;
- @@ -64,6 +65,7 @@
- import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.SkillDat;
- import net.sf.l2j.gameserver.model.actor.instance.L2PetInstance;
- +import net.sf.l2j.gameserver.model.actor.instance.L2RaidBossInstance;
- import net.sf.l2j.gameserver.model.actor.instance.L2RiftInvaderInstance;
- import net.sf.l2j.gameserver.model.actor.knownlist.CharKnownList;
- import net.sf.l2j.gameserver.model.actor.position.CharPosition;
- @@ -721,6 +723,17 @@
- }
- }
- + if (this instanceof L2PcInstance && target instanceof L2RaidBossInstance && Config.ALLOW_BOSS_PETRIFY)
- + {
- + if (target.getLevel() < getLevel())
- + {
- + if (getLevel()-target.getLevel() >= 8)
- + {
- + SkillTable.getInstance().getInfo(1170, 1).getEffects(target, this);
- + }
- + }
- + }
- +
- // Add the L2PcInstance to _knownObjects and _knownPlayer of the target
- target.getKnownList().addKnownObject(this);
- @@ -1202,6 +1215,22 @@
- return;
- }
- +
- + if (this instanceof L2PcInstance)
- + {
- + L2PcInstance ths = (L2PcInstance)this;
- +
- + if (ths.isAio())
- + {
- + if (!ths.isInsideZone(ZONE_PEACE))
- + {
- + ths.sendMessage("AIO characters can only use skills inside peace zones.");
- + sendPacket(ActionFailed.STATIC_PACKET);
- + return;
- + }
- + }
- + }
- +
- // Override casting type
- if (skill.isSimultaneousCast() && !simultaneously)
- simultaneously = true;
- @@ -2241,10 +2270,28 @@
- /**
- * Set the Title of the L2Character. Concatens it if length > 16.
- + * Used for the custom mod pvp and pk kills on title.
- + * @param value The String to test.
- + */
- + public final void customEditTitle(String value)
- + {
- + if (value == null)
- + _title = "";
- + else
- + _title = value.length() > 16 ? value.substring(0, 15) : value;
- + }
- +
- + /**
- + * Set the Title of the L2Character. Concatens it if length > 16.
- * @param value The String to test.
- */
- public final void setTitle(String value)
- {
- + if (this instanceof L2PcInstance && Config.PVP_PK_TITLE)
- + {
- + return;
- + }
- +
- if (value == null)
- _title = "";
- else
- Index: java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminSpawn.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminSpawn.java (revision 3)
- +++ java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminSpawn.java (working copy)
- @@ -21,6 +21,8 @@
- import java.util.regex.Matcher;
- import java.util.regex.Pattern;
- +import net.sf.l2j.Config;
- +import net.sf.l2j.gameserver.Announcements;
- import net.sf.l2j.gameserver.SevenSigns;
- import net.sf.l2j.gameserver.datatables.GmListTable;
- import net.sf.l2j.gameserver.datatables.NpcTable;
- @@ -234,6 +236,10 @@
- spawn.setRespawnMinDelay(43200);
- spawn.setRespawnMaxDelay(129600);
- RaidBossSpawnManager.getInstance().addNewSpawn(spawn, 0, template.getBaseHpMax(), template.getBaseMpMax(), permanent);
- + if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
- + {
- + Announcements.announceToAll("Raid boss "+spawn.getTemplate().getName()+" has been spawned.");
- + }
- }
- else
- {
- 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)
- @@ -22,6 +22,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.instancemanager.CastleManager;
- import net.sf.l2j.gameserver.instancemanager.ClanHallManager;
- import net.sf.l2j.gameserver.instancemanager.CoupleManager;
- import net.sf.l2j.gameserver.instancemanager.DimensionalRiftManager;
- @@ -232,6 +233,60 @@
- // Attacker or spectator logging into a siege zone will be ported at town.
- if (!activeChar.isGM() && (!activeChar.isInSiege() || activeChar.getSiegeState() < 2) && activeChar.isInsideZone(L2Character.ZONE_SIEGE))
- activeChar.teleToLocation(MapRegionTable.TeleportWhereType.Town);
- +
- + if (Config.ANNOUNCE_HERO_ON_ENTER && activeChar.isHero() && !activeChar.isGM())
- + {
- + Announcements.announceToAll("Hero "+activeChar.getName()+" has logged in!");
- + }
- +
- + if (Config.ANNOUNCE_CASTLE_LORDS)
- + {
- + if (activeChar.getClan() != null)
- + {
- + if (activeChar.getClan().getLeaderName().equals(activeChar.getName()))
- + {
- + if (CastleManager.getInstance().getCastleByOwner(activeChar.getClan()) != null)
- + {
- + Announcements.announceToAll(activeChar.getName()+" leader of "+CastleManager.getInstance().getCastleByOwner(activeChar.getClan()).getName()+" has logged in!");
- + }
- + }
- + }
- + }
- +
- + if (Config.ALLOW_PVP_NAME_COLOR_SYSTEM || Config.ALLOW_PK_TITLE_COLOR_SYSTEM)
- + {
- + activeChar.colorsCheck();
- + }
- +
- + if (activeChar.isAio() || activeChar.isVip())
- + {
- + activeChar.checkAioVipColors();
- + }
- +
- + if (Config.PVP_PK_TITLE && Config.ALLOW_NEW_CHAR_TITLE)
- + {
- + if (Config.ALLOW_TITLE_PANEL)
- + {
- + StringBuilder debian = new StringBuilder();
- + NpcHtmlMessage d = new NpcHtmlMessage(1);
- +
- + debian.append("<html><head></head>" +
- + "<body>" +
- + "<center>" +
- + "This panel, allows you to change your title.<br>" +
- + "<br>" +
- + "Option 1:<br>" +
- + "<button value=\"Normal Title\" action=\"bypass -h title1\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">" +
- + "<br>" +
- + "Option 2:<br>" +
- + "<button value=\"PvP/PK Title\" action=\"bypass -h title2\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">" +
- + "<br>" +
- + "</center></body></html>");
- +
- + d.setHtml(debian.toString());
- + activeChar.sendPacket(d);
- + }
- + }
- }
- private static void engage(L2PcInstance cha)
- 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)
- @@ -50,6 +50,12 @@
- {
- player.sendPacket(ActionFailed.STATIC_PACKET);
- + if (player.isAio() && !Config.ALLOW_AIO_USE_GK)
- + {
- + player.sendMessage("AIO players are not allowed to use Gatekeepers.");
- + return;
- + }
- +
- int condition = validateCondition(player);
- StringTokenizer st = new StringTokenizer(command, " ");
- Index: java/net/sf/l2j/gameserver/GameServer.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/GameServer.java (revision 14)
- +++ java/net/sf/l2j/gameserver/GameServer.java (working copy)
- @@ -49,6 +49,7 @@
- import net.sf.l2j.gameserver.datatables.MapRegionTable;
- import net.sf.l2j.gameserver.datatables.NpcTable;
- import net.sf.l2j.gameserver.datatables.NpcWalkerRoutesTable;
- +import net.sf.l2j.gameserver.datatables.OfflineTradersTable;
- import net.sf.l2j.gameserver.datatables.PetDataTable;
- import net.sf.l2j.gameserver.datatables.SkillTable;
- import net.sf.l2j.gameserver.datatables.SkillTreeTable;
- @@ -94,6 +95,8 @@
- import net.sf.l2j.gameserver.model.PartyMatchWaitingList;
- import net.sf.l2j.gameserver.model.entity.Castle;
- import net.sf.l2j.gameserver.model.entity.Hero;
- +import net.sf.l2j.gameserver.model.entity.HzVoteReward;
- +import net.sf.l2j.gameserver.model.entity.TzVoteReward;
- import net.sf.l2j.gameserver.model.entity.l2seresin.events.Kino;
- import net.sf.l2j.gameserver.model.entity.tasks.TaskLoader;
- import net.sf.l2j.gameserver.model.olympiad.Olympiad;
- @@ -281,6 +284,26 @@
- if (Config.ALLOW_WEDDING)
- CoupleManager.getInstance();
- + if (Config.ALLOW_HOPZONE_VOTE_REWARD)
- + {
- + _log.config("Hopzone vote reward is enabled");
- + HzVoteReward.getInstance();
- + }
- + else
- + {
- + _log.config("Hopzone vote reward is disabled");
- + }
- +
- + if (Config.ALLOW_TOPZONE_VOTE_REWARD)
- + {
- + _log.config("Topzone vote reward is enabled");
- + TzVoteReward.getInstance();
- + }
- + else
- + {
- + _log.config("Topzone vote reward is disabled");
- + }
- +
- Util.printSection("Custom");
- TaskLoader.getInstance();
- if (Config.ALLOW_KINO)
- @@ -302,6 +325,9 @@
- KnownListUpdateTaskManager.getInstance();
- MovieMakerManager.getInstance();
- + if ((Config.OFFLINE_TRADE_ENABLE || Config.OFFLINE_CRAFT_ENABLE) && Config.RESTORE_OFFLINERS)
- + OfflineTradersTable.restoreOfflineTraders();
- +
- if (Config.DEADLOCK_DETECTOR)
- {
- _log.info("Deadlock detector is enabled. Timer: " + Config.DEADLOCK_CHECK_INTERVAL + "s.");
- 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) || (Config.WAR_LEGEND_AURA && _activeChar.killingSpreePvps >= Config.KILLS_TO_GET_WAR_LEGEND_AURA)) ? 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/gameserver/handler/admincommandhandlers/AdminVip.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminVip.java (revision 0)
- +++ java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminVip.java (revision 0)
- @@ -0,0 +1,72 @@
- +/*
- + * 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
- + */
- +package net.sf.l2j.gameserver.handler.admincommandhandlers;
- +
- +import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- +
- +/**
- + * @author Anarchy
- + *
- + */
- +public class AdminVip implements IAdminCommandHandler
- +{
- + private static final String[] ADMIN_COMMANDS = { "setvip" };
- +
- + @Override
- + public boolean useAdminCommand(String command, L2PcInstance activeChar)
- + {
- + if (command.equals("setvip"))
- + {
- + Object target = activeChar.getTarget();
- +
- + if (target == null)
- + {
- + activeChar.sendMessage("Invalid target.");
- + return false;
- + }
- +
- + if (!(target instanceof L2PcInstance))
- + {
- + activeChar.sendMessage("Invalid target.");
- + return false;
- + }
- +
- + L2PcInstance trg = (L2PcInstance)target;
- +
- + if (trg.isVip())
- + {
- + trg.setVip(false);
- + activeChar.sendMessage("You have removed the VIP status from "+trg.getName()+".");
- + }
- + else
- + {
- + trg.setVip(true);
- + activeChar.sendMessage("You have given VIP status to "+trg.getName()+".");
- + }
- +
- + return true;
- + }
- +
- + return true;
- + }
- +
- + @Override
- + public String[] getAdminCommandList()
- + {
- + return ADMIN_COMMANDS;
- + }
- +
- +}
- Index: config/custom.properties
- ===================================================================
- --- config/custom.properties (revision 0)
- +++ config/custom.properties (revision 0)
- @@ -0,0 +1,210 @@
- +=================================================================================================
- +#################################################################################################
- +=================================================================================================
- +# Oly Grade Restriction #
- +=================================================================================================
- +#################################################################################################
- +=================================================================================================
- +# Oly Grade Restriction #
- +AllowOlyGradeRestr= True
- +ArmorGradeRestr= B
- +WeaponGradeRestr= A
- +MaxEnchantRestr = 8
- +
- +# Killing spree.
- +AllowKillingSpree = True
- +# Killing spree values (pvp,message;pvp,message;).
- +KillingSpreeReward = 3,is on a killing spree!;6,is on a rampage!;
- +
- +# Pvp & pk kills on title.
- +PvpPkTitle = False
- +#Title Prefixes. If commented - "0 | 0" else "PvpTitlePrefix0PkTitlePrefix0"
- +PvPTitlePrefix =
- +PkTitlePrefix =
- +
- +# Announce hero character on enter.
- +AnnounceHeroOnEnter = True
- +
- +# Announce castle lord on enter.
- +AnnounceCastleLords = True
- +
- +# War Legend Configs
- +WarLegendAura = True
- +KillsToGetWarLegendAura = 10
- +
- +# ================================================================
- +# Offline trade & craft
- +# ================================================================
- +
- +# Enable or disable offline trade mode
- +# Default: False
- +OfflineTradeEnable = True
- +
- +# Enable or disable offline craft mode
- +# Default: False
- +OfflineCraftEnable = True
- +
- +# Offline name color
- +OfflineSetNameColor = True
- +OfflineNameColor = 808080
- +
- +# Allow fame for characters in offline mode
- +# Default: False
- +OfflineFame = True
- +
- +# Restore offline traders/crafters after restart/shutdown.
- +# Default: false.
- +RestoreOffliners = True
- +
- +# Restore offline characters for X days
- +#Default: 10
- +OfflineMaxDays = 10
- +
- +#Disconnect shop after finished selling, buying.
- +#Default: True
- +OfflineDisconnectFinished = True
- +
- +# PvP name color system.
- +AllowPvpNameColorSystem = False
- +# PvP name colors, works like: pvps,color;pvps,color;
- +PvpColors = 100,FFFF00;200,FF00FF
- +
- +# PvP title color system.
- +AllowPkTitleColorSystem = False
- +# Pk title colors, works like: pks,color;pks,color;
- +PkColors = 100,FFFF00;200,FF00FF
- +
- +# Custom starting spawn location.
- +AllowCustomSpawnLocation = True
- +CustomSpawnLocation = 113852,-108766,-851
- +
- +# Social actions for words: lol, hi, haha, yes, no
- +# To add new words go to java/net/sf/l2j/gameserver/handler/chathandlers/ChatAll.java
- +AllowSocialActions = True
- +
- +# Allow boss attack petrify if 8 lvls lower than char.
- +AllowBossPetrify = True
- +
- +# Custom title on new chars.
- +# TO EXW VALEI FALSE GT EINAI TO ALO TRUE POU SOU ELEGA KAI MPOREI NA EXEI ERROR
- +AllowNewCharTitle = False
- +NewCharTitle = L2 Mendrion
- +
- +# Hopzone vote reward.
- +AllowHopzoneVoteReward = False
- +# Vote reward server link.
- +HopzoneServerLink = http://l2.hopzone.net/lineage2/details/74078/L2World-Servers/
- +# First page of servers list link.
- +HopzoneFirstPageLink = http://l2.hopzone.net/lineage2/
- +# Votes for next reward needed.
- +HopzoneVotesDifference = 5
- +# Rank needed for server to be on first page.
- +HopzoneFirstPageRankNeeded = 15
- +# Minutes between rewards.
- +# Eg. You put 5 it checks every 5 minutes for reward.
- +HopzoneRewardCheckTime = 5
- +# Small reward(s).
- +HopzoneSmallReward = 57,100000000;
- +# Big reward(s).
- +HopzoneBigReward = 3470,1;
- +# Dualboxes allowed.
- +HopzoneDuaboxesAllowed = 1
- +
- +# Topzone vote reward.
- +AllowTopzoneVoteReward = False
- +# Vote reward server link.
- +TopzoneServerLink = http://l2topzone.com/lineage2/server-info/6296/L2ToxiccomProMMORPG.html/
- +# First page of servers list link.
- +TopzoneFirstPageLink = http://l2topzone.com/lineage2/server-list/top.html/
- +# Votes for next reward needed.
- +TopzoneVotesDifference = 5
- +# Rank needed for server to be on first page.
- +TopzoneFirstPageRankNeeded = 15
- +# Minutes between rewards.
- +# Eg. You put 5 it checks every 5 minutes for reward.
- +TopzoneRewardCheckTime = 5
- +# Small reward(s).
- +TopzoneSmallReward = 57,100000000;
- +# Big reward(s).
- +TopzoneBigReward = 3470,1;
- +# Dualboxes allowed.
- +TopzoneDuaboxesAllowed = 1
- +
- +# -----------------------------------------
- +# Aio System -
- +# -----------------------------------------
- +# Enable / Disable Aio System (//setaio)
- +EnableAioSystem = True
- +# Enable / Disable Name Color
- +AllowAioNameColor = True
- +AioNameColor = 88AA88
- +# Enable / Disable Title Color
- +AllowAioTitleColor = True
- +AioTitleColor = 88AA88
- +# List of Aio Skills
- +# Format : skillid,skilllvl;skillid2,skilllvl2;....skillidn,skilllvln
- +AioSkills = 1085,3;1304,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;1217,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
- +# Aio Buffers can use GK?
- +AllowAioUseGk = False
- +# Aio Buffers can speak to Class Master?
- +AllowAioUseClassMaster = False
- +
- +# ---------------------------
- +# - VIP Config -
- +# ---------------------------
- +# Command in game: //setvip
- +# If it is true then VIPs will have their name and title colored.
- +VIPColorEnabled = False
- +# VIP Name's Color.
- +VIPColorName = FF33AA
- +# VIP Title's Color.
- +VIPTitleColor = FFAA33
- +# VIP Xp/Sp Rate
- +VIPXpSpRate = 1.5
- +# VIP Adena rate
- +VIPAdenaRate = 1.5
- +# VIP drop rate
- +VIPDropRate = 1.5
- +# VIP spoil rate
- +VIPSpoilRate = 1.5
- +
- +#====================================
- +# Anti Farm System
- +#====================================
- +# You must put True to active the AntiFarm mod.
- +AntiFarmEnabled = True
- +# You must active AntiFarmEnabled = True to enable this mod.
- +# AntiFarm for Party, IP, Clan and Ally.
- +AntiFarmParty = True
- +AntiFarmIP = True
- +AntiFarmClanAlly = True
- +# You must active AntiFarmEnabled = True to enable this mod.
- +# AntiFarm if player has level < AntiFarmMaxLvlDiff.
- +AntiFarmLvlDiff = False
- +AntiFarmMaxLvlDiff = 30
- +# You must active AntiFarmEnabled = True to enable this mod.
- +# AntiFarm if player has Pdef < AntiFarmMaxPdefDiff.
- +AntiFarmPdefDiff = False
- +AntiFarmMaxPdefDiff = 300
- +# You must active AntiFarmEnabled = True to enable this mod.
- +# AntiFarm if player has Patk < AntiFarmMaxPatkDiff.
- +AntiFarmPatkDiff = False
- +AntiFarmMaxPatkDiff = 300
- +# If true summons don't give any reward (avoid pvp/pk farm)
- +AntiFarmSummon = False
- +
- +# Whether or not the announcement to all players about the appearance in the world raidboss (spawn)
- +AnnounceToAllSpawnRb = True
- +
- +# Title panel.
- +# It gives you 2 options to choose about your title.
- +# In order this to work correct, you need to have both pvp/pk on title enabled and custom title.
- +AllowTitlePanel = True
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/model/actor/instance/L2OlympiadManagerInstance.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/actor/instance/L2OlympiadManagerInstance.java (revision 3)
- +++ java/net/sf/l2j/gameserver/model/actor/instance/L2OlympiadManagerInstance.java (working copy)
- @@ -14,9 +14,11 @@
- */
- package net.sf.l2j.gameserver.model.actor.instance;
- +import net.sf.l2j.Config;
- import net.sf.l2j.gameserver.model.L2ItemInstance;
- import net.sf.l2j.gameserver.model.L2Multisell;
- import net.sf.l2j.gameserver.model.entity.Hero;
- +import net.sf.l2j.gameserver.model.itemcontainer.Inventory;
- import net.sf.l2j.gameserver.model.olympiad.CompetitionType;
- import net.sf.l2j.gameserver.model.olympiad.Olympiad;
- import net.sf.l2j.gameserver.model.olympiad.OlympiadGameManager;
- @@ -160,11 +162,17 @@
- break;
- case 4: // register non classed based
- - OlympiadManager.getInstance().registerNoble(player, CompetitionType.NON_CLASSED);
- + if (meetsRequirements(player))
- + {
- + OlympiadManager.getInstance().registerNoble(player, CompetitionType.NON_CLASSED);
- + }
- break;
- case 5: // register classed based
- - OlympiadManager.getInstance().registerNoble(player, CompetitionType.CLASSED);
- + if (meetsRequirements(player))
- + {
- + OlympiadManager.getInstance().registerNoble(player, CompetitionType.CLASSED);
- + }
- break;
- case 6: // request tokens reward
- @@ -321,4 +329,106 @@
- else
- super.onBypassFeedback(player, command);
- }
- +
- + public boolean meetsRequirements(L2PcInstance p)
- + {
- + if (Config.ALLOW_OLY_GRADE_RESTR)
- + {
- + // Grade checks.
- + if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LHAND).getItem().getCrystalType() > Config.WEAPON_GRADE_RESTR)
- + {
- + p.sendMessage("You may not register for the Olympiad, as your weapon's grade is not the appropriate.");
- + return false;
- + }
- + if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST).getItem().getCrystalType() > Config.ARMOR_GRADE_RESTR)
- + {
- + p.sendMessage("You may not register for the Olympiad, as your armor's grade is not the appropriate.");
- + return false;
- + }
- + if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_HEAD).getItem().getCrystalType() > Config.ARMOR_GRADE_RESTR)
- + {
- + p.sendMessage("You may not register for the Olympiad, as your armor's grade is not the appropriate.");
- + return false;
- + }
- + if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_FEET).getItem().getCrystalType() > Config.ARMOR_GRADE_RESTR)
- + {
- + p.sendMessage("You may not register for the Olympiad, as your armor's grade is not the appropriate.");
- + return false;
- + }
- + if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_GLOVES).getItem().getCrystalType() > Config.ARMOR_GRADE_RESTR)
- + {
- + p.sendMessage("You may not register for the Olympiad, as your armor's grade is not the appropriate.");
- + return false;
- + }
- + if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEGS).getItem().getCrystalType() > Config.ARMOR_GRADE_RESTR)
- + {
- + p.sendMessage("You may not register for the Olympiad, as your armor's grade is not the appropriate.");
- + return false;
- + }
- +
- + // Enchant checks.
- + if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LHAND).getEnchantLevel() > Config.MAX_ENCHANT_RESTR)
- + {
- + p.sendMessage("You may not register for the Olympiad, as your weapon's enchant level is not the appropriate.");
- + return false;
- + }
- + if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST).getEnchantLevel() > Config.MAX_ENCHANT_RESTR)
- + {
- + p.sendMessage("You may not register for the Olympiad, as your armor's enchant level is not the appropriate.");
- + return false;
- + }
- + if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_HEAD).getEnchantLevel() > Config.MAX_ENCHANT_RESTR)
- + {
- + p.sendMessage("You may not register for the Olympiad, as your armor's enchant level is not the appropriate.");
- + return false;
- + }
- + if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_FEET).getEnchantLevel() > Config.MAX_ENCHANT_RESTR)
- + {
- + p.sendMessage("You may not register for the Olympiad, as your armor's enchant level is not the appropriate.");
- + return false;
- + }
- + if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_GLOVES).getEnchantLevel() > Config.MAX_ENCHANT_RESTR)
- + {
- + p.sendMessage("You may not register for the Olympiad, as your armor's enchant level is not the appropriate.");
- + return false;
- + }
- + if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEGS).getEnchantLevel() > Config.MAX_ENCHANT_RESTR)
- + {
- + p.sendMessage("You may not register for the Olympiad, as your armor's enchant level is not the appropriate.");
- + return false;
- + }
- + if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_UNDER).getEnchantLevel() > Config.MAX_ENCHANT_RESTR)
- + {
- + p.sendMessage("You may not register for the Olympiad, as your tattoo's enchant level is not the appropriate.");
- + return false;
- + }
- + if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_NECK).getEnchantLevel() > Config.MAX_ENCHANT_RESTR)
- + {
- + p.sendMessage("You may not register for the Olympiad, as your necklace's enchant level is not the appropriate.");
- + return false;
- + }
- + if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEAR).getEnchantLevel() > Config.MAX_ENCHANT_RESTR)
- + {
- + p.sendMessage("You may not register for the Olympiad, as your earring's enchant level is not the appropriate.");
- + return false;
- + }
- + if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_REAR).getEnchantLevel() > Config.MAX_ENCHANT_RESTR)
- + {
- + p.sendMessage("You may not register for the Olympiad, as your earring's enchant level is not the appropriate.");
- + return false;
- + }
- + if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LFINGER).getEnchantLevel() > Config.MAX_ENCHANT_RESTR)
- + {
- + p.sendMessage("You may not register for the Olympiad, as your ring's enchant level is not the appropriate.");
- + return false;
- + }
- + if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RFINGER).getEnchantLevel() > Config.MAX_ENCHANT_RESTR)
- + {
- + p.sendMessage("You may not register for the Olympiad, as your ring's enchant level is not the appropriate.");
- + return false;
- + }
- + }
- +
- + return true;
- + }
- }
- \ No newline at end of file
- 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) || (Config.WAR_LEGEND_AURA && _activeChar.killingSpreePvps >= Config.KILLS_TO_GET_WAR_LEGEND_AURA) ? 1 : 0); // 0x01: Hero Aura
- writeC(_activeChar.isFishing() ? 1 : 0); // Fishing Mode
- 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)
- @@ -20,6 +20,7 @@
- import net.sf.l2j.Config;
- 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;
- @@ -67,6 +68,7 @@
- import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminTarget;
- import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminTeleport;
- import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminUnblockIp;
- +import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminVip;
- import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminZone;
- public class AdminCommandHandler
- @@ -131,6 +133,11 @@
- registerAdminCommandHandler(new AdminTeleport());
- registerAdminCommandHandler(new AdminUnblockIp());
- registerAdminCommandHandler(new AdminZone());
- + if (Config.ENABLE_AIO_SYSTEM)
- + {
- + registerAdminCommandHandler(new AdminAio());
- + }
- + registerAdminCommandHandler(new AdminVip());
- }
- public void registerAdminCommandHandler(IAdminCommandHandler handler)
- Index: java/net/sf/l2j/gameserver/network/L2GameClient.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/L2GameClient.java (revision 3)
- +++ java/net/sf/l2j/gameserver/network/L2GameClient.java (working copy)
- @@ -25,6 +25,7 @@
- import java.util.concurrent.ScheduledFuture;
- import java.util.concurrent.locks.ReentrantLock;
- import java.util.logging.Level;
- +import java.util.logging.LogRecord;
- import java.util.logging.Logger;
- import net.sf.l2j.Config;
- @@ -450,9 +451,19 @@
- public void close(L2GameServerPacket gsp)
- {
- + if (getConnection() == null)
- + return; // offline shop
- +
- getConnection().close(gsp);
- }
- + public void close(L2GameServerPacket[] gspArray)
- + {
- + if (getConnection() == null)
- + return; // offline shop
- + getConnection().close(gspArray);
- + }
- +
- /**
- * @param charslot
- * @return
- @@ -548,6 +559,23 @@
- setDetached(true);
- fast = !getActiveChar().isInCombat() && !getActiveChar().isLocked();
- }
- + L2PcInstance player = L2GameClient.this.getActiveChar();
- + if ((player.isInStoreMode() && Config.OFFLINE_TRADE_ENABLE) || (player.isInCraftMode() && Config.OFFLINE_CRAFT_ENABLE))
- + {
- + player.leaveParty();
- + if (Config.OFFLINE_SET_NAME_COLOR)
- + {
- + player.getAppearance().setNameColor(Config.OFFLINE_NAME_COLOR);
- + player.broadcastUserInfo();
- + }
- + if (player.getOfflineStartTime() == 0)
- + player.setOfflineStartTime(System.currentTimeMillis());
- +
- + LogRecord record = new LogRecord(Level.INFO, "Entering offline mode");
- + record.setParameters(new Object[]{L2GameClient.this});
- + _log.log(record);
- + return;
- + }
- cleanMe(fast);
- }
- catch (Exception e1)
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (revision 4)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (working copy)
- @@ -201,6 +201,15 @@
- bh.handleBypass(_command, activeChar);
- }
- + else if(_command.startsWith("title1"))
- + {
- + activeChar.customEditTitle(Config.NEW_CHAR_TITLE);
- + activeChar.choseNormalTitle = true;
- + }
- + else if(_command.startsWith("title2"))
- + {
- + activeChar.customEditTitle(Config.PVP_TITLE_PREFIX+" "+activeChar.getPvpKills()+" | "+Config.PK_TITLE_PREFIX+" "+activeChar.getPkKills());
- + }
- }
- catch (Exception e)
- {
- Index: java/net/sf/l2j/gameserver/model/entity/TzVoteReward.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/entity/TzVoteReward.java (revision 0)
- +++ java/net/sf/l2j/gameserver/model/entity/TzVoteReward.java (revision 0)
- @@ -0,0 +1,303 @@
- +/*
- + * 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
- + */
- +package net.sf.l2j.gameserver.model.entity;
- +
- +import java.io.BufferedReader;
- +import java.io.InputStreamReader;
- +import java.net.URL;
- +import java.net.URLConnection;
- +import java.util.Collection;
- +import java.util.HashMap;
- +
- +import net.sf.l2j.Config;
- +import net.sf.l2j.gameserver.Announcements;
- +import net.sf.l2j.gameserver.ThreadPoolManager;
- +import net.sf.l2j.gameserver.model.L2World;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- +/**
- + * @author Anarchy
- + *
- + */
- +public class TzVoteReward
- +{
- + // Configurations.
- + private static String topzoneUrl = Config.TOPZONE_SERVER_LINK;
- + private static String page1Url = Config.TOPZONE_FIRST_PAGE_LINK;
- + private static int voteRewardVotesDifference = Config.TOPZONE_VOTES_DIFFERENCE;
- + private static int firstPageRankNeeded = Config.TOPZONE_FIRST_PAGE_RANK_NEEDED;
- + private static int checkTime = 60*1000*Config.TOPZONE_REWARD_CHECK_TIME;
- +
- + // Don't-touch variables.
- + private static int lastVotes = 0;
- + @SuppressWarnings("unused")
- + private static HashMap<String, Integer> playerIps = new HashMap<String, Integer>();
- +
- + public static void updateConfigurations()
- + {
- + topzoneUrl = Config.TOPZONE_SERVER_LINK;
- + page1Url = Config.TOPZONE_FIRST_PAGE_LINK;
- + voteRewardVotesDifference = Config.TOPZONE_VOTES_DIFFERENCE;
- + firstPageRankNeeded = Config.TOPZONE_FIRST_PAGE_RANK_NEEDED;
- + checkTime = 60*1000*Config.TOPZONE_REWARD_CHECK_TIME;
- + }
- +
- + public static void getInstance()
- + {
- + System.out.println("Vote reward system initialized.");
- + ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Runnable()
- + {
- + @SuppressWarnings("synthetic-access")
- + @Override
- + public void run()
- + {
- + if (Config.ALLOW_TOPZONE_VOTE_REWARD)
- + {
- + reward();
- + }
- + else
- + {
- + return;
- + }
- + }
- + }, checkTime/2, checkTime);
- + }
- +
- + private static void reward()
- + {
- + int firstPageVotes = getFirstPageRankVotes();
- + int currentVotes = getVotes();
- +
- + if (firstPageVotes == -1 || currentVotes == -1)
- + {
- + if (firstPageVotes == -1)
- + {
- + System.out.println("There was a problem on getting votes from server with rank "+firstPageRankNeeded+".");
- + }
- + if (currentVotes == -1)
- + {
- + System.out.println("There was a problem on getting server votes.");
- + }
- +
- + return;
- + }
- +
- + if (lastVotes == 0)
- + {
- + lastVotes = currentVotes;
- + Announcements.getInstance();
- + Announcements.announceToAll("Topzone's vote count is "+currentVotes+".");
- + Announcements.getInstance();
- + Announcements.announceToAll("We need "+((lastVotes+voteRewardVotesDifference)-currentVotes)+" vote(s) for reward.");
- + if (firstPageVotes-lastVotes <= 0)
- + {
- + Announcements.getInstance();
- + Announcements.announceToAll("We are in the first page of topzone, reward will be big.");
- + }
- + else
- + {
- + Announcements.getInstance();
- + Announcements.announceToAll("We need "+(firstPageVotes-lastVotes)+" vote(s) for big reward.");
- + }
- + return;
- + }
- +
- + if (currentVotes >= lastVotes+voteRewardVotesDifference)
- + {
- + Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().values();
- + if (firstPageVotes-currentVotes <= 0)
- + {
- + Announcements.getInstance();
- + Announcements.announceToAll("Everyone has been rewarded with big reward.");
- + Announcements.getInstance();
- + Announcements.announceToAll("Topzone's vote count is "+currentVotes+".");
- + for (L2PcInstance p : pls)
- + {
- + boolean canReward = false;
- + String pIp = p.getClient().getConnection().getInetAddress().getHostAddress();
- + if (playerIps.containsKey(pIp))
- + {
- + int count = playerIps.get(pIp);
- + if (count < Config.TOPZONE_DUALBOXES_ALLOWED)
- + {
- + playerIps.remove(pIp);
- + playerIps.put(pIp, count+1);
- + canReward = true;
- + }
- + }
- + else
- + {
- + canReward = true;
- + playerIps.put(pIp, 1);
- + }
- + if (canReward)
- + {
- + for (int i : Config.TOPZONE_BIG_REWARD.keySet())
- + {
- + p.addItem("Vote reward.", i, Config.TOPZONE_BIG_REWARD.get(i), p, true);
- + }
- + }
- + else
- + {
- + p.sendMessage("Already "+Config.TOPZONE_DUALBOXES_ALLOWED+" character(s) of your ip have been rewarded, so this character won't be rewarded.");
- + }
- + }
- + playerIps.clear();
- + }
- + else
- + {
- + Announcements.getInstance();
- + Announcements.announceToAll("Everyone has been rewarded with small reward.");
- + Announcements.getInstance();
- + Announcements.announceToAll("Topzone's vote count is "+currentVotes+".");
- + Announcements.getInstance();
- + Announcements.announceToAll("We need "+(firstPageVotes-currentVotes)+" vote(s) for big reward.");
- + for (L2PcInstance p : pls)
- + {
- + boolean canReward = false;
- + String pIp = p.getClient().getConnection().getInetAddress().getHostAddress();
- + if (playerIps.containsKey(pIp))
- + {
- + int count = playerIps.get(pIp);
- + if (count < Config.TOPZONE_DUALBOXES_ALLOWED)
- + {
- + playerIps.remove(pIp);
- + playerIps.put(pIp, count+1);
- + canReward = true;
- + }
- + }
- + else
- + {
- + canReward = true;
- + playerIps.put(pIp, 1);
- + }
- + if (canReward)
- + {
- + for (int i : Config.TOPZONE_SMALL_REWARD.keySet())
- + {
- + p.addItem("Vote reward.", i, Config.TOPZONE_SMALL_REWARD.get(i), p, true);
- + }
- + }
- + else
- + {
- + p.sendMessage("Already "+Config.TOPZONE_DUALBOXES_ALLOWED+" character(s) of your ip have been rewarded, so this character won't be rewarded.");
- + }
- + }
- + playerIps.clear();
- + }
- +
- + lastVotes = currentVotes;
- + }
- + else
- + {
- + if (firstPageVotes-currentVotes <= 0)
- + {
- + Announcements.getInstance();
- + Announcements.announceToAll("Topzone's vote count is "+currentVotes+".");
- + Announcements.getInstance();
- + Announcements.announceToAll("We need "+((lastVotes+voteRewardVotesDifference)-currentVotes)+" vote(s) for big reward.");
- + }
- + else
- + {
- + Announcements.getInstance();
- + Announcements.announceToAll("Topzone's vote count is "+currentVotes+".");
- + Announcements.getInstance();
- + Announcements.announceToAll("We need "+((lastVotes+voteRewardVotesDifference)-currentVotes)+" vote(s) for small reward.");
- + Announcements.getInstance();
- + Announcements.announceToAll("We need "+(firstPageVotes-currentVotes)+" vote(s) for big reward.");
- + }
- + }
- + }
- +
- + private static int getFirstPageRankVotes()
- + {
- + InputStreamReader isr = null;
- + BufferedReader br = null;
- +
- + try
- + {
- + URLConnection con = new URL(page1Url).openConnection();
- + con.addRequestProperty("User-Agent", "Mozilla/4.76");
- + isr = new InputStreamReader(con.getInputStream());
- + br = new BufferedReader(isr);
- +
- + String line;
- + int i = 0;
- + while ((line = br.readLine()) != null)
- + {
- + if (line.contains("<td><div align=\"center\">"+firstPageRankNeeded+"</div></td>"))
- + {
- + i++;
- + }
- + if (line.contains("<td><div align=\"center\">") && i == 1)
- + {
- + i++;
- + }
- + if (line.contains("<td><div align=\"center\">") && i == 2)
- + {
- + i = 0;
- + int votes = Integer.valueOf(line.split(">")[2].replace("</div", ""));
- + return votes;
- + }
- + }
- +
- + br.close();
- + isr.close();
- + }
- + catch (Exception e)
- + {
- + System.out.println(e);
- + System.out.println("Error while getting server vote count.");
- + }
- +
- + return -1;
- + }
- +
- + private static int getVotes()
- + {
- + InputStreamReader isr = null;
- + BufferedReader br = null;
- +
- + try
- + {
- + URLConnection con = new URL(topzoneUrl).openConnection();
- + con.addRequestProperty("User-Agent", "Mozilla/4.76");
- + isr = new InputStreamReader(con.getInputStream());
- + br = new BufferedReader(isr);
- +
- + boolean got = false;
- +
- + String line;
- + while ((line = br.readLine()) != null)
- + {
- + if (line.contains("<tr><td><div align=\"center\"><b><font style=\"font-size:14px;color:#018BC1;\"") && !got)
- + {
- + got = true;
- + int votes = Integer.valueOf(line.split("=\"font-size:14px;color:#018BC1;\">")[1].replace("</font></b></div></td></tr>", ""));
- + return votes;
- + }
- + }
- +
- + br.close();
- + isr.close();
- + }
- + catch (Exception e)
- + {
- + System.out.println(e);
- + System.out.println("Error while getting server vote count.");
- + }
- +
- + return -1;
- + }
- +}
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/handler/chathandlers/ChatAll.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/chathandlers/ChatAll.java (revision 4)
- +++ java/net/sf/l2j/gameserver/handler/chathandlers/ChatAll.java (working copy)
- @@ -23,6 +23,7 @@
- import net.sf.l2j.gameserver.model.BlockList;
- import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
- +import net.sf.l2j.gameserver.network.serverpackets.SocialAction;
- /**
- * A chat handler
- @@ -87,6 +88,34 @@
- }
- activeChar.sendPacket(cs);
- +
- + if (Config.ALLOW_SOCIAL_ACTIONS)
- + {
- + if (text.equalsIgnoreCase("lol") && !activeChar.isAttackingNow() && !activeChar.isRunning() && !activeChar.isCastingNow())
- + {
- + activeChar.broadcastPacket(new SocialAction(activeChar, 10));
- + }
- +
- + if (text.equalsIgnoreCase("hi") && !activeChar.isAttackingNow() && !activeChar.isRunning() && !activeChar.isCastingNow())
- + {
- + activeChar.broadcastPacket(new SocialAction(activeChar, 2));
- + }
- +
- + if (text.equalsIgnoreCase("haha") && !activeChar.isAttackingNow() && !activeChar.isRunning() && !activeChar.isCastingNow())
- + {
- + activeChar.broadcastPacket(new SocialAction(activeChar, 10));
- + }
- +
- + if (text.equalsIgnoreCase("yes") && !activeChar.isAttackingNow() && !activeChar.isRunning() && !activeChar.isCastingNow())
- + {
- + activeChar.broadcastPacket(new SocialAction(activeChar, 6));
- + }
- +
- + if (text.equalsIgnoreCase("no") && !activeChar.isAttackingNow() && !activeChar.isRunning() && !activeChar.isCastingNow())
- + {
- + activeChar.broadcastPacket(new SocialAction(activeChar, 5));
- + }
- + }
- }
- }
- Index: java/net/sf/l2j/gameserver/model/actor/instance/L2VillageMasterInstance.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/actor/instance/L2VillageMasterInstance.java (revision 3)
- +++ java/net/sf/l2j/gameserver/model/actor/instance/L2VillageMasterInstance.java (working copy)
- @@ -70,6 +70,12 @@
- @Override
- public void onBypassFeedback(L2PcInstance player, String command)
- {
- + if (player.isAio() && !Config.ALLOW_AIO_USE_CLASS_MASTER)
- + {
- + player.sendMessage("AIO players are not allowed to use the class masters.");
- + return;
- + }
- +
- String[] commandStr = command.split(" ");
- String actualCommand = commandStr[0];
- Index: java/net/sf/l2j/gameserver/network/clientpackets/CharacterCreate.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/CharacterCreate.java (revision 12)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/CharacterCreate.java (working copy)
- @@ -172,8 +172,29 @@
- L2PcTemplate template = newChar.getTemplate();
- newChar.addAdena("Init", Config.STARTING_ADENA, null, false);
- - newChar.setXYZInvisible(template.spawnX, template.spawnY, template.spawnZ);
- - newChar.setTitle("");
- + if (!Config.ALLOW_CUSTOM_SPAWN_LOCATION)
- + {
- + newChar.setXYZInvisible(template.spawnX, template.spawnY, template.spawnZ);
- + }
- + else
- + {
- + newChar.setXYZInvisible(Config.CUSTOM_SPAWN_LOCATION[0], Config.CUSTOM_SPAWN_LOCATION[1], Config.CUSTOM_SPAWN_LOCATION[2]);
- + }
- + if (!Config.PVP_PK_TITLE)
- + {
- + if (!Config.ALLOW_NEW_CHAR_TITLE)
- + {
- + newChar.setTitle("");
- + }
- + else
- + {
- + newChar.setTitle(Config.NEW_CHAR_TITLE);
- + }
- + }
- + else
- + {
- + newChar.customEditTitle(Config.PVP_TITLE_PREFIX+" "+newChar.getPvpKills()+" | "+Config.PK_TITLE_PREFIX+" "+newChar.getPkKills());
- + }
- newChar.registerShortCut(new L2ShortCut(0, 0, 3, 2, -1, 1)); // attack shortcut
- newChar.registerShortCut(new L2ShortCut(3, 0, 3, 5, -1, 1)); // take shortcut
- Index: java/net/sf/l2j/gameserver/Shutdown.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/Shutdown.java (revision 3)
- +++ java/net/sf/l2j/gameserver/Shutdown.java (working copy)
- @@ -20,6 +20,7 @@
- import net.sf.l2j.Config;
- import net.sf.l2j.L2DatabaseFactory;
- +import net.sf.l2j.gameserver.datatables.OfflineTradersTable;
- import net.sf.l2j.gameserver.instancemanager.CastleManorManager;
- import net.sf.l2j.gameserver.instancemanager.FourSepulchersManager;
- import net.sf.l2j.gameserver.instancemanager.GrandBossManager;
- @@ -113,6 +114,16 @@
- {
- if (this == SingletonHolder._instance)
- {
- + try
- + {
- + if ((Config.OFFLINE_TRADE_ENABLE || Config.OFFLINE_CRAFT_ENABLE) && Config.RESTORE_OFFLINERS)
- + OfflineTradersTable.storeOffliners();
- + }
- + catch (Throwable t)
- + {
- + _log.log(Level.WARNING, "Error saving offline shops.",t);
- + }
- +
- Util.printSection("Under " + MODE_TEXT[_shutdownMode] + " process");
- // disconnect players
- Index: java/net/sf/l2j/Config.java
- ===================================================================
- --- java/net/sf/l2j/Config.java (revision 20)
- +++ java/net/sf/l2j/Config.java (working copy)
- @@ -33,6 +33,7 @@
- import java.util.Vector;
- import java.util.logging.Logger;
- +import net.sf.l2j.gameserver.templates.item.L2Item;
- import net.sf.l2j.gameserver.util.FloodProtectorConfig;
- import net.sf.l2j.util.StringUtil;
- @@ -60,6 +61,7 @@
- public static final String SERVER_FILE = "./config/server.properties";
- public static final String SIEGE_FILE = "./config/siege.properties";
- public static final String L2SERESIN_FILE = "./config/l2seresin.properties";
- + public static final String CUSTOM_FILE = "./config/custom.properties";
- /**
- * -------------------------------------------------- // Variable Definitions //-------------------------------------------------
- @@ -721,6 +723,87 @@
- public static int CLIENT_PACKET_QUEUE_MAX_UNKNOWN_PER_MIN = 5; // default 5
- // --------------------------------------------------
- + // Custom settings
- + // --------------------------------------------------
- + public static boolean ALLOW_OLY_GRADE_RESTR;
- + public static int ARMOR_GRADE_RESTR;
- + public static int WEAPON_GRADE_RESTR;
- + public static int MAX_ENCHANT_RESTR;
- + public static boolean ALLOW_KILLING_SPREE;
- + public static Map<Integer, String> KILLING_SPREE_REWARD = new HashMap<>();
- + public static boolean PVP_PK_TITLE;
- + public static String PVP_TITLE_PREFIX;
- + public static String PK_TITLE_PREFIX;
- + public static boolean ANNOUNCE_HERO_ON_ENTER;
- + public static boolean ANNOUNCE_CASTLE_LORDS;
- + public static boolean WAR_LEGEND_AURA;
- + public static int KILLS_TO_GET_WAR_LEGEND_AURA;
- + public static boolean OFFLINE_TRADE_ENABLE;
- + public static boolean OFFLINE_CRAFT_ENABLE;
- + public static boolean RESTORE_OFFLINERS;
- + public static int OFFLINE_MAX_DAYS;
- + public static boolean OFFLINE_DISCONNECT_FINISHED;
- + public static boolean OFFLINE_SET_NAME_COLOR;
- + public static int OFFLINE_NAME_COLOR;
- + public static boolean OFFLINE_FAME;
- + public static boolean ALLOW_PVP_NAME_COLOR_SYSTEM;
- + public static Map<Integer, Integer> PVP_COLORS = new HashMap<>();
- + public static boolean ALLOW_PK_TITLE_COLOR_SYSTEM;
- + public static Map<Integer, Integer> PK_COLORS = new HashMap<>();
- + public static boolean ALLOW_CUSTOM_SPAWN_LOCATION;
- + public static int[] CUSTOM_SPAWN_LOCATION = new int[3];
- + public static boolean ALLOW_SOCIAL_ACTIONS;
- + public static boolean ALLOW_BOSS_PETRIFY;
- + public static boolean ALLOW_NEW_CHAR_TITLE;
- + public static String NEW_CHAR_TITLE;
- + public static boolean ALLOW_HOPZONE_VOTE_REWARD;
- + public static String HOPZONE_SERVER_LINK;
- + public static String HOPZONE_FIRST_PAGE_LINK;
- + public static int HOPZONE_VOTES_DIFFERENCE;
- + public static int HOPZONE_FIRST_PAGE_RANK_NEEDED;
- + public static int HOPZONE_REWARD_CHECK_TIME;
- + public static Map<Integer, Integer> HOPZONE_SMALL_REWARD = new HashMap<>();
- + public static Map<Integer, Integer> HOPZONE_BIG_REWARD = new HashMap<>();
- + public static int HOPZONE_DUALBOXES_ALLOWED;
- + public static boolean ALLOW_TOPZONE_VOTE_REWARD;
- + public static String TOPZONE_SERVER_LINK;
- + public static String TOPZONE_FIRST_PAGE_LINK;
- + public static int TOPZONE_VOTES_DIFFERENCE;
- + public static int TOPZONE_FIRST_PAGE_RANK_NEEDED;
- + public static int TOPZONE_REWARD_CHECK_TIME;
- + public static Map<Integer, Integer> TOPZONE_SMALL_REWARD = new HashMap<>();
- + public static Map<Integer, Integer> TOPZONE_BIG_REWARD = new HashMap<>();
- + public static int TOPZONE_DUALBOXES_ALLOWED;
- + public static boolean ENABLE_AIO_SYSTEM;
- + public static boolean ALLOW_AIO_NAME_COLOR;
- + public static int AIO_NAME_COLOR;
- + public static boolean ALLOW_AIO_TITLE_COLOR;
- + public static int AIO_TITLE_COLOR;
- + public static Map<Integer, Integer> AIO_SKILLS = new HashMap<>();
- + public static boolean ALLOW_AIO_USE_GK;
- + public static boolean ALLOW_AIO_USE_CLASS_MASTER;
- + public static boolean VIP_COLOR_ENABLED;
- + public static int VIP_COLOR_NAME;
- + public static int VIP_COLOR_TITLE;
- + public static float VIP_XP_SP_RATE;
- + public static float VIP_ADENA_RATE;
- + public static float VIP_DROP_RATE;
- + public static float VIP_SPOIL_RATE;
- + public static boolean ANTI_FARM_ENALBED;
- + public static boolean ANTI_FARM_PARTY;
- + public static boolean ANTI_FARM_IP;
- + public static boolean ANTI_FARM_CLAN_ALLY;
- + public static boolean ANTI_FARM_LVL_DIFF;
- + public static int ANTI_FARM_MAX_LVL_DIFF;
- + public static boolean ANTI_FARM_PDEF_DIFF;
- + public static int ANTI_FARM_MAX_PDEF_DIFF;
- + public static boolean ANTI_FARM_PATK_DIFF;
- + public static int ANTI_FARM_MAX_PATK_DIFF;
- + public static boolean ANTI_FARM_SUMMON;
- + public static boolean ANNOUNCE_TO_ALL_SPAWN_RB;
- + public static boolean ALLOW_TITLE_PANEL;
- +
- + // --------------------------------------------------
- /**
- * This class initializes all global variables for configuration.<br>
- @@ -747,6 +830,216 @@
- // L2Seresin settings
- try
- {
- + Properties custom = new Properties();
- + InputStream is = new FileInputStream(new File(CUSTOM_FILE));
- + custom.load(is);
- + is.close();
- +
- + ALLOW_OLY_GRADE_RESTR = Boolean.parseBoolean(custom.getProperty("AllowOlyGradeRestr", "false"));
- + String temp = custom.getProperty("ArmorGradeRestr", "S");
- + switch (temp)
- + {
- + case "D":
- + {
- + ARMOR_GRADE_RESTR = L2Item.CRYSTAL_D;
- + break;
- + }
- + case "C":
- + {
- + ARMOR_GRADE_RESTR = L2Item.CRYSTAL_C;
- + break;
- + }
- + case "B":
- + {
- + ARMOR_GRADE_RESTR = L2Item.CRYSTAL_B;
- + break;
- + }
- + case "A":
- + {
- + ARMOR_GRADE_RESTR = L2Item.CRYSTAL_A;
- + break;
- + }
- + case "S":
- + {
- + ARMOR_GRADE_RESTR = L2Item.CRYSTAL_S;
- + break;
- + }
- + default:
- + {
- + ARMOR_GRADE_RESTR = L2Item.CRYSTAL_S;
- + break;
- + }
- + }
- + temp = custom.getProperty("WeaponGradeRestr", "S");
- + switch (temp)
- + {
- + case "D":
- + {
- + WEAPON_GRADE_RESTR = L2Item.CRYSTAL_D;
- + break;
- + }
- + case "C":
- + {
- + WEAPON_GRADE_RESTR = L2Item.CRYSTAL_C;
- + break;
- + }
- + case "B":
- + {
- + WEAPON_GRADE_RESTR = L2Item.CRYSTAL_B;
- + break;
- + }
- + case "A":
- + {
- + WEAPON_GRADE_RESTR = L2Item.CRYSTAL_A;
- + break;
- + }
- + case "S":
- + {
- + WEAPON_GRADE_RESTR = L2Item.CRYSTAL_S;
- + break;
- + }
- + default:
- + {
- + WEAPON_GRADE_RESTR = L2Item.CRYSTAL_S;
- + break;
- + }
- + }
- + MAX_ENCHANT_RESTR = Integer.parseInt(custom.getProperty("MaxEnchantRestr", "65535"));
- + ALLOW_KILLING_SPREE = Boolean.parseBoolean(custom.getProperty("AllowKillingSpree", "false"));
- + String killing_spree_reward = custom.getProperty("KillingSpreeReward", "3,is on a killing spree!;6,is on a rampage!;9,is on a monster kill!;");
- + String killing_spree_reward_splitted_1[] = killing_spree_reward.split(";");
- + for (String s : killing_spree_reward_splitted_1)
- + {
- + String killing_spree_reward_splitted_2[] = s.split(",");
- + KILLING_SPREE_REWARD.put(Integer.parseInt(killing_spree_reward_splitted_2[0]), killing_spree_reward_splitted_2[1]);
- + }
- + PVP_PK_TITLE = Boolean.parseBoolean(custom.getProperty("PvpPkTitle", "false"));
- + PVP_TITLE_PREFIX = custom.getProperty("PvPTitlePrefix", "");
- + PK_TITLE_PREFIX = custom.getProperty("PkTitlePrefix", "");
- + ANNOUNCE_HERO_ON_ENTER = Boolean.parseBoolean(custom.getProperty("AnnounceHeroOnEnter", "false"));
- + ANNOUNCE_CASTLE_LORDS = Boolean.parseBoolean(custom.getProperty("AnnounceCastleLords", "false"));
- + WAR_LEGEND_AURA = Boolean.parseBoolean(custom.getProperty("WarLegendAura", "false"));
- + KILLS_TO_GET_WAR_LEGEND_AURA = Integer.parseInt(custom.getProperty("KillsToGetWarLegendAura", "10"));
- + OFFLINE_TRADE_ENABLE = Boolean.parseBoolean(custom.getProperty("OfflineTradeEnable", "false"));
- + OFFLINE_CRAFT_ENABLE = Boolean.parseBoolean(custom.getProperty("OfflineCraftEnable", "false"));
- + OFFLINE_SET_NAME_COLOR = Boolean.parseBoolean(custom.getProperty("OfflineSetNameColor", "false"));
- + OFFLINE_NAME_COLOR = Integer.decode("0x" + custom.getProperty("OfflineNameColor", "808080"));
- + OFFLINE_FAME = Boolean.parseBoolean(custom.getProperty("OfflineFame", "true"));
- + RESTORE_OFFLINERS = Boolean.parseBoolean(custom.getProperty("RestoreOffliners", "false"));
- + OFFLINE_MAX_DAYS = Integer.parseInt(custom.getProperty("OfflineMaxDays", "10"));
- + OFFLINE_DISCONNECT_FINISHED = Boolean.parseBoolean(custom.getProperty("OfflineDisconnectFinished", "true"));
- + ALLOW_PVP_NAME_COLOR_SYSTEM = Boolean.parseBoolean(custom.getProperty("AllowPvpNameColorSystem", "false"));
- + String pvp_colors = custom.getProperty("PvpColors", "100,FFFF00");
- + String pvp_colors_splitted_1[] = pvp_colors.split(";");
- + for (String s : pvp_colors_splitted_1)
- + {
- + String pvp_colors_splitted_2[] = s.split(",");
- + PVP_COLORS.put(Integer.parseInt(pvp_colors_splitted_2[0]), Integer.decode("0x"+pvp_colors_splitted_2[1]));
- + }
- + ALLOW_PK_TITLE_COLOR_SYSTEM = Boolean.parseBoolean(custom.getProperty("AllowPkTitleColorSystem", "false"));
- + String pk_colors = custom.getProperty("PkColors", "100,FFFF00");
- + String pk_colors_splitted_1[] = pk_colors.split(";");
- + for (String s : pk_colors_splitted_1)
- + {
- + String pk_colors_splitted_2[] = s.split(",");
- + PK_COLORS.put(Integer.parseInt(pk_colors_splitted_2[0]), Integer.decode("0x"+pk_colors_splitted_2[1]));
- + }
- + ALLOW_CUSTOM_SPAWN_LOCATION = Boolean.parseBoolean(custom.getProperty("AllowCustomSpawnLocation", "false"));
- + String custom_spawn_location = custom.getProperty("CustomSpawnLocation", "113852,-108766,-851");
- + String custom_spawn_location_splitted[] = custom_spawn_location.split(",");
- + CUSTOM_SPAWN_LOCATION[0] = Integer.parseInt(custom_spawn_location_splitted[0]);
- + CUSTOM_SPAWN_LOCATION[1] = Integer.parseInt(custom_spawn_location_splitted[1]);
- + CUSTOM_SPAWN_LOCATION[2] = Integer.parseInt(custom_spawn_location_splitted[2]);
- + ALLOW_SOCIAL_ACTIONS = Boolean.parseBoolean(custom.getProperty("AllowSocialActions", "false"));
- + ALLOW_BOSS_PETRIFY = Boolean.parseBoolean(custom.getProperty("AllowBossPetrify", "false"));
- + ALLOW_NEW_CHAR_TITLE = Boolean.parseBoolean(custom.getProperty("AllowNewCharTitle", "false"));
- + NEW_CHAR_TITLE = custom.getProperty("NewCharTitle", "L2 Mendrion");
- + ALLOW_HOPZONE_VOTE_REWARD = Boolean.parseBoolean(custom.getProperty("AllowHopzoneVoteReward", "false"));
- + HOPZONE_SERVER_LINK = custom.getProperty("HopzoneServerLink", "http://l2.hopzone.net/lineage2/details/74078/L2World-Servers/");
- + HOPZONE_FIRST_PAGE_LINK = custom.getProperty("HopzoneFirstPageLink", "http://l2.hopzone.net/lineage2/");
- + HOPZONE_VOTES_DIFFERENCE = Integer.parseInt(custom.getProperty("HopzoneVotesDifference", "5"));
- + HOPZONE_FIRST_PAGE_RANK_NEEDED = Integer.parseInt(custom.getProperty("HopzoneFirstPageRankNeeded", "15"));
- + HOPZONE_REWARD_CHECK_TIME = Integer.parseInt(custom.getProperty("HopzoneRewardCheckTime", "5"));
- + String HOPZONE_SMALL_REWARD_VALUE = custom.getProperty("HopzoneSmallReward", "57,100000000;");
- + String[] hopzone_small_reward_splitted_1 = HOPZONE_SMALL_REWARD_VALUE.split(";");
- + for (String i : hopzone_small_reward_splitted_1)
- + {
- + String[] hopzone_small_reward_splitted_2 = i.split(",");
- + HOPZONE_SMALL_REWARD.put(Integer.parseInt(hopzone_small_reward_splitted_2[0]), Integer.parseInt(hopzone_small_reward_splitted_2[1]));
- + }
- + String HOPZONE_BIG_REWARD_VALUE = custom.getProperty("HopzoneBigReward", "3470,1;");
- + String[] hopzone_big_reward_splitted_1 = HOPZONE_BIG_REWARD_VALUE.split(";");
- + for (String i : hopzone_big_reward_splitted_1)
- + {
- + String[] hopzone_big_reward_splitted_2 = i.split(",");
- + HOPZONE_BIG_REWARD.put(Integer.parseInt(hopzone_big_reward_splitted_2[0]), Integer.parseInt(hopzone_big_reward_splitted_2[1]));
- + }
- + HOPZONE_DUALBOXES_ALLOWED = Integer.parseInt(custom.getProperty("HopzoneDualboxesAllowed", "1"));
- + ALLOW_TOPZONE_VOTE_REWARD = Boolean.parseBoolean(custom.getProperty("AllowTopzoneVoteReward", "false"));
- + TOPZONE_SERVER_LINK = custom.getProperty("TopzoneServerLink", "http://l2.topzone.net/lineage2/details/74078/L2World-Servers/");
- + TOPZONE_FIRST_PAGE_LINK = custom.getProperty("TopzoneFirstPageLink", "http://l2.topzone.net/lineage2/");
- + TOPZONE_VOTES_DIFFERENCE = Integer.parseInt(custom.getProperty("TopzoneVotesDifference", "5"));
- + TOPZONE_FIRST_PAGE_RANK_NEEDED = Integer.parseInt(custom.getProperty("TopzoneFirstPageRankNeeded", "15"));
- + TOPZONE_REWARD_CHECK_TIME = Integer.parseInt(custom.getProperty("TopzoneRewardCheckTime", "5"));
- + String TOPZONE_SMALL_REWARD_VALUE = custom.getProperty("TopzoneSmallReward", "57,100000000;");
- + String[] topzone_small_reward_splitted_1 = TOPZONE_SMALL_REWARD_VALUE.split(";");
- + for (String i : topzone_small_reward_splitted_1)
- + {
- + String[] topzone_small_reward_splitted_2 = i.split(",");
- + TOPZONE_SMALL_REWARD.put(Integer.parseInt(topzone_small_reward_splitted_2[0]), Integer.parseInt(topzone_small_reward_splitted_2[1]));
- + }
- + String TOPZONE_BIG_REWARD_VALUE = custom.getProperty("TopzoneBigReward", "3470,1;");
- + String[] topzone_big_reward_splitted_1 = TOPZONE_BIG_REWARD_VALUE.split(";");
- + for (String i : topzone_big_reward_splitted_1)
- + {
- + String[] topzone_big_reward_splitted_2 = i.split(",");
- + TOPZONE_BIG_REWARD.put(Integer.parseInt(topzone_big_reward_splitted_2[0]), Integer.parseInt(topzone_big_reward_splitted_2[1]));
- + }
- + TOPZONE_DUALBOXES_ALLOWED = Integer.parseInt(custom.getProperty("TopzoneDualboxesAllowed", "1"));
- + ENABLE_AIO_SYSTEM = Boolean.parseBoolean(custom.getProperty("EnableAioSystem", "false"));
- + ALLOW_AIO_NAME_COLOR = Boolean.parseBoolean(custom.getProperty("AllowAioNameColor", "false"));
- + AIO_NAME_COLOR = Integer.decode("0x"+custom.getProperty("AioNameColor", "88AA88"));
- + ALLOW_AIO_TITLE_COLOR = Boolean.parseBoolean(custom.getProperty("AllowAioTitleColor", "false"));
- + AIO_TITLE_COLOR = Integer.decode("0x"+custom.getProperty("AioTitleColor", "88AA88"));
- + String aio_skills = custom.getProperty("AioSkills", "");
- + String[] aio_skills_splitted_1 = aio_skills.split(";");
- + for (String s : aio_skills_splitted_1)
- + {
- + String[] aio_skills_splitted_2 = s.split(",");
- + AIO_SKILLS.put(Integer.parseInt(aio_skills_splitted_2[0]), Integer.parseInt(aio_skills_splitted_2[1]));
- + }
- + ALLOW_AIO_USE_GK = Boolean.parseBoolean(custom.getProperty("AllowAioUseGk", "false"));
- + ALLOW_AIO_USE_CLASS_MASTER = Boolean.parseBoolean(custom.getProperty("AllowAioUseClassMaster", "false"));
- + VIP_COLOR_ENABLED = Boolean.parseBoolean(custom.getProperty("VIPColorEnabled", "false"));
- + VIP_COLOR_NAME = Integer.decode("0x"+custom.getProperty("VIPColorName", "FF33AA"));
- + VIP_COLOR_TITLE = Integer.decode("0x"+custom.getProperty("VIPColorTitle", "FFAA33"));
- + VIP_XP_SP_RATE = Float.parseFloat(custom.getProperty("VIPXpSpRate", "1.5"));
- + VIP_ADENA_RATE = Float.parseFloat(custom.getProperty("VIPAdenaRate", "1.5"));
- + VIP_DROP_RATE = Float.parseFloat(custom.getProperty("VIPDropRate", "1.5"));
- + VIP_SPOIL_RATE = Float.parseFloat(custom.getProperty("VIPSpoilRate", "1.5"));
- + ANTI_FARM_ENALBED = Boolean.parseBoolean(custom.getProperty("AntiFarmEnabled", "false"));
- + ANTI_FARM_PARTY = Boolean.parseBoolean(custom.getProperty("AntiFarmParty", "false"));
- + ANTI_FARM_IP = Boolean.parseBoolean(custom.getProperty("AntiFarmIP", "false"));
- + ANTI_FARM_CLAN_ALLY = Boolean.parseBoolean(custom.getProperty("AntiFarmClanAlly", "false"));
- + ANTI_FARM_LVL_DIFF = Boolean.parseBoolean(custom.getProperty("AntiFarmLvlDiff", "false"));
- + ANTI_FARM_MAX_LVL_DIFF = Integer.parseInt(custom.getProperty("AntiFarmMaxLvlDiff", "30"));
- + ANTI_FARM_PDEF_DIFF = Boolean.parseBoolean(custom.getProperty("AntiFarmPdefDiff", "false"));
- + ANTI_FARM_MAX_PDEF_DIFF = Integer.parseInt(custom.getProperty("AntiFarmMaxPdefDiff", "300"));
- + ANTI_FARM_PATK_DIFF = Boolean.parseBoolean(custom.getProperty("AntiFarmPatkDiff", "false"));
- + ANTI_FARM_MAX_PATK_DIFF = Integer.parseInt(custom.getProperty("AntiFarmMaxPatkDiff", "300"));
- + ANTI_FARM_SUMMON = Boolean.parseBoolean(custom.getProperty("AntiFarmSummon", "false"));
- + ANNOUNCE_TO_ALL_SPAWN_RB = Boolean.parseBoolean(custom.getProperty("AnnounceToAllSpawnRb", "false"));
- + ALLOW_TITLE_PANEL = Boolean.parseBoolean(custom.getProperty("AnnounceToAllSpawnRb", "false"));
- + }
- + catch (Exception e)
- + {
- + e.printStackTrace();
- + throw new Error("Server failed to load " + CUSTOM_FILE + " file.");
- + }
- +
- + // L2Seresin settings
- + try
- + {
- Properties l2seresin = new Properties();
- InputStream is = new FileInputStream(new File(L2SERESIN_FILE));
- l2seresin.load(is);
- Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 20)
- +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy)
- @@ -37,6 +37,7 @@
- import net.sf.l2j.Config;
- import net.sf.l2j.L2DatabaseFactory;
- +import net.sf.l2j.gameserver.Announcements;
- import net.sf.l2j.gameserver.GameTimeController;
- import net.sf.l2j.gameserver.GeoData;
- import net.sf.l2j.gameserver.ItemsAutoDestroy;
- @@ -234,6 +235,162 @@
- */
- public final class L2PcInstance extends L2Playable
- {
- + public boolean choseNormalTitle = false;
- +
- + public void checkAioVipColors()
- + {
- + if (isVip())
- + {
- + if (Config.VIP_COLOR_ENABLED)
- + {
- + getAppearance().setNameColor(Config.VIP_COLOR_NAME);
- + getAppearance().setTitleColor(Config.VIP_COLOR_TITLE);
- + broadcastUserInfo();
- + }
- + }
- + else
- + {
- + if (Config.VIP_COLOR_ENABLED)
- + {
- + getAppearance().setNameColor(0xFFFFFF);
- + getAppearance().setTitleColor(0xFFFFFF);
- + broadcastUserInfo();
- + }
- + }
- +
- + if (isAio())
- + {
- + if (Config.ALLOW_AIO_NAME_COLOR)
- + {
- + getAppearance().setNameColor(Config.AIO_NAME_COLOR);
- + broadcastUserInfo();
- + }
- +
- + if (Config.ALLOW_AIO_TITLE_COLOR)
- + {
- + getAppearance().setTitleColor(Config.AIO_TITLE_COLOR);
- + broadcastUserInfo();
- + }
- + }
- + else
- + {
- + if (Config.ALLOW_AIO_NAME_COLOR)
- + {
- + getAppearance().setNameColor(0xFFFFFF);
- + broadcastUserInfo();
- + }
- +
- + if (Config.ALLOW_AIO_TITLE_COLOR)
- + {
- + getAppearance().setTitleColor(0xFFFFFF);
- + broadcastUserInfo();
- + }
- + }
- + }
- +
- + private boolean _vip = false;
- +
- + public void setVip(boolean val)
- + {
- + if (val)
- + {
- + if (Config.VIP_COLOR_ENABLED)
- + {
- + getAppearance().setNameColor(Config.VIP_COLOR_NAME);
- + getAppearance().setTitleColor(Config.VIP_COLOR_TITLE);
- + broadcastUserInfo();
- + }
- +
- + sendMessage("You are now a VIP.");
- + }
- + else
- + {
- + if (Config.VIP_COLOR_ENABLED)
- + {
- + getAppearance().setNameColor(0xFFFFFF);
- + getAppearance().setTitleColor(0xFFFFFF);
- + broadcastUserInfo();
- + }
- +
- + sendMessage("You are no longer a VIP.");
- + }
- +
- + _vip = val;
- + }
- +
- + public boolean isVip()
- + {
- + return _vip;
- + }
- +
- + private boolean _aio = false;
- +
- + public void setAio(boolean val)
- + {
- + if (val)
- + {
- + if (Config.ALLOW_AIO_NAME_COLOR)
- + {
- + getAppearance().setNameColor(Config.AIO_NAME_COLOR);
- + broadcastUserInfo();
- + }
- +
- + if (Config.ALLOW_AIO_TITLE_COLOR)
- + {
- + getAppearance().setTitleColor(Config.AIO_TITLE_COLOR);
- + broadcastUserInfo();
- + }
- +
- + for (int i : Config.AIO_SKILLS.keySet())
- + {
- + addSkill(SkillTable.getInstance().getInfo(i, Config.AIO_SKILLS.get(i)), true);
- + }
- +
- + sendMessage("You are now an AIO.");
- + }
- + else
- + {
- + if (Config.ALLOW_AIO_NAME_COLOR)
- + {
- + getAppearance().setNameColor(0xFFFFFF);
- + broadcastUserInfo();
- + }
- +
- + if (Config.ALLOW_AIO_TITLE_COLOR)
- + {
- + getAppearance().setTitleColor(0xFFFFFF);
- + broadcastUserInfo();
- + }
- +
- + for (int i : Config.AIO_SKILLS.keySet())
- + {
- + removeSkill(SkillTable.getInstance().getInfo(i, Config.AIO_SKILLS.get(i)), true);
- + }
- +
- + sendMessage("You are no longer an AIO.");
- + }
- +
- + _aio = val;
- + }
- +
- + public boolean isAio()
- + {
- + return _aio;
- + }
- +
- + private long _offlineShopStart = 0;
- +
- + public long getOfflineStartTime()
- + {
- + return _offlineShopStart;
- + }
- + public void setOfflineStartTime(long time)
- + {
- + _offlineShopStart = time;
- + }
- +
- + public int killingSpreePvps = 0;
- +
- private boolean _isTopKiller = false;
- public boolean isTopKiller()
- @@ -284,8 +441,8 @@
- // Character SQL String Definitions:
- 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=?,pvpzone_kills=?,topkiller=? 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,pvpzone_kills,topkiller 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=?,pvpzone_kills=?,topkiller=?,aio=?,vip=? 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,pvpzone_kills,topkiller,aio,vip FROM characters WHERE obj_id=?";
- // Character Subclass SQL String Definitions:
- 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";
- @@ -910,9 +1067,17 @@
- public String getAccountName()
- {
- + if (getClient() == null)
- + return getAccountNamePlayer();
- +
- return getClient().getAccountName();
- }
- + public String getAccountNamePlayer()
- + {
- + return _accountName;
- + }
- +
- public Map<Integer, String> getAccountChars()
- {
- return _chars;
- @@ -4277,6 +4442,8 @@
- // Icons update in order to get retained buffs list
- updateEffectIcons();
- + killingSpreePvps = 0;
- +
- return true;
- }
- @@ -4403,7 +4570,12 @@
- // Check if it's pvp
- if ((checkIfPvP(target) && targetPlayer.getPvpFlag() != 0) || (isInsideZone(ZONE_PVP) && targetPlayer.isInsideZone(ZONE_PVP)))
- - increasePvpKills(targetPlayer);
- + {
- + if (addPvp((L2Playable)target))
- + {
- + increasePvpKills(targetPlayer);
- + }
- + }
- // Target player doesn't have pvp flag set
- else
- {
- @@ -4411,7 +4583,10 @@
- if (targetPlayer.getClan() != null && getClan() != null && getClan().isAtWarWith(targetPlayer.getClanId()) && targetPlayer.getClan().isAtWarWith(getClanId()) && targetPlayer.getPledgeType() != L2Clan.SUBUNIT_ACADEMY && getPledgeType() != L2Clan.SUBUNIT_ACADEMY)
- {
- // 'Both way war' -> 'PvP Kill'
- - increasePvpKills(targetPlayer);
- + if (addPvp((L2Playable)target))
- + {
- + increasePvpKills(targetPlayer);
- + }
- return;
- }
- @@ -4419,13 +4594,65 @@
- if (targetPlayer.getKarma() > 0)
- {
- if (Config.KARMA_AWARD_PK_KILL)
- - increasePvpKills(targetPlayer);
- + {
- + if (addPvp((L2Playable)target))
- + {
- + increasePvpKills(targetPlayer);
- + }
- + }
- }
- else if (targetPlayer.getPvpFlag() == 0)
- increasePkKillsAndKarma(targetPlayer.getLevel());
- }
- }
- + private boolean addPvp(L2Playable vp)
- + {
- + if (!Config.ANTI_FARM_ENALBED)
- + {
- + return true;
- + }
- +
- + if (Config.ANTI_FARM_SUMMON && vp instanceof L2Summon)
- + {
- + return false;
- + }
- +
- + L2PcInstance v = (L2PcInstance)vp;
- +
- + if (Config.ANTI_FARM_PARTY && v.getParty() == getParty())
- + {
- + return false;
- + }
- +
- + if (Config.ANTI_FARM_CLAN_ALLY && (v.getClan() == getClan() || v.getAllyId() == getAllyId()))
- + {
- + return false;
- + }
- +
- + if (Config.ANTI_FARM_IP && v.getClient().getConnection().getInetAddress().getHostAddress() == getClient().getConnection().getInetAddress().getHostAddress())
- + {
- + return false;
- + }
- +
- + if (Config.ANTI_FARM_LVL_DIFF && (v.getLevel()-getLevel() >= Config.ANTI_FARM_MAX_LVL_DIFF || getLevel()-v.getLevel() >= Config.ANTI_FARM_MAX_LVL_DIFF))
- + {
- + return false;
- + }
- +
- + if (Config.ANTI_FARM_PATK_DIFF && (v.getStat().getPAtk(null)-getStat().getPAtk(null) >= Config.ANTI_FARM_MAX_PATK_DIFF || getStat().getPAtk(null)-v.getStat().getPAtk(null) >= Config.ANTI_FARM_MAX_PATK_DIFF))
- + {
- + return false;
- + }
- +
- + if (Config.ANTI_FARM_PDEF_DIFF && (v.getStat().getPDef(null)-getStat().getPDef(null) >= Config.ANTI_FARM_MAX_PDEF_DIFF || getStat().getPDef(null)-v.getStat().getPDef(null) >= Config.ANTI_FARM_MAX_PDEF_DIFF))
- + {
- + return false;
- + }
- +
- + return true;
- + }
- +
- public void increaseCustomPvpKills(L2PcInstance killer)
- {
- setPvpZoneKills(getPvpZoneKills()+1);
- @@ -4436,6 +4663,45 @@
- }
- }
- + private void killingSpreePvp()
- + {
- + killingSpreePvps++;
- + for (int i : Config.KILLING_SPREE_REWARD.keySet())
- + {
- + if (killingSpreePvps == i)
- + {
- + Announcements.announceToAll(getName()+" "+Config.KILLING_SPREE_REWARD.get(i));
- + }
- + }
- + }
- +
- + public void colorsCheck()
- + {
- + if (Config.ALLOW_PVP_NAME_COLOR_SYSTEM)
- + {
- + for (int i : Config.PVP_COLORS.keySet())
- + {
- + if (getPvpKills() >= i)
- + {
- + getAppearance().setNameColor(Config.PVP_COLORS.get(i));
- + broadcastUserInfo();
- + }
- + }
- + }
- +
- + if (Config.ALLOW_PK_TITLE_COLOR_SYSTEM)
- + {
- + for (int i : Config.PK_COLORS.keySet())
- + {
- + if (getPkKills() >= i)
- + {
- + getAppearance().setTitleColor(Config.PK_COLORS.get(i));
- + broadcastUserInfo();
- + }
- + }
- + }
- + }
- +
- /**
- * Increase the pvp kills count and send the info to the player
- * @param kl
- @@ -4445,6 +4711,29 @@
- // Add karma to attacker and increase its PK counter
- setPvpKills(getPvpKills() + 1);
- + if (Config.ALLOW_PVP_NAME_COLOR_SYSTEM || Config.ALLOW_PK_TITLE_COLOR_SYSTEM)
- + {
- + colorsCheck();
- + }
- +
- + if (Config.PVP_PK_TITLE && !choseNormalTitle)
- + {
- + customEditTitle(Config.PVP_TITLE_PREFIX+" "+getPvpKills()+" | "+Config.PK_TITLE_PREFIX+" "+getPkKills());
- + }
- +
- + if (Config.ALLOW_KILLING_SPREE)
- + {
- + killingSpreePvp();
- + }
- +
- + if (Config.WAR_LEGEND_AURA)
- + {
- + if (killingSpreePvps == Config.KILLS_TO_GET_WAR_LEGEND_AURA)
- + {
- + broadcastUserInfo();
- + }
- + }
- +
- addItem("pvp reward", Config.PVP_REWARD[0], Config.PVP_REWARD[1], null, true);
- // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
- @@ -4944,6 +5233,11 @@
- public void setPrivateStoreType(int type)
- {
- _privatestore = type;
- +
- + if (Config.OFFLINE_DISCONNECT_FINISHED && _privatestore == STORE_PRIVATE_NONE && (getClient() == null || getClient().isDetached()))
- + {
- + deleteMe();
- + }
- }
- /**
- @@ -4978,7 +5272,10 @@
- public void setClan(L2Clan clan)
- {
- _clan = clan;
- - setTitle("");
- + if (!Config.PVP_PK_TITLE)
- + {
- + setTitle("");
- + }
- if (clan == null)
- {
- @@ -5815,6 +6112,9 @@
- player.setPvpZoneKills(rset.getInt("pvpzone_kills"));
- player.setIsTopKiller(rset.getInt("topkiller") == 1);
- + player.setAio(rset.getInt("aio") == 1);
- + player.setVip(rset.getInt("vip") == 1);
- +
- player.setClanJoinExpiryTime(rset.getLong("clan_join_expiry_time"));
- if (player.getClanJoinExpiryTime() < System.currentTimeMillis())
- player.setClanJoinExpiryTime(0);
- @@ -6254,7 +6554,9 @@
- statement.setLong(49, getDeathPenaltyBuffLevel());
- statement.setInt(50, getPvpZoneKills());
- statement.setInt(51, isTopKiller() ? 1 : 0);
- - statement.setInt(52, getObjectId());
- + statement.setInt(52, isAio() ? 1 : 0);
- + statement.setInt(53, isVip() ? 1 : 0);
- + statement.setInt(54, getObjectId());
- statement.execute();
- statement.close();
- Index: java/net/sf/l2j/gameserver/model/entity/HzVoteReward.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/entity/HzVoteReward.java (revision 0)
- +++ java/net/sf/l2j/gameserver/model/entity/HzVoteReward.java (revision 0)
- @@ -0,0 +1,293 @@
- +/*
- + * 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
- + */
- +package net.sf.l2j.gameserver.model.entity;
- +
- +import java.io.BufferedReader;
- +import java.io.InputStreamReader;
- +import java.net.URL;
- +import java.net.URLConnection;
- +import java.util.Collection;
- +import java.util.HashMap;
- +
- +import net.sf.l2j.Config;
- +import net.sf.l2j.gameserver.Announcements;
- +import net.sf.l2j.gameserver.ThreadPoolManager;
- +import net.sf.l2j.gameserver.model.L2World;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- +
- +public class HzVoteReward
- +{
- + // Configurations.
- + private static String hopzoneUrl = Config.HOPZONE_SERVER_LINK;
- + private static String page1Url = Config.HOPZONE_FIRST_PAGE_LINK;
- + private static int voteRewardVotesDifference = Config.HOPZONE_VOTES_DIFFERENCE;
- + private static int firstPageRankNeeded = Config.HOPZONE_FIRST_PAGE_RANK_NEEDED;
- + private static int checkTime = 60*1000*Config.HOPZONE_REWARD_CHECK_TIME;
- +
- + // Don't-touch variables.
- + private static int lastVotes = 0;
- + @SuppressWarnings("unused")
- + private static HashMap<String, Integer> playerIps = new HashMap<String, Integer>();
- +
- + public static void updateConfigurations()
- + {
- + hopzoneUrl = Config.HOPZONE_SERVER_LINK;
- + page1Url = Config.HOPZONE_FIRST_PAGE_LINK;
- + voteRewardVotesDifference = Config.HOPZONE_VOTES_DIFFERENCE;
- + firstPageRankNeeded = Config.HOPZONE_FIRST_PAGE_RANK_NEEDED;
- + checkTime = 60*1000*Config.HOPZONE_REWARD_CHECK_TIME;
- + }
- +
- + public static void getInstance()
- + {
- + System.out.println("Vote reward system initialized.");
- + ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Runnable()
- + {
- + @SuppressWarnings("synthetic-access")
- + @Override
- + public void run()
- + {
- + if (Config.ALLOW_HOPZONE_VOTE_REWARD)
- + {
- + reward();
- + }
- + else
- + {
- + return;
- + }
- + }
- + }, checkTime/2, checkTime);
- + }
- +
- + private static void reward()
- + {
- + int firstPageVotes = getFirstPageRankVotes();
- + int currentVotes = getVotes();
- +
- + if (firstPageVotes == -1 || currentVotes == -1)
- + {
- + if (firstPageVotes == -1)
- + {
- + System.out.println("There was a problem on getting votes from server with rank "+firstPageRankNeeded+".");
- + }
- + if (currentVotes == -1)
- + {
- + System.out.println("There was a problem on getting server votes.");
- + }
- +
- + return;
- + }
- +
- + if (lastVotes == 0)
- + {
- + lastVotes = currentVotes;
- + Announcements.getInstance();
- + Announcements.announceToAll("Hopzone's vote count is "+currentVotes+".");
- + Announcements.getInstance();
- + Announcements.announceToAll("We need "+((lastVotes+voteRewardVotesDifference)-currentVotes)+" vote(s) for reward.");
- + if (firstPageVotes-lastVotes <= 0)
- + {
- + Announcements.getInstance();
- + Announcements.announceToAll("We are in the first page of hopzone, reward will be big.");
- + }
- + else
- + {
- + Announcements.getInstance();
- + Announcements.announceToAll("We need "+(firstPageVotes-lastVotes)+" vote(s) for big reward.");
- + }
- + return;
- + }
- +
- + if (currentVotes >= lastVotes+voteRewardVotesDifference)
- + {
- + Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().values();
- + if (firstPageVotes-currentVotes <= 0)
- + {
- + Announcements.getInstance();
- + Announcements.announceToAll("Everyone has been rewarded with big reward.");
- + Announcements.getInstance();
- + Announcements.announceToAll("Hopzone's vote count is "+currentVotes+".");
- + for (L2PcInstance p : pls)
- + {
- + boolean canReward = false;
- + String pIp = p.getClient().getConnection().getInetAddress().getHostAddress();
- + if (playerIps.containsKey(pIp))
- + {
- + int count = playerIps.get(pIp);
- + if (count < Config.HOPZONE_DUALBOXES_ALLOWED)
- + {
- + playerIps.remove(pIp);
- + playerIps.put(pIp, count+1);
- + canReward = true;
- + }
- + }
- + else
- + {
- + canReward = true;
- + playerIps.put(pIp, 1);
- + }
- + if (canReward)
- + {
- + for (int i : Config.HOPZONE_BIG_REWARD.keySet())
- + {
- + p.addItem("Vote reward.", i, Config.HOPZONE_BIG_REWARD.get(i), p, true);
- + }
- + }
- + else
- + {
- + p.sendMessage("Already "+Config.HOPZONE_DUALBOXES_ALLOWED+" character(s) of your ip have been rewarded, so this character won't be rewarded.");
- + }
- + }
- + playerIps.clear();
- + }
- + else
- + {
- + Announcements.getInstance();
- + Announcements.announceToAll("Everyone has been rewarded with small reward.");
- + Announcements.getInstance();
- + Announcements.announceToAll("Hopzone's vote count is "+currentVotes+".");
- + Announcements.getInstance();
- + Announcements.announceToAll("We need "+(firstPageVotes-currentVotes)+" vote(s) for big reward.");
- + for (L2PcInstance p : pls)
- + {
- + boolean canReward = false;
- + String pIp = p.getClient().getConnection().getInetAddress().getHostAddress();
- + if (playerIps.containsKey(pIp))
- + {
- + int count = playerIps.get(pIp);
- + if (count < Config.HOPZONE_DUALBOXES_ALLOWED)
- + {
- + playerIps.remove(pIp);
- + playerIps.put(pIp, count+1);
- + canReward = true;
- + }
- + }
- + else
- + {
- + canReward = true;
- + playerIps.put(pIp, 1);
- + }
- + if (canReward)
- + {
- + for (int i : Config.HOPZONE_SMALL_REWARD.keySet())
- + {
- + p.addItem("Vote reward.", i, Config.HOPZONE_SMALL_REWARD.get(i), p, true);
- + }
- + }
- + else
- + {
- + p.sendMessage("Already "+Config.HOPZONE_DUALBOXES_ALLOWED+" character(s) of your ip have been rewarded, so this character won't be rewarded.");
- + }
- + }
- + playerIps.clear();
- + }
- +
- + lastVotes = currentVotes;
- + }
- + else
- + {
- + if (firstPageVotes-currentVotes <= 0)
- + {
- + Announcements.getInstance();
- + Announcements.announceToAll("Hopzone's vote count is "+currentVotes+".");
- + Announcements.getInstance();
- + Announcements.announceToAll("We need "+((lastVotes+voteRewardVotesDifference)-currentVotes)+" vote(s) for big reward.");
- + }
- + else
- + {
- + Announcements.getInstance();
- + Announcements.announceToAll("Hopzone's vote count is "+currentVotes+".");
- + Announcements.getInstance();
- + Announcements.announceToAll("We need "+((lastVotes+voteRewardVotesDifference)-currentVotes)+" vote(s) for small reward.");
- + Announcements.getInstance();
- + Announcements.announceToAll("We need "+(firstPageVotes-currentVotes)+" vote(s) for big reward.");
- + }
- + }
- + }
- +
- + private static int getFirstPageRankVotes()
- + {
- + InputStreamReader isr = null;
- + BufferedReader br = null;
- +
- + try
- + {
- + URLConnection con = new URL(page1Url).openConnection();
- + con.addRequestProperty("User-Agent", "Mozilla/4.76");
- + isr = new InputStreamReader(con.getInputStream());
- + br = new BufferedReader(isr);
- +
- + String line;
- + int i = 0;
- + while ((line = br.readLine()) != null)
- + {
- + if (line.contains("<span class=\"no\">"+firstPageRankNeeded+"</span>"))
- + {
- + i++;
- + }
- + if (line.contains("Anonymous Votes") && i == 1)
- + {
- + i = 0;
- + int votes = Integer.valueOf(line.split(">")[1].replace("</span", ""));
- + return votes;
- + }
- + }
- +
- + br.close();
- + isr.close();
- + }
- + catch (Exception e)
- + {
- + System.out.println(e);
- + System.out.println("Error while getting server vote count.");
- + }
- +
- + return -1;
- + }
- +
- + private static int getVotes()
- + {
- + InputStreamReader isr = null;
- + BufferedReader br = null;
- +
- + try
- + {
- + URLConnection con = new URL(hopzoneUrl).openConnection();
- + con.addRequestProperty("User-Agent", "Mozilla/4.76");
- + isr = new InputStreamReader(con.getInputStream());
- + br = new BufferedReader(isr);
- +
- + String line;
- + while ((line = br.readLine()) != null)
- + {
- + if (line.contains("Anonymous User Votes"))
- + {
- + int votes = Integer.valueOf(line.split(">")[2].replace("</span", ""));
- + return votes;
- + }
- + }
- +
- + br.close();
- + isr.close();
- + }
- + catch (Exception e)
- + {
- + System.out.println(e);
- + System.out.println("Error while getting server vote count.");
- + }
- +
- + return -1;
- + }
- +}
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/datatables/OfflineTradersTable.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/datatables/OfflineTradersTable.java (revision 0)
- +++ java/net/sf/l2j/gameserver/datatables/OfflineTradersTable.java (revision 0)
- @@ -0,0 +1,274 @@
- +/*
- + * 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
- + */
- +package net.sf.l2j.gameserver.datatables;
- +
- +import java.sql.Connection;
- +import java.sql.PreparedStatement;
- +import java.sql.ResultSet;
- +import java.sql.SQLException;
- +import java.util.Calendar;
- +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.LoginServerThread;
- +import net.sf.l2j.gameserver.model.L2ManufactureItem;
- +import net.sf.l2j.gameserver.model.L2ManufactureList;
- +import net.sf.l2j.gameserver.model.L2World;
- +import net.sf.l2j.gameserver.model.TradeList.TradeItem;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- +import net.sf.l2j.gameserver.network.L2GameClient;
- +import net.sf.l2j.gameserver.network.L2GameClient.GameClientState;
- +
- +public class OfflineTradersTable
- +{
- + private static Logger _log = Logger.getLogger(OfflineTradersTable.class.getName());
- +
- + //SQL DEFINITIONS
- + private static final String SAVE_OFFLINE_STATUS = "INSERT INTO character_offline_trade (`charId`,`time`,`type`,`title`) VALUES (?,?,?,?)";
- + private static final String SAVE_ITEMS = "INSERT INTO character_offline_trade_items (`charId`,`item`,`count`,`price`) VALUES (?,?,?,?)";
- + private static final String CLEAR_OFFLINE_TABLE = "DELETE FROM character_offline_trade";
- + private static final String CLEAR_OFFLINE_TABLE_ITEMS = "DELETE FROM character_offline_trade_items";
- + private static final String LOAD_OFFLINE_STATUS = "SELECT * FROM character_offline_trade";
- + private static final String LOAD_OFFLINE_ITEMS = "SELECT * FROM character_offline_trade_items WHERE charId = ?";
- +
- + public static void storeOffliners()
- + {
- + Connection con = null;
- + try
- + {
- + con = L2DatabaseFactory.getInstance().getConnection();
- + PreparedStatement stm = con.prepareStatement(CLEAR_OFFLINE_TABLE);
- + stm.execute();
- + stm.close();
- + stm = con.prepareStatement(CLEAR_OFFLINE_TABLE_ITEMS);
- + stm.execute();
- + stm.close();
- +
- + con.setAutoCommit(false); // avoid halfway done
- + stm = con.prepareStatement(SAVE_OFFLINE_STATUS);
- + PreparedStatement stm_items = con.prepareStatement(SAVE_ITEMS);
- +
- + //TextBuilder items = TextBuilder.newInstance();
- + for (L2PcInstance pc : L2World.getInstance().getAllPlayers().values())
- + {
- + try
- + {
- + if ((pc.getPrivateStoreType() != L2PcInstance.STORE_PRIVATE_NONE) && (pc.getClient() == null || pc.getClient().isDetached()))
- + {
- + stm.setInt(1, pc.getObjectId()); //Char Id
- + stm.setLong(2, pc.getOfflineStartTime());
- + stm.setInt(3, pc.getPrivateStoreType()); //store type
- + String title = null;
- +
- + switch (pc.getPrivateStoreType())
- + {
- + case L2PcInstance.STORE_PRIVATE_BUY:
- + if (!Config.OFFLINE_TRADE_ENABLE)
- + continue;
- + title = pc.getBuyList().getTitle();
- + for (TradeItem i : pc.getBuyList().getItems())
- + {
- + stm_items.setInt(1, pc.getObjectId());
- + stm_items.setInt(2, i.getItem().getItemId());
- + stm_items.setInt(3, i.getCount());
- + stm_items.setInt(4, i.getPrice());
- + stm_items.executeUpdate();
- + stm_items.clearParameters();
- + }
- + break;
- + case L2PcInstance.STORE_PRIVATE_SELL:
- + case L2PcInstance.STORE_PRIVATE_PACKAGE_SELL:
- + if (!Config.OFFLINE_TRADE_ENABLE)
- + continue;
- + title = pc.getSellList().getTitle();
- + for (TradeItem i : pc.getSellList().getItems())
- + {
- + stm_items.setInt(1, pc.getObjectId());
- + stm_items.setInt(2, i.getObjectId());
- + stm_items.setInt(3, i.getCount());
- + stm_items.setInt(4, i.getPrice());
- + stm_items.executeUpdate();
- + stm_items.clearParameters();
- + }
- + break;
- + case L2PcInstance.STORE_PRIVATE_MANUFACTURE:
- + if (!Config.OFFLINE_CRAFT_ENABLE)
- + continue;
- + title = pc.getCreateList().getStoreName();
- + for (L2ManufactureItem i : pc.getCreateList().getList())
- + {
- + stm_items.setInt(1, pc.getObjectId());
- + stm_items.setInt(2, i.getRecipeId());
- + stm_items.setLong(3, 0);
- + stm_items.setLong(4, i.getCost());
- + stm_items.executeUpdate();
- + stm_items.clearParameters();
- + }
- + }
- + stm.setString(4, title);
- + stm.executeUpdate();
- + stm.clearParameters();
- + con.commit(); // flush
- + }
- + }
- + catch (Exception e)
- + {
- + _log.log(Level.WARNING, "OfflineTradersTable[storeTradeItems()]: Error while saving offline trader: " + pc.getObjectId() + " " + e, e);
- + }
- + }
- + stm.close();
- + stm_items.close();
- + _log.info("Offline traders stored.");
- + }
- + catch (Exception e)
- + {
- + _log.log(Level.WARNING,"OfflineTradersTable[storeTradeItems()]: Error while saving offline traders: " + e,e);
- + }
- + finally
- + {
- + try
- + {
- + con.close();
- + } catch (Exception e)
- + {
- + }
- + con = null;
- + }
- + }
- +
- + public static void restoreOfflineTraders()
- + {
- + _log.info("Loading offline traders...");
- + Connection con = null;
- + int nTraders = 0;
- + try
- + {
- + con = L2DatabaseFactory.getInstance().getConnection();
- + PreparedStatement stm = con.prepareStatement(LOAD_OFFLINE_STATUS);
- + ResultSet rs = stm.executeQuery();
- + while (rs.next())
- + {
- + long time = rs.getLong("time");
- + if (Config.OFFLINE_MAX_DAYS > 0)
- + {
- + Calendar cal = Calendar.getInstance();
- + cal.setTimeInMillis(time);
- + cal.add(Calendar.DAY_OF_YEAR, Config.OFFLINE_MAX_DAYS);
- + if (cal.getTimeInMillis() <= System.currentTimeMillis())
- + continue;
- + }
- +
- + int type = rs.getInt("type");
- + if (type == L2PcInstance.STORE_PRIVATE_NONE)
- + continue;
- +
- + L2PcInstance player = null;
- +
- + try
- + {
- + L2GameClient client = new L2GameClient(null);
- + client.setDetached(true);
- + player = L2PcInstance.load(rs.getInt("charId"));
- + client.setActiveChar(player);
- + player.setOnlineStatus(true, false);
- + client.setAccountName(player.getAccountName());
- + client.setState(GameClientState.IN_GAME);
- + player.setClient(client);
- + player.setOfflineStartTime(time);
- + player.spawnMe(player.getX(), player.getY(), player.getZ());
- + LoginServerThread.getInstance().addGameServerLogin(player.getAccountName(), client);
- + PreparedStatement stm_items = con.prepareStatement(LOAD_OFFLINE_ITEMS);
- + stm_items.setInt(1, player.getObjectId());
- + ResultSet items = stm_items.executeQuery();
- +
- + switch (type)
- + {
- + case L2PcInstance.STORE_PRIVATE_BUY:
- + while (items.next())
- + {
- + if (player.getBuyList().addItemByItemId(items.getInt(2), items.getInt(3), items.getInt(4)) == null)
- + throw new NullPointerException();
- + }
- + player.getBuyList().setTitle(rs.getString("title"));
- + break;
- + case L2PcInstance.STORE_PRIVATE_SELL:
- + case L2PcInstance.STORE_PRIVATE_PACKAGE_SELL:
- + while (items.next())
- + {
- + if (player.getSellList().addItem(items.getInt(2), items.getInt(3), items.getInt(4)) == null)
- + throw new NullPointerException();
- + }
- + player.getSellList().setTitle(rs.getString("title"));
- + player.getSellList().setPackaged(type == L2PcInstance.STORE_PRIVATE_PACKAGE_SELL);
- + break;
- + case L2PcInstance.STORE_PRIVATE_MANUFACTURE:
- + L2ManufactureList createList = new L2ManufactureList();
- + while (items.next())
- + {
- + createList.add(new L2ManufactureItem(items.getInt(2), items.getInt(4)));
- + }
- + player.setCreateList(createList);
- + player.getCreateList().setStoreName(rs.getString("title"));
- + break;
- + }
- + items.close();
- + stm_items.close();
- +
- + player.sitDown();
- + if (Config.OFFLINE_SET_NAME_COLOR)
- + player.getAppearance().setNameColor(Config.OFFLINE_NAME_COLOR);
- + player.setPrivateStoreType(type);
- + player.setOnlineStatus(true, true);
- + player.restoreEffects();
- + player.broadcastUserInfo();
- + nTraders++;
- + }
- + catch (Exception e)
- + {
- + _log.log(Level.WARNING, "OfflineTradersTable[loadOffliners()]: Error loading trader: "+player,e);
- + if (player != null)
- + {
- + player.deleteMe();
- + }
- + }
- + }
- + rs.close();
- + stm.close();
- + _log.info("Loaded: " +nTraders+ " offline trader(s)");
- + stm = con.prepareStatement(CLEAR_OFFLINE_TABLE);
- + stm.execute();
- + stm.close();
- + stm = con.prepareStatement(CLEAR_OFFLINE_TABLE_ITEMS);
- + stm.execute();
- + stm.close();
- + }
- + catch (Exception e)
- + {
- + _log.log(Level.WARNING, "OfflineTradersTable[loadOffliners()]: Error while loading offline traders: ",e);
- + }
- + finally
- + {
- + try
- + {
- + con.close();
- + }
- + catch (Exception e)
- + { }
- + con = null;
- + }
- + }
- +}
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAio.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAio.java (revision 0)
- +++ java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAio.java (revision 0)
- @@ -0,0 +1,72 @@
- +/*
- + * 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
- + */
- +package net.sf.l2j.gameserver.handler.admincommandhandlers;
- +
- +import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- +
- +/**
- + * @author Anarchy
- + *
- + */
- +public class AdminAio implements IAdminCommandHandler
- +{
- + private static final String[] ADMIN_COMMANDS = { "setaio" };
- +
- + @Override
- + public boolean useAdminCommand(String command, L2PcInstance activeChar)
- + {
- + if (command.equals("setaio"))
- + {
- + Object target = activeChar.getTarget();
- +
- + if (target == null)
- + {
- + activeChar.sendMessage("Invalid target.");
- + return false;
- + }
- +
- + if (!(target instanceof L2PcInstance))
- + {
- + activeChar.sendMessage("Invalid target.");
- + return false;
- + }
- +
- + L2PcInstance trg = (L2PcInstance)target;
- +
- + if (trg.isAio())
- + {
- + trg.setAio(false);
- + activeChar.sendMessage("You have removed the AIO status from "+trg.getName()+".");
- + }
- + else
- + {
- + trg.setAio(true);
- + activeChar.sendMessage("You have given AIO status to "+trg.getName()+".");
- + }
- +
- + return true;
- + }
- +
- + return true;
- + }
- +
- + @Override
- + public String[] getAdminCommandList()
- + {
- + return ADMIN_COMMANDS;
- + }
- +
- +}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement