diff --git a/Core.lua b/Core.lua index e0bb26c..2feaa06 100644 --- a/Core.lua +++ b/Core.lua @@ -2041,7 +2041,15 @@ function CleveRoids.ParseMsg(msg) local _, _, target = string.find(conditionBlock, "(@[^%s,]+)") if target then conditionBlock = CleveRoids.Trim(string.gsub(conditionBlock, target, "")) - conditionals.target = string.sub(target, 2) + local tok = string.sub(target, 2) + -- @cursor is a ground-target directive, not a unit. Flag it so the cast + -- routes through ClassicAPI's CastAtCursor / UseAtCursor, and leave the + -- target at its default (CastAtCursor places at the cursor regardless). + if string.lower(tok) == "cursor" then + conditionals.atCursor = true + else + conditionals.target = tok + end end if conditionBlock and conditionals.action then @@ -2655,7 +2663,25 @@ function CleveRoids.DoWithConditionals(msg, hook, fixEmptyTargetFunc, targetBefo castMsg = msg .. "(" .. rank .. ")" end end - if action == CastSpellByName then + if conditionals.atCursor then + -- @cursor: place a ground-target spell/item at the cursor via + -- ClassicAPI (no AoE-reticle click). Both functions fall back to a + -- normal cast/use for non-ground actions. + if action == CastSpellByName then + local sp = CleveRoids.GetSpell(msg) + local spellId = sp and sp.id + if not spellId and GetSpellIdForName then + spellId = GetSpellIdForName(castMsg) + end + if spellId then + C_Spell.CastAtCursor(spellId) + else + CastSpellByName(castMsg) + end + else + C_Item.UseAtCursor(msg) + end + elseif action == CastSpellByName then -- ! prefix anti-toggle: prevent CastSpellByName from toggling off active spells. -- For Attack/AutoShot/Shoot, use the non-toggling AttackTarget() API. -- For self-buffs/shapeshifts, skip if already active on the player.