Need help with target player HP bar

ISupportYourAss

Путник
Пользователь
Сообщения
7
Розыгрыши
0
Репутация
0
Реакции
0
Баллы
64
Хроники
  1. Interlude
  2. Fafurion
Исходники
Присутствуют
Сборка
P166 Fafurion Classic Interlude
Hello, I'm editing an interface (FAFURION p166 source that I got from this forum), merging it with things that I've been finding here. Now I have a problem: when I target a player, it doesn't update the new values. I need to target again if I want to see the new value (HP/MP), The source (L2_166.zip) that i found with display hp/bar wasn't complete.
Can someone share his TargetStatusWnd.uc please? or tell me how to fix it? (i don't know how to send packets tho)
When i target myself or a monster/npc, it works 100%

1784329823172.webp
 
It's likely a server not sending a status update packet for players.
 
Of course, add players that have the player in target as status listeners and send regular status updates, just like it happens with a monster.
 
Последнее редактирование:
Idk where to start, I think that's everything for me as far as target player HP goes. I'm a player btw, not admin. Anyway, thanks.
Diff:
### Eclipse Workspace Patch 1.0
#P aCis_gameserver 29/07/2021
Index: java/net/sf/l2j/gameserver/model/actor/status/PlayerStatus.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/status/PlayerStatus.java    (revision 15)
+++ java/net/sf/l2j/gameserver/model/actor/status/PlayerStatus.java    (working copy)
@@ -427,10 +427,12 @@
         // Send StatusUpdate with current HP, MP and CP to this Player
         final StatusUpdate su = new StatusUpdate(_actor);
         su.addAttribute(StatusType.CUR_HP, (int) _hp);
+        su.addAttribute(StatusType.MAX_HP, getMaxHp());
         su.addAttribute(StatusType.CUR_MP, (int) _mp);
+        su.addAttribute(StatusType.MAX_MP, getMaxMp());
         su.addAttribute(StatusType.CUR_CP, (int) _cp);
         su.addAttribute(StatusType.MAX_CP, getMaxCp());
-        _actor.sendPacket(su);
+        _actor.broadcastPacket(su, true);
        
         final boolean needCpUpdate = needCpUpdate();
         final boolean needHpUpdate = needHpUpdate();
 
Diff:
### Eclipse Workspace Patch 1.0
#P aCis_gameserver 29/07/2021
Index: java/net/sf/l2j/gameserver/model/actor/status/PlayerStatus.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/status/PlayerStatus.java    (revision 15)
+++ java/net/sf/l2j/gameserver/model/actor/status/PlayerStatus.java    (working copy)
@@ -427,10 +427,12 @@
         // Send StatusUpdate with current HP, MP and CP to this Player
         final StatusUpdate su = new StatusUpdate(_actor);
         su.addAttribute(StatusType.CUR_HP, (int) _hp);
+        su.addAttribute(StatusType.MAX_HP, getMaxHp());
         su.addAttribute(StatusType.CUR_MP, (int) _mp);
+        su.addAttribute(StatusType.MAX_MP, getMaxMp());
         su.addAttribute(StatusType.CUR_CP, (int) _cp);
         su.addAttribute(StatusType.MAX_CP, getMaxCp());
-        _actor.sendPacket(su);
+        _actor.broadcastPacket(su, true);
      
         final boolean needCpUpdate = needCpUpdate();
         final boolean needHpUpdate = needHpUpdate();
That will broadcast to all players around, not just the ones who have the player on the target, it will spam packets like crazy.
 
Diff:
### Eclipse Workspace Patch 1.0
#P aCis_gameserver 29/07/2021
Index: java/net/sf/l2j/gameserver/model/actor/status/PlayerStatus.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/status/PlayerStatus.java    (revision 15)
+++ java/net/sf/l2j/gameserver/model/actor/status/PlayerStatus.java    (working copy)
@@ -427,10 +427,12 @@
         // Send StatusUpdate with current HP, MP and CP to this Player
         final StatusUpdate su = new StatusUpdate(_actor);
         su.addAttribute(StatusType.CUR_HP, (int) _hp);
+        su.addAttribute(StatusType.MAX_HP, getMaxHp());
         su.addAttribute(StatusType.CUR_MP, (int) _mp);
+        su.addAttribute(StatusType.MAX_MP, getMaxMp());
         su.addAttribute(StatusType.CUR_CP, (int) _cp);
         su.addAttribute(StatusType.MAX_CP, getMaxCp());
-        _actor.sendPacket(su);
+        _actor.broadcastPacket(su, true);
       
         final boolean needCpUpdate = needCpUpdate();
         final boolean needHpUpdate = needHpUpdate();
thanks for your reply, i'm a player not an admin, so i can't access the server files :')
 
Назад
Сверху Снизу