dymek84

Prefix name change by pvp count

Jul 31st, 2012
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 7.58 KB | None | 0 0
  1. Index: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java
  2. ===================================================================
  3. --- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java    (revision 5538)
  4. +++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java    (working copy)
  5. @@ -4343,7 +4343,58 @@
  6.             DuelManager.getInstance().broadcastToOppositTeam(this, update);
  7.         }
  8.     }
  9. -  
  10. +
  11. +   public void updatePrefix(int pvpKills)
  12. +   {
  13. +       if (Config.PVP_PREFIX_SYSTEM_ENABLED)
  14. +       {
  15. +           //Check if the character has GM access
  16. +           if (isGM())
  17. +               return;
  18. +           {
  19. +               if ((pvpKills >= (Config.PVP_LVL1)) && (pvpKills <= (Config.PVP_LVL1)))
  20. +               {
  21. +                   getActingPlayer().setName(Config.NAME_PREFIX_FOR_PVP_LVL1 + getActingPlayer().getName());
  22. +               }
  23. +               else if ((pvpKills >= (Config.PVP_LVL2)) && (pvpKills <= (Config.PVP_LVL2)))
  24. +               {
  25. +                   getActingPlayer().setName(Config.NAME_PREFIX_FOR_PVP_LVL2 + getActingPlayer().getName());
  26. +               }
  27. +               else if ((pvpKills >= (Config.PVP_LVL3)) && (pvpKills <= (Config.PVP_LVL3)))
  28. +               {
  29. +                   getActingPlayer().setName(Config.NAME_PREFIX_FOR_PVP_LVL3 + getActingPlayer().getName());
  30. +               }
  31. +               else if ((pvpKills >= (Config.PVP_LVL4)) && (pvpKills <= (Config.PVP_LVL4)))
  32. +               {
  33. +                   getActingPlayer().setName(Config.NAME_PREFIX_FOR_PVP_LVL4 + getActingPlayer().getName());
  34. +               }
  35. +               else if ((pvpKills >= (Config.PVP_LVL5)) && (pvpKills <= (Config.PVP_LVL5)))
  36. +               {
  37. +                   getActingPlayer().setName(Config.NAME_PREFIX_FOR_PVP_LVL5 + getActingPlayer().getName());
  38. +               }
  39. +               else if ((pvpKills >= (Config.PVP_LVL6)) && (pvpKills <= (Config.PVP_LVL6)))
  40. +               {
  41. +                   getActingPlayer().setName(Config.NAME_PREFIX_FOR_PVP_LVL6 + getActingPlayer().getName());
  42. +               }
  43. +               else if ((pvpKills >= (Config.PVP_LVL7)) && (pvpKills <= (Config.PVP_LVL7)))
  44. +               {
  45. +                   getActingPlayer().setName(Config.NAME_PREFIX_FOR_PVP_LVL7 + getActingPlayer().getName());
  46. +               }
  47. +               else if ((pvpKills >= (Config.PVP_LVL8)) && (pvpKills <= (Config.PVP_LVL8)))
  48. +               {
  49. +                   getActingPlayer().setName(Config.NAME_PREFIX_FOR_PVP_LVL8 + getActingPlayer().getName());
  50. +               }
  51. +               else if ((pvpKills >= (Config.PVP_LVL9)) && (pvpKills <= (Config.PVP_LVL9)))
  52. +               {
  53. +                   getActingPlayer().setName(Config.NAME_PREFIX_FOR_PVP_LVL9 + getActingPlayer().getName());
  54. +               }
  55. +               else if (pvpKills >= (Config.PVP_LVL10))
  56. +               {
  57. +                   getActingPlayer().setName(Config.NAME_PREFIX_FOR_PVP_LVL10 + getActingPlayer().getName());
  58. +               }
  59. +           }
  60. +       }
  61. +   }
  62.     /**
  63.      * Send a Server->Client packet UserInfo to this L2PcInstance and CharInfo to all L2PcInstance in its _KnownPlayers.<BR><BR>
  64.      *
  65. @@ -5684,6 +5735,9 @@
  66.             // Add karma to attacker and increase its PK counter
  67.             setPvpKills(getPvpKills() + 1);
  68.            
  69. +        updatePrefix(getPvpKills());
  70. +        broadcastUserInfo();
  71. +          
  72.             // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
  73.             sendPacket(new UserInfo(this));
  74.             sendPacket(new ExBrExtraUserInfo(this));
  75. Index: java/com/l2jserver/Config.java
  76. ===================================================================
  77. --- java/com/l2jserver/Config.java  (revision 5538)
  78. +++ java/com/l2jserver/Config.java  (working copy)
  79. @@ -725,6 +725,27 @@
  80.     public static int L2JMOD_DUALBOX_CHECK_MAX_PLAYERS_PER_IP;
  81.     public static int L2JMOD_DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP;
  82.     public static TIntIntHashMap L2JMOD_DUALBOX_CHECK_WHITELIST;
  83. +   public static boolean       PVP_PREFIX_SYSTEM_ENABLED;
  84. +   public static int           PVP_LVL1;
  85. +   public static int           PVP_LVL2;
  86. +   public static int           PVP_LVL3;
  87. +   public static int           PVP_LVL4;
  88. +   public static int           PVP_LVL5;
  89. +   public static int           PVP_LVL6;
  90. +   public static int           PVP_LVL7;
  91. +   public static int           PVP_LVL8;
  92. +   public static int           PVP_LVL9;
  93. +   public static int           PVP_LVL10;
  94. +   public static String            NAME_PREFIX_FOR_PVP_LVL1;
  95. +   public static String            NAME_PREFIX_FOR_PVP_LVL2;
  96. +   public static String            NAME_PREFIX_FOR_PVP_LVL3;
  97. +   public static String            NAME_PREFIX_FOR_PVP_LVL4;
  98. +   public static String            NAME_PREFIX_FOR_PVP_LVL5;
  99. +   public static String            NAME_PREFIX_FOR_PVP_LVL6;
  100. +   public static String            NAME_PREFIX_FOR_PVP_LVL7;
  101. +   public static String            NAME_PREFIX_FOR_PVP_LVL8;
  102. +   public static String            NAME_PREFIX_FOR_PVP_LVL9;
  103. +   public static String            NAME_PREFIX_FOR_PVP_LVL10;
  104.    
  105.     //--------------------------------------------------
  106.     // NPC Settings
  107. @@ -2421,7 +2442,29 @@
  108.                             }
  109.                         }
  110.                     }
  111. -                  
  112. +                   // PVP Name Prefix System configs - Start
  113. +                   PVP_PREFIX_SYSTEM_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("EnablePrefixSystem", "false"));
  114. +                   PVP_LVL1 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl1", "500"));
  115. +                   PVP_LVL2 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl2", "1000"));
  116. +                   PVP_LVL3 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl3", "2000"));
  117. +                   PVP_LVL4 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl4", "2500"));
  118. +                   PVP_LVL5 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl5", "3000"));
  119. +                   PVP_LVL6 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl6", "350"));
  120. +                   PVP_LVL7 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl7", "4000"));
  121. +                   PVP_LVL8 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl8", "4500"));
  122. +                   PVP_LVL9 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl9", "5000"));
  123. +                   PVP_LVL10 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl10", "7000"));
  124. +                   NAME_PREFIX_FOR_PVP_LVL1 = L2JModSettings.getProperty("PrefLvl1", "[Cadet]");
  125. +                   NAME_PREFIX_FOR_PVP_LVL2 = L2JModSettings.getProperty("PrefLvl2", "[Slayer]");
  126. +                   NAME_PREFIX_FOR_PVP_LVL3 = L2JModSettings.getProperty("PrefLvl3", "[Corporal]");
  127. +                   NAME_PREFIX_FOR_PVP_LVL4 = L2JModSettings.getProperty("PrefLvl4", "[Killer]");
  128. +                   NAME_PREFIX_FOR_PVP_LVL5 = L2JModSettings.getProperty("PrefLvl5", "[Executioner]");
  129. +                   NAME_PREFIX_FOR_PVP_LVL6 = L2JModSettings.getProperty("PrefLvl6", "[Most Wanted]");
  130. +                   NAME_PREFIX_FOR_PVP_LVL7 = L2JModSettings.getProperty("PrefLvl7", "[Enforcer}");
  131. +                   NAME_PREFIX_FOR_PVP_LVL8 = L2JModSettings.getProperty("PrefLvl8", "[Assasin}");
  132. +                   NAME_PREFIX_FOR_PVP_LVL9 = L2JModSettings.getProperty("PrefLvl9", "[Exterminator]");
  133. +                   NAME_PREFIX_FOR_PVP_LVL10 = L2JModSettings.getProperty("PrefLvl10", "[Lord of War]");
  134. +                   // PvP Name Prefix System configs - End
  135.                     BANKING_SYSTEM_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("BankingEnabled", "false"));
  136.                     BANKING_SYSTEM_GOLDBARS = Integer.parseInt(L2JModSettings.getProperty("BankingGoldbarCount", "1"));
  137.                     BANKING_SYSTEM_ADENA = Integer.parseInt(L2JModSettings.getProperty("BankingAdenaCount", "500000000"));
  138.  
  139.  
  140. ----------------------------------------------------------------------
  141. Add to l2jmod.properties
  142.  
  143.  
  144. # ---------------------------------------
  145. # Prefix name change by pvp count
  146. # ---------------------------------------
  147. # Want to turn on or off prefix
  148. EnablePrefixSystem = false
  149.  
  150. # Pvp level 1.
  151. PvpLvl1 = 500
  152. PrefLvl1 = [Cadet]
  153.  
  154. # Pvp   level 2.
  155. PvpLvl2 = 1000
  156. PrefLvl2 = [Slayer]
  157.  
  158. # Pvp   level 3.
  159. PvpLvl3 = 2000
  160. PrefLvl3 = [Corporal]
  161.  
  162. # Pvp   level 4.
  163. PvpLvl4 = 2500
  164. PrefLvl4 = [Killer]
  165.  
  166. # Pvp   level 5.
  167. PvpLvl5 = 3000
  168. PrefLvl5 = [Executioner]
  169.  
  170. # Pvp   level 6.
  171. PvpLvl6 = 3500
  172. PrefLvl6 = [Most Wanted]
  173.  
  174. # Pvp   level 7.
  175. PvpLvl7 = 4000
  176. PrefLvl7 = [Enforcer}
  177.  
  178. # Pvp   level 8.
  179. PvpLvl8 = 4500
  180. PrefLvl8 = [Assasin}
  181.  
  182. # Pvp   level 9.
  183. PvpLvl9 = 5000
  184. PrefLvl9 = [Exterminator]
  185.  
  186. # Pvp   level 10.
  187. PvpLvl10 = 7000
  188. PrefLvl10 = [Lord of War]
Advertisement
Add Comment
Please, Sign In to add comment