new pet conditional

This commit is contained in:
Jrc13245
2025-10-08 20:46:03 -04:00
parent 49d55f5205
commit 4c9c6fff60
6 changed files with 173 additions and 33 deletions
+36
View File
@@ -63,6 +63,42 @@ function CleveRoids.IndexSpells()
CleveRoids.Spells = spells
end
-- Indexes all pet spells and their action bar slots
function CleveRoids.IndexPetSpells()
local petSpells = {}
if not UnitExists("pet") then
CleveRoids.PetSpells = petSpells
return
end
for i = 1, NUM_PET_ACTION_SLOTS do
local name, subtext, texture, isToken = GetPetActionInfo(i)
if name and not isToken then
-- Store the spell name and its slot
petSpells[name] = {
slot = i,
name = name,
subtext = subtext,
texture = texture
}
end
end
CleveRoids.PetSpells = petSpells
end
-- Gets a pet spell by name
function CleveRoids.GetPetSpell(spellName)
if not spellName or not CleveRoids.PetSpells then
return nil
end
spellName = CleveRoids.Trim(spellName)
return CleveRoids.PetSpells[spellName]
end
function CleveRoids.IndexTalents()
local talents = {[1] = true}
for tab = 1, GetNumTalentTabs() do