Code:
local tierShoulder = {
hunter = { 78832, 77032, 78737 },
mage = {},
warrior = {},
shaman = {},
warlock = {},
druid = {},
paladin = { holy = {78841,76769,78746}, prot = {78840, 77007,78745}, ret = {78837,76878,78742}},
death_night = {},
monk = {},
rogue = {},
priest = {}
}
local tierChest = {
hunter = { 78756, 77028, 78661 },
mage = {},
warrior = {},
shaman = {},
warlock = {},
druid = {},
paladin = { holy = {78821,76765,78726}, prot = {78827,77003,78732}, ret = {78822,76874,78727}},
death_night = {},
monk = {},
rogue = {},
priest = {}
}
local tierHelm = {
hunter = { 78793, 77030, 78698 },
mage = {},
warrior = {},
shaman = {},
warlock = {},
druid = {},
paladin = {holy = {78787,76767,78692}, prot = {78790,77005,78695}, ret = {78788,76876,78693}},
death_night = {},
monk = {},
rogue = {},
priest = {}
}
local tierHands = {
hunter = { 78769, 77029, 78674 },
mage = {},
warrior = {},
shaman = {},
warlock = {},
druid = {},
paladin = { holy = {78768,76766,78673}, prot = {78722,77004,78677}, ret = {78770,76875,78675}},
death_night = {},
monk = {},
rogue = {},
priest = {}
}
local tierLegs = {
hunter = {78804, 77031, 78709},
mage = {},
warrior = {},
shaman = {},
warlock = {},
druid = {},
paladin = { holy = {78812,76768,78717}, prot = {78810,77006,78715}, ret = {78807,76877,78712}},
death_night = {},
monk = {},
rogue = {},
priest = {}
}
local hasTier = {}
function PQR_HasTier()
local playerClass = UnitClass("player")
local talentTree = GetPrimaryTalentTree()
if playerClass == "Hunter" then
function shoulder()
for i=1,#tierShoulder.hunter do
local isEquiped = IsEquippedItem(tierShoulder.hunter[i])
if isEquiped and not nil then
return 1
end
end
return 0
end
function chest()
for i=1,#tierChest.hunter do
local isEquiped1 = IsEquippedItem(tierChest.hunter[i])
if isEquiped1 and not nil then
return 1
end
end
return 0
end
function helm()
for i=1,#tierHelm.hunter do
local isEquiped2 = IsEquippedItem(tierHelm.hunter[i])
if isEquiped2 and not nil then
return 1
end
end
return 0
end
function hands()
for i=1,#tierHands.hunter do
local isEquiped3 = IsEquippedItem(tierHands.hunter[i])
if isEquiped3 and not nil then
return 1
end
end
return 0
end
function legs()
for i=1,#tierLegs.hunter do
local isEquiped4 = IsEquippedItem(tierLegs.hunter[i])
if isEquiped4 and not nil then
return 1
end
end
return 0
end
elseif playerClass == "Mage" then
return false
elseif playerClass == "Warrior" then
return false
elseif playerClass == "Shaman" then
return false
elseif playerClass == "Warlock" then
return false
elseif playerClass == "Druid" then
return false
elseif playerClass == "Paladin" then
if talentTree == 1 then
function shoulder()
for i=1,#tierShoulder.paladin.holy do
local isEquiped = IsEquippedItem(tierShoulder.paladin.holy[i])
if isEquiped and not nil then
return 1
end
end
return 0
end
function chest()
for i=1,#tierChest.paladin.holy do
local isEquiped = IsEquippedItem(tierChest.paladin.holy[i])
if isEquiped and not nil then
return 1
end
end
return 0
end
function helm()
for i=1,#tierHelm.paladin.holy do
local isEquiped = IsEquippedItem(tierHelm.paladin.holy[i])
if isEquiped and not nil then
return 1
end
end
return 0
end
function hands()
for i=1,#tierHands.paladin.holy do
local isEquiped = IsEquippedItem(tierHands.paladin.holy[i]) or 0
if isEquiped == 1 and not nil then
return 1
end
end
return 0
end
function legs()
for i=1,#tierLegs.paladin.holy do
local isEquiped = IsEquippedItem(tierLegs.paladin.holy[i])
if isEquiped and not nil then
return 1
end
end
return 0
end
elseif talentTree == 2 then
function shoulder()
for i=1,#tierShoulder.paladin.prot do
local isEquiped = IsEquippedItem(tierShoulder.paladin.prot[i])
if isEquiped and not nil then
return 1
end
end
return 0
end
function chest()
for i=1,#tierChest.paladin.prot do
local isEquiped1 = IsEquippedItem(tierChest.paladin.prot[i])
if isEquiped1 and not nil then
return 1
end
end
return 0
end
function helm()
for i=1,#tierHelm.paladin.prot do
local isEquiped2 = IsEquippedItem(tierHelm.paladin.prot[i])
if isEquiped2 and not nil then
return 1
end
end
return 0
end
function hands()
for i=1,#tierHands.paladin.prot do
local isEquiped3 = IsEquippedItem(tierHands.paladin.prot[i])
if isEquiped3 and not nil then
return 1
end
end
return 0
end
function legs()
for i=1,#tierLegs.paladin.prot do
local isEquiped4 = IsEquippedItem(tierLegs.paladin.prot[i])
if isEquiped4 and not nil then
return 1
end
end
return 0
end
elseif talentTree == 3 then
function shoulder()
for i=1,#tierShoulder.paladin.ret do
local isEquiped = IsEquippedItem(tierShoulder.paladin.ret[i])
if isEquiped and not nil then
return 1
end
end
return 0
end
function chest()
for i=1,#tierChest.paladin.ret do
local isEquiped1 = IsEquippedItem(tierChest.paladin.ret[i])
if isEquiped1 and not nil then
return 1
end
end
return 0
end
function helm()
for i=1,#tierHelm.paladin.ret do
local isEquiped2 = IsEquippedItem(tierHelm.paladin.ret[i])
if isEquiped2 and not nil then
return 1
end
end
return 0
end
function hands()
for i=1,#tierHands.paladin.ret do
local isEquiped3 = IsEquippedItem(tierHands.paladin.ret[i])
if isEquiped3 and not nil then
return 1
end
end
return 0
end
function legs()
for i=1,#tierLegs.paladin.ret do
local isEquiped4 = IsEquippedItem(tierLegs.paladin.ret[i])
if isEquiped4 and not nil then
return 1
end
end
return 0
end
end
elseif playerClass == "Death Knight" then
return false
elseif playerClass == "Monk" then
return false
elseif playerClass == "Rogue" then
return false
elseif playerClass == "Priest" then
return false
end
local tier = shoulder()+chest()+helm()+hands()+legs()
if tier < 2 then
return 0
elseif tier >= 2 and tier < 4 then
return 2
elseif tier >= 4 then
return 4
end
end