leonardopsantos / LunarSphere

Modular sphere addon for all classes.
1 stars 4 forks source link

TWW patch #17

Open speedwaystar opened 3 months ago

speedwaystar commented 3 months ago

Edit: updated

 Lib/moduleAPI.lua      |  52 ++++++-------
 Lib/moduleButton.lua   | 196 +++++++++++++++++++++++++------------------------
 Lib/moduleItems.lua    |  56 +++++++-------
 Lib/moduleObject.lua   |  40 +++++-----
 Lib/moduleSettings.lua |  26 +++----
 Lib/moduleSpeech.lua   |  26 ++++---
 Lib/moduleSphere.lua   |   6 +-
 Lib/moduleTemplate.lua |  45 +++++++-----
 LunarSphere.lua        |  29 ++++----
 9 files changed, 246 insertions(+), 230 deletions(-)

diff --git a/Lib/moduleAPI.lua b/Lib/moduleAPI.lua
index 18c7ec8..f466842 100644
--- a/Lib/moduleAPI.lua
+++ b/Lib/moduleAPI.lua
@@ -333,7 +333,7 @@ function Lunar.API:GetItemBagInfo(itemName)
        for slotID = 1, slotTotal do 
            itemLink = Lunar.Items:GetContainerItemLink(bagID, slotID);
            if (itemLink) then
-               searchName, _, _, _, _, _, _, stackSize = GetItemInfo(itemLink);
+               searchName, _, _, _, _, _, _, stackSize = C_Item.GetItemInfo(itemLink);
                if (itemName == searchName)  then
                    _, count, locked = Lunar.Items:GetContainerItemInfo(bagID, slotID);
                    if not locked then
@@ -475,8 +475,8 @@ function Lunar.API:GetSpellID(spellName)
    end

    -- Obtain the total number of spells the player knows
-   for index = 1, MAX_SKILLLINE_TABS do
-       _, _, _, spellsInTab = GetSpellTabInfo(index);
+   for index = 1, C_SpellBook.GetNumSpellBookSkillLines() do
+       spellsInTab = C_SpellBook.GetSpellBookSkillLineInfo(index).numSpellBookItems;
        totalSpells = totalSpells + spellsInTab;
    end

@@ -489,7 +489,7 @@ function Lunar.API:GetSpellID(spellName)
    -- Search every spell in player's spellbook. If the name matches our
    -- spell that we're searching for, save the ID...
    for index = 1, totalSpells do
-       scanName, scanRank = GetSpellBookItemName(index, BOOKTYPE_SPELL);
+       scanName, scanRank = C_SpellBook.GetSpellBookItemName(index, Enum.SpellBookSpellBank.Player);
        if (string.lower(scanName) == filterName) then

            spellID = index;
@@ -736,7 +736,7 @@ function Lunar.API:ToggleActiveAddons(toggle)

                for index = 1, table.getn(LunarSphereSettings.debugAddonList) do
                    if (name == LunarSphereSettings.debugAddonList[index]) then
-                       EnableAddOn(name);
+                       C_AddOns.EnableAddOn(name);
                        table.remove(LunarSphereSettings.debugAddonList, index);
                        break;
                    end
@@ -779,10 +779,10 @@ function Lunar.API:MultiAddToTooltip(actionType, actionName, index, firstLineApp
    if (actionType == "spell") then
 --     spellID, spellRank = Lunar.API:GetSpellID(actionName);

-       spellID = GetSpellLink(actionName);
-       --_, spellRank = GetSpellBookItemName(actionName);
-       if (not Lunar.API:IsVersionClassic() and spellID and (spellID:len() > 0)) then
-           Lunar.Items.tooltip:SetHyperlink(spellID);
+       local link = C_Spell.GetSpellLink(actionName);
+       --_, spellRank = C_SpellBook.GetSpellBookItemName(actionName,Enum.SpellBookSpellBank.Player);
+       if (not Lunar.API:IsVersionClassic() and link and (link:len() > 0)) then
+           Lunar.Items.tooltip:SetHyperlink(link);
        end

 --     Lunar.Items.tooltip:SetHyperlink(GetSpellLink(actionName));     
@@ -793,7 +793,7 @@ function Lunar.API:MultiAddToTooltip(actionType, actionName, index, firstLineApp
    elseif (actionType == "item") then

        if actionName and not ((actionName == "") or (actionName == " ")) then
-           _, itemString = GetItemInfo(actionName);
+           _, itemString = C_Item.GetItemInfo(actionName);
            if (itemString) then
                Lunar.Items.tooltip:SetHyperlink(itemString);
            end
@@ -824,11 +824,11 @@ function Lunar.API:MultiAddToTooltip(actionType, actionName, index, firstLineApp
        objectName = GetActionFromMacroText(macroBody);

        if (objectName) then
-           _, itemString = GetItemInfo(objectName);
+           _, itemString = C_Item.GetItemInfo(objectName);
            if (itemString) then
                Lunar.Items.tooltip:SetHyperlink(itemString);
            else
-               spellID, spellRank = Lunar.API:GetSpellID(objectName);
+               spellID = C_Spell.GetSpellInfo(objectName).spellID

                if (spellID) then
                    Lunar.Items.tooltip:SetSpellBookItem(spellID, BOOKTYPE_SPELL);
@@ -848,7 +848,7 @@ function Lunar.API:MultiAddToTooltip(actionType, actionName, index, firstLineApp
        if (textLine == 1) then
            tipText = tipText .. firstLineAppend;
            if (spellID) then
---             _, tipTextRight = GetSpellBookItemName(spellID, BOOKTYPE_SPELL);
+--             _, tipTextRight = C_SpellBook.GetSpellBookItemName(spellID, Enum.SpellBookSpellBank.Player);
                tipTextRight = spellRank;
                textContainerRight:SetTextColor(0.5,0.5,0.5);
            end
@@ -995,11 +995,11 @@ function Lunar.API:Load()
                if (Lunar.API.isBanker) then
                    price = 1;
                    quantity = 1;
-                   numAvailable = GetItemCount(LunarSphereSettings.reagentList[reagentIndex].name, true) - GetItemCount(LunarSphereSettings.reagentList[reagentIndex].name); --GetInventoryItemLink("player", currentSlot) or (""), true)
+                   numAvailable = C_Item.GetItemCount(LunarSphereSettings.reagentList[reagentIndex].name, true) - C_Item.GetItemCount(LunarSphereSettings.reagentList[reagentIndex].name); --GetInventoryItemLink(Enum.SpellBookSpellBank.Player, currentSlot) or (""), true)
                elseif (Lunar.API.isGuildBanker) then
                    price = 1;
                    quantity = 1;
-   --              numAvailable = GetItemCount(LunarSphereSettings.reagentList[reagentIndex].name, true) - GetItemCount(LunarSphereSettings.reagentList[reagentIndex].name); --GetInventoryItemLink("player", currentSlot) or (""), true)
+   --              numAvailable = C_Item.GetItemCount(LunarSphereSettings.reagentList[reagentIndex].name, true) - C_Item.GetItemCount(LunarSphereSettings.reagentList[reagentIndex].name); --GetInventoryItemLink(Enum.SpellBookSpellBank.Player, currentSlot) or (""), true)
                end

                -- Although it shouldn't happen if the reagent list is built properly, but
@@ -1008,7 +1008,7 @@ function Lunar.API:Load()

                    -- Grab how many of the restock item that we have and set up a counter to buy
                    -- as many pieces we need.
-                   currentAmount = GetItemCount(LunarSphereSettings.reagentList[reagentIndex].name) or 0;
+                   currentAmount = C_Item.GetItemCount(LunarSphereSettings.reagentList[reagentIndex].name) or 0;

                end

@@ -1021,7 +1021,7 @@ function Lunar.API:Load()
                        -- Bank item
                        if (itemIndex <= NUM_BANKGENERIC_SLOTS) then
                            currentSlot = BankButtonIDToInvSlotID(itemIndex);
-                           itemName = GetItemInfo(GetInventoryItemLink("player", currentSlot) or (""));
+                           itemName = C_Item.GetItemInfo(GetInventoryItemLink("player", currentSlot) or (""));

                        -- Bank bag item
                        else
@@ -1045,7 +1045,7 @@ function Lunar.API:Load()
                            end

                            -- Now, obtain an item in the current bag;
-                           itemName = GetItemInfo(Lunar.Items:GetContainerItemLink(currentBag + NUM_BAG_SLOTS, currentSlot) or (""));
+                           itemName = C_Item.GetItemInfo(Lunar.Items:GetContainerItemLink(currentBag + NUM_BAG_SLOTS, currentSlot) or (""));

                        end

@@ -1054,7 +1054,7 @@ function Lunar.API:Load()

                        -- Bank item
                        _, numAvailable = GetGuildBankItemInfo(currentBag, currentSlot)
-                       itemName = GetItemInfo(GetGuildBankItemLink(currentBag, currentSlot) or "");
+                       itemName = C_Item.GetItemInfo(GetGuildBankItemLink(currentBag, currentSlot) or "");

                    -- Grab the current vendor item info
                    else
@@ -1279,7 +1279,7 @@ function Lunar.API:Load()

                            -- Grab the name of the item, and then grab its rarity and item
                            -- type. 
-                           _,_,itemRarity,_,_,itemType = GetItemInfo(itemLink)
+                           _,_,itemRarity,_,_,itemType = C_Item.GetItemInfo(itemLink)

                            -- If the item rarity is 0 (gray, junk), continue...    
                            if ( itemRarity == 0) then
@@ -2656,8 +2656,8 @@ function Lunar.API:Load()
            if button.actionType == "spell" and button.buttonType == 1 and button.spellReagent == nil then
                if LunarSphereSettings.enableDrDamage == true then
                    _G[buttonName .. "Count"]:Show()
-                   _, param[paramOffset + 1] = GetSpellBookItemName(button.actionName);
-   --              _, spellRank = GetSpellBookItemName(button.actionName);
+                   _, param[paramOffset + 1] = GetSpellBookItemName(button.actionName,Enum.SpellBookSpellBank.Player);
+   --              _, spellRank = C_SpellBook.GetSpellBookItemName(button.actionName,Enum.SpellBookSpellBank.Player);
                    if (string.find(button.actionName, "%(")) then
                        spellName = string.match(button.actionName, "(.*)%(");
                    else
@@ -2677,8 +2677,8 @@ function Lunar.API:Load()
                    if button.actionType == "spell" and button.buttonType == 1 and button.spellReagent == nil then
                        if LunarSphereSettings.enableDrDamage == true then
                            _G[buttonName .. "Count"]:Show()
-                           _, param[paramOffset + 1] = GetSpellBookItemName(button.actionName);
-   --                      _, spellRank = GetSpellBookItemName(button.actionName);
+                           _, param[paramOffset + 1] = C_SpellBook.GetSpellBookItemName(button.actionName,Enum.SpellBookSpellBank.Player);
+   --                      _, spellRank = C_SpellBook.GetSpellBookItemName(button.actionName,Enum.SpellBookSpellBank.Player);
                            if (string.find(button.actionName, "%(")) then
                                spellName = string.match(button.actionName, "(.*)%(");
                            else
@@ -2703,11 +2703,11 @@ function Lunar.API:GetItemCooldown(itemData)

    -- We can take item links, item names, and item IDs. We will need to
    -- convert this data into an item id. Best way to do this for now
-   -- if to use GetItemInfo to grab the item link, and from there, we
+   -- if to use C_Item.GetItemInfo to grab the item link, and from there, we
    -- grab the item ID and return the cooldown from it. Pain in the
    -- ass, but the way we need to do it currently.

