From a1869fe860d097c815798f9a75addb4fb5ebe11e Mon Sep 17 00:00:00 2001 From: Kevin Gilbert Date: Thu, 25 Aug 2016 15:03:11 -0700 Subject: [PATCH 1/3] define off-hands inventory slot #17 --- ArtifactMenu.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ArtifactMenu.lua b/ArtifactMenu.lua index e4ad3b6..2122b09 100644 --- a/ArtifactMenu.lua +++ b/ArtifactMenu.lua @@ -5,6 +5,10 @@ local function openWeaponSockets() SocketInventoryItem(16); end +local function openOffhandSockets() + SocketInventoryItem(17); +end + function SlashCmdList.ARTIFACTMENU(msg, editBox) openWeaponSockets(); print("Opening ArtifactMenu..."); -- 1.7.9.5 From 0d0edd5a1f44ca7ba8d7df95b23031bef20e8023 Mon Sep 17 00:00:00 2001 From: Kevin Gilbert Date: Fri, 26 Aug 2016 08:14:46 -0700 Subject: [PATCH 2/3] structure behavior around item quality --- ArtifactMenu.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ArtifactMenu.lua b/ArtifactMenu.lua index 2122b09..036959a 100644 --- a/ArtifactMenu.lua +++ b/ArtifactMenu.lua @@ -10,7 +10,17 @@ local function openOffhandSockets() end function SlashCmdList.ARTIFACTMENU(msg, editBox) - openWeaponSockets(); - print("Opening ArtifactMenu..."); + local ARTIFACT = 6; -- http://wowprogramming.com/docs/api_types#itemQuality + local equippedWeapon = GetInventoryItemID("player", GetInventorySlotInfo("MainHandSlot")); + if equippedWeapon == nil then + print("You do not have any weapons equipped."); + return + end + name, link, quality, iLvl, reqLvl, class, subclass, maxStack, equipSlot, texture, vendorSellPrice = GetItemInfo(equippedWeapon); + if quality == ARTIFACT then + openWeaponSockets(); + else + print("You do not have an Artifact Weapon equipped yet."); + end end -- 1.7.9.5 From 11f18f9e0590838e11ba660ae55e4ddee273b896 Mon Sep 17 00:00:00 2001 From: Kevin Gilbert Date: Fri, 26 Aug 2016 08:15:48 -0700 Subject: [PATCH 3/3] note that off-hands are irrelevant --- ArtifactMenu.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/ArtifactMenu.lua b/ArtifactMenu.lua index 036959a..4be4b4c 100644 --- a/ArtifactMenu.lua +++ b/ArtifactMenu.lua @@ -5,6 +5,7 @@ local function openWeaponSockets() SocketInventoryItem(16); end +-- unneeded, because artifacts are "conjoined" items local function openOffhandSockets() SocketInventoryItem(17); end -- 1.7.9.5