This is an OnHit handler that I use for applying a 'silver multiplier'
let weapon := attacker.GetEquippedObject 16 let name := $weapon If (CompareModelPath "silver" weapon || sv_Count "silver" weapon > 0 || CompareModelPath "mithril" weapon || sv_Count "mithril" weapon > 0) let damage := (GetAttackDamage weapon)*(GetGS fDamageWeaponMult) If GetWeaponType weapon != 5 let attribute := 0 If GetWeaponType weapon < 2 let skill := 14 Else let skill := 16 EndIf Else let attribute := 3 let skill := 28 EndIf let damage *= ((GetGS fDamageStrengthBase) + (attacker.GetAVC attribute)*0.01*(GetGS fDamageStrengthMult))*((GetGS fDamageSkillBase) + (attacker.GetAVC skill)*0.01*(GetGS fDamageSkillMult))*((GetGS fDamageWeaponConditionBase) + (((attacker.GetEquippedCurrentHealth 16)/(GetObjectHealth weapon))*(GetGS fDamageWeaponConditionMult))) let damage += attacker.GetAV AttackBonus If target.IsBlocking let block := (((target.GetAV Block)*(GetGS fBlockSkillMult)*0.01) + (GetGS fBlockSkillBase)) If (target.GetEquippedObject 13 == 0) if target.GetEquippedObject 16 let block *= (GetGS fBlockAmountWeaponMult) else let block *= (GetGS fBlockAmountHandToHandMult) endif Endif if block > (GetGS fBlockMax) let block := (GetGS fBlockMax) endif EndIf let resist := (100 - target.GetAV ReflectDamage)*0.01*(100 - target.GetArmorRating)*0.01 If resist > 0 && block < 1 let damage *= -1*resist*(1 - block) Else Return EndIf let damage *= fSilverVampireMult If damage < 0 If target.GetAV Health > -damage target.ModAV2 Health damage Else target.Kill attacker Endif EndIf EndIf
I'm not very sure if it actually works with bows at all. And it doesn't take the damage multiplier from game difficulty into account, which I don't know how to calculate.
Is there some better, less cumbersome way for doing this? Basically detecting the actual damage value an actor has sustained in a blow and being able to do stuff with it, instead of using all that formula to figure out how much damage the actor should have received in the last blow.