Advertisement
Axelut

Show HP on Pvp

Apr 20th, 2024
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. Index: gameserver/config/players.properties
  2. ===================================================================
  3. --- gameserver/config/players.properties
  4. +++ gameserver/config/players.properties
  5. @@ -284,3 +284,4 @@
  6. # Allow player subclass addition without checking for unique quest items.
  7. AltSubClassWithoutQuests = False
  8. +
  9. +#=============================================================
  10. +# Show Hp PvP
  11. +#=============================================================
  12. +# By João Vitor Barbosa
  13. +ShowHpPvP = True
  14.  
  15. #=============================================================
  16. # Buffs config
  17. #=============================================================
  18.  
  19. # Maximum number of buffs.
  20.  
  21.  
  22. Index: java/net/sf/l2j/Config.java
  23. ===================================================================
  24. --- java/net/sf/l2j/Config.java
  25. +++ java/net/sf/l2j/Config.java
  26. @@ -492,2 +492,3 @@
  27. public static boolean ALT_GAME_SUBCLASS_WITHOUT_QUESTS;
  28. +
  29. +/** Show HP PvP */
  30. +public static boolean SHOW_HP_PVP;
  31. +
  32. /** Buffs */
  33. public static boolean STORE_SKILL_COOLTIME;
  34.  
  35. @@ -1079,5 +1079,6 @@
  36. ALT_GAME_SUBCLASS_WITHOUT_QUESTS = players.getProperty("AltSubClassWithoutQuests", false);
  37. +
  38. +SHOW_HP_PVP = players.getProperty("ShowHpPvP", false);
  39.  
  40. BUFFS_MAX_AMOUNT = players.getProperty("MaxBuffsAmount", 20);
  41.  
  42.  
  43. Index: java/net/sf/l2j/gameserver/model/actor/L2Character.java
  44. ===================================================================
  45. --- java/net/sf/l2j/gameserver/model/actor/L2Character.java
  46. +++ java/net/sf/l2j/gameserver/model/actor/L2Character.java
  47. @@ -5500,3 +5500,4 @@
  48. public final double getCurrentHp()
  49. {
  50. return getStatus().getCurrentHp();
  51. }
  52. +
  53. +public final int getCurrentShowHpPvp()
  54. +{
  55. + return (int) getStatus().getCurrentHp();
  56. +}
  57.  
  58. public final void setCurrentHp(double newHp)
  59. {
  60. getStatus().setCurrentHp(newHp);
  61. }
  62.  
  63.  
  64. Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
  65. ===================================================================
  66. --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
  67. +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
  68. @@ -4222,6 +4222,7 @@
  69. // Add PvP point to attacker.
  70. setPvpKills(getPvpKills() + 1);
  71. +
  72. +// Show HP PvP
  73. +if (Config.SHOW_HP_PVP)
  74. + targetPlayer.sendPacket(new ExShowScreenMessage( getName() + " - HP: " + getCurrentShowHpPvp() + "/" + getMaxHp() , 4000, 0x02, true));
  75.  
  76. // Send UserInfo packet to attacker with its Karma and PK Counter
  77. sendPacket(new UserInfo(this));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement