Skip to content

tes3combatSession⚓︎

A structure that keeps track of combat session data.

Properties⚓︎

alchemyPriority⚓︎

No description yet available.

Returns:

  • result (number)

data⚓︎

A generic lua table that data can be written to, and synced to/from the save. All information stored must be valid for serialization to json.

There is a guide available here on using this table.

Returns:

  • result (table)

distance⚓︎

The combat distance.

Returns:

  • result (number)

lastUseTimestamp⚓︎

Used by the MCP to implement enchanted item cooldown.

Returns:

  • result (number)

mobile⚓︎

Read-only. Convenience access back to the associated actor.

Returns:


potionUseFlag⚓︎

No description yet available.

Returns:

  • result (number)

selectedAction⚓︎

The next action. From observed behavior, this roughly maps to:

Value Behavior
0 Undecided
1 Use melee weapon
2 Use marksman weapon
3 Use hand to hand attacks
4 Use on-touch offensive spell
5 Use on-target offensive spell
6 Use summon spell
7 Flee
8 Cast on-self empowering spell (For example, Ancestor Guardian)
9 MaybeEquipUseItem?
10 Use enchanted item

Returns:

  • result (integer)

selectedItem⚓︎

A potion or an enchanted item whose spell will be used.

Returns:


selectedShield⚓︎

Read-only. No description yet available.

Returns:


selectedSpell⚓︎

This field containg the spell the actor is currently casting. If not in casting state this field has nil value.

Returns:


selectedWeapon⚓︎

Read-only. The weapon the actor is using in this combat session.

Returns:


spellPriority⚓︎

No description yet available.

Returns:

  • result (number)

Methods⚓︎

changeEquipment⚓︎

This method equips an item to the mobile in this combat sesion.

myObject:changeEquipment(equipmentStack)

Parameters:


selectAlchemyWithEffect⚓︎

Selects the alchemy item with the greatest value, for a given effect ID and loads it into the selectedItem property.

local result = myObject:selectAlchemyWithEffect(id)

Parameters:

Returns:

  • result (number)