-   local _, itemLink = GetItemInfo(itemData);
+   local _, itemLink = C_Item.GetItemInfo(itemData);

    local itemID = Lunar.API:GetItemID(itemLink)

diff --git a/Lib/moduleButton.lua b/Lib/moduleButton.lua
index 271e42b..844871e 100644
--- a/Lib/moduleButton.lua
+++ b/Lib/moduleButton.lua
@@ -93,13 +93,13 @@ local stateTransitionsLeave;        -- Transition string for mouse over (leaving)
 local stateTransitionsAlwaysShown; -- Transistion string for always visible menus

 local string = string;
-local tonumber = tonumber;
-local GetItemInfo = GetItemInfo;
-local IsUsableItem = IsUsableItem;
-local ItemHasRange = ItemHasRange;
-local IsItemInRange = IsItemInRange;
-local IsUsableSpell = IsUsableSpell;
-local IsSpellInRange = IsSpellInRange;
+-- local tonumber = tonumber;
+-- local GetItemInfo = GetItemInfo;
+-- local IsUsableItem = IsUsableItem;
+-- local ItemHasRange = ItemHasRange;
+-- local IsItemInRange = IsItemInRange;
+-- local IsUsableSpell = IsUsableSpell;
+-- local IsSpellInRange = IsSpellInRange;

 Lunar.origBackdrop = nil;
 Lunar.origBackdropColor = nil;
