Skip to content

calcHitDetectionCone⚓︎

This event is raised before a hit attempt, to set up the hit detection cone of a attack swing. It is also raised a second time when the attack animation reaches its hit point, to check if the target is still within reach.

--- @param e calcHitDetectionConeEventData
local function calcHitDetectionConeCallback(e)
end
event.register(tes3.event.calcHitDetectionCone, calcHitDetectionConeCallback)

Tip

This event can be filtered based on the attacker.baseObject event data.

Tip

An event can be claimed by setting e.claim to true, or by returning false from the callback. Claiming the event prevents any lower priority callbacks from being called.

Event Data⚓︎

  • angleXY (number): The maximum allowable angle offset (in degrees) in the horizontal direction that will hit. This is related to game setting fCombatAngleXY but using different units. May be adjusted. The highest effective angle is 90 degrees, and larger angles will behave like 90 degrees.
  • angleZ (number): The maximum allowable angle offset (in degrees) in the vertical direction that will hit. This is related to game setting fCombatAngleZ but using different units. May be adjusted. The highest effective angle is 90 degrees, and larger angles will behave like 90 degrees.
  • attacker (tes3reference): Read-only. The reference of the attacker.
  • attackerMobile (tes3mobileActor): Read-only. The mobile which is making the attack.
  • reach (number): The weapon's reach multiplier, typically in the range 0.5 - 2.0. May be adjusted.
  • target (tes3reference): Read-only. The reference of the target. Only available at the second stage (weapon strike).
  • targetMobile (tes3mobileActor): Read-only. The mobile which is targetted. Only available at the second stage (weapon strike).