Set DAM_BACKWASH_ flag for attacker before calling combat damage (#246)

This commit is contained in:
NovaRain
2019-08-14 11:48:45 +08:00
parent 8855326e41
commit cce9697dfd
2 changed files with 10 additions and 1 deletions
+2 -1
View File
@@ -523,11 +523,12 @@ void Inject_CombatDamageHook() {
0x4233E3, // shoot_along_path() - for extra burst targets
0x423AB7, // compute_attack()
0x423BBF, // compute_attack()
0x423DE7, // compute_explosion_on_extras()
// 0x423DE7, // compute_explosion_on_extras()
0x423E69, // compute_explosion_on_extras()
0x424220, // attack_crit_failure()
0x4242FB, // attack_crit_failure()
});
MakeCall(0x423DEB, ComputeDamageHook); // compute_explosion_on_extras() - for the attacker
}
void Inject_FindTargetHook() {
+8
View File
@@ -744,6 +744,14 @@ void ScriptExtender::init() {
long long data = 0x397401C1F6; // test cl, 1; jz 0x483CF2
SafeWriteBytes(0x483CB4, (BYTE*)&data, 5);
// Set the DAM_BACKWASH_ flag for the attacker before calling compute_damage_
SafeWrite32(0x423DE7, 0x40164E80); // or [esi+ctd.flags3Source], DAM_BACKWASH_
long idata = 0x146E09; // or dword ptr [esi+ctd.flagsSource], ebp
SafeWriteBytes(0x423DF0, (BYTE*)&idata, 3);
if (*(BYTE*)0x423DEB != 0xE8) { // not hook call
MakeCall(0x423DEB, (void*)fo::funcoffs::compute_damage_);
}
InitNewOpcodes();
}