@@ -2453,9 +2453,9 @@ function Lunar.Button:UpdateLastUsedSubmenu(menuButton, childButton, clickType,
                                Lunar.Button:UpdateBagDisplay(menuButton, stance, updateClick);
                            elseif (attributeType == "item") then
                                local objectType, stackTotal
-                               _,_,_,_,_,objectType,_,stackTotal = GetItemInfo(attributeValue);
+                               _,_,_,_,_,objectType,_,stackTotal = C_Item.GetItemInfo(attributeValue);
                                if (IsConsumableItem(attributeValue) or (stackTotal > 1) or (objectType == Lunar.Items.reagentString)) then
-                                   _G[menuButton:GetName() .. "Count"]:SetText(GetItemCount(attributeValue, nil, true));
+                                   _G[menuButton:GetName() .. "Count"]:SetText(C_Item.GetItemCount(attributeValue, nil, true));

                                    if (not LunarSphereSettings.showAssignedCounts == true) then
                                        _G[menuButton:GetName() .. "Count"]:Show();
@@ -2501,7 +2501,7 @@ function Lunar.Button:ContinueTrade()

            -- Reset the count of this item being traded
            totalCount = 0;
-           itemCount = GetItemCount(Lunar.Button.tradingQueue[1]) or (0);
+           itemCount = C_Item.GetItemCount(Lunar.Button.tradingQueue[1]) or (0);

            -- If we have this item, continue
            if (itemCount > 0) then
@@ -3268,13 +3268,13 @@ function Lunar.Button:ConvertToMenu(self, clickType)
        if ((cursorType == "spell") and (objectID)) then

            -- Attach the texture of the spell to the icon
-           objectTexture = GetSpellTexture(objectID, objectData);
+           objectTexture = C_Spell.GetSpellTexture(objectID, objectData);

        -- If it was an item drag ...
        elseif (cursorType == "item") then

            -- Get the texture of the item
-           _, _, _, _, _, _, _, _, _, objectTexture = GetItemInfo(objectID);
+           _, _, _, _, _, _, _, _, _, objectTexture = C_Item.GetItemInfo(objectID);

        -- If it was a macro drag ...
        elseif (cursorType == "macro") then
@@ -3359,8 +3359,8 @@ function Lunar.Button:Assign(self, clickType, stance)
    end

    if (cursorType == "spell") then
---     _, spellName = GetSpellBookItemName( objectID, objectData );
---     nextSpellName = GetSpellBookItemName( objectID + 1, objectData );
+--     _, spellName = C_SpellBook.GetSpellBookItemName( objectID, Enum.SpellBookSpellBank.Player );
+--     nextSpellName = C_SpellBook.GetSpellBookItemName( objectID + 1, Enum.SpellBookSpellBank.Player );
 --     spellRank = "(" .. spellRank .. ")";
    end

@@ -3377,7 +3377,7 @@ function Lunar.Button:Assign(self, clickType, stance)

        objectID = mountID;
        objectData = spellID;
-       objectData = select(3, GetSpellInfo(spellID));
+       objectData = C_Spell.GetSpellInfo(spellID).iconID;
    end

    if (cursorType == "battlepet") then
@@ -3387,13 +3387,13 @@ function Lunar.Button:Assign(self, clickType, stance)
    end

    --if (cursorType == "item") then
-   --      local itemType = select(6, GetItemInfo(objectID));
+   --      local itemType = select(6, C_Item.GetItemInfo(objectID));
    --      local oID = objectID;

            --print(itemType.." "..objectID);

    --      objectID = "item:" .. objectID;
-   --      objectData = GetItemIcon(objectID);
+   --      objectData = C_Item.GetItemIcon(objectID);

    --      if C_ToyBox.GetToyInfo(oID) ~= nil then
                --objectID, _, objectData = C_ToyBox.GetToyInfo(oID);
@@ -3513,10 +3513,10 @@ function Lunar.Button:Assign(self, clickType, stance)
        if (cursorType == "spell") then

            -- Get the name of the spell and its texture
-           --_, spellID = GetSpellBookItemInfo(objectSpellID, objectData);
-           objectName = GetSpellBookItemName(objectID, objectData);
-           objectTexture = GetSpellTexture(objectSpellID);
-           spellName = GetSpellInfo(objectSpellID);
+           --spellID = C_SpellBook.GetSpellBookItemInfo(objectSpellID, Enum.SpellBookSpellBank.Player).spellID;
+           objectName = C_SpellBook.GetSpellBookItemName(objectID, Enum.SpellBookSpellBank.Player);
+           objectTexture = C_Spell.GetSpellTexture(objectSpellID);
+           spellName = C_Spell.GetSpellInfo(objectSpellID).name;

            -- Fix for Call Pet for hunters.
            if (objectName ~= spellName) then
@@ -3536,7 +3536,7 @@ function Lunar.Button:Assign(self, clickType, stance)
                    end
 --             end
                -- We don't want spell ranks on the first spell tab data or the professions tab ... these are generic
-               if (objectID <= (select(4, GetSpellTabInfo(1))) or objectSpellID >= (select(3, GetSpellTabInfo(5)))) then
+               if (objectID <= C_SpellBook.GetSpellBookSkillLineInfo(1).numSpellBookItems) or (objectSpellID >= C_SpellBook.GetSpellBookSkillLineInfo(5).itemIndexOffset) then
                    spellRank = "";
                end
    --          objectName = objectName .. spellRank;
@@ -3548,19 +3548,19 @@ function Lunar.Button:Assign(self, clickType, stance)
            cursorType = "spell";
            objectName = objectID;
            objectTexture = objectData;
-           self:SetAttribute("*"..cursorType .. "2-S" .. stance .. clickType, GetSpellInfo(objectName));
+           self:SetAttribute("*"..cursorType .. "2-S" .. stance .. clickType, C_Spell.GetSpellInfo(objectName).name);

        elseif (cursorType == "flyout") then

            -- Get the name of the spell and its texture
-           objectName = objectID GetSpellBookItemName(objectID, objectData);
+           objectName = C_SpellBook.GetSpellBookItemName(objectID, Enum.SpellBookSpellBank.Player);
            objectTexture = objectData;

        -- If it was an item drag ...
        elseif (cursorType == "item") then

            -- Get the name of the item, what it can stack as, and its texture
-           objectName, _, _, _, _, objectMainType, objectType, stackTotal, _, objectTexture = GetItemInfo(objectData);
+           objectName, _, _, _, _, objectMainType, objectType, stackTotal, _, objectTexture = C_Item.GetItemInfo(objectData);

            if Lunar.API:IsVersionRetail() and C_ToyBox.GetToyInfo(objectID) then
@@ -3594,7 +3594,7 @@ function Lunar.Button:Assign(self, clickType, stance)
            if (buttonID ~= 0) then
                if (clickType == Lunar.Button:GetButtonSetting(buttonID, stance, LUNAR_GET_SHOW_COUNT)) then
                    if (objectName == "item:6265") or (IsConsumableItem(objectName) or (stackTotal > 1) or (objectType == Lunar.Items.reagentString)) then
-                       _G[buttonName .. "Count"]:SetText(GetItemCount(objectID, nil, true));
+                       _G[buttonName .. "Count"]:SetText(C_Item.GetItemCount(objectID, nil, true));

                        if (not LunarSphereSettings.showAssignedCounts == true) then
                            _G[buttonName .. "Count"]:Show();
@@ -3847,7 +3847,7 @@ function Lunar.Button:AssignByType(button, clickType, buttonType, stance, lastUs
                    end

                    -- Make the icon and count shown be the item with the smallest count
-                   local count1, count2 = GetItemCount(objectName1), GetItemCount(objectName2);
+                   local count1, count2 = C_Item.GetItemCount(objectName1), C_Item.GetItemCount(objectName2);
                    if ((count1 or (0))  > (count2 or (0))) then
                        objectName = objectName2 or objectName1;
                        if (objectName == "") then
@@ -3897,7 +3897,7 @@ function Lunar.Button:AssignByType(button, clickType, buttonType, stance, lastUs
            -- grab the texture, if the object exists
            if (objectName) then
                local objectType_l, stackTotal_l;
-               _, _, _, _, _, objectMainType, objectType_l, stackTotal_l, _, objectTexture = GetItemInfo(objectName);
+               _, _, _, _, _, objectMainType, objectType_l, stackTotal_l, _, objectTexture = C_Item.GetItemInfo(objectName);

                --print("objectMainType : ", objectMainType, objectType_l, stackTotal_l, objectTexture)

@@ -3908,7 +3908,7 @@ function Lunar.Button:AssignByType(button, clickType, buttonType, stance, lastUs
                        if (clickType == Lunar.Button:GetButtonSetting(buttonID, stance, LUNAR_GET_SHOW_COUNT)) then
                            if (stackTotal_l) then
                                if (IsConsumableItem(objectName) or (stackTotal_l > 1) or (objectType_l == Lunar.Items.reagentString)) then
-                                   _G[buttonName .. "Count"]:SetText(GetItemCount(objectName, nil, true));
+                                   _G[buttonName .. "Count"]:SetText(C_Item.GetItemCount(objectName, nil, true));

                                    if (not LunarSphereSettings.showAssignedCounts == true) then
                                        _G[buttonName .. "Count"]:Show();
@@ -3930,7 +3930,7 @@ function Lunar.Button:AssignByType(button, clickType, buttonType, stance, lastUs
            if (string.sub(objectName, 1, 2) == "**") then
                objectName = string.sub(objectName, 3);
 --             objectName, _, objectTexture = string.match(objectName, "%*%*(.*)~(.*)~(.*)") --string.sub(objectName, 3);
-               objectTexture = select(3, GetSpellInfo(objectName));
+               objectTexture = C_Spell.GetSpellInfo(objectName).iconID;
                cursorType = "spell";
            end

@@ -3942,7 +3942,7 @@ function Lunar.Button:AssignByType(button, clickType, buttonType, stance, lastUs
            if (string.sub(objectName, 1, 2) == "**") then
                objectName = string.sub(objectName, 3);
 --             objectTexture = "Interface\\Icons\\Ability_Hunter_BeastCall";
---             objectTexture = select(3, GetSpellInfo(objectName));
+--             objectTexture = C_Spell.GetSpellInfo(objectName).iconID;
                cursorType = "spell";
            end

@@ -4008,8 +4008,8 @@ function Lunar.Button:AssignByType(button, clickType, buttonType, stance, lastUs

                    if (objectData) then
                        -- Get the name of the spell and its texture
-                       objectName = GetSpellBookItemName(objectID, objectData);
-                       objectTexture = GetSpellTexture(objectID, objectData);
+                       objectName = C_SpellBook.GetSpellBookItemName(objectID, Enum.SpellBookSpellBank.Player);
+                       objectTexture = C_Spell.GetSpellTexture(objectID, objectData);
                    end

                -- If it was an item drag ...
@@ -4019,7 +4019,7 @@ function Lunar.Button:AssignByType(button, clickType, buttonType, stance, lastUs
                    -- what it can stack as, and its texture
                    if (objectData) then

-                       objectName, _, _, _, _, objectType, _, stackTotal, _, objectTexture = GetItemInfo(objectData);
+                       objectName, _, _, _, _, objectType, _, stackTotal, _, objectTexture = C_Item.GetItemInfo(objectData);

 --                     if (objectType == LunarSphereGlobal.searchData.armor) or (objectType == LunarSphereGlobal.searchData.weapon) then
 --                         -- Grab the item link and secure only the parts that we need for the item
@@ -4031,7 +4031,7 @@ function Lunar.Button:AssignByType(button, clickType, buttonType, stance, lastUs
                    -- If we don't have objectData, we're pulling from saved data. All we care about is the stackTotal
                    -- and the objectType (if they exist because they are in our inventory)
                    else
-                       _, _, _, _, _, _, objectType, stackTotal = GetItemInfo(objectName);
+                       _, _, _, _, _, _, objectType, stackTotal = C_Item.GetItemInfo(objectName);
                    end

                    -- If the item is consumable, or can stack, or is a reagent ... we will show the
@@ -4039,7 +4039,7 @@ function Lunar.Button:AssignByType(button, clickType, buttonType, stance, lastUs
                    if (buttonID > 0) then
                        if (clickType == Lunar.Button:GetButtonSetting(buttonID, stance, LUNAR_GET_SHOW_COUNT)) and (stackTotal) then
                            if (IsConsumableItem(objectName) or (stackTotal > 1) or (objectType == Lunar.Items.reagentString)) then
-                               _G[buttonName .. "Count"]:SetText(GetItemCount(objectName, nil, true));
+                               _G[buttonName .. "Count"]:SetText(C_Item.GetItemCount(objectName, nil, true));

                                if (not LunarSphereSettings.showAssignedCounts == true) then
                                    _G[buttonName .. "Count"]:Show();
@@ -4186,13 +4186,13 @@ end
                if (buttonType == 132) then
                    button:SetAttribute("*type-S" .. stance  .. clickType, cursorType)
                    button:SetAttribute("*"..cursorType .. "-S" .. stance .. clickType, objectName); -- tempName);
-                   button:SetAttribute("*"..cursorType .. "2-S" .. stance .. clickType, GetSpellInfo(objectName)); -- tempName);
+                   button:SetAttribute("*"..cursorType .. "2-S" .. stance .. clickType, C_Spell.GetSpellInfo(objectName).name); -- tempName);
                elseif ( Lunar.API:IsVersionRetail() or Lunar.API:IsVersionWotLK() ) then
                    --print("4194 : ", "*type-S" .. stance  .. clickType, "macrotext")
                    button:SetAttribute("*type-S" .. stance  .. clickType, "macrotext")
---             local tempName = select(1, GetSpellInfo(objectName));
+--             local tempName = C_Spell.GetSpellInfo(objectName).name
                    button:SetAttribute("*macrotext-S" .. stance .. clickType, objectName); -- tempName);
-                   button:SetAttribute("*macrotext2-S" .. stance .. clickType, "/stopcasting\n/cast [nomounted] " .. (GetSpellInfo(objectName) or "")  .. "\n/dismount"); -- tempName);
+                   button:SetAttribute("*macrotext2-S" .. stance .. clickType, "/stopcasting\n/cast [nomounted] " .. (C_Spell.GetSpellInfo(objectName).name or "")  .. "\n/dismount"); -- tempName);
 --"/cast [nomounted] " .. objectName .. "\n/dismount"
                elseif (Lunar.API:IsVersionRetail() == false ) then
                    -- OMG, could this be more complicated? We have to set
@@ -4316,7 +4316,7 @@ function Lunar.Button:GetBagTexture(buttonType)
    elseif (buttonType <= 94) then
        local objectName = GetBagName(buttonType - 90);
        if (objectName) then
-           _,_,_,_,_,_,_,_,_, objectTexture = GetItemInfo(objectName);
+           _,_,_,_,_,_,_,_,_, objectTexture = C_Item.GetItemInfo(objectName);
        end
    else
        objectTexture = LUNAR_ART_PATH .. "menuKey";
@@ -4534,7 +4534,7 @@ function Lunar.Button:LoadButtonData(buttonID)
                        end
 --]]
                        -- Get the name of the item, what it can stack as, and its texture
-                       _, _, _, _, _, _, objectType, stackTotal = GetItemInfo(objectName);
+                       _, _, _, _, _, _, objectType, stackTotal = C_Item.GetItemInfo(objectName);

                        -- If the item is consumable, or can stack, or we set it to show a count ... we will show the
                        -- count of the item on the button
@@ -4543,7 +4543,7 @@ function Lunar.Button:LoadButtonData(buttonID)
                                if (buttonID > 0) then
                                    if (stackTotal) then
                                        if ((objectName == "item:6265") or IsConsumableItem(objectName) or (stackTotal > 1) or (objectType == Lunar.Items.reagentString) or (LunarSphereSettings.buttonData[buttonID].showCount == true)) then
-                                           _G[buttonName .. "Count"]:SetText(GetItemCount(objectName));
+                                           _G[buttonName .. "Count"]:SetText(C_Item.GetItemCount(objectName));
    --                                      if (clickType == Lunar.Button:GetButtonSetting(buttonID, stance, LUNAR_GET_SHOW_COUNT)) then
                                                LunarSphereSettings.buttonData[buttonID].showCount = true;
    --                                      end
@@ -4574,9 +4574,9 @@ function Lunar.Button:LoadButtonData(buttonID)
                        else
                            macroAction = GetActionFromMacroText(macroBody);
                            if (macroAction) then
-                               _,_,_,_,_,_,_,_,_,newTexture = GetItemInfo(macroAction);
+                               _,_,_,_,_,_,_,_,_,newTexture = C_Item.GetItemInfo(macroAction);
                                if not newTexture then
-                                   newTexture = GetSpellTexture(macroAction);
+                                   newTexture = C_Spell.GetSpellTexture(macroAction);
                                end
                            end
                            if string.find(macroBody, "#show") and not string.find(macroBody, "#showt") then
@@ -4641,7 +4641,7 @@ function Lunar.Button:LoadButtonData(buttonID)
                            _G[buttonName]:SetAttribute("*type-S" .. stance .. clickType, cursorType)
                            _G[buttonName]:SetAttribute("*" ..cursorType .. "-S" .. stance .. clickType, objectName)
                            if (tostring(tonumber(objectName)) == objectName) then
-                               _G[buttonName]:SetAttribute("*" ..cursorType .. "2-S" .. stance .. clickType, GetSpellInfo(objectName));
+                               _G[buttonName]:SetAttribute("*" ..cursorType .. "2-S" .. stance .. clickType, C_Spell.GetSpellInfo(objectName).name);
                                _G[buttonName]:SetAttribute("*" ..cursorType .. "-S" .. stance .. clickType, objectName);
                            end
                        end
@@ -4801,7 +4801,8 @@ function Lunar.Button:FindSpellReagent(button, stance, clickType, actionName, cu
            Lunar.Items.tooltip:SetOwner(UIParent, "ANCHOR_NONE");

            -- Grab the spell ID of the spell. If we have an ID (the spell exists), continue
-           local spellID, spellRank = Lunar.API:GetSpellID(actionName);
+           local spellID = C_Spell.GetSpellInfo(actionName).spellID
+           local spellRank = nil
            if (spellID) then

                -- Set our locals, then set our spell to the temp tooltip
@@ -5211,7 +5212,8 @@ Lunar.eventHandler = {
    ["SPELL_ACTIVATION_OVERLAY_GLOW_HIDE"] = function (self, event, arg1)
        if (self.buttonType == 1) then
            -- Get spell ID and check it against the arg
-           local _, spellID = GetSpellBookItemInfo((GetSpellInfo(self.actionName)) or "");
+--         local spellID = C_SpellBook.GetSpellBookItemInfo(C_Spell.GetSpellInfo(self.actionName).name).spellID
+           local spellID = C_Spell.GetSpellInfo(self.actionName).spellID
            if (spellID == arg1) then
                self.procGlow:Hide();
                self.procGlowShown = nil;
@@ -5221,7 +5223,8 @@ Lunar.eventHandler = {
    ["SPELL_ACTIVATION_OVERLAY_GLOW_SHOW"] = function (self, event, arg1)
        if (self.buttonType == 1) then
            -- Get spell ID and check it against the arg
-           local _, spellID = GetSpellBookItemInfo((GetSpellInfo(self.actionName)) or "");
+           --local spellID = C_SpellBook.GetSpellBookItemInfo(C_Spell.GetSpellInfo(self.actionName).name).spellID
+           local spellID = C_Spell.GetSpellInfo(self.actionName).spellID
            if (spellID == arg1) then
                self.procGlow:Show();
                self.procGlowShown = true;
@@ -5303,7 +5306,7 @@ function Lunar.Button.UpdateState(self, stateData)
                    _, actionType, actionName = Lunar.Button:GetButtonData(self:GetID(), self.currentStance, showActionCount);

                    if (actionType == "item") then
-                       local objectName, _, _, _, _, _, objectType, stackTotal = GetItemInfo(actionName);
+                       local objectName, _, _, _, _, _, objectType, stackTotal = C_Item.GetItemInfo(actionName);

                        if (objectName) then
                            if (IsConsumableItem(objectName) or (stackTotal > 1) or (objectType == Lunar.Items.reagentString)) then
@@ -5529,7 +5532,7 @@ function Lunar.Button:Update(self, countOnly)
        objectName = GetActionFromMacroText(macroBody);

        if (objectName) then
-           _, itemString = GetItemInfo(objectName);
+           _, itemString = C_Item.GetItemInfo(objectName);
            if (itemString) then
                macroEquiped = IsEquippedItem(objectName);
            end
@@ -5629,7 +5632,7 @@ function Lunar.Button:UpdateCount(self)
    if (not self.actionTypeCount) then
        if (self:GetID() == 0) then
            self.actionNameCount = LunarSphereSettings.sphereAction or ("") 
-           if GetSpellInfo(self.actionNameCount) then
+           if C_Spell.GetSpellInfo(self.actionNameCount) then
                self.actionTypeCount = "spell";
                Lunar.Button:FindSpellReagent(self, self.currentStance, -1, self.actionNameCount, self.actionTypeCount)
            else
@@ -5654,7 +5657,7 @@ function Lunar.Button:UpdateCount(self)

        -- Possibly just switch actionType and actionName to "item" and the reagent name, instead of this code ... to save space?
        if (actionType == "spell") and (self.spellReagent) then
-           reagentCount = GetSpellCount(actionName) or (0);
+           reagentCount = C_Spell.GetSpellCount(actionName) or (0);
            if (reagentCount > 0) then
                if (self:GetID() > 0) then
                    _G[self:GetName() .. "Count"]:Show();
@@ -5682,8 +5685,8 @@ function Lunar.Button:UpdateCount(self)
                if (self.buttonType) then
                    if (self.buttonType < 130) then --if (self.buttonType == 12) or (self.buttonType == 22) or (self.buttonType == 13) or (self.buttonType == 23) then
                        local actionName1, actionName2 = string.match(actionName, "/use (.*)\n/use (.*)");
-                       local count1 = GetItemCount(actionName1) or (0);
-                       local count2 = GetItemCount(actionName2) or (0);
+                       local count1 = C_Item.GetItemCount(actionName1) or (0);
+                       local count2 = C_Item.GetItemCount(actionName2) or (0);
                        if (count1 > count2) then
                            actionName = actionName2;
                            if (actionName == "") then
@@ -5696,7 +5699,7 @@ function Lunar.Button:UpdateCount(self)
                            end
                        end
                    else
-                       actionName = GetItemInfo(GetInventoryItemLink("player", self.buttonType - 117) or ("")) or ("");
+                       actionName = C_Item.GetItemInfo(GetInventoryItemLink("player", self.buttonType - 117) or ("")) or ("");
                    end
                    actionName = actionName or ("") ;

@@ -5716,7 +5719,7 @@ function Lunar.Button:UpdateCount(self)

            -- Obtain the stackTotal that the item can have
            local stackTotal, objectMainType, objectType, itemLink, itemID, itemCount;
-           _, itemLink, _, _, _, objectMainType, objectType, stackTotal = GetItemInfo(actionName);
+           _, itemLink, _, _, _, objectMainType, objectType, stackTotal = C_Item.GetItemInfo(actionName);

            -- Make sure we have a stackTotal (meaning, we have it in our in our inventory)
            if (stackTotal) then
@@ -5727,7 +5730,7 @@ function Lunar.Button:UpdateCount(self)
                -- charges instead of the item count
 --             totalCharges = Lunar.Items:GetCharges(itemID);
 --             if (totalCharges) then
-               itemCount = GetItemCount(actionName, nil, true);
+               itemCount = C_Item.GetItemCount(actionName, nil, true);
 --             _G[self:GetName() .. "Count"]:SetText(itemCount);

                -- If the item is consumable, a reagent, or can stack, we will show the count of the item
@@ -5817,7 +5820,7 @@ function Lunar.Button.UpdateCooldown(self, filter)
        if (not button.actionTypeCooldown) then
            if (self:GetID() == 0) then
                self.actionNameCooldown = LunarSphereSettings.sphereAction or ("") 
-               if GetSpellInfo(self.actionNameCooldown) then
+               if C_Spell.GetSpellInfo(self.actionNameCooldown) then
                    self.actionTypeCooldown = "spell";
                    LunarSphereSettings.buttonData[0].showCount = true;
                else
@@ -5844,7 +5847,7 @@ function Lunar.Button.UpdateCooldown(self, filter)
        -- that we're looking at
        enable = 1;
        if (actionType == "spell") then
-           startTime, duration, enable = GetSpellCooldown(actionName);
+           startTime, duration, enable = C_Spell.GetSpellCooldown(actionName);
        elseif (actionType == "item") then
            startTime, duration = Lunar.API:GetItemCooldown(actionName);
        elseif (actionType == "macro") or (actionType == "macrotext") then
@@ -5856,10 +5859,10 @@ function Lunar.Button.UpdateCooldown(self, filter)
                end
            end
            if actionName then
-               if GetItemInfo(actionName) then
+               if C_Item.GetItemInfo(actionName) then
                    startTime, duration = Lunar.API:GetItemCooldown(actionName);
                else
-                   startTime, duration, enable = GetSpellCooldown(actionName);
+                   startTime, duration, enable = C_Spell.GetSpellCooldown(actionName);
                end
            end
        elseif (actionType == "pet") then
@@ -6006,7 +6009,7 @@ function Lunar.Button.OnUpdate(self, elapsed, button)
        local actionType = self:GetAttribute("updateIconType");
        local actionName = self:GetAttribute("updateIconName");
        if (actionType == "spell") then
-           self.texture:SetTexture(GetSpellTexture(actionName));
+           self.texture:SetTexture(C_Spell.GetSpellTexture(actionName));
        end
    end

@@ -6188,12 +6191,13 @@ function Lunar.Button:UpdateUsable(self, filter, rangeOnly)
        -- Pull the data based on the type of button we have
        if (self.actionType == "spell") then

-           _, spellLink = GetSpellBookItemInfo(self.actionName);
-           texture = GetSpellTexture(self.actionName);
+           spellLink = C_Spell.GetSpellLink(self.actionName);
+           texture = C_Spell.GetSpellTexture(self.actionName);
            if (not spellLink) then
-               spellLink, _, texture = GetSpellInfo(self.actionName); -- or ("");
+               spellLink, _, texture = C_Spell.GetSpellInfo(self.actionName); -- or ("");
            end
-           name, rank = GetSpellInfo(self.actionName) or "";
+           name = C_Spell.GetSpellInfo(self.actionName).name or "";
+           rank = nil
            if (rank) then
                name = name .. "(" .. rank .. ")";
            end
@@ -6201,7 +6205,7 @@ function Lunar.Button:UpdateUsable(self, filter, rangeOnly)
            spellLink = spellLink or ("");
 --         spellLink = self.actionName;
            if not (rangeOnly == true) then
-               isUsable, notEnoughMana = IsUsableSpell(spellLink); --self.actionName);
+               isUsable, notEnoughMana = C_Spell.IsUsableSpell(spellLink); --self.actionName);
                -- Adjust for spell mounts since we assign by number. They can always be used ... kinda.
                if (not isUsable) then
                    if (tostring(tonumber(self.actionName)) == self.actionName) then
@@ -6228,15 +6232,15 @@ function Lunar.Button:UpdateUsable(self, filter, rangeOnly)
                    border:Hide();
                end
            end
-           inRange = IsSpellInRange(name, "target"); --self.actionName, "target");
+           inRange = C_Spell.IsSpellInRange(name, "target"); --self.actionName, "target");
        elseif (self.actionType == "item") then
            if (not (rangeOnly == true)) then
-               isUsable, notEnoughMana = IsUsableItem(self.actionName);
+               isUsable, notEnoughMana = C_Item.IsUsableItem(self.actionName);
                self.notEnoughMana = nil; --notEnoughMana;
                self.isUsable = isUsable;
            end
-           if ItemHasRange(self.actionName) then
-               inRange = IsItemInRange(self.actionName, "target"); 
+           if C_Item.ItemHasRange(self.actionName) then
+               inRange = C_Item.IsItemInRange(self.actionName, "target");  
            end
        elseif (self.actionType == "macro") or (self.actionType == "macrotext") then
            isUsable = true;
@@ -6251,22 +6255,22 @@ function Lunar.Button:UpdateUsable(self, filter, rangeOnly)
 --             end
            end
            if macroAction and (macroAction ~= "") then
-               if GetItemInfo(macroAction) then
+               if C_Item.GetItemInfo(macroAction) then
                    if not (rangeOnly == true) then
-                       isUsable, notEnoughMana = IsUsableItem(macroAction);
+                       isUsable, notEnoughMana = C_Item.IsUsableItem(macroAction);
                        self.notEnoughMana = nil --notEnoughMana;
                        self.isUsable = isUsable;
                    end
-                   if ItemHasRange(macroAction) then
-                       inRange = IsItemInRange(macroAction, "target"); 
+                   if C_Item.ItemHasRange(macroAction) then
+                       inRange = C_Item.IsItemInRange(macroAction, "target");  
                    end
                else
                    if not (rangeOnly == true) then
-                       isUsable, notEnoughMana = IsUsableSpell(macroAction);
+                       isUsable, notEnoughMana = C_Spell.IsUsableSpell(macroAction);
                        self.notEnoughMana = notEnoughMana;
                        self.isUsable = isUsable;
                    end
-                   inRange = IsSpellInRange(macroAction, "target");
+                   inRange = C_Spell.IsSpellInRange(macroAction, "target");
                end
            else
                self.isUsable = isUsable;
@@ -6487,9 +6491,9 @@ function Lunar.Button:UpdateIcon(button)
    --          if not objectName then
    --              objectName = GetMacroItem(actionName);
                    if (objectName) then
-                       _,_,_,_,_,_,_,_,_,newTexture = GetItemInfo(objectName); --GetActionFromMacroText(macroBody));
+                       _,_,_,_,_,_,_,_,_,newTexture = C_Item.GetItemInfo(objectName); --GetActionFromMacroText(macroBody));
                        if not newTexture then
