Guest User

Untitled

a guest
Aug 20th, 2012
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.05 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P L2_GameServer
  3. Index: java/config/l2jmods.properties
  4. ===================================================================
  5. --- java/config/l2jmods.properties (revision 3945)
  6. +++ java/config/l2jmods.properties (working copy)
  7. @@ -256,4 +256,75 @@
  8. # This option will enable core support for:
  9. # Mana Drug (item ID 726), using skill ID 9007.
  10. # Mana Potion (item ID 728), using skill ID 9008.
  11. -EnableManaPotionSupport = False
  12. \ No newline at end of file
  13. +EnableManaPotionSupport = False
  14. +
  15. +
  16. +# ---------------------------------------
  17. +# Section: PvP Title Color Change System by Level
  18. +# ---------------------------------------
  19. +# Each Amount will change the title content and color to the values defined here.
  20. +# Example: PvpAmount1 = 20, when a character's PvP counter reaches 20
  21. +# their title color and content will change according to the ColorForAmount value.
  22. +# Note: Colors Must Be in RBG format.
  23. +EnablePvPColorSystem = false
  24. +EnablePkColorSystem = false
  25. +
  26. +# Pvp Amount, Title & color level 1.
  27. +PvpAmount1 = 50
  28. +PkAmount1 = 50
  29. +ColorForAmount1 = 00FF00
  30. +TitleForAmount1 = 00FF00
  31. +
  32. +# Pvp Amount, Title & color level 2.
  33. +PvpAmount2 = 100
  34. +PkAmount2 = 100
  35. +ColorForAmount2 = 00FF00
  36. +TitleForAmount2 = 00FF00
  37. +
  38. +# Pvp Amount, Title & color level 3.
  39. +PvpAmount3 = 150
  40. +PkAmount3 = 150
  41. +ColorForAmount3 = 00FF00
  42. +TitleForAmount3 = 00FF00
  43. +
  44. +# Pvp Amount, Title & color level 4.
  45. +PvpAmount4 = 200
  46. +PkAmount4 = 200
  47. +ColorForAmount4 = 00FF00
  48. +TitleForAmount4 = 00FF00
  49. +
  50. +# Pvp Amount, Title & color level 5.
  51. +PvpAmount5 = 250
  52. +PkAmount5 = 250
  53. +ColorForAmount5 = 00FF00
  54. +TitleForAmount1 = 00FF00
  55. +
  56. +# Pvp Amount, Title & color level 6.
  57. +PvpAmount6 = 300
  58. +PkAmount6 = 300
  59. +ColorForAmount6 = 00FF00
  60. +TitleForAmount6 = 00FF00
  61. +
  62. +# Pvp Amount, Title & color level 7.
  63. +PvpAmount7 = 350
  64. +PkAmount7 = 350
  65. +ColorForAmount7 = 00FF00
  66. +TitleForAmount7 = 00FF00
  67. +
  68. +# Pvp Amount, Title & color level 8.
  69. +PvpAmount8 = 400
  70. +PkAmount8 = 400
  71. +ColorForAmount8 = 00FF00
  72. +TitleForAmount8 = 00FF00
  73. +
  74. +# Pvp Amount, Title & color level 9.
  75. +PvpAmount9 = 450
  76. +PkAmount9 = 450
  77. +ColorForAmount9 = 00FF00
  78. +TitleForAmount9 = 00FF00
  79. +
  80. +# Pvp Amount, Title & color level 10.
  81. +PvpAmount10 = 500
  82. +PkAmount10 = 500
  83. +ColorForAmount10 = 00FF00
  84. +TitleForAmount10 = 00FF00
  85. \ No newline at end of file
  86.  
  87. Index: java/net/sf/l2j/Config.java
  88. ===================================================================
  89. --- java/net/sf/l2j/Config.java (revision 3945)
  90. +++ java/net/sf/l2j/Config.java (working copy)
  91. @@ -616,8 +616,51 @@
  92. public static boolean OFFLINE_SET_NAME_COLOR;
  93. public static int OFFLINE_NAME_COLOR;
  94. public static boolean L2JMOD_ENABLE_MANA_POTIONS_SUPPORT;
  95. + public static boolean PVP_TITLE_AND_COLOR_SYSTEM_ENABLED;
  96. + public static boolean PK_COLOR_SYSTEM_ENABLED;
  97. + public static int PVP_AmounT1;
  98. + public static int PK_AmounT1;
  99. + public static int TITLE_COLOR_FOR_PVP_AmounT1;
  100. + public static int NAME_COLOR_FOR_PK_AmounT1;
  101. + public static int PVP_AmounT2;
  102. + public static int PK_AmounT2;
  103. + public static int TITLE_COLOR_FOR_PVP_AmounT2;
  104. + public static int NAME_COLOR_FOR_PK_AmounT2;
  105. + public static int PVP_AmounT3;
  106. + public static int PK_AmounT3;
  107. + public static int TITLE_COLOR_FOR_PVP_AmounT3;
  108. + public static int NAME_COLOR_FOR_PK_AmounT3;
  109. + public static int PVP_AmounT4;
  110. + public static int PK_AmounT4;
  111. + public static int TITLE_COLOR_FOR_PVP_AmounT4;
  112. + public static int NAME_COLOR_FOR_PK_AmounT4;
  113. + public static int PVP_AmounT5;
  114. + public static int PK_AmounT5;
  115. + public static int TITLE_COLOR_FOR_PVP_AmounT5;
  116. + public static int NAME_COLOR_FOR_PK_AmounT5;
  117. + public static int PVP_AmounT6;
  118. + public static int PK_AmounT6;
  119. + public static int TITLE_COLOR_FOR_PVP_AmounT6;
  120. + public static int NAME_COLOR_FOR_PK_AmounT6;
  121. + public static int PVP_AmounT7;
  122. + public static int PK_AmounT7;
  123. + public static int TITLE_COLOR_FOR_PVP_AmounT7;
  124. + public static int NAME_COLOR_FOR_PK_AmounT7;
  125. + public static int PVP_AmounT8;
  126. + public static int PK_AmounT8;
  127. + public static int TITLE_COLOR_FOR_PVP_AmounT8;
  128. + public static int NAME_COLOR_FOR_PK_AmounT8;
  129. + public static int PVP_AmounT9;
  130. + public static int PK_AmounT9;
  131. + public static int TITLE_COLOR_FOR_PVP_AmounT9;
  132. + public static int NAME_COLOR_FOR_PK_AmounT9;
  133. + public static int PVP_AmounT10;
  134. + public static int PK_AmounT10;
  135. + public static int TITLE_COLOR_FOR_PVP_AmounT10;
  136. + public static int NAME_COLOR_FOR_PK_AmounT10;
  137. + public static int PVP_AmounT11;
  138. + public static int PK_AmounT11;
  139.  
  140. -
  141. //--------------------------------------------------
  142. // NPC Settings
  143. //--------------------------------------------------
  144. @@ -2014,6 +2057,51 @@
  145. OFFLINE_NAME_COLOR = Integer.decode("0x" + L2JModSettings.getProperty("OfflineNameColor", "808080"));
  146.  
  147. L2JMOD_ENABLE_MANA_POTIONS_SUPPORT = Boolean.parseBoolean(L2JModSettings.getProperty("EnableManaPotionSupport", "false"));
  148. +
  149. + PVP_TITLE_AND_COLOR_SYSTEM_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("EnablePvPColorSystem", "false"));
  150. + PK_COLOR_SYSTEM_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("EnablePkColorSystem", "false"));
  151. +
  152. + PVP_AmounT1 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount1", "50"));
  153. + PK_AmounT1 = Integer.parseInt(L2JModSettings.getProperty("PkAmount1", "50"));
  154. + TITLE_COLOR_FOR_PVP_AmounT1 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount1", "00FF00"));
  155. + NAME_COLOR_FOR_PK_AmounT1 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount1", "00FF00"));
  156. + PVP_AmounT2 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount2", "100"));
  157. + PK_AmounT2 = Integer.parseInt(L2JModSettings.getProperty("PkAmount2", "100"));
  158. + TITLE_COLOR_FOR_PVP_AmounT2 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount2", "00FF00"));
  159. + NAME_COLOR_FOR_PK_AmounT2 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount2", "00FF00"));
  160. + PVP_AmounT3 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount3", "150"));
  161. + PK_AmounT3 = Integer.parseInt(L2JModSettings.getProperty("PkAmount3", "150"));
  162. + TITLE_COLOR_FOR_PVP_AmounT3 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount3", "00FF00"));
  163. + NAME_COLOR_FOR_PK_AmounT3 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount3", "00FF00"));
  164. + PVP_AmounT4 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount4", "200"));
  165. + PK_AmounT4 = Integer.parseInt(L2JModSettings.getProperty("PkAmount4", "200"));
  166. + TITLE_COLOR_FOR_PVP_AmounT4 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount4", "00FF00"));
  167. + NAME_COLOR_FOR_PK_AmounT4 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount4", "00FF00"));
  168. + PVP_AmounT5 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount5", "250"));
  169. + PK_AmounT5 = Integer.parseInt(L2JModSettings.getProperty("PkAmount5", "250"));
  170. + TITLE_COLOR_FOR_PVP_AmounT5 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount5", "00FF00"));
  171. + NAME_COLOR_FOR_PK_AmounT5 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount5", "00FF00"));
  172. + PVP_AmounT6 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount6", "300"));
  173. + PK_AmounT6 = Integer.parseInt(L2JModSettings.getProperty("PkAmount6", "300"));
  174. + TITLE_COLOR_FOR_PVP_AmounT6 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount6", "00FF00"));
  175. + NAME_COLOR_FOR_PK_AmounT6 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount6", "00FF00"));
  176. + PVP_AmounT7 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount7", "350"));
  177. + PK_AmounT7 = Integer.parseInt(L2JModSettings.getProperty("PkAmount7", "350"));
  178. + TITLE_COLOR_FOR_PVP_AmounT7 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount7", "00FF00"));
  179. + NAME_COLOR_FOR_PK_AmounT7 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount7", "00FF00"));
  180. + PVP_AmounT8 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount8", "400"));
  181. + PK_AmounT8 = Integer.parseInt(L2JModSettings.getProperty("PkAmount8", "400"));
  182. + TITLE_COLOR_FOR_PVP_AmounT8 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount8", "00FF00"));
  183. + NAME_COLOR_FOR_PK_AmounT8 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount8", "00FF00"));
  184. + PVP_AmounT9 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount9", "450"));
  185. + PK_AmounT9 = Integer.parseInt(L2JModSettings.getProperty("PkAmount9", "450"));
  186. + TITLE_COLOR_FOR_PVP_AmounT9 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount9", "00FF00"));
  187. + NAME_COLOR_FOR_PK_AmounT9 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount9", "00FF00"));
  188. + PVP_AmounT10 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount10", "500"));
  189. + PK_AmounT10 = Integer.parseInt(L2JModSettings.getProperty("PkAmount10", "500"));
  190. + TITLE_COLOR_FOR_PVP_AmounT10 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount10", "00FF00"));
  191. + NAME_COLOR_FOR_PK_AmounT10 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount10", "00FF00"));
  192. +
  193. }
  194. catch (Exception e)
  195. {
  196. Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
  197. ===================================================================
  198. --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 3945)
  199. +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy)
  200. @@ -4384,6 +4384,109 @@
  201. DuelManager.getInstance().broadcastToOppositTeam(this, update);
  202. }
  203. }
  204. +
  205. + public void updatePvPTitleColor(int pvpKillAmount)
  206. + {
  207. + if (Config.PVP_TITLE_AND_COLOR_SYSTEM_ENABLED)
  208. + {
  209. + //Check if the character has GM access and if so, let them be.
  210. + if (isGM())
  211. + return;
  212. + {
  213. + if ((pvpKillAmount >= (Config.PVP_AmounT1)) && (pvpKillAmount < (Config.PVP_AmounT2)))
  214. + {
  215. + getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PVP_AmounT1);
  216. + }
  217. + if ((pvpKillAmount >= (Config.PVP_AmounT2)) && (pvpKillAmount < (Config.PVP_AmounT3)))
  218. + {
  219. + getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PVP_AmounT2);
  220. + }
  221. + if ((pvpKillAmount >= (Config.PVP_AmounT3)) && (pvpKillAmount < (Config.PVP_AmounT4)))
  222. + {
  223. + getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PVP_AmounT3);
  224. + }
  225. + if ((pvpKillAmount >= (Config.PVP_AmounT4)) && (pvpKillAmount < (Config.PVP_AmounT5)))
  226. + {
  227. + getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PVP_AmounT4);
  228. + }
  229. + if ((pvpKillAmount >= (Config.PVP_AmounT5)) && (pvpKillAmount < (Config.PVP_AmounT6)))
  230. + {
  231. + getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PVP_AmounT5);
  232. + }
  233. + if ((pvpKillAmount >= (Config.PVP_AmounT6)) && (pvpKillAmount < (Config.PVP_AmounT7)))
  234. + {
  235. + getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PVP_AmounT6);
  236. + }
  237. + if ((pvpKillAmount >= (Config.PVP_AmounT7)) && (pvpKillAmount < (Config.PVP_AmounT8)))
  238. + {
  239. + getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PVP_AmounT7);
  240. + }
  241. + if ((pvpKillAmount >= (Config.PVP_AmounT8)) && (pvpKillAmount < (Config.PVP_AmounT9)))
  242. + {
  243. + getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PVP_AmounT8);
  244. + }
  245. + if ((pvpKillAmount >= (Config.PVP_AmounT9)) && (pvpKillAmount < (Config.PVP_AmounT10)))
  246. + {
  247. + getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PVP_AmounT9);
  248. + }
  249. + else if (pvpKillAmount >= (Config.PVP_AmounT10))
  250. + {
  251. + getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PVP_AmounT10);
  252. + }
  253. + }
  254. + }
  255. + }
  256. + public void updatePkNameColor(int pkKillAmount)
  257. + {
  258. + if (Config.PK_COLOR_SYSTEM_ENABLED)
  259. + {
  260. + //Check if the character has GM access and if so, let them be.
  261. + if (isGM())
  262. + return;
  263. + {
  264. + if ((pkKillAmount >= (Config.PK_AmounT1)) && (pkKillAmount < (Config.PVP_AmounT2)))
  265. + {
  266. + getAppearance().setNameColor(Config.NAME_COLOR_FOR_PK_AmounT1);
  267. + }
  268. + if ((pkKillAmount >= (Config.PK_AmounT2)) && (pkKillAmount < (Config.PVP_AmounT3)))
  269. + {
  270. + getAppearance().setNameColor(Config.NAME_COLOR_FOR_PK_AmounT2);
  271. + }
  272. + if ((pkKillAmount >= (Config.PK_AmounT3)) && (pkKillAmount < (Config.PVP_AmounT4)))
  273. + {
  274. + getAppearance().setNameColor(Config.NAME_COLOR_FOR_PK_AmounT3);
  275. + }
  276. + if ((pkKillAmount >= (Config.PK_AmounT4)) && (pkKillAmount < (Config.PVP_AmounT5)))
  277. + {
  278. + getAppearance().setNameColor(Config.NAME_COLOR_FOR_PK_AmounT4);
  279. + }
  280. + if ((pkKillAmount >= (Config.PK_AmounT5)) && (pkKillAmount < (Config.PVP_AmounT6)))
  281. + {
  282. + getAppearance().setNameColor(Config.NAME_COLOR_FOR_PK_AmounT5);
  283. + }
  284. + if ((pkKillAmount >= (Config.PK_AmounT6)) && (pkKillAmount < (Config.PVP_AmounT7)))
  285. + {
  286. + getAppearance().setNameColor(Config.NAME_COLOR_FOR_PK_AmounT6);
  287. + }
  288. + if ((pkKillAmount >= (Config.PK_AmounT7)) && (pkKillAmount < (Config.PVP_AmounT8)))
  289. + {
  290. + getAppearance().setNameColor(Config.NAME_COLOR_FOR_PK_AmounT7);
  291. + }
  292. + if ((pkKillAmount >= (Config.PK_AmounT8)) && (pkKillAmount < (Config.PVP_AmounT9)))
  293. + {
  294. + getAppearance().setNameColor(Config.NAME_COLOR_FOR_PK_AmounT8);
  295. + }
  296. + if ((pkKillAmount >= (Config.PK_AmounT9)) && (pkKillAmount < (Config.PVP_AmounT10)))
  297. + {
  298. + getAppearance().setNameColor(Config.NAME_COLOR_FOR_PK_AmounT9);
  299. + }
  300. + else if (pkKillAmount >= (Config.PVP_AmounT10))
  301. + {
  302. + getAppearance().setNameColor(Config.NAME_COLOR_FOR_PK_AmounT10);
  303. + }
  304. + }
  305. + }
  306. + }
  307.  
  308. /**
  309. * Send a Server->Client packet UserInfo to this L2PcInstance and CharInfo to all L2PcInstance in its _KnownPlayers.<BR><BR>
  310. @@ -5663,6 +5766,10 @@
  311. {
  312. // Add karma to attacker and increase its PK counter
  313. setPvpKills(getPvpKills() + 1);
  314. +
  315. + //Update the character's name color if they reached any of the 5 PvP levels.
  316. + updatePvPTitleColor(getPvpKills());
  317. + broadcastUserInfo();
  318.  
  319. // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
  320. sendPacket(new UserInfo(this));
  321. @@ -5717,6 +5824,10 @@
  322. setKarma(getKarma() + newKarma);
  323. if (increasePk)
  324. setPkKills(getPkKills() + 1);
  325. +
  326. + //Update the character's title color if they reached any of the 5 PK levels.
  327. + updatePkNameColor(getPkKills());
  328. + broadcastUserInfo();
  329.  
  330. // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
  331. sendPacket(new UserInfo(this));
  332.  
  333. Index: java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
  334. ===================================================================
  335. --- java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (revision 3945)
  336. +++ java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (working copy)
  337. @@ -312,6 +312,9 @@
  338. quest.notifyEnterWorld(activeChar);
  339. }
  340. activeChar.sendPacket(new QuestList());
  341. +
  342. + if (activeChar.getPvpKills()>=(Config.PVP_AmounT1) && (Config.PVP_TITLE_AND_COLOR_SYSTEM_ENABLED)) activeChar.updatePvPTitleColor(activeChar.getPvpKills());
  343. + if (activeChar.getPkKills()>=(Config.PK_AmounT1) && (Config.PK_COLOR_SYSTEM_ENABLED)) activeChar.updatePkNameColor(activeChar.getPkKills());
  344.  
  345. if (Config.PLAYER_SPAWN_PROTECTION > 0)
  346. activeChar.setProtection(true);
Advertisement
Add Comment
Please, Sign In to add comment