The hook should be placed at line 435, after the apr is declared and before the Repel check and any actual hit check is done. Alternatively, placing it at line 472 would still work as intended.
Here's an example of how the hook could look like:
Code: Select all
local hd = {"Combat:attackTargetWith:attackerBonuses", target=target, weapon=weapon, damtype=damtype, mult=mult, dam=dam, apr=apr, atk=atk, def=def, armor=armor}
if self:triggerHook(hd) then
target, weapon, damtype, mult, dam, apr, atk, def, armor = hd.target, hd.weapon, hd.damtype, hd.mult, hd.dam, hd.apr, hd.atk, hd.def, hd.armor
if hd.stop then return end
end

PS: the hook can't be called "Combat:attackTargetWith" because that's the name of a hook at the very end of "attackTargetHitProcs", just saying.