ActionEquipMostDamagingRanged(object)

Causes the calling creature to equip the most damaging ranged weapon in its inventory.

action ActionEquipMostDamagingRanged(
    object oVersus = OBJECT_INVALID
);

Parameters

oVersus

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


Description

The creature will equip the ranged weapon in its possession that can do the most damage (specifically against oVersus, if that is not OBJECT_INVALID). If no valid range weapon can be found, it will equip the most damaging melee 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.


Version

1.22

See Also

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


 author: Troels Therkelsen, editor: Dave Robinson
 Send comments on this topic.