Quantcast

structure behavior around item quality

Kevin Gilbert [08-26-16 - 15:14]
structure behavior around item quality
Filename
ArtifactMenu.lua
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