From 46ea2fb265f720368382ced235c54c1658c73044 Mon Sep 17 00:00:00 2001 From: NovaRain Date: Wed, 14 Jun 2017 12:39:33 +0800 Subject: [PATCH] Added Attack Type argument for HOOK_COMBATDAMAGE (from Crafty) #100 --- artifacts/scripting/hookscripts.txt | 1 + sfall/Modules/HookScripts/CombatHs.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/artifacts/scripting/hookscripts.txt b/artifacts/scripting/hookscripts.txt index f70144ca..76e45804 100644 --- a/artifacts/scripting/hookscripts.txt +++ b/artifacts/scripting/hookscripts.txt @@ -169,6 +169,7 @@ int arg8 - The bodypart that was struck int arg9 - Roll result of the attack (check with is_success, etc functions; basically: 0-crit. fail, 1-fail, 2-success, 3-crit. success) int arg10 - Number of bullets actually hit the target (1 for melee attacks) int arg11 - The amount of knockback to the target +int arg12 - Attack Type (see ATKTYPE_* constants) int ret1 - The damage to the target int ret2 - The damage to the attacker diff --git a/sfall/Modules/HookScripts/CombatHs.cpp b/sfall/Modules/HookScripts/CombatHs.cpp index eda7f07a..d0a225e5 100644 --- a/sfall/Modules/HookScripts/CombatHs.cpp +++ b/sfall/Modules/HookScripts/CombatHs.cpp @@ -133,7 +133,7 @@ static void __declspec(naked) ComputeDamageHook() { jz hookscript; inc dword ptr ds : [edx + 0x2c]; hookscript: - hookbegin(11); + hookbegin(12); mov ebx, [edx + 0x20]; mov args[0x00], ebx; mov ebx, [edx + 0x00]; @@ -156,6 +156,8 @@ hookscript: mov args[0x24], ebx; mov ebx, [edx + 0x34]; // knockback value mov args[0x28], ebx; + mov ebx, [edx + 0x04]; // attack type + mov args[0x2c], ebx; pushad; push HOOK_COMBATDAMAGE;