Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P L2_GameServer
- Index: java/config/l2jmods.properties
- ===================================================================
- --- java/config/l2jmods.properties (revision 3945)
- +++ java/config/l2jmods.properties (working copy)
- @@ -256,4 +256,75 @@
- # This option will enable core support for:
- # Mana Drug (item ID 726), using skill ID 9007.
- # Mana Potion (item ID 728), using skill ID 9008.
- -EnableManaPotionSupport = False
- \ No newline at end of file
- +EnableManaPotionSupport = False
- +
- +
- +# ---------------------------------------
- +# Section: PvP Title Color Change System by Level
- +# ---------------------------------------
- +# Each Amount will change the title content and color to the values defined here.
- +# Example: PvpAmount1 = 20, when a character's PvP counter reaches 20
- +# their title color and content will change according to the ColorForAmount value.
- +# Note: Colors Must Be in RBG format.
- +EnablePvPColorSystem = false
- +EnablePkColorSystem = false
- +
- +# Pvp Amount, Title & color level 1.
- +PvpAmount1 = 50
- +PkAmount1 = 50
- +ColorForAmount1 = 00FF00
- +TitleForAmount1 = 00FF00
- +
- +# Pvp Amount, Title & color level 2.
- +PvpAmount2 = 100
- +PkAmount2 = 100
- +ColorForAmount2 = 00FF00
- +TitleForAmount2 = 00FF00
- +
- +# Pvp Amount, Title & color level 3.
- +PvpAmount3 = 150
- +PkAmount3 = 150
- +ColorForAmount3 = 00FF00
- +TitleForAmount3 = 00FF00
- +
- +# Pvp Amount, Title & color level 4.
- +PvpAmount4 = 200
- +PkAmount4 = 200
- +ColorForAmount4 = 00FF00
- +TitleForAmount4 = 00FF00
- +
- +# Pvp Amount, Title & color level 5.
- +PvpAmount5 = 250
- +PkAmount5 = 250
- +ColorForAmount5 = 00FF00
- +TitleForAmount1 = 00FF00
- +
- +# Pvp Amount, Title & color level 6.
- +PvpAmount6 = 300
- +PkAmount6 = 300
- +ColorForAmount6 = 00FF00
- +TitleForAmount6 = 00FF00
- +
- +# Pvp Amount, Title & color level 7.
- +PvpAmount7 = 350
- +PkAmount7 = 350
- +ColorForAmount7 = 00FF00
- +TitleForAmount7 = 00FF00
- +
- +# Pvp Amount, Title & color level 8.
- +PvpAmount8 = 400
- +PkAmount8 = 400
- +ColorForAmount8 = 00FF00
- +TitleForAmount8 = 00FF00
- +
- +# Pvp Amount, Title & color level 9.
- +PvpAmount9 = 450
- +PkAmount9 = 450
- +ColorForAmount9 = 00FF00
- +TitleForAmount9 = 00FF00
- +
- +# Pvp Amount, Title & color level 10.
- +PvpAmount10 = 500
- +PkAmount10 = 500
- +ColorForAmount10 = 00FF00
- +TitleForAmount10 = 00FF00
- \ No newline at end of file
- Index: java/net/sf/l2j/Config.java
- ===================================================================
- --- java/net/sf/l2j/Config.java (revision 3945)
- +++ java/net/sf/l2j/Config.java (working copy)
- @@ -616,8 +616,51 @@
- public static boolean OFFLINE_SET_NAME_COLOR;
- public static int OFFLINE_NAME_COLOR;
- public static boolean L2JMOD_ENABLE_MANA_POTIONS_SUPPORT;
- + public static boolean PVP_TITLE_AND_COLOR_SYSTEM_ENABLED;
- + public static boolean PK_COLOR_SYSTEM_ENABLED;
- + public static int PVP_AmounT1;
- + public static int PK_AmounT1;
- + public static int TITLE_COLOR_FOR_PVP_AmounT1;
- + public static int NAME_COLOR_FOR_PK_AmounT1;
- + public static int PVP_AmounT2;
- + public static int PK_AmounT2;
- + public static int TITLE_COLOR_FOR_PVP_AmounT2;
- + public static int NAME_COLOR_FOR_PK_AmounT2;
- + public static int PVP_AmounT3;
- + public static int PK_AmounT3;
- + public static int TITLE_COLOR_FOR_PVP_AmounT3;
- + public static int NAME_COLOR_FOR_PK_AmounT3;
- + public static int PVP_AmounT4;
- + public static int PK_AmounT4;
- + public static int TITLE_COLOR_FOR_PVP_AmounT4;
- + public static int NAME_COLOR_FOR_PK_AmounT4;
- + public static int PVP_AmounT5;
- + public static int PK_AmounT5;
- + public static int TITLE_COLOR_FOR_PVP_AmounT5;
- + public static int NAME_COLOR_FOR_PK_AmounT5;
- + public static int PVP_AmounT6;
- + public static int PK_AmounT6;
- + public static int TITLE_COLOR_FOR_PVP_AmounT6;
- + public static int NAME_COLOR_FOR_PK_AmounT6;
- + public static int PVP_AmounT7;
- + public static int PK_AmounT7;
- + public static int TITLE_COLOR_FOR_PVP_AmounT7;
- + public static int NAME_COLOR_FOR_PK_AmounT7;
- + public static int PVP_AmounT8;
- + public static int PK_AmounT8;
- + public static int TITLE_COLOR_FOR_PVP_AmounT8;
- + public static int NAME_COLOR_FOR_PK_AmounT8;
- + public static int PVP_AmounT9;
- + public static int PK_AmounT9;
- + public static int TITLE_COLOR_FOR_PVP_AmounT9;
- + public static int NAME_COLOR_FOR_PK_AmounT9;
- + public static int PVP_AmounT10;
- + public static int PK_AmounT10;
- + public static int TITLE_COLOR_FOR_PVP_AmounT10;
- + public static int NAME_COLOR_FOR_PK_AmounT10;
- + public static int PVP_AmounT11;
- + public static int PK_AmounT11;
- -
- //--------------------------------------------------
- // NPC Settings
- //--------------------------------------------------
- @@ -2014,6 +2057,51 @@
- OFFLINE_NAME_COLOR = Integer.decode("0x" + L2JModSettings.getProperty("OfflineNameColor", "808080"));
- L2JMOD_ENABLE_MANA_POTIONS_SUPPORT = Boolean.parseBoolean(L2JModSettings.getProperty("EnableManaPotionSupport", "false"));
- +
- + PVP_TITLE_AND_COLOR_SYSTEM_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("EnablePvPColorSystem", "false"));
- + PK_COLOR_SYSTEM_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("EnablePkColorSystem", "false"));
- +
- + PVP_AmounT1 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount1", "50"));
- + PK_AmounT1 = Integer.parseInt(L2JModSettings.getProperty("PkAmount1", "50"));
- + TITLE_COLOR_FOR_PVP_AmounT1 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount1", "00FF00"));
- + NAME_COLOR_FOR_PK_AmounT1 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount1", "00FF00"));
- + PVP_AmounT2 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount2", "100"));
- + PK_AmounT2 = Integer.parseInt(L2JModSettings.getProperty("PkAmount2", "100"));
- + TITLE_COLOR_FOR_PVP_AmounT2 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount2", "00FF00"));
- + NAME_COLOR_FOR_PK_AmounT2 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount2", "00FF00"));
- + PVP_AmounT3 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount3", "150"));
- + PK_AmounT3 = Integer.parseInt(L2JModSettings.getProperty("PkAmount3", "150"));
- + TITLE_COLOR_FOR_PVP_AmounT3 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount3", "00FF00"));
- + NAME_COLOR_FOR_PK_AmounT3 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount3", "00FF00"));
- + PVP_AmounT4 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount4", "200"));
- + PK_AmounT4 = Integer.parseInt(L2JModSettings.getProperty("PkAmount4", "200"));
- + TITLE_COLOR_FOR_PVP_AmounT4 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount4", "00FF00"));
- + NAME_COLOR_FOR_PK_AmounT4 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount4", "00FF00"));
- + PVP_AmounT5 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount5", "250"));
- + PK_AmounT5 = Integer.parseInt(L2JModSettings.getProperty("PkAmount5", "250"));
- + TITLE_COLOR_FOR_PVP_AmounT5 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount5", "00FF00"));
- + NAME_COLOR_FOR_PK_AmounT5 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount5", "00FF00"));
- + PVP_AmounT6 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount6", "300"));
- + PK_AmounT6 = Integer.parseInt(L2JModSettings.getProperty("PkAmount6", "300"));
- + TITLE_COLOR_FOR_PVP_AmounT6 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount6", "00FF00"));
- + NAME_COLOR_FOR_PK_AmounT6 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount6", "00FF00"));
- + PVP_AmounT7 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount7", "350"));
- + PK_AmounT7 = Integer.parseInt(L2JModSettings.getProperty("PkAmount7", "350"));
- + TITLE_COLOR_FOR_PVP_AmounT7 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount7", "00FF00"));
- + NAME_COLOR_FOR_PK_AmounT7 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount7", "00FF00"));
- + PVP_AmounT8 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount8", "400"));
- + PK_AmounT8 = Integer.parseInt(L2JModSettings.getProperty("PkAmount8", "400"));
- + TITLE_COLOR_FOR_PVP_AmounT8 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount8", "00FF00"));
- + NAME_COLOR_FOR_PK_AmounT8 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount8", "00FF00"));
- + PVP_AmounT9 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount9", "450"));
- + PK_AmounT9 = Integer.parseInt(L2JModSettings.getProperty("PkAmount9", "450"));
- + TITLE_COLOR_FOR_PVP_AmounT9 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount9", "00FF00"));
- + NAME_COLOR_FOR_PK_AmounT9 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount9", "00FF00"));
- + PVP_AmounT10 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount10", "500"));
- + PK_AmounT10 = Integer.parseInt(L2JModSettings.getProperty("PkAmount10", "500"));
- + TITLE_COLOR_FOR_PVP_AmounT10 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount10", "00FF00"));
- + NAME_COLOR_FOR_PK_AmounT10 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount10", "00FF00"));
- +
- }
- catch (Exception e)
- {
- Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 3945)
- +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy)
- @@ -4384,6 +4384,109 @@
- DuelManager.getInstance().broadcastToOppositTeam(this, update);
- }
- }
- +
- + public void updatePvPTitleColor(int pvpKillAmount)
- + {
- + if (Config.PVP_TITLE_AND_COLOR_SYSTEM_ENABLED)
- + {
- + //Check if the character has GM access and if so, let them be.
- + if (isGM())
- + return;
- + {
- + if ((pvpKillAmount >= (Config.PVP_AmounT1)) && (pvpKillAmount < (Config.PVP_AmounT2)))
- + {
- + getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PVP_AmounT1);
- + }
- + if ((pvpKillAmount >= (Config.PVP_AmounT2)) && (pvpKillAmount < (Config.PVP_AmounT3)))
- + {
- + getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PVP_AmounT2);
- + }
- + if ((pvpKillAmount >= (Config.PVP_AmounT3)) && (pvpKillAmount < (Config.PVP_AmounT4)))
- + {
- + getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PVP_AmounT3);
- + }
- + if ((pvpKillAmount >= (Config.PVP_AmounT4)) && (pvpKillAmount < (Config.PVP_AmounT5)))
- + {
- + getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PVP_AmounT4);
- + }
- + if ((pvpKillAmount >= (Config.PVP_AmounT5)) && (pvpKillAmount < (Config.PVP_AmounT6)))
- + {
- + getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PVP_AmounT5);
- + }
- + if ((pvpKillAmount >= (Config.PVP_AmounT6)) && (pvpKillAmount < (Config.PVP_AmounT7)))
- + {
- + getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PVP_AmounT6);
- + }
- + if ((pvpKillAmount >= (Config.PVP_AmounT7)) && (pvpKillAmount < (Config.PVP_AmounT8)))
- + {
- + getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PVP_AmounT7);
- + }
- + if ((pvpKillAmount >= (Config.PVP_AmounT8)) && (pvpKillAmount < (Config.PVP_AmounT9)))
- + {
- + getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PVP_AmounT8);
- + }
- + if ((pvpKillAmount >= (Config.PVP_AmounT9)) && (pvpKillAmount < (Config.PVP_AmounT10)))
- + {
- + getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PVP_AmounT9);
- + }
- + else if (pvpKillAmount >= (Config.PVP_AmounT10))
- + {
- + getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PVP_AmounT10);
- + }
- + }
- + }
- + }
- + public void updatePkNameColor(int pkKillAmount)
- + {
- + if (Config.PK_COLOR_SYSTEM_ENABLED)
- + {
- + //Check if the character has GM access and if so, let them be.
- + if (isGM())
- + return;
- + {
- + if ((pkKillAmount >= (Config.PK_AmounT1)) && (pkKillAmount < (Config.PVP_AmounT2)))
- + {
- + getAppearance().setNameColor(Config.NAME_COLOR_FOR_PK_AmounT1);
- + }
- + if ((pkKillAmount >= (Config.PK_AmounT2)) && (pkKillAmount < (Config.PVP_AmounT3)))
- + {
- + getAppearance().setNameColor(Config.NAME_COLOR_FOR_PK_AmounT2);
- + }
- + if ((pkKillAmount >= (Config.PK_AmounT3)) && (pkKillAmount < (Config.PVP_AmounT4)))
- + {
- + getAppearance().setNameColor(Config.NAME_COLOR_FOR_PK_AmounT3);
- + }
- + if ((pkKillAmount >= (Config.PK_AmounT4)) && (pkKillAmount < (Config.PVP_AmounT5)))
- + {
- + getAppearance().setNameColor(Config.NAME_COLOR_FOR_PK_AmounT4);
- + }
- + if ((pkKillAmount >= (Config.PK_AmounT5)) && (pkKillAmount < (Config.PVP_AmounT6)))
- + {
- + getAppearance().setNameColor(Config.NAME_COLOR_FOR_PK_AmounT5);
- + }
- + if ((pkKillAmount >= (Config.PK_AmounT6)) && (pkKillAmount < (Config.PVP_AmounT7)))
- + {
- + getAppearance().setNameColor(Config.NAME_COLOR_FOR_PK_AmounT6);
- + }
- + if ((pkKillAmount >= (Config.PK_AmounT7)) && (pkKillAmount < (Config.PVP_AmounT8)))
- + {
- + getAppearance().setNameColor(Config.NAME_COLOR_FOR_PK_AmounT7);
- + }
- + if ((pkKillAmount >= (Config.PK_AmounT8)) && (pkKillAmount < (Config.PVP_AmounT9)))
- + {
- + getAppearance().setNameColor(Config.NAME_COLOR_FOR_PK_AmounT8);
- + }
- + if ((pkKillAmount >= (Config.PK_AmounT9)) && (pkKillAmount < (Config.PVP_AmounT10)))
- + {
- + getAppearance().setNameColor(Config.NAME_COLOR_FOR_PK_AmounT9);
- + }
- + else if (pkKillAmount >= (Config.PVP_AmounT10))
- + {
- + getAppearance().setNameColor(Config.NAME_COLOR_FOR_PK_AmounT10);
- + }
- + }
- + }
- + }
- /**
- * Send a Server->Client packet UserInfo to this L2PcInstance and CharInfo to all L2PcInstance in its _KnownPlayers.<BR><BR>
- @@ -5663,6 +5766,10 @@
- {
- // Add karma to attacker and increase its PK counter
- setPvpKills(getPvpKills() + 1);
- +
- + //Update the character's name color if they reached any of the 5 PvP levels.
- + updatePvPTitleColor(getPvpKills());
- + broadcastUserInfo();
- // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
- sendPacket(new UserInfo(this));
- @@ -5717,6 +5824,10 @@
- setKarma(getKarma() + newKarma);
- if (increasePk)
- setPkKills(getPkKills() + 1);
- +
- + //Update the character's title color if they reached any of the 5 PK levels.
- + updatePkNameColor(getPkKills());
- + broadcastUserInfo();
- // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
- sendPacket(new UserInfo(this));
- Index: java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (revision 3945)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (working copy)
- @@ -312,6 +312,9 @@
- quest.notifyEnterWorld(activeChar);
- }
- activeChar.sendPacket(new QuestList());
- +
- + if (activeChar.getPvpKills()>=(Config.PVP_AmounT1) && (Config.PVP_TITLE_AND_COLOR_SYSTEM_ENABLED)) activeChar.updatePvPTitleColor(activeChar.getPvpKills());
- + if (activeChar.getPkKills()>=(Config.PK_AmounT1) && (Config.PK_COLOR_SYSTEM_ENABLED)) activeChar.updatePkNameColor(activeChar.getPkKills());
- if (Config.PLAYER_SPAWN_PROTECTION > 0)
- activeChar.setProtection(true);
Advertisement
Add Comment
Please, Sign In to add comment