diff --git a/Conditionals.md b/Conditionals.md index 1a90c9e..d876923 100644 --- a/Conditionals.md +++ b/Conditionals.md @@ -77,7 +77,7 @@ These default to checking the current target. Most can be redirected with `@unit | Conditional | Description | No | Multi | Example | NP | Addon | |-------------|-------------|:--:|:-----:|---------|:--:|-------| | `alive` | Unit is alive | ✅ | — | `[alive]` | | | -| `behind` | Behind target / count behind | ✅ | ✅ | `[behind]` `[behind:>=2]` | | UnitXP_SP3 | +| `behind` | Behind target / count behind | ✅ | ✅ | `[behind]` `[behind:>=2]` `[behind:meleerange>1]` | | UnitXP_SP3 | | `buff` | Target has buff (with time/stacks/rank) | ✅ | ✅ | `[buff:Shield>#3]` `[nobuff:Renew/Rejuv]` `[buff:Regrowth(Rank_9)]` | | | | `buffcapped` | Target buff bar full (32) | ✅ | — | `[nobuffcapped]` | v2.20 | | | `casting` | Target is casting (specific spell) | ✅ | ✅ | `[casting]` `[casting:Heal]` | | | @@ -89,9 +89,9 @@ These default to checking the current target. Most can be redirected with `@unit | `dead` | Unit is dead | ✅ | — | `[dead]` | | | | `debuff` | Target has debuff (with time/stacks/rank) | ✅ | ✅ | `[debuff:Moonfire<4]` `[nodebuff:Rake]` `[debuff:Moonfire(Rank_10)]` | | | | `debuffcapped` | Target debuff bar full | ✅ | — | `[nodebuffcapped]` | v2.20 | | -| `distance` | Distance in yards | ✅ | ✅ | `[distance:<40]` | | UnitXP_SP3 | +| `distance` | Distance in yards / count within range | ✅ | ✅ | `[distance:<40]` `[distance:30>1]` `[distance:30:facing>1]` | | UnitXP_SP3 | | `exists` | Unit exists | ✅ | — | `[@mouseover,exists]` | | | -| `facing` | Facing target / count facing | ✅ | ✅ | `[facing]` `[facing:>2]` | | UnitXP_SP3 | +| `facing` | Facing target / count facing | ✅ | ✅ | `[facing]` `[facing:>2]` `[facing:meleerange>1]` | | UnitXP_SP3 | | `harm` | Unit is hostile | ✅ | — | `[harm]` | | | | `help` | Unit is friendly | ✅ | — | `[help]` | | | | `hp` | Target HP % | — | ✅ | `[hp:<20]` `[hp:>30&<70]` | | | @@ -103,7 +103,7 @@ These default to checking the current target. Most can be redirected with `@unit | `isplayer` | Unit is a player | ✅ | — | `[isplayer]` | | | | `istank` | Unit is marked as tank | ✅ | — | `[istank]` `[@focus,istank]` | | pfUI | | `level` | Target level (skull = 63) | — | ✅ | `[level:>60]` | | | -| `meleerange` | In melee range / count in melee | ✅ | ✅ | `[meleerange]` `[meleerange:>1]` | | UnitXP_SP3 | +| `meleerange` | In melee range / count in melee | ✅ | ✅ | `[meleerange]` `[meleerange:>1]` `[meleerange:facing>1]` | | UnitXP_SP3 | | `member` | Target is in party or raid | ✅ | — | `[member]` | | | | `multiscan` | Scan enemies by priority, soft-cast | — | ✅ | `[multiscan:nearest]` `[multiscan:skull]` | | UnitXP_SP3 | | `mytag` | Target is tapped by you | ✅ | — | `[mytag]` `[nomytag]` | | | @@ -146,14 +146,70 @@ With Nampower v2.41+, all `[@unit]` redirects support additional token formats b ## Multi-Unit Count Mode -Range and position conditionals (`meleerange`, `behind`, `facing`, `insight`, `inrange`, `outrange`) support counting enemies when given an operator + number. Requires UnitXP_SP3. Operators: `>`, `<`, `>=`, `<=`, `=`, `~=` +Range and position conditionals (`meleerange`, `behind`, `facing`, `insight`, `inrange`, `outrange`, `distance`) support counting enemies when given an operator + number. Requires UnitXP_SP3. Operators: `>`, `<`, `>=`, `<=`, `=`, `~=` ```lua /cast [meleerange:>1] Whirlwind -- AoE if 2+ enemies in melee /cast [behind:>=2] Blade Flurry -- Cleave if behind 2+ enemies -/cast [facing:>2] Cone of Cold -- Frontal AoE if facing 3+ enemies +/cast [facing:>2] Cone of Cold -- Frontal AoE if facing 3+ enemies /cast [inrange:Multi-Shot>1] Multi-Shot -- AoE if 2+ in spell range /cast [insight:>0] Arcane Explosion -- AoE if any enemy in LoS +/cast [distance:30>2] Volley -- AoE if 3+ enemies within 30 yards +``` + +### Compound Count Mode (Filters) + +Count mode conditionals can combine checks using a **filter qualifier** so that each enemy is tested against multiple conditions simultaneously. Without filters, separate conditionals like `[facing:>1 meleerange:>1]` count independently — an enemy could satisfy one check but not the other, giving false positives. + +**Syntax:** `[conditional:filter>N]` or `[conditional:distance:filter>N]` + +#### Available Filters + +| Filter | Effect | +|--------|--------| +| `facing` | Enemy is in front of the player | +| `behind` | Player is behind the enemy | +| `meleerange` | Enemy is in melee range | + +#### Conditionals Supporting Filters + +| Conditional | Filter syntax | Meaning | +|---|---|---| +| `meleerange` | `[meleerange:facing>N]` | In melee range AND facing | +| `meleerange` | `[meleerange:behind>N]` | In melee range AND behind | +| `nomeleerange` | `[nomeleerange:facing>N]` | NOT in melee range AND facing | +| `facing` | `[facing:meleerange>N]` | Facing AND in melee range | +| `facing` | `[facing:10>N]` | Facing AND within 10 yards | +| `nofacing` | `[nofacing:meleerange>N]` | NOT facing AND in melee range | +| `behind` | `[behind:meleerange>N]` | Behind AND in melee range | +| `behind` | `[behind:10>N]` | Behind AND within 10 yards | +| `nobehind` | `[nobehind:meleerange>N]` | NOT behind AND in melee range | +| `distance` | `[distance:30>N]` | Within 30 yards (count mode, no filter) | +| `distance` | `[distance:30:facing>N]` | Within 30 yards AND facing | +| `distance` | `[distance:30:behind>N]` | Within 30 yards AND behind | +| `nodistance` | `[nodistance:30:facing>N]` | NOT within 30 yards AND facing | + +For `facing`, `nofacing`, `behind`, and `nobehind`, a number as the filter name sets a distance threshold (in yards) instead of a named filter. + +For `distance` and `nodistance`, the distance threshold and filter are separated by a colon: `distance:YARDS:FILTER>COUNT`. + +#### Examples + +```lua +-- Cleave only if 2+ enemies in melee range AND in front of you +/cast [meleerange:facing>1] Cleave + +-- Cancel Blade Flurry if fewer than 2 enemies within 10 yards +/cancelaura [distance:10<2] Blade Flurry + +-- AoE if 3+ enemies within 30 yards and facing +/cast [distance:30:facing>2] Cone of Cold + +-- Whirlwind if 2+ enemies in melee, even those behind you +/cast [meleerange:>1] Whirlwind + +-- Only Backstab if behind 1+ enemy in melee range +/cast [behind:meleerange>0] Backstab ``` ## Multiscan (Target Scanning)