GetIsWeaponEffective(object, int)

Check whether script owner's equipped weapon is able to damage a given object.

int GetIsWeaponEffective(
    object oVersus = OBJECT_INVALID,
    int bOffHand = FALSE
);

Parameters

oVersus

Object to test weapon against. (Default: OBJECT_INVALID)

bOffHand

Check weapon equipped in off-hand? (Default: FALSE)


Description

Returns TRUE if it's possible for the script's owner to damage the given object with its equipped weapon. If bOffHand=TRUE, then the off-hand weapon is tested.



Remarks

This function must be called from a script which is "owned" by the creature whose weapon is to be tested.

The oVersus argument need not be a creature. For example, using a chest as the argument would normally return TRUE, but if the chest's plot flag is checked, then this function will return FALSE.

Also, an actual weapon need not be present. If no weapon is equipped, the creature's bare-handed attack is tested.


Version

1.22

See Also

categories: Get Data from Object Functions


 author: Jason Harris, editor: Kristian Markon