# DataType:altability

Contains all the data related to alternate abilities

## Members

| **Type**                                                                                       | **Member**                | **Description**                                                           |
| ---------------------------------------------------------------------------------------------- | ------------------------- | ------------------------------------------------------------------------- |
| [*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)               | **AARankRequired**        | Rank required to train                                                    |
| [*bool*](/macroquest/data-types-and-top-level-objects/data-types/datatype-bool.md)             | **CanTrain**              | Returns true/false on if the Alternative Ability can be trained           |
| [*string*](/macroquest/data-types-and-top-level-objects/data-types/datatype-string.md)         | **Category**              | The name of the category that this AA belongs to.                         |
| [*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)               | **Cost**                  | Base cost to train                                                        |
| [*string*](/macroquest/data-types-and-top-level-objects/data-types/datatype-string.md)         | **Description**           | Basic description                                                         |
| [*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)               | **GroupID**               | ID of the AA group that this AA belongs to                                |
| [*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)               | **ID**                    | ID                                                                        |
| [*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)               | **Index**                 | Returns the index number of the Alternative Ability                       |
| [*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)               | **MaxRank**               | Max rank available in this ability                                        |
| [*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)               | **MinLevel**              | Minimum level to train                                                    |
| [*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)               | **MyReuseTime**           | Reuse time (in seconds) that takes into account any hastened AA abilities |
| [*string*](/macroquest/data-types-and-top-level-objects/data-types/datatype-string.md)         | **Name**                  | Name                                                                      |
| [*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)               | **NextIndex**             | Returns the next index number of the Alternative Ability                  |
| [*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)               | **PointsSpent**           | Returns the amount of points spent on an AA                               |
| [*bool*](/macroquest/data-types-and-top-level-objects/data-types/datatype-bool.md)             | **Passive**               | Returns true/false on if the Alternative Ability is passive               |
| [*altability*](/macroquest/data-types-and-top-level-objects/data-types/datatype-altability.md) | **RequiresAbility**       | Required ability (if any)                                                 |
| [*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)               | **Rank**                  | Returns the Rank of the AA                                                |
| [*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)               | **RequiresAbilityPoints** | Points required in above ability                                          |
| [*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)               | **ReuseTime**             | Reuse time in seconds                                                     |
| [*string*](/macroquest/data-types-and-top-level-objects/data-types/datatype-string.md)         | **ShortName**             | First line of button label (if any)                                       |
| [*string*](/macroquest/data-types-and-top-level-objects/data-types/datatype-string.md)         | **ShortName2**            | Second line of button label (if any)                                      |
| [*spell*](/macroquest/data-types-and-top-level-objects/data-types/datatype-spell.md)           | **Spell**                 | Spell used by the ability (if any)                                        |
| [*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)               | **Type**                  | Type (1-6)                                                                |
| [*string*](/macroquest/data-types-and-top-level-objects/data-types/datatype-string.md)         | **To String**             | Same as **Name**                                                          |

### Example:

If the AA "Companion's Aegis" can be trained, buy the next index/rank of it

{% tabs %}
{% tab title="MQScript" %}

```
/if (${AltAbility[Companion's Aegis].CanTrain}) {
    /alt buy ${AltAbility[Companion's Aegis].NextIndex}
}
```

{% endtab %}

{% tab title="Lua" %}

```lua
if mq.TLO.AltAbility("Companion's Aegis").CanTrain() then
    mq.cmd.alt('buy '..mq.TLO.AltAbility("Companion's Aegis").NextIndex())
end
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://macroquest.gitbook.io/macroquest/data-types-and-top-level-objects/data-types/datatype-altability.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
