diff --git a/Conditionals.md b/Conditionals.md index 96cdabc..83bfa72 100644 --- a/Conditionals.md +++ b/Conditionals.md @@ -87,10 +87,14 @@ These default to checking the current target. Most can be redirected with `@unit | `cc` | Target has CC effect | ✅ | ✅ | `[cc:stun/fear]` `[nocc:polymorph]` | | | | `channeltime` | Target channel time remaining (seconds) | ✅ | ✅ | `[channeltime:<0.5]` | | | | `class` | Target class (players only) | ✅ | ✅ | `[class:Warrior/Priest]` | | | +| `curse` | Target has a Curse debuff | ✅ | — | `[curse]` `[@focus,curse]` | | ClassicAPI | | `cursive` | GUID-based debuff tracking (time remaining) | ✅ | ✅ | `[cursive:Rake<3]` `[nocursive:Rip]` | | Cursive | | `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 | | +| `disease` | Target has a Disease debuff | ✅ | — | `[disease]` `[@party1,disease]` | | ClassicAPI | +| `dispellable` | Target has any dispellable debuff | ✅ | — | `[dispellable]` | | ClassicAPI | +| `dispellablebuff` | Target has any dispellable buff (offensive) | ✅ | — | `[harm,dispellablebuff]` | | ClassicAPI | | `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]` `[facing:meleerange>1]` | | UnitXP_SP3 | @@ -105,6 +109,8 @@ 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]` | | | +| `magic` | Target has a Magic debuff | ✅ | — | `[magic]` `[@focus,magic]` | | ClassicAPI | +| `magicbuff` | Target has a dispellable Magic buff (offensive) | ✅ | — | `[harm,magicbuff]` | | ClassicAPI | | `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 | @@ -113,6 +119,7 @@ These default to checking the current target. Most can be redirected with `@unit | `othertag` | Target is tapped by someone else | ✅ | — | `[othertag]` `[noothertag]` | | | | `outrange` | Out of spell range / count out | ✅ | ✅ | `[outrange:Charge]` `[outrange:Charge>0]` | | UnitXP_SP3 (count) | | `party` | Unit is in your party | ✅ | ✅ | `[party]` `[party:focus]` | | | +| `poison` | Target has a Poison debuff | ✅ | — | `[poison]` `[@party1,poison]` | | ClassicAPI | | `power` | Target mana/rage/energy % | — | ✅ | `[power:<30]` | | | | `powerlost` | Target power deficit | — | ✅ | `[powerlost:>100]` | | | | `powertype` | Target power type | ✅ | ✅ | `[powertype:mana/rage]` | | | @@ -127,6 +134,28 @@ These default to checking the current target. Most can be redirected with `@unit | `ttk` | Time to kill target (seconds) | ✅ | ✅ | `[ttk:<10]` | | TimeToKill | | `type` | Creature type | ✅ | ✅ | `[type:Undead/Beast]` | | | +## Dispel-Type Conditionals (ClassicAPI) + +`magic`, `curse`, `disease`, `poison`, and `dispellable` detect the **dispel type** of a unit's auras — something vanilla can't normally read. They require the [ClassicAPI](https://github.com/brues-code/ClassicAPI) client mod (which exposes `C_UnitAuras`). They are no-argument booleans, default to `@target`, and can be redirected with `@unit`. + +- **Debuff side (defensive cleanse):** `magic` / `curse` / `disease` / `poison` are true when the unit has a **harmful** aura of that dispel type. `dispellable` is true when the unit has any dispel-typed debuff. +- **Buff side (offensive dispel / strip):** `magicbuff` and `dispellablebuff` check the unit's **buffs** instead — use these to detect an enemy buff you can remove (e.g. Dispel Magic / Purge). 1.12 offensive dispel only removes Magic, so `magicbuff` is the practical one. + +**Without ClassicAPI** these degrade gracefully: the positive form returns false and the `no` form returns true (vanilla can't read dispel types), so a `[magic]` clause simply won't fire rather than erroring. + +> **Note:** `dispellable` is class-agnostic — it's true for *any* dispel type, including ones your class can't remove. On a class with limited dispels (e.g. a Priest, who can only clear Magic and Disease) use the specific `magic` / `disease` keywords rather than `dispellable`. + +```lua +-- Priest: Dispel Magic on yourself, else friendly target's magic, else strip an enemy's magic buff +/cast [@player,magic] Dispel Magic; [help,magic] Dispel Magic; [harm,magicbuff] Dispel Magic + +-- Druid: decurse / depoison your target or focus +/cast [curse] Remove Curse; [poison] Cure Poison; [@focus,curse] Remove Curse + +-- Paladin: one-button Cleanse covering all three types it can remove +/cast [magic] Cleanse; [disease] Cleanse; [poison] Cleanse +``` + ## Extended Unit Tokens (Nampower v2.41+) With Nampower v2.41+, all `[@unit]` redirects support additional token formats beyond standard tokens: