Thread Tools Display Modes
08-05-16, 11:06 PM   #1
Torhal
A Pyroguard Emberseer
 
Torhal's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 1,196
Here's code for determining all of the item classes and their associated subclasses:

Code:
do
	COMPILED_ITEM_CLASSES = {}
	local classIndex = 0
	local className = _G.GetItemClassInfo(classIndex)

	while className and className ~= "" do
		COMPILED_ITEM_CLASSES[classIndex] = {
			name = className,
			subClasses = {},
		}

		local subClassIndex = 0
		local subClassName = _G.GetItemSubClassInfo(classIndex, subClassIndex)

		while subClassName and subClassName ~= "" do
			COMPILED_ITEM_CLASSES[classIndex].subClasses[subClassIndex] = subClassName

			subClassIndex = subClassIndex + 1
			subClassName = _G.GetItemSubClassInfo(classIndex, subClassIndex)
		end

		classIndex = classIndex + 1
		className = _G.GetItemClassInfo(classIndex)
	end
end
You can then look at the table (it's globally declared) to see what's what. The starting index of 0 rather than 1 is intentional - they're actually used by Blizzard.
__________________
Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Author of NPCScan and many other AddOns.

Last edited by Torhal : 08-05-16 at 11:14 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Defining the armor type


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off