Foereaper

GetPlayerSpec ext

Aug 4th, 2018
997
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.11 KB | None | 0 0
  1. local ClassSpecList = {
  2.     [1] = { -- Warrior
  3.         {46924, 12294, 12328}, -- Arms
  4.         {46917, 23881, 12292}, -- Fury
  5.         {46968, 20243, 50720}  -- Protection
  6.     },
  7.     [2] = { -- Paladin
  8.         {53563, 20473, 20215}, -- Holy
  9.         {53595, 20925, 20911}, -- Prot
  10.         {35395, 53385, 20375}  -- Ret
  11.     },
  12.     [3] = { -- Hunter
  13.         {53270, 34692, 19574}, -- Beast Mastery
  14.         {53209, 19506, 19434}, -- Marksmanship
  15.         {53301, 19386, 56344}  -- Survival
  16.     },
  17.     [4] = { -- Rogue
  18.         {51662, 1329, 14177},  -- Assassination
  19.         {51690, 13750, 13877}, -- Combat
  20.         {51713, 14183, 16511}  -- Sublety
  21.     },
  22.     [5] = { -- Priest
  23.         {47540, 10060, 63574}, -- Discipline
  24.         {47788, 20711, 19236}, -- Holy
  25.         {34914, 15473, 15286}  -- Shadow
  26.     },
  27.     [6] = { -- CLASS_DEATH_KNIGHT
  28.         {55050, 49016, 48982}, -- Blood
  29.         {49184, 49143, 50887}, -- Frost
  30.         {55090, 52143, 49194}  -- Unholy
  31.     },
  32.     [7] = { -- CLASS_SHAMAN
  33.         {51490, 30706, 16164}, -- Elemental
  34.         {51533, 60103, 16268}, -- Enhancement
  35.         {61295, 590, 591}      -- Restoration
  36.     },
  37.     [8] = { -- CLASS_MAGE
  38.         {44425, 12042, 54646}, -- Arcane
  39.         {44457, 11129, 11366}, -- Fire
  40.         {44572, 11426, 12472}  -- Frost
  41.     },
  42.     [9] = { -- CLASS_WARLOCK
  43.         {48181, 30108, 63108}, -- Affliction
  44.         {59672, 47193, 19028}, -- Demonology
  45.         {50796, 17962, 17877}  -- Destruction
  46.     },
  47.     [11] = { -- CLASS_DRUID
  48.         {48505, 24858, 5570},  -- Balance
  49.         {50334, 33917, 61336}, -- Feral
  50.         {48438, 33891, 18562}  -- Restoration
  51.     }
  52. }
  53.  
  54. function Player:GetPlayerSpec()
  55.     local class = self:GetClass()
  56.     for tier = 1, 3 do
  57.         for tree = 1, 3 do
  58.             if(ClassSpecList[class][tree][tier]) then
  59.                 if(self:HasSpell(ClassSpecList[class][tree][tier])) then
  60.                     return(tree)
  61.                 end
  62.             end
  63.         end
  64.     end
  65.    
  66.     -- If no spec is found (You fucked up your spec dude, go reroll..) return 0.
  67.     -- Check for this wherever this function is used.
  68.     return 0;
  69. end
  70.  
  71. -- This is how you use it in a script
  72. -- player:GetPlayerSpec()
Add Comment
Please, Sign In to add comment