Guest User

Smart Pvp Feature - Core

a guest
Feb 4th, 2013
407
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5.23 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P aCis_gameserver
  3. Index: config/crystalia.properties
  4. ===================================================================
  5. --- config/crystalia.properties (revision 6)
  6. +++ config/crystalia.properties (working copy)
  7. @@ -186,4 +186,13 @@
  8.  # Game server console report.
  9.  # If set to true, game server console will get a report of
  10.  # current vote count, votes needed for next reward and votes needed for first page.
  11. -AllowHopzoneGameServerReport = True
  12. \ No newline at end of file
  13. +AllowHopzoneGameServerReport = True
  14. +
  15. +# Cool Pvp Feature (by Crystalia)
  16. +AllowPvpFeature = False
  17. +# Pvp's count to show the reward table.
  18. +PvpForRewards = 100
  19. +# Option 2 rewards you with pk (set your pk amount).
  20. +PkForReward = 30
  21. +# Option 3 rewards you with pvp (set your pvp amount).
  22. +PvpForReward = 30
  23. \ No newline at end of file
  24. Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java
  25. ===================================================================
  26. --- java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (revision 6)
  27. +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (working copy)
  28. @@ -38,6 +38,7 @@
  29. import net.sf.l2j.gameserver.network.SystemMessageId;
  30. import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
  31. import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
  32. +import net.sf.l2j.gameserver.network.serverpackets.UserInfo;
  33. import net.sf.l2j.gameserver.util.GMAudit;
  34.  
  35. public final class RequestBypassToServer extends L2GameClientPacket
  36. @@ -101,6 +102,28 @@
  37.             {
  38.                 playerHelp(activeChar, _command.substring(12));
  39.             }
  40. +          
  41. +                       else if (_command.startsWith("reward1"))
  42. +                           {
  43. +                               activeChar.setHero(true);
  44. +                               activeChar.broadcastUserInfo();
  45. +                               activeChar.sendMessage("Congratulations, wise choise! Enjoy your reward.");
  46. +                           }
  47. +                          
  48. +                           else if (_command.startsWith("reward2"))
  49. +                           {
  50. +                               activeChar.setPkKills(activeChar.getPkKills() + Config.PK_FOR_REWARD);
  51. +                               activeChar.sendPacket(new UserInfo(activeChar));
  52. +                               activeChar.sendMessage("Congratulations, wise choise! Enjoy your reward.");
  53. +                           }
  54. +                          
  55. +                           else if (_command.startsWith("reward3"))
  56. +                           {
  57. +                               activeChar.setPvpKills(activeChar.getPvpKills() + Config.PVP_FOR_REWARD);
  58. +                               activeChar.sendPacket(new UserInfo(activeChar));
  59. +                               activeChar.sendMessage("Congratulations, wise choise! Enjoy your reward.");
  60. +                           }
  61. +          
  62.             else if (_command.startsWith("npc_"))
  63.             {
  64.                 if (!activeChar.validateBypass(_command))
  65. Index: java/net/sf/l2j/Config.java
  66. ===================================================================
  67. --- java/net/sf/l2j/Config.java (revision 6)
  68. +++ java/net/sf/l2j/Config.java (working copy)
  69. @@ -559,6 +559,11 @@
  70.     public static int HOPZONE_DUALBOXES_ALLOWED;
  71.     public static boolean ALLOW_HOPZONE_GAME_SERVER_REPORT;
  72.    
  73. +    public static boolean ALLOW_PVP_FEATURE;
  74. +    public static int PVP_FOR_REWARDS;
  75. +    public static int PK_FOR_REWARD;
  76. +    public static int PVP_FOR_REWARD;
  77. +    
  78.     //--------------------------------------------------
  79.     // Server
  80.     //--------------------------------------------------
  81. @@ -1462,6 +1467,12 @@
  82.                 }
  83.                 HOPZONE_DUALBOXES_ALLOWED = Integer.parseInt(crystalia.getProperty("HopzoneDualboxesAllowed", "1"));
  84.                 ALLOW_HOPZONE_GAME_SERVER_REPORT = Boolean.parseBoolean(crystalia.getProperty("AllowHopzoneGameServerReport", "false"));
  85. +            
  86. +                ALLOW_PVP_FEATURE = Boolean.parseBoolean(crystalia.getProperty("AllowPvpFeature", "False"));
  87. +                PVP_FOR_REWARDS = Integer.parseInt(crystalia.getProperty("PvpForRewards", "100"));
  88. +                PK_FOR_REWARD = Integer.parseInt(crystalia.getProperty("PkForReward", "30"));
  89. +                PVP_FOR_REWARD = Integer.parseInt(crystalia.getProperty("PvpForReward", "30"));
  90. +            
  91.             }
  92.             catch (Exception e)
  93.             {
  94. Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
  95. ===================================================================
  96. --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (revision 6)
  97. +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (working copy)
  98. @@ -258,6 +258,9 @@
  99.     // Killing spree.
  100.     private int killingSpreePvps = 0;
  101.    
  102. +   // Cool Pvp Feature by Crystalia
  103. +   private int ConsecutiveKillCount = 0;
  104. +  
  105.     // VIP.
  106.     private boolean vip = false;
  107.    
  108. @@ -5020,6 +5023,16 @@
  109.         // Add karma to attacker and increase its PK counter
  110.         setPvpKills(getPvpKills() + 1);
  111.        
  112. +        ConsecutiveKillCount++;
  113. +
  114. +        if (Config.ALLOW_PVP_FEATURE && ConsecutiveKillCount == Config.PVP_FOR_REWARDS)
  115. +                   Announcements.getInstance().announceToAll(getName()+", got "+Config.PVP_FOR_REWARDS+" pvp without to die! He got reward for his effort.");
  116. +                {
  117. +                   String reward = HtmCache.getInstance().getHtm("data/html/reward.htm");
  118. +                   if (reward != null)
  119. +                       sendPacket(new NpcHtmlMessage(1, reward));
  120. +                } 
  121. +        
  122.         if (Config.ALLOW_KILLING_SPREE)
  123.         {
  124.             killingSpreePvp();
Advertisement
Add Comment
Please, Sign In to add comment