// Send damage and control-loss notices only for the unit they describe on a LocalMP host. // The barrel and breech producers know the affected unit; the control-loss hints describe the // stock hero manager's current-hero cell, which on a local host can be left on another unit. // The HUD receives only the type, text index and ID. { "module": "local_mp_damage_notifications", "features": [ "K-Player damage notices" ], "requires": [ "local_mp_core" ], "sites": { // Damage handler prologue reads the impact's tagged unit reference. // 2.61.0.37: 0x398780; 2.61.0.43: 0x398700. "barrel_damage": { "variants": [ { "written_for": "2.61.0.37", "locate": { "method": "signature", "pattern": "41 56 56 57 53 48 83 ec 58 48 8b 72 ?? 89 f0 83 e0 01 0b 05 ?? ?? ?? ?? 3b 42 ?? 0f 85", "captures": { "unit": { "offset": 12, "type": "u8" } } } } ] }, // The barrel handler sends HUD_MSG_EVENT with hud_gun_barrel_exploded. "barrel_damage_notice": { "variants": [ { "written_for": "2.61.0.37", "locate": { "method": "within", "in": "barrel_damage", "pattern": "b9 09 00 00 00 ba e2 01 00 00 45 31 c0 45 31 c9 e8 ?? ?? ?? ??", "captures": { "id": { "offset": 6, "type": "u32" }, "deliver": { "offset": 17, "type": "rel32" } } } } ] }, // Fire update prologue through the argument saves and the weapon owner's unit load. // 2.61.0.37: 0x13e03a0; 2.61.0.43: 0x13e4a40. "breech_fire_update": { "variants": [ { "written_for": "2.61.0.37", "locate": { "method": "signature", "pattern": "41 57 41 56 41 55 41 54 56 57 55 53 48 81 ec f8 01 00 00 44 0f 29 bc 24 e0 01 00 00 44 0f 29 b4 24 d0 01 00 00 44 0f 29 ac 24 c0 01 00 00 44 0f 29 a4 24 b0 01 00 00 44 0f 29 9c 24 a0 01 00 00 44 0f 29 94 24 90 01 00 00 44 0f 29 8c 24 80 01 00 00 44 0f 29 84 24 70 01 00 00 0f 29 bc 24 60 01 00 00 0f 29 b4 24 50 01 00 00 4c 89 8c 24 18 01 00 00 4c 89 84 24 d8 00 00 00 48 89 94 24 10 01 00 00 48 89 ce f3 44 0f 10 94 24 80 02 00 00 48 8b 49 ??", "captures": { "unit": { "offset": 147, "type": "u8" } } } } ] }, // The fire update sends HUD_MSG_EVENT with hud_gun_breech_malfunction_misfire. "breech_damage_notice": { "variants": [ { "written_for": "2.61.0.37", "locate": { "method": "within", "in": "breech_fire_update", "pattern": "b9 09 00 00 00 ba e4 01 00 00 45 31 c0 45 31 c9 e8 ?? ?? ?? ??", "captures": { "id": { "offset": 6, "type": "u32" }, "deliver": { "offset": 17, "type": "rel32" } } } } ] }, // Resolve the currently controlled unit, preferring the active override over the original unit. // 2.61.0.37: 0x598bc0; 2.61.0.43: 0x5994c0. "mplayer_controlled_unit": { "variants": [ { "written_for": "2.61.0.37", "locate": { "method": "signature", "pattern": "48 83 ec 38 48 8d 81 78 08 00 00 48 8d 91 84 08 00 00 44 8b 81 80 08 00 00 4c 8d 89 54 08 00 00 45 85 c0 4c 0f 45 ca 48 8d 91 48 08 00 00" } } ] }, // HUD_MSG_DAMAGE delivery: resolves the text index to localized text, then pushes // {type, text, id} into the local HUD event queue. The control-loss hints (HUD text indices // 261..283) are pushed here. // 2.61.0.37: 0x19b1030; 2.61.0.43: 0x19b6ba0. "hud_damage_deliver": { "variants": [ { "written_for": "2.61.0.37", "locate": { "method": "signature", "pattern": "56 57 53 48 83 ec 50 48 83 3d ?? ?? ?? ?? 00 0f 84 ?? ?? ?? ?? 44 89 c6 89 cf b0 01" } } ] }, // HeroManager::on_controlled_hero_changed stores the previous and current controlled unit into // two adjacent process-wide cells. The hint refresh code reads the current one. // 2.61.0.37: 0xec6319, cell 0x7bad418; 2.61.0.43: 0xeca349, cell 0x7bb9778. "hero_unit": { "variants": [ { "written_for": "2.61.0.37", "locate": { "method": "signature", "pattern": "48 89 05 ?? ?? ?? ?? 48 89 3d ?? ?? ?? ?? 48 8b 3d ?? ?? ?? ?? 48 39 fe 0f 94 c0 08 c8", "captures": { "cell": { "offset": 10, "type": "rel32" } } } } ] } } }