xRelic

Show HP/CP/ at pvp death

Jul 6th, 2021 (edited)
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.49 KB | None | 0 0
  1. Index: L2jFrozen_GameServer/config/functions/pvp.properties
  2. ===================================================================
  3. --- L2jFrozen_GameServer/config/functions/pvp.properties
  4. +++ L2jFrozen_GameServer/config/functions/pvp.properties
  5. @@ -207,4 +208,5 @@
  6. # War Legend Configs
  7. WarLegendAura = False
  8. KillsToGetWarLegendAura = 30
  9. +
  10. +#=============================================================
  11. +# Show Hp PvP
  12. +#=============================================================
  13. +# By João Vitor Barbosa
  14. +ShowHpPvP = True
  15.  
  16. #====================================
  17. # Anti Farm System
  18. #====================================
  19. # You must put True to active the AntiFarm mod.
  20.  
  21.  
  22.  
  23. Creditos meu !!
  24.  
  25.  
  26. Index: java/L2jFrozen_GameServer/head-src/com/l2jfrozen/Config.java
  27. ===================================================================
  28. --- java/L2jFrozen_GameServer/head-src/com/l2jfrozen/Config.java
  29. +++ java/L2jFrozen_GameServer/head-src/com/l2jfrozen/Config.java
  30. @@ -2623,2 +2624,3 @@
  31. public static boolean WAR_LEGEND_AURA;
  32. public static int KILLS_TO_GET_WAR_LEGEND_AURA;
  33. +
  34. +// Show HP PvP
  35. +public static boolean SHOW_HP_PVP;
  36.  
  37. public static boolean ANTI_FARM_ENABLED;
  38.  
  39. @@ -2744,6 +2745,7 @@
  40. WAR_LEGEND_AURA = Boolean.parseBoolean(pvpSettings.getProperty("WarLegendAura", "False"));
  41. KILLS_TO_GET_WAR_LEGEND_AURA = Integer.parseInt(pvpSettings.getProperty("KillsToGetWarLegendAura", "30"));
  42. +
  43. +// Show HP PvP
  44. +SHOW_HP_PVP = Boolean.parseBoolean(pvpSettings.getProperty("ShowHpPvP", "True"));
  45.  
  46. ANTI_FARM_ENABLED = Boolean.parseBoolean(pvpSettings.getProperty("AntiFarmEnabled", "False"));
  47.  
  48.  
  49.  
  50.  
  51. Index: java/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/L2Character.java
  52. ===================================================================
  53. --- java/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/L2Character.java
  54. +++ java/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/L2Character.java
  55. @@ -10312,4 +10313,5 @@
  56. public final double getCurrentHp()
  57. {
  58. return getStatus().getCurrentHp();
  59. }
  60. + /**
  61. + * Gets the current enemy hp after death
  62. + * @return the current hp
  63. + */
  64. + public final int getCurrentShowHpPvp()
  65. + {
  66. + return (int) getStatus().getCurrentHp();
  67. + }
  68. +
  69. + /**
  70. + * Gets the current enemy hp after death
  71. + * @return the current hp
  72. + */
  73. + public final int getCurrentShowCpPvp()
  74. + {
  75. + return (int) getStatus().getCurrentCp();
  76. + }
  77.  
  78. /**
  79. * Sets the current hp.
  80. * @param newHp the new current hp
  81. */
  82. public final void setCurrentHp(final double newHp)
  83. {
  84. getStatus().setCurrentHp(newHp);
  85. }
  86.  
  87.  
  88. Index: java/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
  89. ===================================================================
  90. --- java/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
  91. +++ java/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
  92. @@ -7859,1 +7860,2 @@
  93. // If in Arena, do nothing
  94. if (isInsideZone(ZONE_PVP) || targetPlayer.isInsideZone(ZONE_PVP))
  95. return;
  96. +
  97. +// Show HP PvP
  98. +if (Config.SHOW_HP_PVP)
  99. +targetPlayer.sendPacket(new ExShowScreenMessage( getName() + " - HP: " + getCurrentShowHpPvp() + "/" + getCurrentShowCpPvp() + " - CP: " , 4000));
  100.  
  101. // check anti-farm
  102. if (!checkAntiFarm(targetPlayer))
  103. return;
  104.  
  105.  
  106.  
  107.  
  108.  
  109. import com.l2jfrozen.gameserver.network.serverpackets.ExShowScreenMessage;
  110.  
  111.  
Add Comment
Please, Sign In to add comment