diff options
author | mekolat <mekolat@users.noreply.github.com> | 2015-05-19 18:27:46 -0400 |
---|---|---|
committer | mekolat <mekolat@users.noreply.github.com> | 2015-05-19 18:52:48 -0400 |
commit | c6c3671dbe28c596ef06b4670979c5923c8821b6 (patch) | |
tree | 7e1964f2afbe41e517d085c4a9cba1330e5a7858 /src/map/clif.cpp | |
parent | 3474fe93eef3cde085b6a9ee8c7efd4a5e2cddea (diff) | |
download | tmwa-c6c3671dbe28c596ef06b4670979c5923c8821b6.tar.gz tmwa-c6c3671dbe28c596ef06b4670979c5923c8821b6.tar.bz2 tmwa-c6c3671dbe28c596ef06b4670979c5923c8821b6.tar.xz tmwa-c6c3671dbe28c596ef06b4670979c5923c8821b6.zip |
fix mob hp, add mob range, unfuck packets
Diffstat (limited to 'src/map/clif.cpp')
-rw-r--r-- | src/map/clif.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/map/clif.cpp b/src/map/clif.cpp index 5297084..bae0bf1 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -772,6 +772,8 @@ static void clif_mob0078(dumb_ptr<mob_data> md, Buffer& buf) { nullpo_retv(md); + int max_hp = md->stats[mob_stat::MAX_HP]; + int hp = md->hp; Packet_Fixed<0x0078> fixed_78; fixed_78.block_id = md->bl_id; @@ -785,6 +787,12 @@ void clif_mob0078(dumb_ptr<mob_data> md, Buffer& buf) fixed_78.pos.y = md->bl_y; fixed_78.pos.dir = md->dir; + fixed_78.gloves_or_part_of_hp = static_cast<short>(hp >> 16); + fixed_78.part_of_guild_id_or_part_of_hp = static_cast<short>(hp & 0xffff); + fixed_78.part_of_guild_id_or_part_of_max_hp = static_cast<short>(max_hp >> 16); + fixed_78.guild_emblem_or_part_of_max_hp = static_cast<short>(max_hp & 0xffff); + fixed_78.karma_or_attack_range = battle_get_range(md); + buf = create_fpacket<0x0078, 54>(fixed_78); } @@ -796,6 +804,8 @@ static void clif_mob007b(dumb_ptr<mob_data> md, Buffer& buf) { nullpo_retv(md); + int max_hp = md->stats[mob_stat::MAX_HP]; + int hp = md->hp; Packet_Fixed<0x007b> fixed_7b; fixed_7b.block_id = md->bl_id; @@ -805,18 +815,18 @@ void clif_mob007b(dumb_ptr<mob_data> md, Buffer& buf) fixed_7b.option = md->option; fixed_7b.mob_class = md->mob_class; // snip: stuff for monsters disguised as PCs - fixed_7b.tick_and_maybe_part_of_guild_emblem = gettick(); - fixed_7b.max_hp = md->stats[mob_stat::MAX_HP]; - fixed_7b.hp = md->hp; + fixed_7b.tick = gettick(); fixed_7b.pos2.x0 = md->bl_x; fixed_7b.pos2.y0 = md->bl_y; fixed_7b.pos2.x1 = md->to_x; fixed_7b.pos2.y1 = md->to_y; - fixed_7b.five1 = 5; - fixed_7b.five2 = 5; - int level = battle_get_lv(md); - fixed_7b.level = (level > battle_config.max_lv) ? battle_config.max_lv : level; + + fixed_7b.gloves_or_part_of_hp = static_cast<short>(hp >> 16); + fixed_7b.part_of_guild_id_or_part_of_hp = static_cast<short>(hp & 0xffff); + fixed_7b.part_of_guild_id_or_part_of_max_hp = static_cast<short>(max_hp >> 16); + fixed_7b.guild_emblem_or_part_of_max_hp = static_cast<short>(max_hp & 0xffff); + fixed_7b.karma_or_attack_range = battle_get_range(md); buf = create_fpacket<0x007b, 60>(fixed_7b); } @@ -883,6 +893,7 @@ void clif_npc0078(dumb_ptr<npc_data> nd, Buffer& buf) fixed_78.pos.x = nd->bl_x; fixed_78.pos.y = nd->bl_y; fixed_78.pos.dir = nd->dir; + fixed_78.sex = nd->sex; buf = create_fpacket<0x0078, 54>(fixed_78); } |