-                           newTexture = GetSpellTexture(objectName);
+                           newTexture = C_Spell.Texture(objectName);
                        end
                    end
                end
@@ -6501,22 +6505,22 @@ function Lunar.Button:UpdateIcon(button)
 --     else
 --         local spellID = Lunar.API:GetSpellID(objectName);
 --         if (spellID) then
---             newTexture = GetSpellTexture(spellID, "spell");
+--             newTexture = C_Spell.GetSpellTexture(spellID, "spell");
 --         end
 --     if not newTexture then
---         newTexture = GetSpellTexture(objectName);
+--         newTexture = C_Spell.GetSpellTexture(objectName);
 --     end

        -- Grab the item texture first.
 --[[       if (objectName) then
-           _,_,_,_,_,_,_,_,_,newTexture = GetItemInfo(objectName); --GetActionFromMacroText(macroBody));
+           _,_,_,_,_,_,_,_,_,newTexture = C_Item.GetItemInfo(objectName); --GetActionFromMacroText(macroBody));
        end

        -- If it wasn't an item, we'll have no texture. So, grab the spell texture
        if (not newTexture) then
            local spellID = Lunar.API:GetSpellID(objectName);
            if (spellID) then
-               newTexture = GetSpellTexture(spellID, "spell");
+               newTexture = C_Spell.GetSpellTexture(spellID, "spell");
            end
        end
 --]]
@@ -6545,14 +6549,14 @@ function Lunar.Button:GetIconTexture(cursorType, objectID, objectData)
    if (cursorType == "spell") then

        -- Get the name of the spell and its texture
---     objectName = GetSpellBookItemName(objectID, objectData);
-       objectTexture = GetSpellTexture(objectID, objectData);
+--     objectName = C_SpellBook.GetSpellBookItemName(objectID, Enum.SpellBookSpellBank.Player);
+       objectTexture = C_Spell.GetSpellTexture(objectID, objectData);

    -- If it was an item drag ...
    elseif (cursorType == "item") then

        -- Get the name of the item, what it can stack as, and its texture
-       _,_,_,_,_,_,_,_,_,objectTexture = GetItemInfo(objectData);
+       _,_,_,_,_,_,_,_,_,objectTexture = C_Item.GetItemInfo(objectData);

    -- If it was a macro drag ...
    elseif (cursorType == "macro") then
@@ -7157,13 +7161,13 @@ function Lunar.Button:SetTooltip(self)
            itemCount = "";
            if (buttonType) then
                if (actionType == "item") then
