Bluur

Correção Announce PvP/ Pk L2JFrozen

Jan 12th, 2017
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 6.76 KB | None | 0 0
  1. Index: F:/Workspace/L2jFrozen_GameServer/config/functions/pvp.properties
  2. ===================================================================
  3. --- F:/Workspace/L2jFrozen_GameServer/config/functions/pvp.properties   (revision 899)
  4. +++ F:/Workspace/L2jFrozen_GameServer/config/functions/pvp.properties   (working copy)
  5. @@ -181,15 +143,12 @@
  6. # Default : True  
  7. AllowSoEInPvP = True
  8.  
  9. -# Announce all Kills (PVP and PK Kills) (THIS MOD IS STILL BETA!)
  10. -AnnounceAllKill = False
  11. +# Announces when a Player Pvp another Player. Default - false
  12. +AnnouncePvPKill = False
  13.  
  14. # Announces when a Player PK another Player. Default - false  
  15. AnnouncePkKill = False
  16.  
  17. -# Announces when a Player Pvp another Player. Default - false
  18. -AnnouncePvPKill = False
  19. -
  20. # When the duel is more than 4 players are transported to the coordinates,
  21. # Listed below
  22. DuelSpawnX = -102495
  23. Index: F:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
  24. ===================================================================
  25. --- F:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java  (revision 899)
  26. +++ F:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java  (working copy)
  27. @@ -6478,6 +6455,10 @@
  28.              if(checkIfPvP(target) && targetPlayer.getPvpFlag() != 0 || isInsideZone(ZONE_PVP) && targetPlayer.isInsideZone(ZONE_PVP))
  29.              {
  30.                      increasePvpKills();
  31. +           if(target instanceof L2PcInstance && Config.ANNOUNCE_PVP_KILL && !isGM())
  32. +           {
  33. +                   Announcements.getInstance().announceToPlayers("PvP: " + getName() + " hunted " + target.getName());
  34. +           }
  35.              }
  36.              else
  37.              {
  38. @@ -6490,14 +6471,10 @@
  39.                                      {
  40.                                              // 'Both way war' -> 'PvP Kill'
  41.                                              increasePvpKills();
  42. -                                   if(target instanceof L2PcInstance && Config.ANNOUNCE_PVP_KILL)
  43. +                                   if(target instanceof L2PcInstance && Config.ANNOUNCE_PVP_KILL && !isGM())
  44.                                              {
  45. -                                           Announcements.getInstance().announceToAll("Player " + getName() + " hunted Player " + target.getName());
  46. +                                           Announcements.getInstance().announceToPlayers("PvP: " + getName() + " hunted " + target.getName());
  47.                                              }
  48. -                                   else if(target instanceof L2PcInstance && Config.ANNOUNCE_ALL_KILL)
  49. -                                   {
  50. -                                           Announcements.getInstance().announceToAll("Player " + getName() + " killed Player " + target.getName());
  51. -                                   }
  52.                                              addItemReword(targetPlayer);
  53.                                              return;
  54.                                      }
  55. @@ -6511,27 +6488,22 @@
  56.                                      if(Config.KARMA_AWARD_PK_KILL)
  57.                                      {
  58.                                              increasePvpKills();
  59. +                                   if(target instanceof L2PcInstance && Config.ANNOUNCE_PVP_KILL && !isGM())
  60. +                                   {
  61. +                                           Announcements.getInstance().announceToPlayers("PvP: " + getName() + " hunted " + target.getName());
  62. +                                   }
  63.                                      }
  64. -  
  65. -                           if(target instanceof L2PcInstance && Config.ANNOUNCE_PVP_KILL)
  66. -                           {
  67. -                                   Announcements.getInstance().announceToAll("Player " + getName() + " hunted Player " + target.getName());
  68. -                           }
  69.                              }
  70.                              else if(targetPlayer.getPvpFlag() == 0) // Target player doesn't have karma
  71.                              {
  72.                                      increasePkKillsAndKarma(targetPlayer.getLevel());
  73. -                           if(target instanceof L2PcInstance && Config.ANNOUNCE_PK_KILL)
  74. +                           if(target instanceof L2PcInstance && Config.ANNOUNCE_PK_KILL && !isGM())
  75.                                      {
  76. -                                   Announcements.getInstance().announceToAll("Player " + getName() + " has assassinated Player " + target.getName());
  77. +                                   Announcements.getInstance().announceToPlayers("PK: " + getName() + " has assassinated " + target.getName());
  78.                                      }
  79.                              }
  80.                      }
  81.              }
  82. -       if(target instanceof L2PcInstance && Config.ANNOUNCE_ALL_KILL)
  83. -       {
  84. -           Announcements.getInstance().announceToAll("Player " + getName() + " killed Player " + target.getName());
  85. -       }
  86.  
  87.              if(targetPlayer.getObjectId() == _lastKill && (count < Config.REWORD_PROTECT - 1 || Config.REWORD_PROTECT == 0) || !(_inEventDM && DM.is_started()))
  88.              {
  89. Index: F:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/entity/Announcements.java
  90. ===================================================================
  91. --- F:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/entity/Announcements.java (revision 899)
  92. +++ F:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/entity/Announcements.java (working copy)
  93. @@ -257,26 +257,29 @@
  94.         cs = null;
  95.       }
  96. +
  97. +   public void announceToPlayers(String message)
  98. +   {
  99. +       for (L2PcInstance player : L2World.getInstance().getAllPlayers())
  100. +       {
  101. +           player.sendMessage(message);
  102. +       }
  103. +      }
  104. +
  105.     // Method fo handling announcements from admin
  106.     public void handleAnnounce(String command, int lengthToTrim)
  107.     {
  108. Index: F:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/Config.java
  109. ===================================================================
  110. --- F:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/Config.java    (revision 899)
  111. +++ F:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/Config.java    (working copy)
  112. @@ -2531,7 +2547,6 @@
  113.      /** Announce PvP, PK, Kill*/
  114.      public static boolean ANNOUNCE_PVP_KILL;
  115.      public static boolean ANNOUNCE_PK_KILL;
  116. -   public static boolean ANNOUNCE_ALL_KILL;
  117.  
  118.      public static int DUEL_SPAWN_X;
  119.      public static int DUEL_SPAWN_Y;
  120. @@ -2649,8 +2686,7 @@
  121.                      ALLOW_POTS_IN_PVP = Boolean.parseBoolean(pvpSettings.getProperty("AllowPotsInPvP", "True"));
  122.                      /** Enable Pk Info mod. Displays number of times player has killed other */
  123.                      ENABLE_PK_INFO = Boolean.valueOf(pvpSettings.getProperty("EnablePkInfo", "false"));
  124. -           // Get the AnnounceAllKill, AnnouncePvpKill and AnnouncePkKill values
  125. -           ANNOUNCE_ALL_KILL = Boolean.parseBoolean(pvpSettings.getProperty("AnnounceAllKill", "False"));
  126. +           // Get the AnnouncePvpKill and AnnouncePkKill values
  127.                      ANNOUNCE_PVP_KILL = Boolean.parseBoolean(pvpSettings.getProperty("AnnouncePvPKill", "False"));
  128.                      ANNOUNCE_PK_KILL = Boolean.parseBoolean(pvpSettings.getProperty("AnnouncePkKill", "False"));
  129.  
  130. @@ -5297,18 +5333,14 @@
  131.              {
  132.                      STARTING_AA = Integer.parseInt(pValue);
  133.              }
  134. -       else if(pName.equalsIgnoreCase("AnnouncePvPKill") && !ANNOUNCE_ALL_KILL)
  135. +       else if(pName.equalsIgnoreCase("AnnouncePvPKill"))
  136.              {
  137.                      ANNOUNCE_PVP_KILL = Boolean.valueOf(pValue);
  138.              }
  139. -       else if(pName.equalsIgnoreCase("AnnouncePkKill") && !ANNOUNCE_ALL_KILL)
  140. +       else if(pName.equalsIgnoreCase("AnnouncePkKill"))
  141.              {
  142.                      ANNOUNCE_PK_KILL = Boolean.valueOf(pValue);
  143.              }
  144. -       else if(pName.equalsIgnoreCase("AnnounceAllKill") && !ANNOUNCE_PVP_KILL && !ANNOUNCE_PK_KILL)
  145. -       {
  146. -           ANNOUNCE_ALL_KILL = Boolean.valueOf(pValue);
  147. -       }
  148.              else if(pName.equalsIgnoreCase("DisableWeightPenalty"))
  149.              {
  150.                      DISABLE_WEIGHT_PENALTY = Boolean.valueOf(pValue);
Advertisement
Add Comment
Please, Sign In to add comment