ActionEquipMostDamagingMelee(object, int)

Causes the calling creature to equip its most damaging weapon.

void ActionEquipMostDamagingMelee(
    object oVersus = OBJECT_INVALID,
    int bOffHand = FALSE
);

Parameters

oVersus

You can try to get the most damaging weapon against oVersus (Default: OBJECT_INVALID)

bOffHand

(Default: FALSE)


Description

The creature will equip the melee weapon in its possession that can do the most damage (specifically against oVersus, if it is not OBJECT_INVALID) . If no valid melee weapon is found, it will equip the most damaging range weapon.



Remarks

This function should only ever be called in the EndOfCombatRound (the onCombatRoundEnd script, or uncomment the line with NW_FLAG_END_COMBAT_ROUND_EVENT in the onSpawn script and use the onUserDefined script) scripts, because otherwise it would have to stop the combat round to run simulation.

As with all ActionEquip* functions, it is not necessary to first unequip the current item in the same inventory slot before equipping the new item.

[UNKNOWN: bOffHand == TRUE does not appear to have any effect, other than if the calling creature does not have a weapon in the primary hand slot, then it will equip the weapon in the primary slot.]


Version

1.22

See Also

functions: ActionEquipMostDamagingRanged | ActionEquipMostEffectiveArmor | EquipAppropriateWeapons
categories: Action on Object Functions | Combat Actions Functions | Inventory Functions


 author: Troels Therkelsen
 Send comments on this topic.