-                   local _, _, _, _, _, _, _, stackTotal, _, _, _, classID = GetItemInfo(actionName);
+                   local _, _, _, _, _, _, _, stackTotal, _, _, _, classID = C_Item.GetItemInfo(actionName);
                    -- Make sure we have a stackTotal (meaning, we have it in our in our inventory)
                    -- Then, make sure the item is eligible for showing a count
                    if (stackTotal) then
                        -- classID == 0 is Consumable
                        if (IsConsumableItem(actionName) or (stackTotal > 1) or (classID == 0) ) then
-                           itemCount = " (" .. GetItemCount(actionName, nil, true) .. ")";
+                           itemCount = " (" .. C_Item.GetItemCount(actionName, nil, true) .. ")";
                        end
                    end

@@ -7187,11 +7191,11 @@ function Lunar.Button:SetTooltip(self)
                                --print("buttonType (7184):", buttonType, ", ", actionName, ", ", actionType)

                                if (actionType == "item") then
-                                   myGameTooltip:AddLine(buttonName .. (GetItemInfo(actionName) or (actionName .. " " .. Lunar.Locale["_NOT_IN_CACHE"]))  .. " " .. itemCount .. keybindText, 1, 1, 1);
+                                   myGameTooltip:AddLine(buttonName .. (C_Item.GetItemInfo(actionName) or (actionName .. " " .. Lunar.Locale["_NOT_IN_CACHE"]))  .. " " .. itemCount .. keybindText, 1, 1, 1);
                                else
                                    -- Make sure we don't show spell IDs
                                    if (actionName == tostring(tonumber(actionName))) then
-                                       actionName = GetSpellInfo(actionName);
+                                       actionName = C_Spell.GetSpellInfo(actionName).name;
                                    end

                                    myGameTooltip:AddLine(buttonName .. actionName .. " " .. itemCount .. keybindText, 1, 1, 1);
@@ -7209,7 +7213,7 @@ function Lunar.Button:SetTooltip(self)
 --                     end
                        if DrDamage and (actionType == "spell") and (LunarSphereSettings.enableDrDamageTips == true) then
 --                     if DrDamage and (LunarSphereSettings.enableDrDamage == true) and (actionType == "spell") and (LunarSphereSettings.enableDrDamageTips == true) then
-                           local spellID = Lunar.API:GetSpellID(actionName);
+                           local spellID = C_Spell.GetSpellInfo(actionName).spellID
                            if (spellID) then
                                DrDamage:SetSpell(myGameTooltip, spellID);
                            end
@@ -7283,7 +7287,7 @@ function Lunar.Button:SetTooltip(self)
                        end
                        myGameTooltip:AddTexture("Interface\\Addons\\LunarSphere\\art\\tooltipMouse" .. index);
                        if not ((actionName == "") or (actionName == "item: ") or (actionName == " ") or (actionName == nil)) then
-                           actionName = GetItemInfo(actionName);
+                           actionName = C_Item.GetItemInfo(actionName);
                            if (actionName == nil) then
                                myGameTooltip:AddLine(Lunar.Locale["OUT_OF_STOCK"], 1.0, 0, 0);
                            else
@@ -7312,7 +7316,7 @@ function Lunar.Button:SetTooltip(self)

                        --print("SetTooltip (7309)")

-                       if (buttonTexture) and (GetItemCount(actionName) > 0) then
+                       if (buttonTexture) and (C_Item.GetItemCount(actionName) > 0) then
                            if (LunarSphereSettings.tooltipType == 2) then
                                myGameTooltip:AddLine(buttonName .. actionName .. " " .. itemCount  .. keybindText, 1, 1, 1);
                                myGameTooltip:AddTexture("Interface\\Addons\\LunarSphere\\art\\tooltipMouse" .. index);
@@ -7352,13 +7356,13 @@ function Lunar.Button:SetTooltip(self)
                        if (buttonType < 130) then
                            actionName, actionName2 = string.match(actionName, "/use (.*)\n/use (.*)");
                        else
-                           actionName = GetItemInfo(GetInventoryItemLink("player", buttonType - 117) or ("")) or ("");
+                           actionName = C_Item.GetItemInfo(C_Item.GetInventoryItemLink("player", buttonType - 117) or ("")) or ("");
                        end
                        myGameTooltip:AddLine(buttonName .. Lunar.Locale[Lunar.Object.dropdownData["Button_Type"][math.floor(buttonType / 10) + catagoryStart][3] .. (math.fmod(buttonType, 10) + 1)] .. keybindText, 1, 1, 1);
                        myGameTooltip:AddTexture("Interface\\Addons\\LunarSphere\\art\\tooltipMouse" .. index);
                        if (actionName ~= "") then
                            if (buttonType < 130) then
-                               myGameTooltip:AddLine("" .. buttonName .. actionName .. " (" .. (GetItemCount(actionName) or (0)) .. ")", 1, 1, 1);
+                               myGameTooltip:AddLine("" .. buttonName .. actionName .. " (" .. (C_ITem.GetItemCount(actionName) or (0)) .. ")", 1, 1, 1);
                            else
                                myGameTooltip:AddLine("" .. buttonName .. actionName, 0.7, 0.7, 1);
                            end
@@ -7370,7 +7374,7 @@ function Lunar.Button:SetTooltip(self)
                            end
                        end                             
                        if (actionName2 ~= "") then
-                           myGameTooltip:AddLine("" .. buttonName .. actionName2 .. " (" .. (GetItemCount(actionName2) or (0)) .. ")", 1, 1, 1);
+                           myGameTooltip:AddLine("" .. buttonName .. actionName2 .. " (" .. (C_Item.GetItemCount(actionName2) or (0)) .. ")", 1, 1, 1);
                        else
                            if (buttonType < 130) then
                                myGameTooltip:AddLine(buttonName .. Lunar.Object.dropdownData["Button_Type"][1 + catagoryStart][1] .. ": " .. Lunar.Locale["OUT_OF_STOCK"], 1, 1, 1);
diff --git a/Lib/moduleItems.lua b/Lib/moduleItems.lua
index a993f81..6d2afad 100644
--- a/Lib/moduleItems.lua
+++ b/Lib/moduleItems.lua
@@ -495,7 +495,7 @@ function Lunar.Items:DebugPrint()
                    local objName = itemData[itemTableNames[nameIndex]][index].name;

                    if (string.sub(objName, 1, 2) == "**") then
-                       objName = GetSpellInfo(string.sub(objName, 3));
+                       objName = C_Spell.GetSpellInfo(string.sub(objName, 3)).name;
                    end

                    DEFAULT_CHAT_FRAME:AddMessage(": found: " .. objName);
@@ -540,16 +540,17 @@ function Lunar.Items:BuildLookupStrings()
        end
    end

-   searchData.drink         = GetSpellInfo(430);
-   searchData.food      = GetSpellInfo(433);
-   searchData.potionHealing = GetSpellInfo(441); -- healing-potion
-   searchData.potionMana    = GetSpellInfo(2023); -- restore-mana
-   searchData.energyDrink   = GetSpellInfo(9512);
-   searchData.bandage   = GetSpellInfo(746);
-   searchData.healthStone   = GetSpellInfo(6262); -- minor-healthstone (works for Retail)
-   searchData.refreshment   = GetSpellInfo(44166);
+   searchData.drink         = C_Spell.GetSpellInfo(430).name;
+   searchData.food      = C_Spell.GetSpellInfo(433).name;
+   searchData.potionHealing = C_Spell.GetSpellInfo(441).name; -- healing-potion
+   searchData.potionMana    = C_Spell.GetSpellInfo(2023).name; -- restore-mana
+   searchData.energyDrink   = C_Spell.GetSpellInfo(9512).name;
+   searchData.bandage   = C_Spell.GetSpellInfo(746).name;
+   searchData.healthStone   = C_Spell.GetSpellInfo(6262).name; -- minor-healthstone (works for Retail)
+   searchData.refreshment   = C_Spell.GetSpellInfo(44166).name;

-   Lunar.Locale["_SUMMON"] = select(2, GetSpellInfo(688))
+-- Lunar.Locale["_SUMMON"] = select(2, C_Spell.GetSpellInfo(688))
+   Lunar.Locale["_SUMMON"] = nil -- was rank

    -- Now, run through each entry in the search data and make sure it has a spell attached to it.
    -- Make sure we skip mount, rage potion, and charges
@@ -594,39 +595,39 @@ function Lunar.Items:BuildLookupStrings()
 -- local tempWeapon,tempArmor,_,tempConsume;
 -- local _, tempReagent = C_AuctionHouse.GetAuctionItemSubClasses(10);

-   -- This is the most retarded thing ever. GetItemInfo will return on the
+   -- This is the most retarded thing ever. C_Item.GetItemInfo will return on the
    -- 12th value the classID and on the 13th the subclassID, both of which do
    -- _NOT_ change with the locale. Talk about reinventing the wheel.

    if (not searchData.weapon) or (searchData.weapon == "") then
        searchData.weapon = tempWeapon;
        if (not searchData.weapon) or (searchData.weapon == "") then
-           _,_,_,_,_,searchData.weapon = GetItemInfo(2139); -- Dirk
+           _,_,_,_,_,searchData.weapon = C_Item.GetItemInfo(2139); -- Dirk
        end
    end

    if (not searchData.armor) or (searchData.armor == "") then
        searchData.armor = tempArmor;
        if (not searchData.armor) or (searchData.armor == "") then
-           _,_,_,_,_,searchData.armor = GetItemInfo(2960); -- Journeyman's Gloves
+           _,_,_,_,_,searchData.armor = C_Item.GetItemInfo(2960); -- Journeyman's Gloves
        end
    end

    if (not searchData.consume) or (searchData.consume == "") then
        searchData.consume = tempConsume;
        if (not searchData.consume) or (searchData.consume == "") then
-           _,_,_,_,_,searchData.consume = GetItemInfo(159); -- Refreshing spring water
+           _,_,_,_,_,searchData.consume = C_Item.GetItemInfo(159); -- Refreshing spring water
        end
    end

    if (not searchData.reagent) or (searchData.reagent == "") then
        searchData.reagent = tempReagent;
        if (not searchData.reagent) or (searchData.reagent == "") then
-           _,_,_,_,_,_,searchData.reagent = GetItemInfo(4470); -- Simple Wood
+           _,_,_,_,_,_,searchData.reagent = C_Item.GetItemInfo(4470); -- Simple Wood
        end
    end

-   _, _, _, _, _, searchData.misc, searchData.junk,_ = GetItemInfo(6948);  -- Item: Hearthstone
+   _, _, _, _, _, searchData.misc, searchData.junk,_ = C_Item.GetItemInfo(6948);  -- Item: Hearthstone

    -- Store the reagent string as part of the Item module table as well
    Lunar.Items.reagentString = searchData.reagent;
@@ -660,7 +661,7 @@ function Lunar.Items:GetItemSpell(itemCatagory)
    local index, itemSpell;

    for index = 1, (string.len(itemSpellID[itemCatagory]) / 6) do 
-       itemSpell = GetItemSpell(tonumber(string.sub(itemSpellID[itemCatagory], (index - 1) * 6 + 1, index * 6 - 1)));
+       itemSpell = C_Item.GetItemSpell(tonumber(string.sub(itemSpellID[itemCatagory], (index - 1) * 6 + 1, index * 6 - 1)));

        if (itemSpell) then
            break;
@@ -715,8 +716,8 @@ function Lunar.Items:UpdateItemCounts()

                -- Cycle through each item and assign its count.
                for index = 1, table.getn(itemData[itemTableNames[nameIndex]]) do 
