Advertisement
Guest User

Untitled

a guest
Aug 1st, 2012
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 6.57 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()
  12. +   {
  13. +       if (Config.PVP_PREFIX_SYSTEM_ENABLED)
  14. +       {
  15. +           //Check if the character has GM access
  16. +           if (isGM())
  17. +               return;
  18. +           {
  19. +               ing pvpKills = getPvpKills();
  20. +               if ((pvpKills >= (Config.PVP_LVL1)) && (pvpKills <= (Config.PVP_LVL1)))
  21. +               {
  22. +                            setPrefix(Config.NAME_PREFIX_FOR_PVP_LVL1);
  23. +               }
  24. +               else if ((pvpKills >= (Config.PVP_LVL2)) && (pvpKills <= (Config.PVP_LVL2)))
  25. +               {
  26. +                   setPrefix(Config.NAME_PREFIX_FOR_PVP_LVL2);
  27. +               }
  28. +               else if ((pvpKills >= (Config.PVP_LVL3)) && (pvpKills <= (Config.PVP_LVL3)))
  29. +               {
  30. +                   setPrefix(Config.NAME_PREFIX_FOR_PVP_LVL3);
  31. +               }
  32. +               else if ((pvpKills >= (Config.PVP_LVL4)) && (pvpKills <= (Config.PVP_LVL4)))
  33. +               {
  34. +                   setPrefix(Config.NAME_PREFIX_FOR_PVP_LVL4);
  35. +               }
  36. +               else if ((pvpKills >= (Config.PVP_LVL5)) && (pvpKills <= (Config.PVP_LVL5)))
  37. +               {
  38. +                   setPrefix(Config.NAME_PREFIX_FOR_PVP_LVL5);
  39. +               }
  40. +               else if ((pvpKills >= (Config.PVP_LVL6)) && (pvpKills <= (Config.PVP_LVL6)))
  41. +               {
  42. +                   setPrefix(Config.NAME_PREFIX_FOR_PVP_LVL6);
  43. +               }
  44. +               else if ((pvpKills >= (Config.PVP_LVL7)) && (pvpKills <= (Config.PVP_LVL7)))
  45. +               {
  46. +                   setPrefix(Config.NAME_PREFIX_FOR_PVP_LVL7);
  47. +               }
  48. +               else if ((pvpKills >= (Config.PVP_LVL8)) && (pvpKills <= (Config.PVP_LVL8)))
  49. +               {
  50. +                   setPrefix(Config.NAME_PREFIX_FOR_PVP_LVL8);
  51. +               }
  52. +               else if ((pvpKills >= (Config.PVP_LVL9)) && (pvpKills <= (Config.PVP_LVL9)))
  53. +               {
  54. +                   setPrefix(Config.NAME_PREFIX_FOR_PVP_LVL9);
  55. +               }
  56. +               else if (pvpKills >= (Config.PVP_LVL10))
  57. +               {
  58. +                   setPrefix(Config.NAME_PREFIX_FOR_PVP_LVL10);
  59. +               }
  60. +           }
  61. +       }
  62. +   }
  63. +   private String _prefix;
  64. +   public String getPrefix()
  65. +   {
  66. +       return _prefix;
  67. +   }
  68. +   public void setPrefix(String prefix)
  69. +   {
  70. +       _prefix = prefix;
  71. +   }
  72.     /**
  73.      * Send a Server->Client packet UserInfo to this L2PcInstance and CharInfo to all L2PcInstance in its _KnownPlayers.<BR><BR>
  74.      *
  75. @@ -5684,6 +5735,9 @@
  76.             // Add karma to attacker and increase its PK counter
  77.             setPvpKills(getPvpKills() + 1);
  78.            
  79. +        updatePrefix(getPvpKills());
  80. +        broadcastUserInfo();
  81. +          
  82.             // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
  83.             sendPacket(new UserInfo(this));
  84.             sendPacket(new ExBrExtraUserInfo(this));
  85. Index: java/com/l2jserver/Config.java
  86. ===================================================================
  87. --- java/com/l2jserver/Config.java  (revision 5538)
  88. +++ java/com/l2jserver/Config.java  (working copy)
  89. @@ -725,6 +725,27 @@
  90.     public static int L2JMOD_DUALBOX_CHECK_MAX_PLAYERS_PER_IP;
  91.     public static int L2JMOD_DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP;
  92.     public static TIntIntHashMap L2JMOD_DUALBOX_CHECK_WHITELIST;
  93. +   public static boolean       PVP_PREFIX_SYSTEM_ENABLED;
  94. +   public static final int         PVP_LVL1;
  95. +   public static final int         PVP_LVL2;
  96. +   public static final int         PVP_LVL3;
  97. +   public static final int         PVP_LVL4;
  98. +   public static final int         PVP_LVL5;
  99. +   public static final int         PVP_LVL6;
  100. +   public static final int         PVP_LVL7;
  101. +   public static final int         PVP_LVL8;
  102. +   public static final int         PVP_LVL9;
  103. +   public static final int         PVP_LVL10;
  104. +   public static final String          NAME_PREFIX_FOR_PVP_LVL1;
  105. +   public static final String          NAME_PREFIX_FOR_PVP_LVL2;
  106. +   public static final String          NAME_PREFIX_FOR_PVP_LVL3;
  107. +   public static final String          NAME_PREFIX_FOR_PVP_LVL4;
  108. +   public static final String          NAME_PREFIX_FOR_PVP_LVL5;
  109. +   public static final String          NAME_PREFIX_FOR_PVP_LVL6;
  110. +   public static final String          NAME_PREFIX_FOR_PVP_LVL7;
  111. +   public static final String          NAME_PREFIX_FOR_PVP_LVL8;
  112. +   public static final String          NAME_PREFIX_FOR_PVP_LVL9;
  113. +   public static final String          NAME_PREFIX_FOR_PVP_LVL10;
  114.    
  115.     //--------------------------------------------------
  116.     // NPC Settings
  117. @@ -2421,7 +2442,29 @@
  118.                             }
  119.                         }
  120.                     }
  121. -                  
  122. +                   // PVP Name Prefix System configs - Start
  123. +                   PVP_PREFIX_SYSTEM_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("EnablePrefixSystem", "false"));
  124. +                   PVP_LVL1 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl1", "500"));
  125. +                   PVP_LVL2 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl2", "1000"));
  126. +                   PVP_LVL3 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl3", "2000"));
  127. +                   PVP_LVL4 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl4", "2500"));
  128. +                   PVP_LVL5 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl5", "3000"));
  129. +                   PVP_LVL6 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl6", "350"));
  130. +                   PVP_LVL7 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl7", "4000"));
  131. +                   PVP_LVL8 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl8", "4500"));
  132. +                   PVP_LVL9 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl9", "5000"));
  133. +                   PVP_LVL10 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl10", "7000"));
  134. +                   NAME_PREFIX_FOR_PVP_LVL1 = L2JModSettings.getProperty("PrefLvl1", "[Cadet]");
  135. +                   NAME_PREFIX_FOR_PVP_LVL2 = L2JModSettings.getProperty("PrefLvl2", "[Slayer]");
  136. +                   NAME_PREFIX_FOR_PVP_LVL3 = L2JModSettings.getProperty("PrefLvl3", "[Corporal]");
  137. +                   NAME_PREFIX_FOR_PVP_LVL4 = L2JModSettings.getProperty("PrefLvl4", "[Killer]");
  138. +                   NAME_PREFIX_FOR_PVP_LVL5 = L2JModSettings.getProperty("PrefLvl5", "[Executioner]");
  139. +                   NAME_PREFIX_FOR_PVP_LVL6 = L2JModSettings.getProperty("PrefLvl6", "[Most Wanted]");
  140. +                   NAME_PREFIX_FOR_PVP_LVL7 = L2JModSettings.getProperty("PrefLvl7", "[Enforcer}");
  141. +                   NAME_PREFIX_FOR_PVP_LVL8 = L2JModSettings.getProperty("PrefLvl8", "[Assasin}");
  142. +                   NAME_PREFIX_FOR_PVP_LVL9 = L2JModSettings.getProperty("PrefLvl9", "[Exterminator]");
  143. +                   NAME_PREFIX_FOR_PVP_LVL10 = L2JModSettings.getProperty("PrefLvl10", "[Lord of War]");
  144. +                   // PvP Name Prefix System configs - End
  145.                     BANKING_SYSTEM_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("BankingEnabled", "false"));
  146.                     BANKING_SYSTEM_GOLDBARS = Integer.parseInt(L2JModSettings.getProperty("BankingGoldbarCount", "1"));
  147.                     BANKING_SYSTEM_ADENA = Integer.parseInt(L2JModSettings.getProperty("BankingAdenaCount", "500000000"));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement