diff options
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 1467493bb..ffa3acd9d 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2387,6 +2387,8 @@ int clif_updatestatus(struct map_session_data *sd,int type) break; case SP_HP: WFIFOL(fd,4)=sd->status.hp; + if(battle_config.disp_hpmeter) + clif_hpmeter(sd); break; case SP_SP: WFIFOL(fd,4)=sd->status.sp; @@ -5774,6 +5776,46 @@ int clif_party_hp(struct party *p,struct map_session_data *sd) return 0; } /*========================================== + * GMへ場所とHP通知 + *------------------------------------------ + */ +int clif_hpmeter(struct map_session_data *sd) +{ + struct map_session_data *md; + unsigned char buf[16]; + unsigned char buf2[16]; + int i; + + nullpo_retr(0, sd); + + WBUFW(buf,0)=0x107; + WBUFL(buf,2)=sd->bl.id; + WBUFW(buf,6)=sd->bl.x; + WBUFW(buf,8)=sd->bl.y; + + for(i=0;i<fd_max;i++){ + if(session[i] && (md=session[i]->session_data) && md->state.auth && + md->bl.m == sd->bl.m && pc_isGM(md) && sd != md){ + memcpy(WFIFOP(i,0),buf,packet_len_table[0x107]); + WFIFOSET(i,packet_len_table[0x107]); + } + } + + WBUFW(buf2,0)=0x106; + WBUFL(buf2,2)=sd->status.account_id; + WBUFW(buf2,6)=(sd->status.hp > 0x7fff)? 0x7fff:sd->status.hp; + WBUFW(buf2,8)=(sd->status.max_hp > 0x7fff)? 0x7fff:sd->status.max_hp; + for(i=0;i<fd_max;i++){ + if(session[i] && (md=session[i]->session_data) && md->state.auth && + md->bl.m == md->bl.m && pc_isGM(md) && sd != md){ + memcpy(WFIFOP(i,0),buf2,packet_len_table[0x106]); + WFIFOSET(i,packet_len_table[0x106]); + } + } + + return 0; +} +/*========================================== * パーティ場所移動(未使用) *------------------------------------------ */ |