-                   itemData[itemTableNames[nameIndex]][index].count = GetItemCount(itemData[itemTableNames[nameIndex]][index].name);
-                   itemData[itemTableNames[nameIndex]][index].count = GetItemCount(itemData[itemTableNames[nameIndex]][index].name, nil, true);
+                   itemData[itemTableNames[nameIndex]][index].count = C_Item.GetItemCount(itemData[itemTableNames[nameIndex]][index].name);
+                   itemData[itemTableNames[nameIndex]][index].count = C_Item.GetItemCount(itemData[itemTableNames[nameIndex]][index].name, nil, true);
                end
            end
        end
@@ -1363,7 +1364,7 @@ function Lunar.Items:UpdateLowHighItems()
    local canFly = Lunar.API:IsFlyableArea()
    local inAQ = Lunar.API:IsInAQ();
    local Lunar_Seahorse = 0;
-    local Lunar_AbyssalMount_Name, _ = GetSpellInfo(75207);
+    local Lunar_AbyssalMount_Name, _ = C_Spell.GetSpellInfo(75207).name;

    local playerLevel = UnitLevel("player");

@@ -2083,7 +2084,10 @@ function Lunar.Items:RetailScanForSpellMounts()

    --local locKalimdor, locEastern, locOutland, locNorthrend, locMaelstrom, locPandaren, locDreanor = GetMapContinents();

-      local name, description, standingID, _ = GetFactionInfoByID(1271)
+   local data = C_Reputation.GetFactionDataByID(1271)
+  local name = data.name
+   local description = data.description
+   local standingID = data.currentStanding
    local LunarProfValue = Lunar.API:UserGetProfession();
    local mountIDs;

@@ -2370,7 +2374,7 @@ function Lunar.Items:UpdateBagContents(bagID, updateType)
            if (itemType == searchData.consume) or (itemID == 5514) or (itemID == 32578)  then

                -- Figure out what spell it casts, if any.
-               itemSpell, spellRank = GetItemSpell(itemName);
+               itemSpell, spellRank =C_Item.GetItemSpell(itemName);

                if (itemSpell) then
 -- Already done at the top
