@@ -343,8 +343,8 @@ build instructions.
343343 - [ ` C_Spell.IsSpellHarmful(spellID) ` / ` C_Spell.IsSpellHelpful(spellID) ` ] ( #c_spellisspellharmfulspellid--c_spellisspellhelpfulspellid )
344344 - [ ` GetSpellSchool(spellID) ` ] ( #getspellschoolspellid )
345345 - [ ` CastSpellNoToggle(name | spellID) ` ] ( #castspellnotogglename--spellid )
346- - [ ` C_Spell.CastAtCursor(spellID ) ` ] ( #c_spellcastatcursorspellid )
347- - [ ` C_Spell.CastAtUnit(spellID , unit) ` ] ( #c_spellcastatunitspellid -unit )
346+ - [ ` C_Spell.CastAtCursor(spellIDOrName ) ` ] ( #c_spellcastatcursorspellidorname )
347+ - [ ` C_Spell.CastAtUnit(spellIDOrName , unit) ` ] ( #c_spellcastatunitspellidorname -unit )
348348 - [ ` C_Spell.CancelSpellByID(spellID) ` / ` CancelSpellByName(name) ` ] ( #c_spellcancelspellbyidspellid--cancelspellbynamename )
349349 - [ ` C_Spell.UnitCastingInfo(unit) ` / ` C_Spell.CastingInfo() ` ] ( #c_spellunitcastinginfounit--c_spellcastinginfo )
350350 - [ ` C_Spell.UnitChannelInfo(unit) ` / ` C_Spell.ChannelInfo() ` ] ( #c_spellunitchannelinfounit--c_spellchannelinfo )
@@ -5507,7 +5507,7 @@ C_Item.UseAtCursor("Iron Grenade")
55075507
55085508Implementation chains the existing item-use path
55095509(` Item::Location::FindByArgInBags ` + ` FUN_ITEM_USE ` ) with
5510- [ ` Spell::AtCursor::Resolve ` ] ( #c_spellcastatcursorspellid ) — same
5510+ [ ` Spell::AtCursor::Resolve ` ] ( #c_spellcastatcursorspellidorname ) — same
55115511cursor-resolution helper ` C_Spell.CastAtCursor ` uses. When the item
55125512fires a non-ground-target spell, the cursor leg no-ops and returns
55135513` false ` ; the item still uses normally (any implicit target — current
@@ -5535,7 +5535,7 @@ C_Item.UseAtUnit("Iron Grenade", "player")
55355535Same chain as ` UseAtCursor ` (` Item::Location::FindByArgInBags ` +
55365536` FUN_ITEM_USE ` ) but committing the placement at the unit's world
55375537position via
5538- [ ` Spell::AtCursor::CommitAtCoords ` ] ( #c_spellcastatunitspellid -unit )
5538+ [ ` Spell::AtCursor::CommitAtCoords ` ] ( #c_spellcastatunitspellidorname -unit )
55395539instead of the cursor raycast. Returns ` true ` when the placement
55405540landed at the unit; ` false ` for non-ground-target items (the item
55415541still fires with any implicit target), unparseable input,
@@ -8474,28 +8474,37 @@ Using this from inside a macro action slot? See
84748474[ ` CastSpellNoToggle ` as a macro cast line] ( #castspellnotoggle-as-a-macro-cast-line ) below for the additional
84758475parser support that makes the slot tag correctly for action-bar UIs.
84768476
8477- ### ` C_Spell.CastAtCursor(spellID ) `
8477+ ### ` C_Spell.CastAtCursor(spellIDOrName ) `
84788478
84798479Casts a ground-target spell at the player's current cursor world
84808480position, bypassing the manual click on the AoE reticle the engine
84818481would otherwise require. ClassicAPI's analog of modern's
84828482` /cast [@cursor] Blizzard ` . Returns ` true ` when the cursor-placement
84838483leg landed; ` false ` for non-ground-target spells (cast still fires
8484- normally on the current target), unknown spellIDs , cursor over UI /
8484+ normally on the current target), unknown spells , cursor over UI /
84858485off-screen, etc.
84868486
8487+ Accepts a ** spellID** or a ** spell name** :
8488+
84878489``` lua
8488- C_Spell .CastAtCursor (10 ) -- Blizzard rank 1 at cursor
8489- C_Spell .CastAtCursor (2120 ) -- Flamestrike rank 1 at cursor
8490+ C_Spell .CastAtCursor (10 ) -- Blizzard Rank 1 (exact spellID)
8491+ C_Spell .CastAtCursor (2120 ) -- Flamestrike Rank 1
8492+ C_Spell .CastAtCursor (" Blizzard" ) -- highest known rank
8493+ C_Spell .CastAtCursor (" Blizzard(Rank 6)" ) -- that specific rank
84908494```
84918495
8496+ A ** numeric** spellID casts that * exact* spell — every rank is its own
8497+ spellID, so ` 10 ` casts Blizzard Rank 1 (not the highest known rank). A
8498+ ** name** goes through the engine's own resolver, which parses a trailing
8499+ ` (Rank N) ` ; a bare name casts the highest rank you know.
8500+
84928501Two-stage internally:
84938502
8494- 1 . Initiates the cast through the same path
8495- [ ` CastSpellByName ` ] ( docs/API.md#numeric-spellids-in-cast-and-castspellbyname )
8496- uses ( ` FUN_RESOLVE_SPELL_NAME_TO_SLOT ` + the engine's cast
8497- dispatcher). If the spell needs a ground target, the engine
8498- enters placement mode and arms the AoE reticle.
8503+ 1 . Initiates the cast: a numeric spellID resolves to its exact spellbook
8504+ slot ( ` Spell::Lookup::FindSpellbookSlot ` , so the requested rank is the one
8505+ that fires), a name goes through ` FUN_RESOLVE_SPELL_NAME_TO_SLOT ` ; either
8506+ way it dispatches through the engine's cast dispatcher. If the spell needs
8507+ a ground target, the engine enters placement mode and arms the AoE reticle.
84998508
850085092 . Refreshes the cursor's screen→world raycast via
85018510 ` FUN_REFRESH_CURSOR_RAYCAST ` (the same internal the engine fires
@@ -8514,24 +8523,28 @@ The companion item version is
85148523[ ` C_Item.UseAtCursor ` ] ( #c_itemuseatcursoriteminfo ) — same chain via
85158524the item-use path for grenades / on-use ground-target items.
85168525
8517- ### ` C_Spell.CastAtUnit(spellID , unit) `
8526+ ### ` C_Spell.CastAtUnit(spellIDOrName , unit) `
85188527
85198528Casts a ground-target spell at ` unit ` 's feet, bypassing the AoE
85208529reticle click. ClassicAPI's analog of modern's
8521- ` /cast [@unit] Flamestrike ` — ` CastAtUnit(spellID , "player") ` drops it
8530+ ` /cast [@unit] Flamestrike ` — ` CastAtUnit(spell , "player") ` drops it
85228531at the player's position, ` "target" ` at the target's, and so on for
85238532any unit token (` "mouseover" ` , ` "party1" ` , ` "raid7" ` , …). Returns
85248533` true ` when the placement landed at the unit; ` false ` for
85258534non-ground-target spells (cast still fires normally), unknown
8526- spellIDs, or a unit with no resolvable position.
8535+ spells, or a unit with no resolvable position.
8536+
8537+ The first argument takes a spellID or a spell name, with the same
8538+ exact-rank / ` (Rank N) ` semantics as ` CastAtCursor ` .
85278539
85288540``` lua
8529- C_Spell .CastAtUnit (2120 , " target" ) -- Flamestrike at the target's feet
8530- C_Spell .CastAtUnit (10 , " player" ) -- Blizzard centered on yourself
8541+ C_Spell .CastAtUnit (2120 , " target" ) -- Flamestrike at the target's feet
8542+ C_Spell .CastAtUnit (10 , " player" ) -- Blizzard Rank 1 on yourself
8543+ C_Spell .CastAtUnit (" Blizzard(Rank 6)" , " target" )
85318544```
85328545
85338546Same two-stage shape as
8534- [ ` C_Spell.CastAtCursor ` ] ( #c_spellcastatcursorspellid ) , but instead of
8547+ [ ` C_Spell.CastAtCursor ` ] ( #c_spellcastatcursorspellidorname ) , but instead of
85358548the cursor raycast, step 2 reads the unit's world position from its
85368549` GetPosition ` virtual (the same one ` CheckInteractDistance ` /
85378550` UnitInRange ` use) and commits placement there via
0 commit comments