From c6c3671dbe28c596ef06b4670979c5923c8821b6 Mon Sep 17 00:00:00 2001 From: mekolat Date: Tue, 19 May 2015 18:27:46 -0400 Subject: fix mob hp, add mob range, unfuck packets --- src/map/clif.cpp | 25 ++++++++++++++++++------- src/map/map.hpp | 1 + 2 files changed, 19 insertions(+), 7 deletions(-) (limited to 'src') 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 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 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(hp >> 16); + fixed_78.part_of_guild_id_or_part_of_hp = static_cast(hp & 0xffff); + fixed_78.part_of_guild_id_or_part_of_max_hp = static_cast(max_hp >> 16); + fixed_78.guild_emblem_or_part_of_max_hp = static_cast(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 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 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(hp >> 16); + fixed_7b.part_of_guild_id_or_part_of_hp = static_cast(hp & 0xffff); + fixed_7b.part_of_guild_id_or_part_of_max_hp = static_cast(max_hp >> 16); + fixed_7b.guild_emblem_or_part_of_max_hp = static_cast(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 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); } diff --git a/src/map/map.hpp b/src/map/map.hpp index b5f8566..aac646b 100644 --- a/src/map/map.hpp +++ b/src/map/map.hpp @@ -324,6 +324,7 @@ struct npc_data : block_list short n; Species npc_class; DIR dir; + SEX sex; DamageType sit; interval_t speed; NpcName name; -- cgit v1.2.3-60-g2f50