BabaVoss Posted May 10, 2023 Group: Members Topic Count: 37 Topics Per Day: 0.02 Content Count: 79 Reputation: 0 Joined: 06/17/20 Last Seen: February 7, 2024 Share Posted May 10, 2023 (edited) Good day guys, i would like to ask help regarding View_hpmeter, how to disable or hide hp bar when in Hide/Cloak status? Edited May 11, 2023 by BabaVoss Quote Link to comment Share on other sites More sharing options...
0 Sallycantdance Posted May 10, 2023 Group: Members Topic Count: 225 Topics Per Day: 0.14 Content Count: 798 Reputation: 12 Joined: 12/04/20 Last Seen: 6 hours ago Share Posted May 10, 2023 2 minutes ago, BabaVoss said: Good day guys, i would like to ask help regarding View_hpmeter, how to disable or hide hp bar when in Hide/Cloak status? are you using gm account while your looking at the players hp bar while hiding? if your using a gm account you can see their hp bar while hiding and if you are a normal player and you see the hp bar or normal players that was hiding or cloaking thats a real problem Quote Link to comment Share on other sites More sharing options...
0 BabaVoss Posted May 10, 2023 Group: Members Topic Count: 37 Topics Per Day: 0.02 Content Count: 79 Reputation: 0 Joined: 06/17/20 Last Seen: February 7, 2024 Author Share Posted May 10, 2023 38 minutes ago, GM Winter said: are you using gm account while your looking at the players hp bar while hiding? if your using a gm account you can see their hp bar while hiding and if you are a normal player and you see the hp bar or normal players that was hiding or cloaking thats a real problem Good eve @GM Winter, i turned on viewhpmeter for all. i wanted to provide new gameplay experience for players, but the problem is, hp bar also shows on hide/cloak status. thats why i want it to hide on hide/cloak status Quote Link to comment Share on other sites More sharing options...
0 Sallycantdance Posted May 10, 2023 Group: Members Topic Count: 225 Topics Per Day: 0.14 Content Count: 798 Reputation: 12 Joined: 12/04/20 Last Seen: 6 hours ago Share Posted May 10, 2023 where did you turn it on? maybe this can help you /conf/groups.conf Quote id: 10 name: "Law Enforcement" inherit: ( "Support" ) level: 2 commands: { hide: true follow: true kick: true disguise: true fakename: true option: true speed: true warp: true kill: true recall: true ban: true block: true jail: true jailfor: true mute: true storagelist: true cartlist: true itemlist: true stats: true } log_commands: true permissions: { join_chat: true kick_chat: true hide_session: true who_display_aid: true hack_info: true any_warp: true view_hpmeter: true } }, Quote Link to comment Share on other sites More sharing options...
0 joecalis Posted May 10, 2023 Group: Members Topic Count: 8 Topics Per Day: 0.00 Content Count: 64 Reputation: 41 Joined: 03/26/12 Last Seen: March 29 Share Posted May 10, 2023 (edited) in clif.cpp Find: void clif_hpmeter_single( map_session_data& sd, uint32 id, uint32 hp, uint32 maxhp ){ struct PACKET_ZC_NOTIFY_HP_TO_GROUPM p = {}; Change To: void clif_hpmeter_single( map_session_data& sd, uint32 id, uint32 hp, uint32 maxhp ){ struct PACKET_ZC_NOTIFY_HP_TO_GROUPM p = {}; map_session_data* dstsd = map_id2sd(id); if (dstsd && (dstsd->sc.option & (OPTION_HIDE | OPTION_CLOAK | OPTION_CHASEWALK) || dstsd->special_state.perfect_hiding)) return; Edited May 11, 2023 by joecalis Quote Link to comment Share on other sites More sharing options...
0 BabaVoss Posted May 11, 2023 Group: Members Topic Count: 37 Topics Per Day: 0.02 Content Count: 79 Reputation: 0 Joined: 06/17/20 Last Seen: February 7, 2024 Author Share Posted May 11, 2023 (edited) 2 hours ago, joecalis said: in clif.cpp Find: void clif_hpmeter_single( map_session_data& sd, uint32 id, uint32 hp, uint32 maxhp ){ struct PACKET_ZC_NOTIFY_HP_TO_GROUPM p = {}; Change To: void clif_hpmeter_single( map_session_data& sd, uint32 id, uint32 hp, uint32 maxhp ){ struct PACKET_ZC_NOTIFY_HP_TO_GROUPM p = {}; map_session_data* dstsd = map_id2sd(id); if (dstsd && (dstsd->sc.option & (OPTION_HIDE | OPTION_CLOAK | OPTION_CHASEWALK) || sd->special_state.perfect_hiding)) return; @joecalis good day sir joe, sorry i dont have this on my clif.cpp. i only have this /*========================================== * Server tells 'sd' player client the abouts of 'dstsd' player *------------------------------------------*/ static void clif_getareachar_pc(struct map_session_data* sd,struct map_session_data* dstsd) { struct block_list *d_bl; int i; if( dstsd->chatID ) { struct chat_data *cd = NULL; if( (cd = (struct chat_data*)map_id2bl(dstsd->chatID)) && cd->usersd[0]==dstsd) clif_dispchat(cd,sd->fd); } else if( dstsd->state.vending ) clif_showvendingboard(&dstsd->bl,dstsd->message,sd->fd); else if( dstsd->state.buyingstore ) clif_buyingstore_entry_single(sd, dstsd); if(dstsd->spiritball > 0) clif_spiritball_single(sd->fd, dstsd); if (dstsd->spiritcharm_type != CHARM_TYPE_NONE && dstsd->spiritcharm > 0) clif_spiritcharm_single(sd->fd, dstsd); if (dstsd->soulball > 0) clif_soulball_single(sd->fd, dstsd); if( (sd->status.party_id && dstsd->status.party_id == sd->status.party_id) || //Party-mate, or hpdisp setting. (sd->bg_id && sd->bg_id == dstsd->bg_id) || //BattleGround pc_has_permission(sd, PC_PERM_VIEW_HPMETER) ) clif_hpmeter_single(sd->fd, dstsd->bl.id, dstsd->battle_status.hp, dstsd->battle_status.max_hp); /*========================================== * Sends HP bar to a single fd. [Skotlex] *------------------------------------------*/ void clif_hpmeter_single(int fd, int id, unsigned int hp, unsigned int maxhp) { #if PACKETVER < 20100126 const int cmd = 0x106; #else const int cmd = 0x80e; #endif WFIFOHEAD(fd,packet_len(cmd)); WFIFOW(fd,0) = cmd; WFIFOL(fd,2) = id; #if PACKETVER < 20100126 if( maxhp > INT16_MAX ) {// To correctly display the %hp bar. [Skotlex] WFIFOW(fd,6) = hp/(maxhp/100); WFIFOW(fd,8) = 100; } else { WFIFOW(fd,6) = hp; WFIFOW(fd,8) = maxhp; } #else WFIFOL(fd,6) = hp; WFIFOL(fd,10) = maxhp; #endif WFIFOSET(fd, packet_len(cmd)); } Edited May 11, 2023 by BabaVoss Quote Link to comment Share on other sites More sharing options...
0 joecalis Posted May 11, 2023 Group: Members Topic Count: 8 Topics Per Day: 0.00 Content Count: 64 Reputation: 41 Joined: 03/26/12 Last Seen: March 29 Share Posted May 11, 2023 Try this: /*========================================== * Sends HP bar to a single fd. [Skotlex] *------------------------------------------*/ void clif_hpmeter_single(int fd, int id, unsigned int hp, unsigned int maxhp) { struct map_session_data* sd = map_id2sd(id); if(sd && (sd->sc.option&(OPTION_HIDE|OPTION_CLOAK|OPTION_CHASEWALK) || sd->special_state.perfect_hiding)) return; #if PACKETVER < 20100126 const int cmd = 0x106; #else const int cmd = 0x80e; #endif WFIFOHEAD(fd,packet_len(cmd)); WFIFOW(fd,0) = cmd; WFIFOL(fd,2) = id; #if PACKETVER < 20100126 if( maxhp > INT16_MAX ) {// To correctly display the %hp bar. [Skotlex] WFIFOW(fd,6) = hp/(maxhp/100); WFIFOW(fd,8) = 100; } else { WFIFOW(fd,6) = hp; WFIFOW(fd,8) = maxhp; } #else WFIFOL(fd,6) = hp; WFIFOL(fd,10) = maxhp; #endif WFIFOSET(fd, packet_len(cmd)); } Then find this: if( !tsd->fd || tsd == sd ) return 0; if (!pc_has_permission(tsd, PC_PERM_VIEW_HPMETER)) return 0; WFIFOHEAD(tsd->fd,packet_len(cmd)); Change it to this: if( !tsd->fd || tsd == sd ) return 0; if (!pc_has_permission(tsd, PC_PERM_VIEW_HPMETER)) return 0; if (sd->sc.option & (OPTION_HIDE | OPTION_CLOAK | OPTION_CHASEWALK) || sd->special_state.perfect_hiding) return 0; WFIFOHEAD(tsd->fd,packet_len(cmd)); 1 Quote Link to comment Share on other sites More sharing options...
0 BabaVoss Posted May 11, 2023 Group: Members Topic Count: 37 Topics Per Day: 0.02 Content Count: 79 Reputation: 0 Joined: 06/17/20 Last Seen: February 7, 2024 Author Share Posted May 11, 2023 (edited) @joecalis wow it worked like magic, im so happy thank you, you are the best! Is it also possible to hide on mapflag gvg_castle or on woe castle? incase during woe it will cause lag or fps drop, i could turn off viewhpmeter during woe castle 18 minutes ago, joecalis said: Try this: Then find this: Change it to this: Edited May 11, 2023 by BabaVoss Quote Link to comment Share on other sites More sharing options...
0 joecalis Posted May 11, 2023 Group: Members Topic Count: 8 Topics Per Day: 0.00 Content Count: 64 Reputation: 41 Joined: 03/26/12 Last Seen: March 29 Share Posted May 11, 2023 In the last code I provided just change this: if(sd && (sd->sc.option&(OPTION_HIDE|OPTION_CLOAK|OPTION_CHASEWALK) || sd->special_state.perfect_hiding)) return; to this: if(sd && (sd->sc.option&(OPTION_HIDE|OPTION_CLOAK|OPTION_CHASEWALK) || sd->special_state.perfect_hiding || map_flag_gvg(sd->bl.m))) return; then the second one: if (sd->sc.option & (OPTION_HIDE | OPTION_CLOAK | OPTION_CHASEWALK) || sd->special_state.perfect_hiding) return 0; to this: if (sd->sc.option & (OPTION_HIDE | OPTION_CLOAK | OPTION_CHASEWALK) || sd->special_state.perfect_hiding || map_flag_gvg(sd->bl.m)) return 0; 1 Quote Link to comment Share on other sites More sharing options...
0 BabaVoss Posted May 13, 2023 Group: Members Topic Count: 37 Topics Per Day: 0.02 Content Count: 79 Reputation: 0 Joined: 06/17/20 Last Seen: February 7, 2024 Author Share Posted May 13, 2023 On 5/11/2023 at 11:21 AM, joecalis said: In the last code I provided just change this: if(sd && (sd->sc.option&(OPTION_HIDE|OPTION_CLOAK|OPTION_CHASEWALK) || sd->special_state.perfect_hiding)) return; to this: if(sd && (sd->sc.option&(OPTION_HIDE|OPTION_CLOAK|OPTION_CHASEWALK) || sd->special_state.perfect_hiding || map_flag_gvg(sd->bl.m))) return; then the second one: if (sd->sc.option & (OPTION_HIDE | OPTION_CLOAK | OPTION_CHASEWALK) || sd->special_state.perfect_hiding) return 0; to this: if (sd->sc.option & (OPTION_HIDE | OPTION_CLOAK | OPTION_CHASEWALK) || sd->special_state.perfect_hiding || map_flag_gvg(sd->bl.m)) return 0; @joecalis good day sir joe, it worked. but theres a little problem, hpmeter for party member isnt visible also hehe. how can we fix it? Quote Link to comment Share on other sites More sharing options...
0 joecalis Posted May 13, 2023 Group: Members Topic Count: 8 Topics Per Day: 0.00 Content Count: 64 Reputation: 41 Joined: 03/26/12 Last Seen: March 29 Share Posted May 13, 2023 change this: if(sd && (sd->sc.option&(OPTION_HIDE|OPTION_CLOAK|OPTION_CHASEWALK) || sd->special_state.perfect_hiding || map_flag_gvg(sd->bl.m))) return; to this: struct map_session_data* tsd = (struct map_session_data*)session[fd]->session_data; if (sd && tsd && (sd->status.party_id && tsd->status.party_id && sd->status.party_id != tsd->status.party_id) && (sd->sc.option & (OPTION_HIDE | OPTION_CLOAK | OPTION_CHASEWALK) || sd->special_state.perfect_hiding || map_flag_gvg(sd->bl.m))) return; change second code: if (sd->sc.option & (OPTION_HIDE | OPTION_CLOAK | OPTION_CHASEWALK) || sd->special_state.perfect_hiding || map_flag_gvg(sd->bl.m)) return 0; to this: if ((sd->status.party_id && tsd->status.party_id && sd->status.party_id != tsd->status.party_id) && (sd->sc.option & (OPTION_HIDE | OPTION_CLOAK | OPTION_CHASEWALK) || sd->special_state.perfect_hiding || map_flag_gvg(sd->bl.m))) return 0; Quote Link to comment Share on other sites More sharing options...
0 BabaVoss Posted May 13, 2023 Group: Members Topic Count: 37 Topics Per Day: 0.02 Content Count: 79 Reputation: 0 Joined: 06/17/20 Last Seen: February 7, 2024 Author Share Posted May 13, 2023 @joecalis it didnt work and this script below didnt work anymore either. OPTION_HIDE | OPTION_CLOAK | OPTION_CHASEWALK) || sd->special_state.perfect_hiding || map_flag_gvg Quote Link to comment Share on other sites More sharing options...
0 joecalis Posted May 13, 2023 Group: Members Topic Count: 8 Topics Per Day: 0.00 Content Count: 64 Reputation: 41 Joined: 03/26/12 Last Seen: March 29 Share Posted May 13, 2023 (edited) I don't know what you're trying to accomplish, I thought you wanted party member's hp to be seen even while in gvg map. If you want party member's hp to be seen while cloaked, that's different since it is not visible by party members by default. (Check edit at the bottom) Here is what my unedited server (default settings) look like when a party member is cloaked/hidden. vlc-record-2023-05-13-15h48m49s-2023-05-13 15-46-17.mp4-.mp4 Anyway these are the codes that work for me without the cloaking thing: void clif_hpmeter_single(int fd, int id, unsigned int hp, unsigned int maxhp) { struct map_session_data* sd = map_id2sd(id); struct map_session_data* tsd = (struct map_session_data*)session[fd]->session_data; bool sameparty = false; bool isBg = false; if (sd && tsd && (sd->sc.option & (OPTION_HIDE | OPTION_CLOAK | OPTION_CHASEWALK) || sd->special_state.perfect_hiding || map_flag_gvg(sd->bl.m))) { if (sd->status.party_id && tsd->status.party_id && sd->status.party_id == tsd->status.party_id) sameparty = true; if (sd->bg_id && tsd->bg_id && sd->bg_id == tsd->bg_id) isBg = true; if (!sameparty && !isBg) return; } #if PACKETVER < 20100126 const int cmd = 0x106; #else const int cmd = 0x80e; #endif WFIFOHEAD(fd,packet_len(cmd)); WFIFOW(fd,0) = cmd; WFIFOL(fd,2) = id; #if PACKETVER < 20100126 if( maxhp > INT16_MAX ) {// To correctly display the %hp bar. [Skotlex] WFIFOW(fd,6) = hp/(maxhp/100); WFIFOW(fd,8) = 100; } else { WFIFOW(fd,6) = hp; WFIFOW(fd,8) = maxhp; } #else WFIFOL(fd,6) = hp; WFIFOL(fd,10) = maxhp; #endif WFIFOSET(fd, packet_len(cmd)); } static int clif_hpmeter_sub(struct block_list *bl, va_list ap) { struct map_session_data *sd, *tsd; #if PACKETVER < 20100126 const int cmd = 0x106; #else const int cmd = 0x80e; #endif sd = va_arg(ap, struct map_session_data *); tsd = (TBL_PC *)bl; nullpo_ret(sd); nullpo_ret(tsd); if( !tsd->fd || tsd == sd ) return 0; if (!pc_has_permission(tsd, PC_PERM_VIEW_HPMETER)) return 0; bool sameparty = false; bool isBg = false; if (sd->sc.option & (OPTION_HIDE | OPTION_CLOAK | OPTION_CHASEWALK) || sd->special_state.perfect_hiding || map_flag_gvg(sd->bl.m)) { if (sd->status.party_id && tsd->status.party_id && sd->status.party_id == tsd->status.party_id) sameparty = true; if (sd->bg_id && tsd->bg_id && sd->bg_id == tsd->bg_id) isBg = true; if(!sameparty && !isBg) return 0; } WFIFOHEAD(tsd->fd,packet_len(cmd)); WFIFOW(tsd->fd,0) = cmd; WFIFOL(tsd->fd,2) = sd->status.account_id; #if PACKETVER < 20100126 if( sd->battle_status.max_hp > INT16_MAX ) { //To correctly display the %hp bar. [Skotlex] WFIFOW(tsd->fd,6) = sd->battle_status.hp/(sd->battle_status.max_hp/100); WFIFOW(tsd->fd,8) = 100; } else { WFIFOW(tsd->fd,6) = sd->battle_status.hp; WFIFOW(tsd->fd,8) = sd->battle_status.max_hp; } #else WFIFOL(tsd->fd,6) = sd->battle_status.hp; WFIFOL(tsd->fd,10) = sd->battle_status.max_hp; #endif WFIFOSET(tsd->fd,packet_len(cmd)); return 0; } For the cloaking/hiding I'll have to look at it some other time. Edit: NVM I found an easy fix to the cloaking/hiding thing Find: //Whenever we send "changeoption" to the client, the provoke icon is lost //There is probably an option for the provoke icon, but as we don't know it, we have to do this for now if (sc->data[SC_PROVOKE]) { const struct TimerData *td = get_timer(sc->data[SC_PROVOKE]->timer); clif_status_change(bl, StatusIconChangeTable[SC_PROVOKE], 1, (!td ? INFINITE_TICK : DIFF_TICK(td->tick, gettick())), 0, 0, 0); } Change To: //Whenever we send "changeoption" to the client, the provoke icon is lost //There is probably an option for the provoke icon, but as we don't know it, we have to do this for now if (sc->data[SC_PROVOKE]) { const struct TimerData *td = get_timer(sc->data[SC_PROVOKE]->timer); clif_status_change(bl, StatusIconChangeTable[SC_PROVOKE], 1, (!td ? INFINITE_TICK : DIFF_TICK(td->tick, gettick())), 0, 0, 0); } if (sd) clif_hpmeter(sd); It seems that the party member hp doesn't show when you cloak in front of other party members but if you walk away outside of their screen then walk back it'll show, so I just made it that if you cloak you'll send your hpmeter to everyone in screen range. Edited May 13, 2023 by joecalis added cloaking fix and BG check 1 Quote Link to comment Share on other sites More sharing options...
0 BabaVoss Posted May 31, 2023 Group: Members Topic Count: 37 Topics Per Day: 0.02 Content Count: 79 Reputation: 0 Joined: 06/17/20 Last Seen: February 7, 2024 Author Share Posted May 31, 2023 (edited) @joecalis good day joecalis, sorry to bump you again. Can you pls add town mapflaag to this? if (sd->sc.option & (OPTION_HIDE | OPTION_CLOAK | OPTION_CHASEWALK) || sd->special_state.perfect_hiding || map_flag_gvg(sd->bl.m)) { thank you pls Edited May 31, 2023 by BabaVoss Quote Link to comment Share on other sites More sharing options...
Question
BabaVoss
Good day guys, i would like to ask help regarding View_hpmeter, how to disable or hide hp bar when in Hide/Cloak status?
Edited by BabaVossLink to comment
Share on other sites
13 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.