Triggers

Triggers can be found under the tactics tab in the character menu. They are crucial to managing your gladiators. Each trigger has one or more **event**, one or more **condition**, and one or more **action**. When the event(s) happens, and if all or one of the conditions are true (you can choose AND logic or OR logic here), then the gladiator will do the action(s). You can have more than one trigger, and the order of the triggers matters. Higher ordered triggers take precedence.

### **Creating triggers**

Triggers can be created by clicking the New Tactic button under the tactics tab. Events, conditions, and actions can be created by clicking the plus button under each section.

## Events

**List of events**

* When character gets damaged
* When ally gets damaged
* When character wounds enemy
* When character attacks enemy
* When character kills enemy
* When ally dies
* When character enters combat
* Always

Remember, you can have multiple events within a single trigger. If you are uncertain which event to use, use the 'Always' event.

## Conditions

Conditions can either have `AND` properties or `OR` properties. When using `AND`, all conditions must be true in order for the action to occur. When using `OR`, only a single condition must be true in order for the action to occur.

When referring to a character, the options are generally:

*- Self*

*- Event Enemy*

*- Event Ally*

*- Target*

*- Enemy(Nearest)*

*- Ally(Nearest)*

*- Enemy(Highest Health)*

*- Enemy(Lowest Health)*

*- Enemy(Highest Level)*

*- Enemy(Lowest Level)*

Event characters are the characters that are referenced in non-explicit character commands. For example, if the event is "When ally gets damaged", then to heal the ally that got damaged, use 'Event Ally' as the character that you heal. Another example: If you have your Event set to 'Always' (which is typically best), then create a 'Unit status' condition that is true when the 'Event Ally' health is below 40%, and create an event to heal the 'Event Ally'.

**List of conditions**

* **Unit status** 1 - Checks if health or stamina of a *character* is or is not within certain custom ranges*.*
* **Compare unit status** 1 - Exactly like above but instead compares two characters' values*.*
* **Unit State** 1 - Checks to see if a character is or is not Casting, Disabled, Dead, Fleeing, or Rampaging.
* **Damage Value** 2 - Checks to see if the character has a damage value that falls within a percentage range of the target's health.
* **Damage type** 2 - Checks damage type of the character.
* **Distance between** 1 - Checks distance between two characters*.*
* **Buff / Debuff** 1 - Checks to see if a character has a buff or has a debuff. It cannot check if the character does not have a buff/debuff*.*
* **Units within area** 1 - Checks to see how many units are within X m of a character. The units can be either enemies or allies, but not both. The distance range is completely customizable. If you want your range to have two bounds, then you simply need a 2nd condition. (For example if you want from 3 meters to 7 meters, have one condition that requires above 3, and another condition that requires below 7).
* **Engaged Enemies Count** 1 - Checks the number of enemies that are targeting a character. The number of enemies is a customizable range.
* **Unit Situation** 1 - Can check if character is stunned, unmoveable, struck up, knocked down, knocked out, or disarmed. If you want multiple of these, add another condition doing so.
* **Unit Behavior** 1 - Checks if character is or is not attacking, blocking, or dodging.
* **Weapon Type** 1 - Checks character's weapon type. Can use `IS` or `IS NOT` here.
* **Armor Type** 1 - Checks character's armor type. Can use `IS` or `IS NOT` here.

1 *Character in this case can be any from the above list.*

2 *Character in this case can only be the character who has the trigger.*

## Actions

* **No-target command** - Either command the character to stop or command the character to flee. Stop will bring the character to a standstill.
* **Cast Spell** - Cast a learned spell to a target. Possible targets depends on the skill. You cannot attack you allies nor heal your enemies.
* **Issue Target Command** - Attack or Attack Move to enemy. Enemy can be any of the enemy characters listed above. *(add what attack move does here)*
* **Use Consumable** - In-game it reads, "Use item that restores X% to Y% of (Health or Stamina or Mana)". *(add how consumables work here)*
* **Activate Spell** - Activate or deactivate any applicable spells. Mainly used for self buffs or stances/states. Anything that can be used here can also be used in the Cast Spell action. Either should work just fine. *(add list of applicable spells here)*
* **Switch Attack Direction** - Changes the attack direction of the character.
* **Switch Engage Style** - Changes the engage style of the character.
* **Switch Combat Style** - Changes the combat style of the character.

## Current Bugs

* Reordered triggers do not save their new position. The only known way around this is to go to the save file and manually reorder them.
* If the condition is empty, then it must be set to `AND`. If it is set to `OR`, the trigger will not work.
* The enabled/disabled flag is saved for the global trigger. Disabling it for one gladiator will disable it for all other gladiators also using that trigger. (Only matters if you export and import triggers)
* Using the Unit Behavior condition will only let you use the default version. Altering the condition will cause it to revert to default.