Quantcast

Merge branch 'feature/offhands' into develop

Kevin Gilbert [08-26-16 - 15:15]
Merge branch 'feature/offhands' into develop
Filename
ArtifactMenu.lua
diff --git a/ArtifactMenu.lua b/ArtifactMenu.lua
index e4ad3b6..4be4b4c 100644
--- a/ArtifactMenu.lua
+++ b/ArtifactMenu.lua
@@ -5,8 +5,23 @@ local function openWeaponSockets()
     SocketInventoryItem(16);
 end

+-- unneeded, because artifacts are "conjoined" items
+local function openOffhandSockets()
+    SocketInventoryItem(17);
+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