// Bind self damage, avionics failure and hit-parts feedback to the player on a LocalMP host. // The stock damage producers skip hero/attacker checks on dedicated-server paths because a // dedicated server has no HUD; on a LocalMP host both run in the same process. // The HUD receives only the type, text index and ID, or the victim's damaged parts list. { "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. // 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" } } ] }, // Unit avionics/electronics failure dispatcher (13-entry switch for guidance, sensors, radar, // RWR, TWS, optics, targeting pod, laser designator, NVG, indicators). Reads its owning Unit* // from [comp + unit]; most cases emit HUD_MSG_DAMAGE without checking the unit's hero flag. // 2.61.0.37: 0xfca8b0; 2.61.0.43: 0xfce8e0. "avionics_damage": { "variants": [ { "written_for": "2.61.0.37", "locate": { "method": "signature", "pattern": "41 57 41 56 41 55 41 54 56 57 55 53 48 83 ec 58 0f 29 74 24 40 48 89 ce 83 fa 0c 0f 87 ?? ?? ?? ?? 89 d0 48 8d 0d ?? ?? ?? ?? 48 63 04 81 48 01 c8 ff e0 48 8b 46 ??", "captures": { "unit": { "offset": 54, "type": "u8" } } } } ] }, // Camera optic-view exit invoked by avionics_damage cases 2, 7 and 8 without checking hero. // 2.61.0.37: 0xfcab0b -> 0x15cd9c0; 2.61.0.43: 0xfceb3b -> 0x15d2760. "avionics_exit_optic": { "variants": [ { "written_for": "2.61.0.37", "locate": { "method": "within", "in": "avionics_damage", "pattern": "48 81 c1 ?? ?? ?? ?? 89 d3 ba 01 00 00 00 41 b0 01 e8 ?? ?? ?? ??", "captures": { "call": { "offset": 18, "type": "rel32" } } } } ] }, // Hit event attacker Unit* offset loaded before comparing against g_hero in Unit::onEvent // (unit_on_event is resolved in local_mp_core). // 2.61.0.37: 0x104495d (offender=0xd0); 2.61.0.43: 0x1048d7d (offender=0xd0). "hit_event_offender": { "variants": [ { "written_for": "2.61.0.37", "locate": { "method": "within", "in": "unit_on_event", "pattern": "48 8b bf ?? ?? ?? ?? 48 8b 35 ?? ?? ?? ?? 48 85 f6 74 ?? 48 8b 8e ?? ?? ?? ??", "captures": { "offender": { "offset": 3, "type": "u32" } } } } ] }, // Watched hero cell used when spectating in Unit::onEvent. // 2.61.0.37: 0x10449ab -> 0x7bad420; 2.61.0.43: 0x1048dcb -> 0x7bb9780. "hit_watched_hero": { "variants": [ { "written_for": "2.61.0.37", "locate": { "method": "within", "in": "unit_on_event", "pattern": "40 84 ed 74 ?? 48 8b 15 ?? ?? ?? ?? 48 8b 0d ?? ?? ?? ?? 48 39 d7 75 ??", "captures": { "watched_hero": { "offset": 8, "type": "rel32" } } } } ] }, // Unconditional enemy parts-list, hit-camera important events and naval hit-state calls // reached after the hit-camera attacker check in Unit::onEvent. // 2.61.0.37: 0x1045fc3 -> 0x18977c0, 0x1897cc0, 0x1896a40; // 2.61.0.43: 0x104a3d9 -> 0x189d140, 0x189d640, 0x189c3c0. "hit_parts_feedback": { "variants": [ { "written_for": "2.61.0.37", "locate": { "method": "within", "in": "unit_on_event", "pattern": "48 8b 0d ?? ?? ?? ?? 4c 8d b4 24 00 01 00 00 4c 89 ea 4d 89 f0 e8 ?? ?? ?? ?? 48 8b 0d ?? ?? ?? ?? 4c 89 ea 4d 89 f0 e8 ?? ?? ?? ?? 66 41 83 bd 8c 00 00 00 05 75 ?? 48 8b 0d ?? ?? ?? ?? 4c 8d 84 24 00 01 00 00 4c 89 ea e8 ?? ?? ?? ??", "captures": { "enqueue_enemy_parts": { "offset": 22, "type": "rel32" }, "hit_cam_important": { "offset": 40, "type": "rel32" }, "naval_hit_state": { "offset": 74, "type": "rel32" } } } } ] } } }