|
|
|
Custom flags are bouquet validators which accept a user defined anonymous function that returns a boolean value. This allows for any custom condition to be used as part of the evaluation of a bouquet's chain of validators. These custom flag validators can be any valid anonymous Lua function which returns `true` or `false`.
|
|
|
|
|
|
|
|
## Table of Contents
|
|
|
|
|
|
|
|
[[_TOC_]]
|
|
|
|
|
|
|
|
## Accessing Unit Information
|
|
|
|
|
|
|
|
The `VUHDO_unitInfo` table provides the relevant cached information on the subject unit to the anonymous function.
|
|
|
|
|
|
|
|
The simple example below returns true if the unit is named 'Ivaria':
|
| ... | ... | @@ -7,18 +13,24 @@ The simple example below returns true if the unit is named 'Ivaria': |
|
|
|
return ("Ivaria" == VUHDO_unitInfo["name"])
|
|
|
|
```
|
|
|
|
|
|
|
|
### Example 1
|
|
|
|
|
|
|
|
The follow is a more complicated example which returns true only if the player's spell 'Prayer of Mending' is off cooldown and the unit is below 90% health:
|
|
|
|
|
|
|
|
```lua
|
|
|
|
return ((select(2,GetSpellCooldown("Prayer of Mending")) == 0) and ((VUHDO_unitInfo["health"] / VUHDO_unitInfo["healthmax"]) < 0.9)) and true or false;
|
|
|
|
```
|
|
|
|
|
|
|
|
## Example 2
|
|
|
|
|
|
|
|
Another example which returns true only if the unit is currently marked with a raid icon of 'Green Triangle' and also has a custom debuff active called 'Penetrating Cold':
|
|
|
|
|
|
|
|
```lua
|
|
|
|
return VUHDO_unitInfo["raidIcon"] == 4 and VUHDO_getUnitCustomDebuffs()[VUHDO_unitInfo["unit"]] and VUHDO_getUnitCustomDebuffs()[VUHDO_unitInfo["unit"]]["Penetrating Cold"] and true or false;
|
|
|
|
```
|
|
|
|
|
|
|
|
## Checking for a HoT Icon
|
|
|
|
|
|
|
|
As of VuhDo v3.173, there is a new API that must be used to determine whether a unit has an active HoT Icon:
|
|
|
|
|
|
|
|
```lua
|
| ... | ... | @@ -34,14 +46,20 @@ The third optional argument to `VUHDO_hasUnitHot` specifies the unit type who mu |
|
|
|
|
|
|
|
When omitted, the third argument defaults to `VUHDO_UNIT_HOT_TYPE_MINE`.
|
|
|
|
|
|
|
|
### Example 3
|
|
|
|
|
|
|
|
One more example which returns true only if the unit has an active HoT Icon tracking 'Atonement' cast by the player:
|
|
|
|
|
|
|
|
```lua
|
|
|
|
return VUHDO_hasUnitHot(VUHDO_unitInfo["unit"], "Atonement") and true or false;
|
|
|
|
```
|
|
|
|
|
|
|
|
## More Examples
|
|
|
|
|
|
|
|
More example bouquets using custom flags of various kinds can be found on [wago.io](https://wago.io/p/Ivaria).
|
|
|
|
|
|
|
|
## Unit Information Table Schema
|
|
|
|
|
|
|
|
Unit information (`VUHDO_unitInfo` table):
|
|
|
|
|
|
|
|
| key | type / value | value description |
|
| ... | ... | |