@@ -2664,7 +2668,7 @@ function Lunar.Items:ModifyItemDataTable(tableName, modifyType, itemName, itemCo
                -- text exists. If it is, we need to increase the strength by 1000 (to use it first,
                -- if need be).

---             _, itemLink = GetItemInfo(itemName);
+--             _, itemLink = C_Item.GetItemInfo(itemName);
                if (itemLink) and (itemLink ~= "spellMount") then
                    Lunar.Items.tooltip:ClearLines();
                    Lunar.Items.tooltip:SetOwner(UIParent, "ANCHOR_NONE");
@@ -2697,10 +2701,10 @@ function Lunar.Items:ModifyItemDataTable(tableName, modifyType, itemName, itemCo
                    local pos = table.getn(itemData[tableName])
                    if (itemLink ~= "spellMount") then
                        --print("Lunar.Items:ModifyItemDataTable 2346", tableName, modifyType, itemName, itemCount, itemLevel, itemMinLevel, GetItemSpell(itemName))
-                       itemData[tableName][pos].spell = GetItemSpell(itemName);
+                       itemData[tableName][pos].spell = C_Item.GetItemSpell(itemName);
                    else
                        --print("Lunar.Items:ModifyItemDataTable 2349", tableName, modifyType, itemName, itemCount, itemLevel, itemMinLevel, string.sub(itemName, 3))
-                       itemData[tableName][pos].spell = GetSpellInfo(string.sub(itemName, 3));
+                       itemData[tableName][pos].spell = C_Spell.GetSpellInfo(string.sub(itemName, 3)).name;
                        itemData[tableName][pos].spellMount = true;
                        itemData[tableName][pos].itemID = "spellMount";
                    end
@@ -2712,7 +2716,7 @@ function Lunar.Items:ModifyItemDataTable(tableName, modifyType, itemName, itemCo
                end

                if (tableName == "companion") then
-                   itemData[tableName][table.getn(itemData[tableName])].spell = GetSpellInfo(string.sub(itemName, 3));
+                   itemData[tableName][table.getn(itemData[tableName])].spell = C_Spell.GetSpellInfo(string.sub(itemName, 3)).name;
                    itemData[tableName][table.getn(itemData[tableName])].itemID = "spellMount";
                end

diff --git a/Lib/moduleObject.lua b/Lib/moduleObject.lua
index 34a18e0..2f041b9 100644
--- a/Lib/moduleObject.lua
+++ b/Lib/moduleObject.lua
@@ -687,9 +687,9 @@ function Lunar.Object.DropdownInitialize(self, dropdownObject, listName, modifyS
                                objectTexture = "";
                                if (objectName) then
                                    if (buttonType >= 80) and (buttonType < 90) then
-                                       objectTexture = select(3, GetSpellInfo(string.sub(objectName, 3)));
+                                       objectTexture = C_Spell.GetSpellInfo(string.sub(objectName, 3)).iconID;
                                    else
-                                       _,_,_,_,_,_,_,_,_,objectTexture = GetItemInfo(objectName);
+                                       _,_,_,_,_,_,_,_,_,objectTexture = C_Item.GetItemInfo(objectName);
                                    end
                                end

@@ -727,7 +727,7 @@ function Lunar.Object.DropdownInitialize(self, dropdownObject, listName, modifyS
 -- This is just a submenu option, not a main option
 --                         if (buttonType == 132) then
 --                             if (objectName) then
---                                 objectTexture = select(3, GetSpellInfo(string.sub(3, objectName)));
+--                                 objectTexture = C_Spell.GetSpellInfo(string.sub(3, objectName)).iconID;
 --                             end
 --                         end

@@ -899,9 +899,9 @@ function Lunar.Object:SubmenuFunction(listName, updateFunction)
            objectTexture = "";
            if (objectName) then
                if (buttonType >= 80) and (buttonType < 90) then
-                   objectTexture = select(3, GetSpellInfo(string.sub(objectName, 3)));
+                   objectTexture = C_Spell.GetSpellInfo(string.sub(objectName, 3)).iconID;
                else
-                   _,_,_,_,_,_,_,_,_,objectTexture = GetItemInfo(objectName);
+                   _,_,_,_,_,_,_,_,_,objectTexture = C_Item.GetItemInfo(objectName);
                end
            end

@@ -1077,14 +1077,14 @@ function Lunar.Object.IconPlaceHolder_OnClick(self)

        if (updateType == "spell") then

-           _, spellRank = GetSpellBookItemName(updateID, updateData);
---         nextSpellName = GetSpellBookItemName(updateID + 1, updateData);
-           spellRank = "(" .. spellRank .. ")";
+--         _, spellRank = C_SpellBook.GetSpellBookItemName(updateID, Enum.SpellBookSpellBank.Player);
+--         nextSpellName = C_SpellBook.GetSpellBookItemName(updateID + 1, Enum.SpellBookSpellBank.Player);
+--         spellRank = "(" .. spellRank .. ")";

-           --_, spellID = GetSpellBookItemInfo(updateID, updateData);
-           actionName = GetSpellBookItemName(updateID, updateData);
-           objectTexture = GetSpellTexture(updateID, updateData);
-           spellName = GetSpellInfo(updateTrueSpellID);
+           --spellID = C_SpellBook.GetSpellBookItemInfo(updateID, Enum.SpellBookSpellBank.Player).spellID;
+           actionName = C_SpellBook.GetSpellBookItemName(updateID, Enum.SpellBookSpellBank.Player);
+           objectTexture = C_Spell.GetSpellTexture(updateID, updateData);
+           spellName = C_Spell.GetSpellInfo(updateTrueSpellID).name;

            -- Fix for Call Pet for hunters.
            if (actionName ~= spellName) then
@@ -1098,13 +1098,11 @@ function Lunar.Object.IconPlaceHolder_OnClick(self)
 --                     spellRank = "";
 --                     actionName = Lunar.API:FixFaerie(actionName);
 --                 end
-                   if (spellRank == "()") then
-                       spellRank = "";
-                       actionName = Lunar.API:FixFaerie(actionName);
-                   end
+               spellRank = nil;
+               actionName = Lunar.API:FixFaerie(actionName);
 --             end
                -- We don't want spell ranks on the first spell tab or professions tab data ... these are generic
-               if (updateID <= (select(4, GetSpellTabInfo(1))) or updateID >= (select(3, GetSpellTabInfo(5)))) then
+               if (updateID <= (select(4, C_SpellBook.GetSpellBookSkillLineInfo(1))) or updateID >= (select(3, C_SpellBook.GetSpellBookSkillLineInfo(5)))) then
                    spellRank = "";
                end
                actionName = actionName .. spellRank;
@@ -1127,7 +1125,7 @@ function Lunar.Object.IconPlaceHolder_OnClick(self)
            displayID, _, _, _, _ = C_MountJournal.GetMountInfoExtraByID(updateID)

        elseif (updateType == "item") then
-           actionName, _, _, _, _, objectType, _, _, _, objectTexture = GetItemInfo(updateID);
+           actionName, _, _, _, _, objectType, _, _, _, objectTexture = C_Item.GetItemInfo(updateID);
 -- NEW code for item names (item link for weapons/armor, to remember their "of the bear" and other animal
 -- modifiers, all other items is JUST the item ID)
            if (objectType == LunarSphereGlobal.searchData.armor) or (objectType == LunarSphereGlobal.searchData.weapon) then
@@ -1197,8 +1195,8 @@ function Lunar.Object.SphereActionIconPlaceHolder_OnClick(self)
        local actionName, objectTexture;

        if (cursorType == "spell") then
-           actionName = GetSpellBookItemName(cursorID, cursorData);
-           objectTexture = GetSpellTexture(cursorID, cursorData);
+           actionName = C_SpellBook.GetSpellBookItemName(cursorID, Enum.SpellBookSpellBank.Player);
+           objectTexture = C_Spell.GetSpellTexture(cursorID, cursorData);
        elseif (updateType == "battlepet") then
            -- Set the name of the spell and its texture
            _, _, _, _, _, _, _, actionName, objectTexture, _, displayID = C_PetJournal.GetPetInfoByPetID(updateID);
@@ -1207,7 +1205,7 @@ function Lunar.Object.SphereActionIconPlaceHolder_OnClick(self)
            actionName, _, objectTexture = C_MountJournal.GetMountInfo(updateData)
            displayID, _, _, _, _ = C_MountJournal.GetMountInfoExtra(updateData)
        elseif (cursorType == "item") then
-           _, actionName, _, _, _, _, _, _, _, objectTexture = GetItemInfo(cursorID);
+           _, actionName, _, _, _, _, _, _, _, objectTexture = C_Item.GetItemInfo(cursorID);
            actionName = "item:" .. Lunar.API:GetItemID(actionName);
        end

diff --git a/Lib/moduleSettings.lua b/Lib/moduleSettings.lua
index 0cc6a41..1893c69 100644
--- a/Lib/moduleSettings.lua
+++ b/Lib/moduleSettings.lua
@@ -369,10 +369,10 @@ function Lunar.Settings:Initialize()
        tempObject:SetScript("OnClick", Lunar.Object.SphereActionIconPlaceHolder_OnClick)
        tempObject:SetScript("OnReceiveDrag", Lunar.Object.SphereActionIconPlaceHolder_OnClick);
        if (LunarSphereSettings.sphereAction) then
-           if GetSpellInfo(LunarSphereSettings.sphereAction) then
-               objectTexture = GetSpellTexture(LunarSphereSettings.sphereAction);
+           if C_Spell.GetSpellInfo(LunarSphereSettings.sphereAction) then
+               objectTexture = C_Spell.GetSpellTexture(LunarSphereSettings.sphereAction);
            else
-               objectTexture = GetItemIcon(LunarSphereSettings.sphereAction);  
+               objectTexture = C_Item.GetItemIcon(LunarSphereSettings.sphereAction);   
            end
            _G["LSSettingssphereActionAssignIcon"]:SetTexture(objectTexture);
        end
@@ -4586,7 +4586,7 @@ function Lunar.Settings:StanceIconSetup(stanceIconName, stanceIconWidthBoundry,

                    if (shiftIcon) then
                        if (shiftActive) then
-                           shiftIcon = GetSpellTexture(shiftID);
+                           shiftIcon = C_Spell.GetSpellTexture(shiftID);
                        end

                        iconObject:SetNormalTexture(shiftIcon);
@@ -4999,25 +4999,25 @@ if not (LunarSphereSettings.memoryDisableSpeech) then
            if (Lunar.Button.CompanionType) then
                cursorType = "companion";
                actionName, objectTexture = select(3, GetCompanionInfo(Lunar.Button.CompanionType, Lunar.Button.CompanionID));
---             actionName = GetSpellInfo(actionName);
+--             actionName = C_Spell.GetSpellInfo(actionName).name;
            end
            Lunar.Button.CompanionType = nil;
            Lunar.Button.CompanionID = nil;

            if (cursorType == "spell") then
-               actionName, actionRank = GetSpellBookItemName(cursorID, cursorData);
-               objectTexture = GetSpellTexture(cursorID, cursorData);
+               actionName = C_SpellBook.GetSpellBookItemName(cursorID, Enum.SpellBookSpellBank.Player).name;

                -- Fix for Call Pet for hunters.
-               local _, spellID = GetSpellBookItemInfo(cursorID, cursorData);
-               local spellName = GetSpellInfo(spellID);
+               local spellID = C_SpellBook.GetSpellBookItemInfo(cursorID, Enum.SpellBookSpellBank.Player).spellID;
+               local spellName = C_Spell.GetSpellInfo(spellID).name;
+               objectTexture = C_Spell.GetSpellTexture(spellID);
                if (actionName ~= spellName) then
                    actionName = spellName;
                end

            elseif (cursorType == "item") then
-               actionName, _, _, _, _, _, _, _, _, objectTexture = GetItemInfo(cursorID);
-               actionName = GetItemSpell(actionName);
+               actionName, _, _, _, _, _, _, _, _, objectTexture = C_Item.GetItemInfo(cursorID);
+               actionName = C_Item.GetItemSpell(actionName);
            end

            if (actionName) then
@@ -5353,7 +5353,7 @@ if not (LunarSphereSettings.memoryDisableReagents) then
            if (LunarSphereSettings.reagentList) then
                if (LunarSphereSettings.reagentList[index + slider:GetValue()]) then
                    if (LunarSphereSettings.reagentList[index + slider:GetValue()].itemID) then
-                       _,_,_,_,_,_,_,_,_, objectTexture = GetItemInfo(LunarSphereSettings.reagentList[index + slider:GetValue()].itemID);
+                       _,_,_,_,_,_,_,_,_, objectTexture = C_Item.GetItemInfo(LunarSphereSettings.reagentList[index + slider:GetValue()].itemID);

                        _G["LSSettingsReagentIcon" .. index]:SetNormalTexture(objectTexture);
                        _G["LSSettingsReagentName" .. index .. "Text"]:SetText(LunarSphereSettings.reagentList[index + slider:GetValue()].name);
@@ -5409,7 +5409,7 @@ if not (LunarSphereSettings.memoryDisableReagents) then
                    local objectName, objectType, stackTotal, objectTexture;

                    -- Get the name of the item, what it can stack as, and its texture
-                   objectName, _, _, _, _, objectType, _, stackTotal, _, objectTexture = GetItemInfo(itemID);
+                   objectName, _, _, _, _, objectType, _, stackTotal, _, objectTexture = C_Item.GetItemInfo(itemID);

                    table.insert(LunarSphereSettings.reagentList, {["name"] = objectName, ["maxAmount"] = 20, ["itemID"] = itemID});
                    index = table.getn(LunarSphereSettings.reagentList);
diff --git a/Lib/moduleSpeech.lua b/Lib/moduleSpeech.lua
index 1da4eff..48311f5 100644
--- a/Lib/moduleSpeech.lua
+++ b/Lib/moduleSpeech.lua
@@ -172,7 +172,8 @@ function Lunar.Speech:Initialize()
    Lunar.Speech:LoadLibrary();
    Lunar.Speech:UpdateRegisteredSpells();

-   summonText = select(2, GetSpellInfo(23214));
+   --summonText = select(2, C_Spell.GetSpellInfo(23214));
+   summonText = nil -- was range
    Lunar.Speech.summonText = summonText;

 end
@@ -190,7 +191,8 @@ function Lunar.Speech.OnEvent(self, event, unit, target, castGUID, spellID)
    -- order to catch spells that have a cast time.

    if (event == "UNIT_SPELLCAST_SENT") then
-       self.spellName, self.spellRank = GetSpellInfo(spellID);
+       self.spellName = C_Spell.GetSpellInfo(spellID).name
+       self.spellRank = nil
        self.spellTarget = target;

        -- If the target data doesn't exist, grab it from the player target if possible
@@ -311,9 +313,9 @@ function Lunar.Speech:Export(wipeOldData, scriptID)

    -- Check to see if the exporter is loaded. If not, load it up
    local theReason;
-   local isLoaded = IsAddOnLoaded("LunarSphereExporter");
+   local isLoaded = C_AddOns.IsAddOnLoaded("LunarSphereExporter");
    if ( not isLoaded ) then
-       isLoaded, theReason = LoadAddOn("LunarSphereExporter");
+       isLoaded, theReason = C_AddOns.LoadAddOn("LunarSphereExporter");
    end

    -- If it was successfully loaded, run the exporter and export our data.
@@ -875,14 +877,14 @@ function Lunar.Speech.ParseSpeech(self, speech)
    speech = string.gsub(speech, "<focus>", (UnitName("focus") or self.spellTarget or UnitName("target") or ""));
    if string.find(speech, "<mount>") then
        -- Wipe the "summon" from the name, if it exists, for all locales (in theory)
-       local spellName, spellRank = GetSpellBookItemName(self.spellName)
-       if spellName and spellRank and (spellRank ~= "")  then
-           spellName = string.gsub(spellName, spellRank, "");
-           spellName = string.gsub(spellName, string.lower(spellRank), "");
-           spellName = strtrim(string.gsub(spellName, "d'un", ""));
-       else
-           spellName = self.spellName;
-       end
+       -- local spellName, spellRank = C_SpellBook.GetSpellBookItemName(self.spellName,Enum.SpellBookSpellBank.Player)
+       -- if spellName and spellRank and (spellRank ~= "")  then
+       --  spellName = string.gsub(spellName, spellRank, "");
+       --  spellName = string.gsub(spellName, string.lower(spellRank), "");
+       --  spellName = strtrim(string.gsub(spellName, "d'un", ""));
+       -- else
+       spellName = self.spellName;
+       -- end
        speech = string.gsub(speech, "<mount>", (spellName or ("")));
    end
    speech = string.gsub(speech, "<spell>", (self.spellName or ("")));
diff --git a/Lib/moduleSphere.lua b/Lib/moduleSphere.lua
index 37c8710..c2d7aa0 100644
--- a/Lib/moduleSphere.lua
+++ b/Lib/moduleSphere.lua
@@ -2654,7 +2654,7 @@ end
 function Lunar.Sphere.Updates(self, elapsed)

    if (dataTracking.loadedPlayer == false) then
-       if (HasPetSpells()) then
+       if (C_SpellBook.HasPetSpells()) then
            local minXP, maxXP = GetPetExperience();
            if (maxXP == 0) then
                return;
@@ -2810,8 +2810,8 @@ end

 -- Some notes ...
    -- Drink, Potion, and Food finder =)
-   --local spellName = GetItemSpell("Refreshing Spring Water");
-   --local sName, sLink, iRarity, iLevel, iMinLevel, sType, sSubType, iStackCount = GetItemInfo("Honey Bread");
+   --local spellName = C_Item.GetItemSpell("Refreshing Spring Water");
+   --local sName, sLink, iRarity, iLevel, iMinLevel, sType, sSubType, iStackCount = C_Item.GetItemInfo("Honey Bread");
    --message(sName..","..iLevel..","..iMinLevel..","..sType..","..sSubType);
    -- Drink, Restore Mana, Healing Potion, Food
    -- Honey Bread, Darnassian Bleu, Shiny Red Apple, Tough Hunk of Bread, Forest Mushroom Cap, Tough Jerky
diff --git a/Lib/moduleTemplate.lua b/Lib/moduleTemplate.lua
index a9560e3..2d80449 100644
--- a/Lib/moduleTemplate.lua
+++ b/Lib/moduleTemplate.lua
@@ -5866,7 +5866,7 @@ function Lunar.Template:LoadTemplateData()
        if (string.sub(data, 4, 4) == "1") and (searchDB.reagents) then
            LunarSphereSettings.reagentList = Lunar.API:CopyTable(searchDB.reagents);
            for i = 1, table.getn(LunarSphereSettings.reagentList) do
-               LunarSphereSettings.reagentList[i].name = GetItemInfo(tonumber(LunarSphereSettings.reagentList[i].itemID));
+               LunarSphereSettings.reagentList[i].name = C_Item.GetItemInfo(tonumber(LunarSphereSettings.reagentList[i].itemID));
            end
        end

@@ -5991,8 +5991,8 @@ function Lunar.Template:ParseTemplateData()

        -- Obtain the total number of spells the player knows
        local totalSpells = 0;
-       for i = 1, MAX_SKILLLINE_TABS do
-           totalSpells = totalSpells + select(4, GetSpellTabInfo(i));
+       for i = 1, C_SpellBook.GetNumSpellBookSkillLines() do
+           totalSpells = totalSpells + C_SpellBook.GetSpellBookSkillLineInfo(i).numSpellBookItems;
        end

        local clickType, stance, buttonID, isNotLearned, isOutOfMana, canBeUsed, companionCheck;
@@ -6081,7 +6081,7 @@ function Lunar.Template:ParseTemplateData()
                                -- special parse for spell mounts
                                local isCompanion;
                                if (tostring(tonumber(objectName)) == objectName) then
-                                   _, _, objectTexture = GetSpellInfo(tonumber(objectName));
+                                   objectTexture = C_Spell.GetSpellInfo(tonumber(objectName)).iconID;
                                    newName = objectName;
                                    isCompanion = true;
                                end
@@ -6098,8 +6098,10 @@ function Lunar.Template:ParseTemplateData()
                                        multiSpell = { strsplit(":::", objectTexture) }
                                        for key, value in pairs(multiSpell) do
                                            if (value) then
-                                               if GetSpellInfo(value) then
-                                                   newName, rankFound, newIcon = GetSpellInfo(GetSpellInfo(value));
+                                               if C_Spell.GetSpellInfo(value) then
+                                                   newName = C_Spell.GetSpellInfo(C_Spell.GetSpellInfo(value)).name
+                                                   rankFound = nil
+                                                   newIcon = C_Spell.GetSpellInfo(C_Spell.GetSpellInfo(value)).iconID;
                                                    canBeUsed, isOutOfMana = IsUsableSpell(value);
                                                    if (not (canBeUsed and isOutOfMana)) then
                                                        isNotLearned = true;
@@ -6115,8 +6117,11 @@ function Lunar.Template:ParseTemplateData()
                                        end
                                    else
                                        if (spellID) then
-                                           newName, rankFound, objectTexture = GetSpellInfo(GetSpellInfo(spellID));
-                                           canBeUsed = GetSpellBookItemInfo(newName or (""));
+                                           newName = C_Spell.GetSpellInfo(C_Spell.GetSpellInfo(spellID)).name
+                                           rankFound = nil
+                                           objectTexture = C_Spell.GetSpellInfo(C_Spell.GetSpellInfo(spellID)).iconID;
+                                           canBeUsed = IsPlayerSpell(spellID)
+--                                         canBeUsed = C_SpellBook.GetSpellBookItemInfo(newName or (""));
 --                                         canBeUsed, isOutOfMana = IsUsableSpell(tonumber(spellID));
                                            if (not newName) then
                                                companionCheck = true;
@@ -6126,15 +6131,15 @@ function Lunar.Template:ParseTemplateData()
                                            else
                                                rankFound = 0;
                                                for i = 1, totalSpells do
-                                                   scanName, scanRank = GetSpellBookItemName(i, BOOKTYPE_SPELL);
-                                                   scanTexture = string.lower(GetSpellTexture(i, BOOKTYPE_SPELL) or (""));
+                                                   scanName, scanRank = C_SpellBook.GetSpellBookItemName(i, Enum.SpellBookSpellBank.Player);
+                                                   scanTexture = string.lower(C_Spell.GetSpellTexture(i, BOOKTYPE_SPELL) or (""));

                                                    if (scanName == newName and scanTexture == objectTexture) then
                                                        rankFound = rankFound + 1;
                                                        if not (objectRank) then
                                                            newName = scanName;
                                                        end
-                                                       if (objectRank == rankFound) or (scanName == GetSpellInfo(759)) then
+                                                       if (objectRank == rankFound) or (scanName == C_Spell.GetSpellInfo(759).name) then
                                                            newName = scanName .. "(" .. scanRank .. ")";
                                                            break;
                                                        end
@@ -6142,7 +6147,7 @@ function Lunar.Template:ParseTemplateData()

                                                    if (scanTexture ~= objectTexture) and (rankFound > 0) then
                                                        if not (objectRank) or (objectRank and (objectRank <= rankFound)) then
-                                                           newName, rankFound = GetSpellBookItemName(i - 1, BOOKTYPE_SPELL);
+                                                           newName, rankFound = C_SpellBook.GetSpellBookItemName(i - 1, Enum.SpellBookSpellBank.Player);
                                                        end
                                                        break;
                                                    end
@@ -6178,7 +6183,9 @@ function Lunar.Template:ParseTemplateData()
                                                end
                                            end
                                        else
-                                           newName, rankFound, objectTexture = GetSpellInfo(GetSpellInfo(tonumber(objectTexture)));
+                                           newName = C_Spell.GetSpellInfo(C_Spell.GetSpellInfo(tonumber(objectTexture))).name
+                                           rankFound = nil
+                                           objectTexture = C_Spell.GetSpellInfo(C_Spell.GetSpellInfo(tonumber(objectTexture))).iconID;
                                        end 
                                    end

@@ -6191,16 +6198,16 @@ function Lunar.Template:ParseTemplateData()

                                    objectTexture = string.lower(objectTexture or (""));
                                    for i = 1, totalSpells do
-                                       scanName, scanRank = GetSpellBookItemName(i, BOOKTYPE_SPELL);
+                                       scanName, scanRank = C_SpellBook.GetSpellBookItemName(i, Enum.SpellBookSpellBank.Player);

-                                       scanTexture = string.lower(GetSpellTexture(i, BOOKTYPE_SPELL) or (""));
+                                       scanTexture = string.lower(C_Spell.GetSpellTexture(i, BOOKTYPE_SPELL) or (""));

                                        if (scanTexture == objectTexture) then
                                            rankFound = rankFound + 1;
                                            if not (objectRank) then
                                                newName = scanName;
                                            end
-                                           if (objectRank == rankFound) or (scanName == GetSpellInfo(759)) then
+                                           if (objectRank == rankFound) or (scanName == C_Spell.GetSpellInfo(759).name) then
                                                newName = scanName .. "(" .. scanRank .. ")";
                                                break;
                                            end
@@ -6208,8 +6215,8 @@ function Lunar.Template:ParseTemplateData()

                                        if (scanTexture ~= objectTexture) and (rankFound > 0) then
                                            if not (objectRank) or (objectRank and (objectRank <= rankFound)) then
-                                               newName, rankFound = GetSpellBookItemName(i - 1, BOOKTYPE_SPELL);
-                                               isNotLearned = (GetSpellBookItemInfo(i - 1, BOOKTYPE_SPELL) == "FUTURESPELL");
+                                               newName, rankFound = C_SpellBook.GetSpellBookItemName(i - 1, Enum.SpellBookSpellBank.Player);
+                                               isNotLearned = (C_SpellBook.GetSpellBookItemInfo(i - 1, Enum.SpellBookSpellBank.Player) == "FUTURESPELL");
                                                if (isNotLearned) then
                                                    newName = nil;
                                                    break;
@@ -6249,7 +6256,7 @@ function Lunar.Template:ParseTemplateData()
                                -- if we found a valid spell, add it. Otherwise, wipe it from this button
                                if (newName) then
                                    -- Hack for mage gems
---                                 if (newName == GetSpellInfo(759)) then
+--                                 if (newName == C_Spell.GetSpellInfo(759)) then
 --                                     newName = newName .. "(" .. rankFound .. ")";
 --                                 end
                                    Lunar.Button:SetButtonData(buttonID, stance, clickType, buttonType, cursorType, newName, objectTexture);
diff --git a/LunarSphere.lua b/LunarSphere.lua
index 5d44d7e..a3921d3 100644
--- a/LunarSphere.lua
+++ b/LunarSphere.lua
@@ -179,10 +179,10 @@ function LunarSphere_OnEvent(self, event)
        end

        -- Load up our exporter and get our export database ready
-       local isLoaded = IsAddOnLoaded("LunarSphereExporter");
+       local isLoaded = C_AddOns.IsAddOnLoaded("LunarSphereExporter");
        if ( not isLoaded ) then
-           EnableAddOn("LunarSphereExporter") 
-           isLoaded = LoadAddOn("LunarSphereExporter");
+           C_AddOns.EnableAddOn("LunarSphereExporter") 
+           isLoaded = C_AddOns.LoadAddOn("LunarSphereExporter");
        end

        if (Lunar.Settings.BuildTemplateList) then
@@ -365,10 +365,10 @@ function LunarSphere_VariablesLoaded()
    end

    -- Load up our exporter and get our export database ready
--- local isLoaded = IsAddOnLoaded("LunarSphereExporter");
+-- local isLoaded = C_AddOns.IsAddOnLoaded("LunarSphereExporter");
 -- if ( not isLoaded ) then
---     EnableAddOn("LunarSphereExporter") 
---     isLoaded = LoadAddOn("LunarSphereExporter");
+--     C_AddOns.EnableAddOn("LunarSphereExporter") 
+--     isLoaded = C_AddOns.LoadAddOn("LunarSphereExporter");
 -- end

    -- Run our version checking code. If the versions are not current,
@@ -1045,7 +1045,7 @@ function LunarSphere_BackwardsCompatibility()
                        buttonType, cursorType, objectName, objectTexture = Lunar.Button:GetButtonData(buttonID, stance, clickType);
                        if (buttonType) then
                            if (buttonType >= 112) and (buttonType < 130) then
-                               newName = GetItemInfo(objectName);
+                               newName = C_Item.GetItemInfo(objectName);
                                if (newName) then
                                    Lunar.Button:SetButtonData(buttonID, stance, clickType, buttonType, cursorType, newName, objectTexture);
                                end
@@ -1565,7 +1565,7 @@ function LunarSphere_BackwardsCompatibility_PlayerLogin()
        if (playerLoginCheck[1] == 0.611) then
            table.remove(playerLoginCheck, 1);
            -- fix trade skills
-           local generalTabSkills = select(4, GetSpellTabInfo(1));
+           local generalTabSkills = C_SpellBook.GetSpellBookSkillLineInfo(1).numSpellBookItems;
            local newName;

            for buttonID = 0, 130 do 
@@ -1574,11 +1574,11 @@ function LunarSphere_BackwardsCompatibility_PlayerLogin()
                        for stance = 0, 12 do 
                            buttonType, cursorType, objectName, objectTexture = Lunar.Button:GetButtonData(buttonID, stance, clickType);
                            if (buttonType) and (buttonType == 1)then
-                               spellID = Lunar.API:GetSpellID(objectName)
+                               spellID = C_Spell.GetSpellInfo(objectName).spellID
                                if (spellID) then 
                                    if (spellID <= generalTabSkills) then
                                        -- Just grab the name without rank and set it again
-                                       objectName = GetSpellBookItemName(objectName);
+--                                     objectName = C_SpellBook.GetSpellBookItemName(objectName,Enum.SpellBookSpellBank.Player);
                                        Lunar.Button:SetButtonData(buttonID, stance, clickType, buttonType, cursorType, objectName, objectTexture);
                                    end
                                end
@@ -1623,7 +1623,8 @@ function LunarSphere_BackwardsCompatibility_PlayerLogin()
            table.remove(playerLoginCheck, 1);
            -- fix the summon spells in the speech database
            local scriptIndex, spellIndex;
-           local summonText = select(2, GetSpellInfo(23214));
+-- local summonText = select(2, C_Spell.GetSpellInfo(23214)); -- rank? why? it's NIL now, anyway
+           summonText = nil
            local tempSummon = "%(" .. summonText .. "%)";
            if (LunarSpeechLibrary and LunarSpeechLibrary.script) then
                for scriptIndex = 1, table.getn(LunarSpeechLibrary.script) do 
@@ -1766,7 +1767,7 @@ function LunarSphere_MacroFix()
        if (not macroTexture) or (macroTexture == "Interface\\Icons\\INV_Misc_QuestionMark") then
            local objectName = GetActionFromMacroText(macroBody);
            if (objectName) then
-               _,_,_,_,_,_,_,_,_,macroTexture = GetItemInfo(objectName);
+               _,_,_,_,_,_,_,_,_,macroTexture = C_Item.GetItemInfo(objectName);
            end
        end
        return macroName, macroTexture, macroBody, arg4;
@@ -1862,14 +1863,14 @@ end
 function Lunar.DrDamageFunc(button)
    if LunarSphereSettings.enableDrDamage == true then
        if (button.actionType == "spell" and button.buttonType == 1 and button.spellReagent == nil) then
-           local _, spellRank = GetSpellBookItemName(button.actionName);
+--         local _, spellRank = C_SpellBook.GetSpellBookItemName(button.actionName,Enum.SpellBookSpellBank.Player);
            local spellName;
            if (string.find(button.actionName, "%(")) then
                spellName = string.match(button.actionName, "(.*)%(");
            else
                spellName = button.actionName;
            end
-           return nil, spellName, spellRank;
+           return nil, spellName, nil;
        end
    end
    return nil;
speedwaystar commented 1 month ago

in addition, API 11.0.5 removed some Enums, including Enum.PowerType.Obsolete2, which breaks moduleSphere.lua. simply commenting out line 486 resolves the issue.

the DIFF above is out of date. let me know if you want my current, working DIFF.