l2redkiller Posted March 4, 2010 Posted March 4, 2010 here we are : ### 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); its a Gracia Final code so if have epilogue try put manually :D gl with it Quote
Coyote™ Posted March 4, 2010 Posted March 4, 2010 This has been made before, so its pointless adding more and more levels. If somebody has the main code, he can make it for 1k levels. Imagine if everybody started to re-share codes, while he has only added a few useless values.. Quote
l2redkiller Posted March 4, 2010 Author Posted March 4, 2010 i made for my own server with 10 for pvp 10 for pk so use it or not xD only share it maybe ppl dont wanna create or cant create it like that ^^ Quote
Coyote™ Posted March 4, 2010 Posted March 4, 2010 i made for my own server with 10 for pvp 10 for pk so use it or not xD only share it maybe ppl dont wanna create or cant create it like that ^^ You didn't create it, you extended it. It's way different. Quote
+cs.tribal Posted March 6, 2010 Posted March 6, 2010 That is already shared Anyway...i will give it a try... Quote
xAddytzu Posted March 6, 2010 Posted March 6, 2010 good work thanks.... Sure! + 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); + } + } Quote
iambackfrom Posted March 6, 2010 Posted March 6, 2010 i wonna ask where i need to puts codes like that and what need to do with them can someone help me because i never done it or maybe there is guide ? :) Quote
Coyote™ Posted March 6, 2010 Posted March 6, 2010 its like vago's pvp color It IS what Vago shared. Quote
iambackfrom Posted March 6, 2010 Posted March 6, 2010 omg someone help me answer my question i dieing here because i try to do my self but i cant hwre need to put that ? Quote
Gxz Posted March 6, 2010 Posted March 6, 2010 It IS what Vago shared. then stealing someones work and pretending that is urs is forbidden, someone should lock it Quote
down Posted March 6, 2010 Posted March 6, 2010 omg someone help me answer my question i dieing here because i try to do my self but i cant hwre need to put that ? Config.java, l2jmods.properties, EnterWorld.java, L2PcInstance.java Quote
iambackfrom Posted March 6, 2010 Posted March 6, 2010 Config.java, l2jmods.properties, EnterWorld.java, L2PcInstance.java thanks that there is peoples whoa helping like me but when i open those files where i have to put those codes ant with what program i have to pen it ? Quote
iambackfrom Posted March 6, 2010 Posted March 6, 2010 soory for double posting but whe i trying to modify its says eror alwasy.. i wonna ask where are those files becausei cant found them Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.