From f446ab5591bce622aa954cf8ef9f104a7d0370a0 Mon Sep 17 00:00:00 2001 From: Continuity Date: Tue, 25 Jun 2024 20:09:18 +0200 Subject: [PATCH] Preparation changes for TWW. --- LibQuestItem-1.0/LibQuestItem-1.0.lua | 16 +++++----- nop-button.lua | 44 +++++++++++++++++++++------ nop-core.lua | 18 +++++------ nop-data.lua | 1 + nop-events.lua | 12 +++++--- nop-item.lua | 35 +++++++++++++++------ nop-quest.lua | 6 ++-- nop-slash.lua | 4 +-- 8 files changed, 92 insertions(+), 44 deletions(-) diff --git a/LibQuestItem-1.0/LibQuestItem-1.0.lua b/LibQuestItem-1.0/LibQuestItem-1.0.lua index 7691c24..9d9046f 100644 --- a/LibQuestItem-1.0/LibQuestItem-1.0.lua +++ b/LibQuestItem-1.0/LibQuestItem-1.0.lua @@ -1,4 +1,4 @@ -local MAJOR, MINOR = "LibQuestItem-1.0", tonumber("28") or 999 -- ES increased version to take over all older instances +local MAJOR, MINOR = "LibQuestItem-1.0", tonumber("29") or 999 -- ES increased version to take over all older instances local LibQuestItem = LibStub:NewLibrary(MAJOR, MINOR) if not LibQuestItem then return end -- no need to update @@ -17,11 +17,12 @@ local select = _G.select local tonumber = _G.tonumber local tostring = _G.tostring -local GetContaineritemId = _G.GetContaineritemId -local GetContainerNumSlots = _G.GetContainerNumSlots -local GetInventoryitemId = _G.GetInventoryitemId -local GetInventorySlotInfo = _G.GetInventorySlotInfo -local GetItemInfo = _G.GetItemInfo +local GetContaineritemId = _G.GetContaineritemId or _G.C_Item.GetContaineritemId +local GetContainerNumSlots = _G.GetContainerNumSlots or _G.C_Item.GetContainerNumSlots +local GetInventoryitemId = _G.GetInventoryitemId or _G.C_Item.GetInventoryitemId +local GetInventorySlotInfo = _G.GetInventorySlotInfo or _G.GetInventorySlotInfo +local GetItemInfo = _G.GetItemInfo or _G.C_Item.GetItemInfo +local GetItemSpell = _G.GetItemSpell or _G.C_Item.GetItemSpell local strformat = _G.string.format local strlen = _G.string.len @@ -34,7 +35,8 @@ LibQuestItem.frame = LibQuestItem.frame or CreateFrame("Frame", "LibQuestItem10F -- ----- -- localization -- ----- -local LOCALE_QUEST = ((_G.GetItemClassInfo == nil) and select(10, GetAuctionItemClasses())) or _G.GetItemClassInfo(LE_ITEM_CLASS_QUESTITEM or (Enum and Enum.ItemClass and Enum.ItemClass.Questitem)) or "Quest" -- ES legion aware fix +local GetItemClassInfo = _G.GetItemClassInfo or _G.C_Item.GetItemClassInfo +local LOCALE_QUEST = ((GetItemClassInfo == nil) and select(10, GetAuctionItemClasses())) or GetItemClassInfo(LE_ITEM_CLASS_QUESTITEM or (Enum and Enum.ItemClass and Enum.ItemClass.Questitem)) or "Quest" -- ES legion aware fix -- ----- -- local helpers diff --git a/nop-button.lua b/nop-button.lua index 0625a1c..35a6f5e 100644 --- a/nop-button.lua +++ b/nop-button.lua @@ -7,9 +7,9 @@ local CreateFrame = _G.CreateFrame; assert(CreateFrame ~= nil,'CreateFrame') local GameTooltip = _G.GameTooltip; assert(GameTooltip ~= nil,'GameTooltip') local GameTooltip_SetDefaultAnchor = _G.GameTooltip_SetDefaultAnchor; assert(GameTooltip_SetDefaultAnchor ~= nil,'GameTooltip_SetDefaultAnchor') local GetCVar = _G.GetCVar; assert(GetCVar ~= nil,'GetCVar') -local GetItemCooldown = _G.GetItemCooldown; assert(GetItemCooldown ~= nil,'GetItemCooldown') -local GetItemInfo = _G.GetItemInfo; assert(GetItemInfo ~= nil,'GetItemInfo') -local GetMouseFocus = _G.GetMouseFocus; assert(GetMouseFocus ~= nil,'GetMouseFocus') +local GetItemCooldown = _G.GetItemCooldown or _G.C_Item.GetItemCooldown; assert(GetItemCooldown ~= nil,'GetItemCooldown') +local GetItemInfo = _G.GetItemInfo or _G.C_Item.GetItemInfo; assert(GetItemInfo ~= nil,'GetItemInfo') +--local GetMouseFocus = _G.GetMouseFocus; assert(GetMouseFocus ~= nil,'GetMouseFocus') local GetScreenWidth = _G.GetScreenWidth; assert(GetScreenWidth ~= nil,'GetScreenWidth') local GetTime = _G.GetTime; assert(GetTime ~= nil,'GetTime') local IsAltKeyDown = _G.IsAltKeyDown; assert(IsAltKeyDown ~= nil,'IsAltKeyDown') @@ -179,6 +179,16 @@ function NOP:ButtonPostClick(button) -- post click on button self:TimerFire("ItemShowNew", TIMER_IDLE / 3) end end +function NOP:ButtonPreClick(bt, button) -- post click on button + if button then + if (button == 'RightButton') then + bt:SetAttribute("type", nil) + bt:SetAttribute("spell", nil) + bt:SetAttribute("target-item", nil) + bt:SetAttribute("item", nil) + end + end +end function NOP:ButtonOnDragStart(button) -- start moving if NOP.AceDB.profile.lockButton or self:inCombat() then return end if IsAltKeyDown() then button:StartMoving() end @@ -265,7 +275,7 @@ function NOP:ButtonLoad() -- create button, restore his position bt:RegisterForClicks("AnyUp", "AnyDown") -- act on key release bt:SetScript("OnEnter", function(self) NOP:ButtonOnEnter(self) end) bt:SetScript("OnLeave", function(self) NOP:ButtonOnLeave(self) end) - bt:SetScript("PreClick", function(self,button) NOP.preClick = true end) + bt:SetScript("PreClick", function(self,button) NOP:ButtonPreClick(self, button) NOP.preClick = true end) bt:SetScript("PostClick", function(self,button) NOP:ButtonPostClick(button) end) bt:SetScript("OnDragStart", function(self) NOP:ButtonOnDragStart(self) end) bt:SetScript("OnDragStop", function(self) NOP:ButtonOnDragStop(self) end) @@ -317,13 +327,23 @@ function NOP:ButtonShow() -- display button local bt = self.BF self:ButtonCount(bt.itemCount) bt.icon:SetTexture(bt.itemTexture or DEFAULT_ICON) - if (GetMouseFocus() == bt) then self:ButtonOnEnter(bt) end -- update tooltip if mouse is over button + --if (GetMouseFocus() == bt) then self:ButtonOnEnter(bt) end -- update tooltip if mouse is over button + if (bt:IsMouseMotionFocus()) then self:ButtonOnEnter(bt) end -- update tooltip if mouse is over button if bt.itemTexture then - bt:SetAttribute("type1", "macro") -- "type1" Unmodified left click. - bt:SetAttribute("macrotext1", bt.mtext) - self:Verbose("ButtonShow:","macro text",self:CompressText(bt.mtext)) + --bt:SetAttribute("type1", "macro") -- "type1" Unmodified left click. + --bt:SetAttribute("macrotext1", bt.mtext) + --self:Verbose("ButtonShow:","macro text",self:CompressText(bt.mtext)) + bt:SetAttribute("type", bt.mtype) + bt:SetAttribute("spell", bt.mspell) + bt:SetAttribute("item", bt.mtarget) -- ("bag slot") + bt:SetAttribute("target-item", bt.mtargetitem) -- ("bag slot") + self:Verbose("ButtonShow:",self:CompressText(bt.mtype),bt.mspell and self:CompressText(bt.mspell),bt.mtarget and self:CompressText("item: " .. bt.mtarget),bt.mtargetitem and self:CompressText("target-item: " .. bt.mtargetitem)) else - bt:SetAttribute("macrotext1", "") + --bt:SetAttribute("macrotext1", nil) + bt:SetAttribute("type", nil) + bt:SetAttribute("spell", nil) + bt:SetAttribute("target-item", nil) + bt:SetAttribute("item", nil) end -- self:printt("ButtonShow:","macro text",self:CompressText(bt.mtext)) if not (bt:IsVisible() or bt:IsShown()) then bt:Show() end @@ -349,7 +369,11 @@ function NOP:ButtonHide() -- hide button bt.mtext = MACRO_INACTIVE bt.itemTexture = nil bt.icon:SetTexture(DEFAULT_ICON) - bt:SetAttribute("macrotext1", MACRO_INACTIVE) + --bt:SetAttribute("macrotext1", MACRO_INACTIVE) + bt:SetAttribute("type", nil) + bt:SetAttribute("spell", nil) + bt:SetAttribute("target-item", nil) + bt:SetAttribute("item", nil) self:ButtonCount(bt.itemCount) self.ActionButton_HideOverlayGlow(bt) --ActionButton_HideOverlayGlow(bt) diff --git a/nop-core.lua b/nop-core.lua index 118f394..c2ef488 100644 --- a/nop-core.lua +++ b/nop-core.lua @@ -9,21 +9,21 @@ local CreateFrame = _G.CreateFrame; assert(CreateFrame ~= nil,'CreateFrame') local date = _G.date; assert(date ~= nil,'date') local debugprofilestop = _G.debugprofilestop; assert(debugprofilestop ~= nil,'debugprofilestop') local ERR_SPELL_FAILED_REAGENTS_GENERIC = _G.ERR_SPELL_FAILED_REAGENTS_GENERIC; assert(ERR_SPELL_FAILED_REAGENTS_GENERIC ~= nil,'ERR_SPELL_FAILED_REAGENTS_GENERIC') -local ExpandAllFactionHeaders = _G.ExpandAllFactionHeaders; assert(ExpandAllFactionHeaders ~= nil,'ExpandAllFactionHeaders') +local ExpandAllFactionHeaders = _G.ExpandAllFactionHeaders or _G.C_Reputation.ExpandAllFactionHeaders; assert(ExpandAllFactionHeaders ~= nil,'ExpandAllFactionHeaders') local format = _G.format; assert(format ~= nil,'format') local GetArchaeologyRaceInfo = _G.GetArchaeologyRaceInfo; assert(GetArchaeologyRaceInfo ~= nil,'GetArchaeologyRaceInfo') local GetCVar = _G.GetCVar; assert(GetCVar ~= nil,'GetCVar') -local GetFactionInfo = _G.GetFactionInfo; assert(GetFactionInfo ~= nil,'GetFactionInfo') -local GetFactionInfoByID = _G.GetFactionInfoByID; assert(GetFactionInfoByID ~= nil,'GetFactionInfoByID') +local GetFactionInfo = _G.GetFactionInfo or _G.C_CreatureInfo.GetFactionInfo; assert(GetFactionInfo ~= nil,'GetFactionInfo') +local GetFactionInfoByID = _G.GetFactionInfoByID or _G.C_CreatureInfo.GetFactionInfo; assert(GetFactionInfoByID ~= nil,'GetFactionInfoByID') local GetChatWindowInfo = _G.GetChatWindowInfo; assert(GetChatWindowInfo ~= nil,'GetChatWindowInfo') -local GetItemCount = _G.GetItemCount; assert(GetItemCount ~= nil,'GetItemCount') -local GetItemInfo = _G.GetItemInfo; assert(GetItemInfo ~= nil,'GetItemInfo') -local GetItemSpell = _G.GetItemSpell; assert(GetItemSpell ~= nil,'GetItemSpell') +local GetItemCount = _G.GetItemCount or _G.C_Item.GetItemCount; assert(GetItemCount ~= nil,'GetItemCount') +local GetItemInfo = _G.GetItemInfo or _G.C_Item.GetItemInfo; assert(GetItemInfo ~= nil,'GetItemInfo') +local GetItemSpell = _G.GetItemSpell or _G.C_Item.GetItemSpell; assert(GetItemSpell ~= nil,'GetItemSpell') local GetMinimapZoneText = _G.GetMinimapZoneText; assert(GetMinimapZoneText ~= nil,'GetMinimapZoneText') local GetNumArchaeologyRaces = _G.GetNumArchaeologyRaces; assert(GetNumArchaeologyRaces ~= nil,'GetNumArchaeologyRaces') -local GetNumFactions = _G.GetNumFactions; assert(GetNumFactions ~= nil,'GetNumFactions') -local GetSpellCooldown = _G.GetSpellCooldown; assert(GetSpellCooldown ~= nil,'GetSpellCooldown') -local GetSpellInfo = _G.GetSpellInfo; assert(GetSpellInfo ~= nil,'GetSpellInfo') +local GetNumFactions = _G.GetNumFactions or _G.C_Reputation.GetNumFactions; assert(GetNumFactions ~= nil,'GetNumFactions') +local GetSpellCooldown = _G.GetSpellCooldown or _G.C_Spell.GetSpellCooldown; assert(GetSpellCooldown ~= nil,'GetSpellCooldown') +local GetSpellInfo = _G.GetSpellInfo or _G.C_Spell.GetSpellInfo; assert(GetSpellInfo ~= nil,'GetSpellInfo') local GetTime = _G.GetTime; assert(GetTime ~= nil,'GetTime') local gsub = _G.gsub; assert(gsub ~= nil,'gsub') local InCombatLockdown = _G.InCombatLockdown; assert(InCombatLockdown ~= nil,'InCombatLockdown') diff --git a/nop-data.lua b/nop-data.lua index 666c7fa..5e12691 100644 --- a/nop-data.lua +++ b/nop-data.lua @@ -48,6 +48,7 @@ NOP.T_INSTA_WQ = { -- [spellID] = itemID, list of OH advancements and spells for [221561] = 140158, -- Rift Cannon } NOP.T_SPELL_BY_NAME = { -- [itemID] = {{count_to_use,priority},{"sub-Zone",...},{[mapID]=true,...}} table to fetch via GetItemSpell(itemID) for group of items where spell-name is the same + [186520] = {{1,PRI_OPEN},nil,nil}, -- Chest of Playtest Equipment - Create Essential Stuff [137908] = {{1,PRI_OPEN},nil,nil}, -- Recipe: Battlebound Armbands, produce spell Learning [ 99726] = {{1,PRI_OPEN},nil,nil}, -- Create Item, Leggings of the Cursed Vanquisher [113355] = {{1,PRI_OPEN},nil,nil}, -- Flip Card, Card of Omens diff --git a/nop-events.lua b/nop-events.lua index f0da6b6..cb48939 100644 --- a/nop-events.lua +++ b/nop-events.lua @@ -14,7 +14,7 @@ local format = _G.format; assert(format ~= nil,'format') local GameTooltip = _G.GameTooltip; assert(GameTooltip ~= nil,'GameTooltip') local GetBindingKey = _G.GetBindingKey; assert(GetBindingKey ~= nil,'GetBindingKey') local GetBuildInfo = _G.GetBuildInfo; assert(GetBuildInfo ~= nil,'GetBuildInfo') -local GetItemCooldown = _G.GetItemCooldown; assert(GetItemCooldown ~= nil,'GetItemCooldown') +local GetItemCooldown = _G.GetItemCooldown or _G.C_Item.GetItemCooldown; assert(GetItemCooldown ~= nil,'GetItemCooldown') local hooksecurefunc = _G.hooksecurefunc; assert(hooksecurefunc ~= nil,'hooksecurefunc') local INTERRUPTED = _G.INTERRUPTED; assert(INTERRUPTED ~= nil,'INTERRUPTED') local ipairs = _G.ipairs; assert(ipairs ~= nil,'ipairs') @@ -96,9 +96,13 @@ function NOP:UI_ERROR_MESSAGE(event, msgType, msg, ...) -- handle lockpicking it UIErrorsFrame:Clear() local bt = self.BF if bt and self:ItemToPicklock(bt.itemID) then - bt.mtext = format(MACRO_PICKLOCK,self.pickLockSpell,bt.bagID,bt.slotID) - bt:SetAttribute("type1", "macro") - bt:SetAttribute("macrotext1", bt.mtext) + --bt.mtext = format(MACRO_PICKLOCK,self.pickLockSpell,bt.bagID,bt.slotID) + --bt:SetAttribute("type1", "macro") + --bt:SetAttribute("macrotext1", bt.mtext) + bt:SetAttribute("type", "spell") + bt:SetAttribute("spell", self.pickLockSpell) + bt:SetAttribute("target-item", format("item:%d", bt.itemID)) + bt:SetAttribute("item", nil) end return end diff --git a/nop-item.lua b/nop-item.lua index 0b80996..d529e15 100644 --- a/nop-item.lua +++ b/nop-item.lua @@ -9,9 +9,9 @@ local GetContainerItemID = _G.GetContainerItemID or C_Container.GetContainerItem local GetContainerItemInfo = _G.GetContainerItemInfo or C_Container.GetContainerItemInfo; assert(GetContainerItemInfo ~= nil,'GetContainerItemInfo') local GetContainerItemLink = _G.GetContainerItemLink or C_Container.GetContainerItemLink; assert(GetContainerItemLink ~= nil,'GetContainerItemLink') local GetContainerNumSlots = _G.GetContainerNumSlots or C_Container.GetContainerNumSlots; assert(GetContainerNumSlots ~= nil,'GetContainerNumSlots') -local GetItemCount = _G.GetItemCount; assert(GetItemCount ~= nil,'GetItemCount') -local GetItemInfo = _G.GetItemInfo; assert(GetItemInfo ~= nil,'GetItemInfo') -local GetItemSpell = _G.GetItemSpell; assert(GetItemSpell ~= nil,'GetItemSpell') +local GetItemCount = _G.GetItemCount or _G.C_Item.GetItemCount; assert(GetItemCount ~= nil,'GetItemCount') +local GetItemInfo = _G.GetItemInfo or _G.C_Item.GetItemInfo; assert(GetItemInfo ~= nil,'GetItemInfo') +local GetItemSpell = _G.GetItemSpell or _G.C_Item.GetItemSpell; assert(GetItemSpell ~= nil,'GetItemSpell') local GetTime = _G.GetTime; assert(GetTime ~= nil,'GetTime') local LOCKED = _G.LOCKED; assert(LOCKED ~= nil,'LOCKED') local math = _G.math; assert(math ~= nil,'math') @@ -23,7 +23,7 @@ local tonumber = _G.tonumber; assert(tonumber ~= nil,'tonumber') local type = _G.type; assert(type ~= nil,'type') local unpack = _G.unpack; assert(unpack ~= nil,'unpack') local wipe = _G.wipe; assert(wipe ~= nil,'wipe') -local GetItemCooldown = _G.GetItemCooldown; assert(GetItemCooldown ~= nil,'GetItemCooldown') +local GetItemCooldown = _G.GetItemCooldown or _G.C_Item.GetItemCooldown; assert(GetItemCooldown ~= nil,'GetItemCooldown') local UnpackAuraData = AuraUtil.UnpackAuraData; assert(UnpackAuraData ~= nil,'UnpackAuraData') local GetPlayerAuraBySpellID = C_UnitAuras.GetPlayerAuraBySpellID; assert(GetPlayerAuraBySpellID ~= nil,'GetPlayerAuraBySpellID') -- local AddOn @@ -373,27 +373,44 @@ function NOP:ItemShow(itemID,prio) -- add item to button if type(itemTexture) == "table" then itemTexture = itemTexture.iconFileID end - local mtext = format(P.MACRO_ACTIVE,itemID) + --local mtext = format(P.MACRO_ACTIVE,itemID) + --local mtarget = format("%d",itemID) + local mtarget = format("item:%d", itemID) + local mtargetitem = nil + local mtype = "item" + local mspell = nil if T_PICK[itemID] then -- item has picklock in tooltip local bag, slot = self:ItemToPicklock(itemID) -- find where in bags is item which still with unlock because same itemID can be unlocked or locked it depends on state of item if bag and slot then bagID = bag slotID = slot isGlow = true - mtext = format(P.MACRO_PICKLOCK,self.pickLockSpell,bagID,slotID) -- this one needs unlock + --mtext = format(P.MACRO_PICKLOCK,self.pickLockSpell,bagID,slotID) -- this one needs unlock + mtype = "spell" + mspell = self.pickLockSpell + mtarget = nil + mtargetitem = format("item:%d", itemID) --format("%d %d" ,bagID,slotID) -- this one needs unlock else T_PICK[itemID] = nil -- it not require lockpick anymore end elseif NOP.T_DISENCHANT_ITEMS[itemID] then isGlow = true - mtext = format(P.MACRO_DISENCHANT,itemID) -- disenchant this + --mtext = format(P.MACRO_DISENCHANT,itemID) -- disenchant this + mtype = "spell" + mspell = "Disenchant" + mtarget = nil + mtargetitem = format("item:%d", itemID) --format("%d %d" ,bagID,slotID) -- disenchant this end - if (bt.itemCount ~= itemCount) or (bt.itemID ~= itemID) or (bt.isGlow ~= isGlow) or (bt.mtext ~= mtext) then + if (bt.itemCount ~= itemCount) or (bt.itemID ~= itemID) or (bt.isGlow ~= isGlow) or (bt.mtext ~= mtext) or (bt.mtype ~= mtype) or (bt.mspell ~= mspell) or (bt.mtarget ~= mtarget) or (bt.mtargetitem ~= mtargetitem) then bt.prio = prio bt.showID = itemID bt.itemID = itemID bt.isGlow = isGlow - bt.mtext = mtext + --bt.mtext = mtext + bt.mtype = mtype + bt.mspell = mspell + bt.mtarget = mtarget + bt.mtargetitem = mtargetitem bt.bagID = bagID bt.slotID = slotID bt.itemCount = itemCount diff --git a/nop-quest.lua b/nop-quest.lua index 93f7d9e..dcb8fb9 100644 --- a/nop-quest.lua +++ b/nop-quest.lua @@ -8,9 +8,9 @@ local floor = _G.floor; assert(floor ~= nil,'floor') local GameTooltip = _G.GameTooltip; assert(GameTooltip ~= nil,'GameTooltip') local GameTooltip_SetDefaultAnchor = _G.GameTooltip_SetDefaultAnchor; assert(GameTooltip_SetDefaultAnchor ~= nil,'GameTooltip_SetDefaultAnchor') local GetCVar = _G.GetCVar; assert(GetCVar ~= nil,'GetCVar') -local GetItemCount = _G.GetItemCount; assert(GetItemCount ~= nil,'GetItemCount') -local GetItemIcon = _G.GetItemIcon; assert(GetItemIcon ~= nil,'GetItemIcon') -local GetItemInfo = _G.GetItemInfo; assert(GetItemInfo ~= nil,'GetItemInfo') +local GetItemCount = _G.GetItemCount or _G.C_Item.GetItemCount; assert(GetItemCount ~= nil,'GetItemCount') +local GetItemIcon = _G.GetItemIcon or _G.C_Item.GetItemIcon; assert(GetItemIcon ~= nil,'GetItemIcon') +local GetItemInfo = _G.GetItemInfo or _G.C_Item.GetItemInfo; assert(GetItemInfo ~= nil,'GetItemInfo') local GetQuestLogIndexByID = C_QuestLog.GetLogIndexForQuestID; assert(GetQuestLogIndexByID ~= nil,'GetQuestLogIndexByID') local GetScreenWidth = _G.GetScreenWidth; assert(GetScreenWidth ~= nil,'GetScreenWidth') local hooksecurefunc = _G.hooksecurefunc; assert(hooksecurefunc ~= nil,'hooksecurefunc') diff --git a/nop-slash.lua b/nop-slash.lua index 3f1444b..6aeb137 100644 --- a/nop-slash.lua +++ b/nop-slash.lua @@ -9,8 +9,8 @@ local GetAddOnMemoryUsage = _G.GetAddOnMemoryUsage; assert(GetAddOnMemoryUsage ~ local GetContainerItemID = _G.GetContainerItemID or C_Container.GetContainerItemID; assert(GetContainerItemID ~= nil,'GetContainerItemID') local GetContainerItemLink = _G.GetContainerItemLink or C_Container.GetContainerItemLink; assert(GetContainerItemLink ~= nil,'GetContainerItemLink') local GetContainerNumSlots = _G.GetContainerNumSlots or C_Container.GetContainerNumSlots; assert(GetContainerNumSlots ~= nil,'GetContainerNumSlots') -local GetItemInfo = _G.GetItemInfo; assert(GetItemInfo ~= nil,'GetItemInfo') -local GetSpellInfo = _G.GetSpellInfo; assert(GetSpellInfo ~= nil,'GetSpellInfo') +local GetItemInfo = _G.GetItemInfo or _G.C_Item.GetItemInfo; assert(GetItemInfo ~= nil,'GetItemInfo') +local GetSpellInfo = _G.GetSpellInfo or _G.C_Spell.GetSpellInfo; assert(GetSpellInfo ~= nil,'GetSpellInfo') local GetTime = _G.GetTime; assert(GetTime ~= nil,'GetTime') local issecurevariable = _G.issecurevariable; assert(issecurevariable ~= nil,'issecurevariable') local math = _G.math; assert(math ~= nil,'math')