Support #showtooltip spell:<id> and item:<id>

GetSpell/GetItem now resolve explicit spell:/item: ID forms. spell:<id>
prefers the player's spellbook entry via FindSpellBookSlotByID (per-rank
and pet aware) for full cost/cooldown/usability, falling back to an
id-only entry rendered via SetSpellByID for spells not in the book.
item:<id> reuses the existing numeric lookup for location-aware tooltips.

Guard the id-only path against nil spellSlot/cost in TestForActiveAction
and GetActionCooldown so display-only spell references don't crash.

Remove the dead, no-op GetSpellSlotByID stub.
This commit is contained in:
Brues
2026-08-06 00:15:19 -05:00
parent 1a98a05b7e
commit 71f8f74237
3 changed files with 32 additions and 14 deletions
+5 -2
View File
@@ -970,7 +970,10 @@ function CleveRoids.TestForActiveAction(actions)
actions.active.oom = (manaToCheck < actions.active.spell.cost)
end
local start, duration = GetSpellCooldown(actions.active.spell.spellSlot, actions.active.spell.bookType)
local start, duration = 0, 0
if actions.active.spell.spellSlot then
start, duration = GetSpellCooldown(actions.active.spell.spellSlot, actions.active.spell.bookType)
end
local onCooldown = (start > 0 and duration > 0)
if actions.active.isReactive then
@@ -4626,7 +4629,7 @@ function GetActionCooldown(slot)
return GetInventoryItemCooldown("player", slotId)
end
if a.spell then
if a.spell and a.spell.spellSlot then
return GetSpellCooldown(a.spell.spellSlot, a.spell.bookType)
elseif a.item then
if a.item.bagID and a.item.slot then