pirama

Untitled

Jun 24th, 2015
2,155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.55 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P L2j_Pirama
  3. Index: config/players.properties
  4. ===================================================================
  5. --- config/players.properties   (revision 85)
  6. +++ config/players.properties   (working copy)
  7. @@ -1,6 +1,7 @@
  8.  #=============================================================
  9.  #                           Misc
  10.  #=============================================================
  11.  
  12. +AnnounsPvp = true
  13. +PvpAmounts = 10;20;30;40;50;100;200
  14.  
  15.  
  16.  #Amount of adenas that a new character is given, default is 100
  17.  StartingAdena = 100
  18. Index: java/net/sf/l2j/Config.java
  19. ===================================================================
  20. --- java/net/sf/l2j/Config.java (revision 85)
  21. +++ java/net/sf/l2j/Config.java (working copy)
  22. @@ -449,6 +449,7 @@
  23.     // --------------------------------------------------
  24.    
  25.     /** Misc */
  26. +   public static boolean ANNOUNS_PVP;
  27. +   public static List<Integer> ANNOUNS_PVP_AMOUNTS = new ArrayList<>();
  28.    
  29.     public static int STARTING_ADENA;
  30.     public static boolean EFFECT_CANCELING;
  31.     public static double HP_REGEN_MULTIPLIER;
  32. @@ -1102,6 +1103,7 @@
  33.            
  34.             // players
  35.             ExProperties players = load(PLAYERS_FILE);
  36. +           ANNOUNS_PVP = players.getProperty("AnnounsPvp", true);
  37. +           String[] propertySplit = players.getProperty("PvpAmounts", "").split(";");
  38. +           if (propertySplit.length != 0)
  39. +               for (String i : propertySplit)
  40. +                   ANNOUNS_PVP_AMOUNTS.add(Integer.parseInt(i));
  41.             STARTING_ADENA = players.getProperty("StartingAdena", 100);
  42.             EFFECT_CANCELING = players.getProperty("CancelLesserEffect", true);
  43.             HP_REGEN_MULTIPLIER = players.getProperty("HpRegenMultiplier", 1.);
  44. Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
  45. ===================================================================
  46. --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (revision 85)
  47. +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (working copy)
  48. @@ -37,6 +37,7 @@
  49.  
  50.  import net.sf.l2j.Config;
  51.  import net.sf.l2j.L2DatabaseFactory;
  52. +import net.sf.l2j.gameserver.Announcements;
  53.  import net.sf.l2j.gameserver.LoginServerThread;
  54.  import net.sf.l2j.gameserver.ThreadPoolManager;
  55.  import net.sf.l2j.gameserver.ai.CtrlEvent;
  56. @@ -394,6 +395,8 @@
  57.     private byte _siegeState = 0;
  58.     private int _curWeightPenalty = 0;
  59.    
  60. +   private int _pvpKillsAnnoun;
  61. +  
  62.     private int _lastCompassZone; // the last compass zone update send to the client
  63.    
  64.     private boolean _isInWater;
  65. @@ -1797,6 +1800,16 @@
  66.         _pvpKills = pvpKills;
  67.     }
  68.    
  69. +   public int getPvpKillsAnnoun()
  70. +   {
  71. +       return _pvpKillsAnnoun;
  72. +   }
  73. +  
  74. +   public void setPvpKillsAnnoun(int pvpKillsAnnoun)
  75. +   {
  76. +       _pvpKillsAnnoun = pvpKillsAnnoun;
  77. +   }
  78. +  
  79.     /**
  80.      * @return The ClassId object of the L2PcInstance contained in L2PcTemplate.
  81.      */
  82. @@ -4011,6 +4024,8 @@
  83.             // Clear resurrect xp calculation
  84.             setExpBeforeDeath(0);
  85.            
  86. +           setPvpKillsAnnoun(0);
  87. +          
  88.             if (isCursedWeaponEquipped())
  89.                 CursedWeaponsManager.getInstance().drop(_cursedWeaponEquippedId, killer);
  90.             else
  91. @@ -4212,6 +4227,16 @@
  92.                 // Add PvP point to attacker.
  93.                 setPvpKills(getPvpKills() + 1);
  94.                
  95. +               if (Config.ANNOUNS_PVP)
  96. +               {
  97. +                   setPvpKillsAnnoun(getPvpKillsAnnoun() + 1);
  98. +                   if (Config.ANNOUNS_PVP_AMOUNTS.contains(getPvpKillsAnnoun()))
  99. +                   {
  100. +                       Announcements.announceToAll(" " + getName() + " Killed consecutive " + getPvpKillsAnnoun() + " Adversary's ");
  101. +                   }
  102. +               }
  103.                 // Send UserInfo packet to attacker with its Karma and PK Counter
  104.                 sendPacket(new UserInfo(this));
  105.             }
Advertisement
Add Comment
Please, Sign In to add comment