-- --------------------
-- TellMeWhen
-- Originally by NephMakes

-- Other contributions by:
--		Sweetmms of Blackrock, Oozebull of Twisting Nether, Oodyboo of Mug'thol,
--		Banjankri of Blackrock, Predeter of Proudmoore, Xenyr of Aszune

-- Currently maintained by
-- Cybeloras of Aerie Peak
-- --------------------


if not TMW then return end

local TMW = TMW
local L = TMW.L
local print = TMW.print

local ClassSpellCache = TMW:GetModule("ClassSpellCache")

ClassSpellCache.RaceMap = {
	[1] = "Human",
	[2] = "Orc",
	[3] = "Dwarf",
	[4] = "NightElf",
	[5] = "Scourge",
	[6] = "Tauren",
	[7] = "Gnome",
	[8] = "Troll",
	[9] = "Goblin",
	[10] = "BloodElf",
	[11] = "Draenei",
	[22] = "Worgen",
}

ClassSpellCache.SpellData = {
	[1] = {71,78,100,355,469,676,772,845,871,1134,1160,1161,1464,1680,1715,1719,2457,2458,2565,3127,3411,5246,5308,6343,6544,6552,6572,6673,7384,7386,12289,12290,12292,12294,12295,12296,12298,12299,12311,12317,12319,12320,12321,12322,12323,12328,12329,12330,12668,12676,12678,12712,12724,12725,12761,12762,12797,12799,12809,12834,12835,12849,12852,12867,12950,12958,12963,12971,12972,12975,13045,13046,16487,16489,16492,16493,16494,18499,20230,20243,20252,20253,20502,20503,23588,23881,23920,23922,29144,29592,29593,29594,29598,29723,29725,29801,29834,29836,29838,29859,29888,29889,34428,46867,46908,46909,46910,46913,46914,46915,46917,46924,46945,46949,46951,46952,46953,46968,50685,50686,50687,50720,52174,55694,56611,56612,56636,56637,56638,57499,57755,60970,61216,61221,64382,64976,76858,80128,80129,80976,80977,80979,80980,80981,81099,81913,81914,84570,84571,84572,84579,84580,84583,84587,84588,84604,84607,84608,84614,84615,84621,85288,85384,85388,85730,85741,85742,86346,86655,86894,86896,88161,93098,96103,97462},
	[2] = {465,498,633,635,642,853,879,1022,1038,1044,2812,4987,6940,7294,7328,9799,10326,13819,19740,19746,19750,19891,20049,20056,20057,20066,20113,20138,20139,20140,20143,20144,20145,20154,20164,20165,20174,20175,20177,20179,20208,20217,20224,20225,20234,20235,20237,20238,20271,20359,20360,20473,20487,20488,20911,20925,23214,24275,25780,25956,25988,26016,26022,26023,26573,31789,31801,31821,31822,31823,31825,31828,31829,31842,31848,31849,31850,31866,31867,31868,31876,31878,31884,31935,32223,34767,34769,35395,53375,53376,53380,53381,53382,53385,53486,53488,53503,53551,53556,53557,53563,53569,53576,53592,53595,53600,53671,53673,53695,53696,53709,53710,54151,54428,54968,62124,63646,63647,63648,64205,69820,69826,70940,73629,73630,75806,82242,82326,82327,84628,84629,84631,84633,84635,84636,84800,84839,84854,84963,85043,85102,85117,85126,85222,85256,85285,85446,85457,85458,85462,85463,85464,85495,85498,85499,85510,85511,85512,85639,85646,85673,85696,85795,85803,85804,86150,86172,87138,87163,87164,87168,87172,87174,87175,87461,88820,88821,89901,90286,93417,93418,95859,96231,348704,356110,356112,450761},
	[3] = {75,136,781,883,982,1130,1462,1494,1499,1513,1515,1543,1978,2641,2643,2973,2974,3044,3045,5116,5118,5384,6197,6991,13159,13165,13795,13809,13813,19184,19263,19286,19287,19290,19294,19306,19376,19386,19387,19416,19417,19418,19434,19464,19503,19506,19559,19560,19572,19573,19574,19577,19578,19590,19592,19621,19622,19623,19801,19878,19879,19880,19882,19883,19884,19885,20043,20736,20895,23989,24283,34026,34460,34477,34482,34483,34485,34486,34487,34490,34491,34492,34493,34497,34498,34499,34506,34507,34508,34600,34692,34838,34839,34948,34949,34950,34954,35029,35030,35100,35102,35104,35110,51753,51755,52783,52785,52786,53209,53221,53222,53224,53228,53232,53234,53237,53238,53241,53243,53252,53253,53256,53259,53260,53262,53263,53264,53270,53271,53290,53295,53296,53298,53299,53301,53302,53303,53304,53351,56314,56315,56333,56336,56339,56340,56341,56342,56343,56641,60192,63457,63458,77767,77769,79682,80558,82243,82654,82661,82682,82683,82684,82687,82692,82726,82748,82749,82832,82833,82834,82893,82894,82897,82898,82899,82928,82939,82941,82945,82948,83242,83243,83244,83245,83340,83356,83359,83489,83490,83494,83495,83558,83559,83560,84729,87324,87325,87326,87934,87935,93321},
	[4] = {53,408,703,921,1329,1725,1752,1766,1776,1784,1804,1833,1842,1856,1860,1943,1966,2094,2098,2836,2842,2983,5171,5277,5374,5938,5952,6770,8647,8676,13705,13712,13713,13732,13733,13741,13743,13750,13754,13788,13789,13793,13832,13843,13852,13853,13854,13863,13865,13866,13867,13875,13877,13960,13961,13962,13975,13976,13979,13981,13983,14057,14062,14066,14070,14071,14072,14079,14080,14082,14083,14113,14114,14115,14116,14117,14128,14132,14135,14138,14139,14140,14141,14142,14144,14148,14156,14158,14159,14160,14161,14162,14163,14164,14165,14166,14168,14169,14171,14172,14174,14175,14176,14177,14179,14183,14185,14186,14190,14251,14983,16511,16513,16514,16515,18427,18428,18429,26679,27576,30894,30895,30902,30903,30904,30905,30906,30919,30920,31124,31126,31130,31131,31208,31209,31211,31212,31213,31220,31223,31224,31228,31229,31230,31244,31245,31380,31382,31383,32601,32645,35541,35550,35551,36554,51625,51626,51627,51628,51629,51632,51664,51665,51667,51672,51674,51679,51682,51685,51686,51687,51688,51689,51690,51692,51696,51698,51700,51701,51708,51709,51710,51713,51722,51723,57934,58410,58413,58414,58415,58422,58423,58426,61329,73651,73981,74001,76577,79004,79007,79008,79077,79079,79095,79096,79121,79122,79123,79125,79133,79134,79140,79141,79146,79147,79150,79151,79152,79327,82245,84601,84617,84652,84653,84654,84661,91023},
	[5] = {17,139,453,527,528,585,586,588,589,596,605,724,1706,2006,2050,2060,2061,2096,2944,6346,8092,8122,8129,9484,10060,14520,14522,14523,14747,14748,14751,14768,14769,14770,14771,14780,14781,14788,14789,14790,14791,14889,14892,14898,14908,14909,14910,14911,14912,14914,15008,15009,15010,15011,15013,15017,15018,15020,15028,15029,15030,15031,15237,15259,15273,15274,15275,15286,15307,15308,15311,15312,15313,15317,15362,15392,15407,15448,15473,15487,18530,18531,18533,19236,20711,21562,27683,27789,27790,27811,27815,27816,32375,32379,32546,33076,33142,33145,33158,33159,33160,33167,33191,33192,33201,33202,33206,33371,34433,34753,34859,34861,34914,45234,45243,47509,47511,47515,47516,47517,47535,47536,47537,47540,47558,47559,47560,47562,47564,47565,47566,47567,47569,47570,47573,47577,47580,47581,47585,47586,47587,47588,47788,48045,49868,52795,52797,52798,57470,57472,62618,63534,63542,63544,63574,63625,63626,63730,63733,64044,64127,64129,64843,64901,64904,70772,73325,73413,73510,78069,78202,78203,78204,78228,78244,78245,78500,78501,80556,81625,81656,81657,81659,81662,81700,81749,81762,81763,81766,81830,83968,84732,84733,84734,87099,87100,87151,87192,87195,87327,87336,87430,87431,88625,88627,88684,88685,88687,88690,88994,88995,89485,89488,89489,92295,92297,95649,95740,95860,95861,101062},
	[6] = {3714,33917,42650,43265,45462,45477,45524,45529,45902,46584,47476,47528,47541,47568,48263,48265,48266,48707,48721,48743,48778,48792,48962,48963,48965,48978,48979,48982,48985,49004,49016,49018,49020,49024,49027,49028,49036,49039,49042,49137,49143,49149,49182,49184,49188,49194,49203,49206,49219,49222,49224,49226,49390,49391,49393,49410,49455,49483,49488,49489,49500,49501,49508,49509,49529,49530,49538,49542,49562,49564,49565,49567,49568,49571,49572,49576,49588,49589,49610,49611,49627,49628,49657,49786,49787,49998,50029,50034,50040,50041,50115,50137,50138,50147,50365,50371,50384,50385,50391,50392,50842,50887,50977,51052,51099,51123,51127,51128,51160,51271,51459,51462,51468,51472,51473,51745,51746,51986,52143,52284,53137,53138,53323,53331,53341,53342,53343,53344,53428,54446,54447,54637,55050,55061,55062,55090,55233,55610,55666,55667,56222,56815,56822,56835,57330,59057,59879,59921,61999,62158,62905,62908,63560,65661,66191,66192,66198,70164,73975,77575,77606,81125,81127,81131,81132,81135,81136,81138,81163,81164,81229,81327,81328,81330,81332,81333,81334,81338,81339,82246,85793,85794,85948,86061,89832,91107,91145,91316,91319,91323,93099,94553,94555,96269,96270},
	[7] = {131,324,331,370,403,421,546,556,674,974,1064,1535,2008,2062,2484,2645,2825,2894,3599,3738,5394,5675,5730,6196,8004,8017,8024,8033,8042,8050,8056,8071,8075,8143,8177,8184,8190,8227,8232,8349,8512,16035,16038,16039,16040,16086,16105,16106,16109,16113,16160,16164,16166,16173,16176,16179,16180,16181,16187,16188,16190,16196,16205,16213,16214,16215,16222,16230,16232,16235,16252,16256,16261,16262,16266,16281,16282,16287,16290,16306,16307,16544,17364,17485,17486,17487,20608,28996,28997,28998,28999,29000,29079,29179,29180,29187,29189,29191,29202,29205,29206,30160,30664,30665,30666,30672,30673,30674,30675,30678,30679,30798,30802,30808,30814,30823,30864,30865,30866,30867,30868,30869,30872,30873,30881,30883,30884,32182,36936,43338,51466,51470,51474,51478,51479,51480,51481,51482,51483,51485,51490,51505,51514,51522,51523,51524,51525,51526,51527,51528,51529,51530,51533,51554,51555,51556,51557,51558,51562,51563,51564,51730,51881,51886,52127,55198,57994,60103,60188,61295,61882,62099,63370,63372,63373,63374,66842,66843,66844,73680,73681,73682,73683,73899,73920,76780,77130,77451,77472,77478,77536,77537,77538,77655,77656,77657,77692,77693,77700,77701,77746,77755,77756,77794,77795,77796,77829,77830,79206,82980,82981,82982,82984,82988,84846,84847,84848,86183,86184,86185,86629,86935,86936,86958,86959,86961,86962,87718,88756,88764,88766,88767,95862,98008,450762},
	[8] = {10,66,116,118,120,122,130,133,475,543,759,1449,1459,1463,1953,2120,2136,2139,2948,3561,3562,3563,3565,3566,3567,5143,6117,7302,10059,11069,11070,11078,11080,11083,11094,11095,11103,11108,11113,11115,11119,11120,11124,11129,11151,11160,11170,11175,11180,11185,11189,11190,11210,11213,11222,11232,11237,11242,11247,11252,11255,11366,11367,11416,11417,11418,11419,11420,11426,11958,12042,12043,12051,12338,12339,12340,12341,12349,12350,12357,12358,12378,12463,12467,12469,12472,12473,12487,12488,12489,12500,12501,12502,12503,12518,12519,12569,12571,12574,12575,12592,12598,12605,12606,12839,12840,12846,12872,12873,12952,12953,12982,12983,15058,15059,15060,16757,16758,16763,16765,16766,18459,18460,18462,18463,18464,28271,28272,28332,28574,28592,28593,29074,29075,29076,29438,29439,29440,29441,29444,29447,30449,30451,30455,30482,31569,31570,31571,31572,31574,31575,31579,31582,31583,31584,31585,31586,31589,31638,31639,31640,31641,31642,31656,31657,31658,31661,31667,31668,31669,31670,31672,31674,31675,31676,31679,31680,31682,31683,31687,32266,32267,32271,32272,33690,33691,34293,34295,34296,35578,35581,35715,35717,42955,43987,44378,44379,44394,44395,44397,44398,44399,44400,44402,44403,44404,44425,44445,44446,44448,44449,44457,44469,44470,44471,44472,44543,44545,44546,44548,44549,44561,44566,44567,44568,44570,44571,44572,44614,44745,45438,49358,49359,49360,49361,53140,53142,54354,54486,54646,54658,54659,54734,54747,54749,54787,55091,55092,55094,55339,55340,55342,61305,61316,61721,61780,64353,64357,71757,79684,80353,82676,82691,82731,82930,83049,83050,83074,83082,83156,83157,83501,83513,83515,83619,84253,84254,84668,84669,84671,84673,84674,84722,84723,84726,84727,86181,86209,86259,86260,86303,86304,86314,86500,86508,86880,86914,86948,86949,88148,88342,88344,88345,88346,90787,90788,92315,413841,413843},
	[9] = {126,172,348,603,686,687,688,689,691,693,697,698,702,710,712,713,755,980,1098,1120,1122,1454,1490,1714,1949,5484,5676,5697,5740,5782,5784,6201,6229,6353,6789,17778,17779,17780,17783,17784,17785,17788,17789,17790,17793,17796,17801,17804,17805,17810,17811,17812,17813,17814,17815,17833,17834,17877,17917,17918,17927,17929,17954,17955,17959,17962,18094,18095,18119,18120,18126,18127,18135,18136,18179,18180,18182,18183,18218,18219,18223,18271,18272,18273,18274,18275,18288,18540,18694,18695,18696,18697,18698,18699,18703,18704,18705,18706,18707,18708,18709,18710,18731,18743,18744,18754,18755,18756,18767,18768,18769,18770,18771,18772,18773,18827,18829,19028,22703,23161,23785,23822,23823,23824,23825,27243,28176,29722,29858,29893,30054,30057,30060,30061,30062,30063,30064,30108,30143,30144,30146,30242,30245,30246,30247,30248,30283,30293,30295,30299,30301,30319,30320,30321,30326,32381,32382,32383,32385,32387,32392,32477,32483,32484,34935,34938,34939,35691,35692,35693,47193,47195,47196,47197,47198,47199,47200,47201,47202,47203,47220,47221,47230,47231,47236,47245,47246,47247,47258,47259,47260,47266,47267,47268,47269,47270,47897,47960,48018,48020,48181,50589,50590,50796,53754,53759,54118,54347,54348,54349,54509,54785,54786,59672,59738,59739,59740,59741,63108,63117,63121,63156,63158,63349,63350,63351,71521,74434,75445,77799,77801,79268,80228,80229,80240,80388,80398,80557,84739,84740,84741,85099,85100,85103,85104,85105,85106,85107,85108,85109,85110,85112,85113,85114,85175,85283,85284,85403,85479,86121,86213,86664,86667,87330,87339,88446,88447,88448,89420,89604,89605,91711,91713,91986,93375,93376},
	[11] = {99,339,467,740,768,770,774,779,783,1066,1079,1082,1126,1822,1850,2637,2782,2908,2912,5176,5185,5209,5211,5215,5217,5221,5225,5229,5487,5570,6785,6795,6807,8921,8936,8998,9005,16689,16814,16815,16816,16833,16834,16840,16845,16846,16847,16857,16858,16859,16864,16880,16896,16897,16899,16913,16914,16929,16930,16931,16940,16941,16949,16961,16972,16974,16979,17002,17003,17004,17005,17007,17056,17058,17059,17069,17070,17074,17075,17076,17080,17104,17111,17112,17113,17116,17123,17124,18562,18960,20484,20719,22568,22570,22812,22842,24858,24866,24943,29166,33589,33590,33591,33592,33596,33597,33599,33601,33602,33603,33604,33605,33745,33763,33786,33831,33859,33866,33867,33872,33873,33876,33878,33879,33880,33881,33882,33886,33888,33889,33890,33891,33917,33943,34151,35363,35364,37116,37117,40120,44203,48389,48392,48393,48411,48432,48433,48434,48438,48483,48484,48488,48492,48494,48495,48496,48499,48500,48505,48506,48514,48516,48521,48525,48532,48539,48544,49376,49377,50334,50464,50516,50769,51179,51180,51181,52610,57810,57811,57812,57873,57876,57877,57878,57880,60089,61336,61345,61346,62078,62600,65139,77758,77761,77764,78674,78675,78734,78735,78736,78737,78738,78777,78784,78785,78788,78789,78892,78893,79577,80313,80314,80315,80316,80317,80318,80319,80552,80553,80554,80861,80863,80879,80886,80951,80964,80965,81016,81017,81021,81022,81061,81062,81170,81274,81275,81283,81291,84735,84736,84738,84840,85101,87305,87335,87793,88423,88747,88751,92363,92364,93398,93399,93401,93402,96429,450759},
	["PET"] = {[1742]=3,[2649]=3,[4167]=3,[16827]=3,[17253]=3,[19596]=3,[23145]=3,[24423]=3,[24450]=3,[24604]=3,[24844]=3,[26064]=3,[26090]=3,[34889]=3,[35290]=3,[35346]=3,[35387]=3,[49966]=3,[50245]=3,[50256]=3,[50271]=3,[50274]=3,[50285]=3,[50318]=3,[50433]=3,[50479]=3,[50498]=3,[50518]=3,[50519]=3,[50541]=3,[52234]=3,[52825]=3,[52858]=3,[53175]=3,[53176]=3,[53178]=3,[53179]=3,[53180]=3,[53181]=3,[53182]=3,[53183]=3,[53184]=3,[53186]=3,[53187]=3,[53203]=3,[53204]=3,[53205]=3,[53397]=3,[53401]=3,[53409]=3,[53411]=3,[53426]=3,[53427]=3,[53429]=3,[53430]=3,[53434]=3,[53450]=3,[53451]=3,[53476]=3,[53477]=3,[53478]=3,[53480]=3,[53481]=3,[53482]=3,[53483]=3,[53485]=3,[53490]=3,[53497]=3,[53508]=3,[53511]=3,[53512]=3,[53514]=3,[53516]=3,[53517]=3,[53554]=3,[53555]=3,[54044]=3,[54644]=3,[54680]=3,[54706]=3,[55709]=3,[55749]=3,[56626]=3,[57386]=3,[58604]=3,[61680]=3,[61681]=3,[61682]=3,[61683]=3,[61684]=3,[61685]=3,[61686]=3,[61687]=3,[61688]=3,[61689]=3,[61690]=3,[62758]=3,[62759]=3,[62760]=3,[62762]=3,[62764]=3,[62765]=3,[63900]=3,[65220]=3,[75447]=3,[87467]=3,[87884]=3,[87887]=3,[87891]=3,[88680]=3,[89446]=3,[89601]=3,[90309]=3,[90314]=3,[90327]=3,[90328]=3,[90337]=3,[90339]=3,[90347]=3,[90348]=3,[90355]=3,[90361]=3,[90363]=3,[90364]=3,[91083]=3,[91644]=3,[92380]=3,[93273]=3,[93433]=3,[93434]=3,[93435]=3,[94003]=3,[94019]=3,[94022]=3,[96201]=3,[97229]=3,[3110]=9,[3716]=9,[6307]=9,[6358]=9,[6360]=9,[7812]=9,[7814]=9,[7870]=9,[17735]=9,[17767]=9,[19505]=9,[19647]=9,[30151]=9,[30153]=9,[30213]=9,[32233]=9,[54049]=9,[54278]=9,[54424]=9,[61013]=9,[89751]=9,[89766]=9,[89792]=9,[89808]=9,[89953]=9,[91702]=9},
	["RACIAL"] = {[822]={{10},0},[5227]={{5},0},[6562]={{11},39},[7744]={{5},0},[20549]={{6},0},[20550]={{6},0},[20551]={{6},0},[20552]={{6},0},[20555]={{8},0},[20557]={{8},0},[20558]={{8},0},[20572]={{2},45},[20573]={{2},0},[20574]={{2},0},[20575]={{2},256},[20577]={{5},0},[20579]={{5},0},[20582]={{4},0},[20583]={{4},0},[20585]={{4},0},[20589]={{7},0},[20591]={{7},0},[20592]={{7},0},[20593]={{7},0},[20594]={{3},0},[20595]={{3},0},[20596]={{3},0},[20597]={{1},0},[20598]={{1},0},[20599]={{1},0},[20864]={{1},0},[25046]={{10},8},[26290]={{8},0},[26297]={{8},0},[28730]={{10},402},[28875]={{11},0},[28877]={{10},0},[28878]={{11},208},[28880]={{11},1},[33697]={{2},64},[33702]={{2},384},[50613]={{10},32},[54562]={{2},32},[58943]={{8},0},[58984]={{4},0},[59221]={{11},1},[59224]={{3},0},[59535]={{11},2},[59536]={{11},4},[59538]={{11},16},[59539]={{11},32},[59540]={{11},64},[59541]={{11},128},[59542]={{11},2},[59543]={{11},4},[59544]={{11},16},[59545]={{11},32},[59547]={{11},64},[59548]={{11},128},[59752]={{1},0},[65222]={{2},64},[68975]={{22},0},[68976]={{22},0},[68978]={{22},0},[68992]={{22},0},[68996]={{22},0},[69041]={{9},0},[69042]={{9},0},[69044]={{9},0},[69045]={{9},0},[69046]={{9},0},[69070]={{9},0},[69179]={{10},1},[76252]={{4},0},[79738]={{1},0},[79739]={{3},0},[79740]={{7},0},[79741]={{11},0},[79742]={{22},0},[79743]={{2},0},[79744]={{8},0},[79746]={{6},0},[79747]={{5},0},[79748]={{10},0},[79749]={{9},0},[80483]={{10},4},[87840]={{22},0},[92680]={{7},0},[92682]={{3},0},[94293]={{22},0}},
}

local Cache = ClassSpellCache.SpellData


-- Adjustments to the imported cache data:
tinsert(Cache[3], 1, 75) -- Add "Auto Shot" to hunter.
