Jump to content

Recommended Posts

Posted

Good evening everyone, today I share a code for acis I found from JBrasil forum.

Basically what the code does is when someone kills us in PvP, shows us how much HP has been as pictured.

 
Index: gameserver/config/players.properties
===================================================================
--- gameserver/config/players.properties
+++ gameserver/config/players.properties
@@ -284,3 +284,4 @@
# Allow player subclass addition without checking for unique quest items.
AltSubClassWithoutQuests = False
+
+#=============================================================
+#              Show Hp PvP
+#=============================================================
+# By João Vitor Barbosa
+ShowHpPvP = True
 
#=============================================================
#                        Buffs config
#=============================================================
 
# Maximum number of buffs.
 
 
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java
+++ java/net/sf/l2j/Config.java
@@ -492,2 +492,3 @@
public static boolean ALT_GAME_SUBCLASS_WITHOUT_QUESTS;
+
+/** Show HP PvP */
+public static boolean SHOW_HP_PVP;
+
/** Buffs */
public static boolean STORE_SKILL_COOLTIME;
 
@@ -1079,5 +1079,6 @@
ALT_GAME_SUBCLASS_WITHOUT_QUESTS = players.getProperty("AltSubClassWithoutQuests", false);
+
+SHOW_HP_PVP = players.getProperty("ShowHpPvP", false);
 
BUFFS_MAX_AMOUNT = players.getProperty("MaxBuffsAmount", 20);
 
 
Index: java/net/sf/l2j/gameserver/model/actor/L2Character.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/L2Character.java
+++ java/net/sf/l2j/gameserver/model/actor/L2Character.java
@@ -5500,3 +5500,4 @@
public final double getCurrentHp()
{
return getStatus().getCurrentHp();
}
+
+public final int getCurrentShowHpPvp()
+{
+ return (int) getStatus().getCurrentHp();
+}
 
public final void setCurrentHp(double newHp)
{
getStatus().setCurrentHp(newHp);
}
 
 
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
@@ -4222,6 +4222,7 @@
// Add PvP point to attacker.
setPvpKills(getPvpKills() + 1);
+
+// Show HP PvP
+if (Config.SHOW_HP_PVP)
+ targetPlayer.sendPacket(new ExShowScreenMessage( getName() + " - HP: " + getCurrentShowHpPvp() + "/" + getMaxHp() , 4000, 0x02, true));
 
// Send UserInfo packet to attacker with its Karma and PK Counter
sendPacket(new UserInfo(this));
Guest
This topic is now closed to further replies.


×
×
  • Create New...