﻿-- --------------------
-- 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",
	[25] = "Pandaren",
	[26] = "Pandaren",
	[24] = "Pandaren",
}
ClassSpellCache.SpellData = {
	[1] = {71,78,100,355,469,676,845,871,1160,1464,1680,1715,1719,2457,2458,2565,3127,3411,5246,5308,6343,6544,6552,6572,6673,7384,7386,12292,12294,12323,12328,12712,12950,12972,12975,13046,18499,20243,23588,23881,23920,23922,29144,29725,29838,34428,44949,46915,46917,46924,46953,46968,50622,52174,55694,56636,57755,64382,76838,76856,76857,76858,81099,84608,84615,85288,85384,86101,86110,86346,86535,88163,93098,95738,96103,97462,100130,102052,102060,103826,103827,103828,103840,107566,107570,107574,110506,112048,113344,114028,114029,114030,114192,114203,114207,115767,115768,115799,117313,118000,118038,118340,118779,119938,122475,122509,123829,128217,131086,137047,137048,137049,137050,143268,145672},
	[2] = {498,633,635,642,853,879,1022,1038,1044,2812,4987,6940,7328,10326,13819,19740,19750,20066,20113,20154,20164,20165,20167,20217,20271,20473,20925,23214,24275,25780,25956,26023,26573,31801,31821,31842,31849,31850,31868,31884,31935,32223,34767,34769,35395,42463,53376,53385,53503,53551,53563,53576,53592,53595,53600,54428,62124,66235,69820,69826,73629,73630,76669,76671,76672,81297,82242,82326,82327,84839,84963,85043,85222,85256,85499,85512,85673,85804,86102,86103,86172,86539,86659,86669,86678,86698,86704,87138,87172,88263,88821,93417,94289,96172,96231,101423,105361,105424,105593,105622,105805,105809,110301,110501,111529,112859,114039,114154,114157,114158,114163,114165,114852,114871,114916,114917,115547,115675,115750,115801,119072,121783,123830,130551,130552,136494,137026,137027,137028,137029,140333,148040,450761},
	[3] = {75,136,781,883,982,1130,1462,1494,1499,1513,1515,1543,1978,2641,2643,3044,3045,5116,5118,5384,6197,6991,8737,13159,13165,13809,13813,19263,19287,19386,19387,19434,19503,19506,19574,19577,19623,19801,19878,19879,19880,19882,19883,19884,19885,20736,34026,34477,34483,34487,34490,34600,34692,34954,35102,35110,51753,53209,53224,53232,53238,53253,53260,53270,53271,53296,53301,53351,56315,56343,56641,63458,76657,76658,76659,77442,77767,77769,82654,82683,82684,82692,82726,82834,83242,83243,83244,83245,87324,87935,93321,93322,109212,109215,109248,109259,109260,109298,109304,109306,110497,115939,117050,118424,118675,118976,120360,120679,120697,120761,121414,121818,130392,131894,136311,137014,137015,137016,137017,138430,143392,147362},
	[4] = {53,408,703,921,1329,1725,1752,1766,1776,1784,1804,1833,1842,1856,1860,1943,1966,2094,2098,2818,2823,2836,2983,3408,5171,5277,5374,5761,5938,6770,8647,8676,8679,8680,13750,13852,13877,14062,14117,14161,14183,14185,14190,16511,22482,26679,27576,31209,31220,31223,31224,31230,32645,32743,35551,36554,51667,51690,51701,51713,51722,51723,57934,58410,58423,61329,73651,73981,74001,76577,76803,76806,76808,79008,79096,79134,79140,79147,79152,79327,82245,84601,84617,84654,86392,89775,91023,108208,108209,108210,108211,108212,108215,108216,110503,111240,112974,113742,113780,114014,114015,114018,114842,121152,121411,121471,121473,121474,121733,122233,131511,137034,137035,137036,137037,137619,138106,1248969},
	[5] = {17,139,527,528,585,586,588,589,596,605,1706,2006,2050,2060,2061,2096,2944,6346,8092,8122,9484,10060,14914,15286,15407,15473,15487,19236,20711,21562,32375,32379,32546,33076,33206,34433,34861,34914,45243,47515,47517,47536,47540,47573,47585,47788,48045,52798,62618,63733,64044,64129,64843,64901,73325,73413,73510,77484,77485,77486,77489,78203,78500,81206,81208,81209,81662,81700,81749,83968,84733,87336,88625,88686,89485,89488,89745,92297,95649,95740,95860,95861,108920,108921,108942,108945,108968,109142,109175,109186,109964,110502,110744,110745,112833,114884,120517,120692,120696,120785,121135,121148,121196,121536,122098,122128,123040,124464,124465,124467,124468,124469,126135,126154,127626,137030,137031,137032,137033,139139,142723},
	[6] = {3714,42650,43265,45462,45477,45524,45529,45902,46584,47476,47528,47541,47568,48263,48265,48266,48707,48721,48743,48792,48982,49016,49020,49028,49039,49143,49184,49206,49222,49509,49530,49542,49572,49576,49998,50029,50034,50041,50371,50385,50392,50842,50887,50977,51052,51128,51160,51271,51462,51986,52143,52212,53323,53331,53341,53342,53343,53344,53428,54446,54447,54637,55050,55078,55090,55095,55233,55610,56222,56815,56835,57330,59057,59879,59921,61250,61999,62158,63560,66192,70164,73975,77513,77514,77515,77575,77606,81127,81132,81136,81164,81229,81328,81333,82246,85948,86113,86524,86536,86537,89832,91107,93099,96268,108170,108194,108196,108199,108200,108201,110498,111673,114556,114866,115989,119975,123693,130735,130736,137005,137006,137007,137008,145676,148211},
	[7] = {324,331,370,403,421,546,556,974,1064,1535,2008,2062,2484,2645,2825,2894,3599,5394,6196,8004,8017,8024,8033,8034,8042,8050,8056,8143,8177,8190,8232,8349,8737,10444,16164,16166,16188,16190,16196,16213,16282,17364,20608,25504,29000,30674,30809,30814,30823,30884,32182,33750,36936,51470,51485,51490,51505,51514,51522,51527,51530,51533,51558,51564,51730,51886,51945,52127,52752,57994,58875,60103,60188,61295,61882,62099,63374,73680,73681,73682,73683,73685,73899,73920,73921,76780,77130,77222,77223,77226,77472,77478,77657,77747,77756,79206,86099,86100,86108,86529,86629,88764,88766,89920,95862,98008,108269,108270,108271,108273,108280,108281,108282,108283,108284,108285,108287,110504,112858,114049,114089,114093,114911,115356,115357,115360,116956,117012,117013,117014,120668,123099,123831,137038,137039,137040,137041,147074,450762},
	[8] = {10,66,116,118,120,122,130,133,475,759,1449,1459,1463,1953,2120,2136,2139,2948,3561,3562,3563,3565,3566,3567,5143,6117,7302,10059,11129,11366,11416,11417,11418,11419,11420,11426,11958,12042,12043,12051,12472,12598,12846,12982,28271,28272,30449,30451,30455,30482,31589,31661,31687,32266,32267,32271,32272,33690,33691,35715,35717,42955,43987,44425,44448,44457,44549,44572,44614,45438,49358,49359,49360,49361,53140,53142,55342,61305,61316,61721,61780,76547,76613,79684,80353,84254,84714,86949,88342,88344,88345,88346,89744,102051,108839,108843,108853,108978,110499,110959,111264,112948,112965,113092,113724,114003,114664,114923,114954,114995,115610,115757,116011,117216,117957,120145,120146,121039,125430,126201,132209,132620,132621,132626,132627,133681,137018,137019,137020,137021,140468},
	[9] = {126,172,348,686,688,689,691,697,698,710,712,713,755,980,1098,1120,1122,1454,1490,1949,5484,5697,5740,5782,5784,6201,6229,6353,6789,17877,17962,18223,18540,20707,23161,27243,29722,29858,29893,30108,30146,30283,47897,48018,48020,48181,53759,63106,74434,77215,77219,77220,77799,77801,80240,86091,86121,86664,87330,87385,93375,101508,101976,103101,103103,103112,103128,103129,103130,103131,103133,103134,103135,103136,103139,103140,103141,103142,103150,103958,103967,104233,104243,104315,104773,104938,105174,108359,108366,108370,108371,108396,108415,108416,108482,108499,108501,108503,108505,108508,108558,108559,108563,108647,108683,108869,109145,109151,109466,109773,109784,109797,110505,110913,111397,111400,111546,111771,112089,113858,113860,113861,114129,114592,114635,114790,116208,116852,116858,117198,117896,119678,119898,120451,122351,123686,124538,124539,124913,124917,129343,131736,131737,131740,131973,132566,137042,137043,137044,137046,137206,137587,141931,146739},
	[10] = {100780,100784,100787,101545,101546,101643,103985,107270,107428,107500,108562,108977,109132,110500,113656,115008,115069,115070,115072,115073,115074,115078,115080,115098,115129,115151,115173,115174,115175,115176,115178,115180,115181,115203,115213,115288,115294,115295,115308,115310,115313,115315,115396,115399,115450,115451,115460,115464,115543,115546,115612,115636,115869,115921,116023,116092,116095,116346,116645,116670,116680,116694,116705,116740,116781,116812,116841,116844,116847,116849,116995,117368,117418,117640,117895,117906,117907,117952,117959,117967,117993,118022,118672,119381,119392,119582,119611,119650,119996,120224,120225,120227,120267,120272,120274,120275,120277,120278,121128,121253,121278,121817,122057,122278,122280,122281,122464,122470,122783,123192,123273,123332,123586,123725,123766,123904,123980,123986,124040,124041,124081,124098,124101,124146,124280,124334,124335,124502,124507,124682,125033,125170,125355,125953,126046,126060,126086,126890,126892,126893,126895,128531,128591,128595,128678,128938,130610,130654,132120,132463,132467,135914,135920,136336,137022,137023,137024,137025,137384,137562,137639,139598,1245934,1247280,1251700},
	[11] = {99,339,740,768,770,774,779,783,1066,1079,1126,1822,1850,2637,2782,2908,2912,5176,5185,5211,5215,5217,5221,5225,5229,5420,5487,6785,6795,6807,8921,8936,9005,16689,16864,16870,16914,16931,16949,16961,16974,17007,17057,17073,18562,18960,20484,20719,22568,22570,22812,22842,24858,29166,33596,33605,33745,33763,33778,33786,33873,33876,33878,33886,33917,33943,37846,40120,44203,48393,48438,48484,48500,48503,48505,50464,50769,52610,61336,62078,62606,77492,77493,77494,77495,77758,78674,78675,78777,79577,80863,81062,81097,81098,81269,84736,84738,84840,85101,86093,86096,86097,86104,88423,88747,88751,92364,93399,93402,94447,96206,97985,97993,102280,102342,102351,102352,102354,102355,102359,102401,102543,102545,102546,102547,102558,102560,102791,102792,102793,102794,102795,106707,106731,106732,106733,106734,106735,106737,106785,106830,106832,106839,106898,106922,106952,106996,106998,108238,108288,108299,108373,110309,112071,112857,113043,114107,115800,124974,125972,127663,131768,132158,132469,135288,137009,137010,137011,137012,137013,138611,145108,145109,145110,145205,145518,450759},
	["PET"] = {[3110]=6,[3716]=6,[6358]=6,[6360]=6,[7814]=6,[7870]=6,[17735]=6,[17767]=6,[19505]=6,[19647]=6,[30151]=6,[30153]=6,[30213]=6,[32233]=6,[54049]=6,[89751]=6,[89766]=6,[89792]=6,[89808]=6,[112042]=6,[115043]=6,[115232]=6,[115408]=6,[117225]=6,[118093]=6,[119899]=6,[123746]=6,[134477]=6,[142689]=6,[1742]=6,[2649]=6,[4167]=6,[16827]=6,[17253]=6,[24423]=6,[24450]=6,[24604]=6,[24844]=6,[26064]=6,[26090]=6,[34889]=6,[35290]=6,[35346]=6,[49966]=6,[50245]=6,[50256]=6,[50274]=6,[50285]=6,[50318]=6,[50433]=6,[50479]=6,[50498]=6,[50518]=6,[50519]=6,[50541]=6,[54644]=6,[54680]=6,[54706]=6,[55749]=6,[56626]=6,[57386]=6,[58604]=6,[65220]=6,[88680]=6,[90309]=6,[90314]=6,[90327]=6,[90328]=6,[90337]=6,[90339]=6,[90347]=6,[90355]=6,[90361]=6,[90363]=6,[90364]=6,[91644]=6,[92380]=6,[93273]=6,[93433]=6,[93434]=6,[93435]=6,[94019]=6,[94022]=6,[96201]=6,[97229]=6,[126246]=6,[126259]=6,[126309]=6,[126311]=6,[126355]=6,[126364]=6,[126373]=6,[126393]=6,[126402]=6,[126423]=6,[128432]=6,[128433]=6,[128997]=6,[135678]=6,[137798]=6,[25027]=6,[31707]=6,[33395]=6,[36213]=6,[47468]=6,[47481]=6,[47482]=6,[47484]=6,[57984]=6,[62137]=6,[91776]=6,[91778]=6,[91797]=6,[91800]=6,[91802]=6,[91809]=6,[91837]=6,[91838]=6,[114355]=6,[115236]=6,[115268]=6,[115276]=6,[115284]=6,[115578]=6,[115625]=6,[115746]=6,[115748]=6,[115770]=6,[115778]=6,[115781]=6,[115831]=6,[117588]=6,[118297]=6,[118337]=6,[118345]=6,[118347]=6,[118350]=6},
	["RACIAL"] = {[822]={{10},0},[5227]={{5},0},[6562]={{11},551},[7744]={{5},0},[20549]={{6},0},[20550]={{6},0},[20551]={{6},0},[20552]={{6},0},[20555]={{8},0},[20557]={{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},576},[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},1535},[69070]={{9},0},[69179]={{10},1},[76252]={{4},0},[79738]={{1},0},[79739]={{3},0},[79740]={{7},0},[79741]={{11},0},[79742]={{22},1535},[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},[107072]={{24},0},[107073]={{24},0},[107074]={{24},0},[107076]={{24},0},[107079]={{24},8},[121093]={{11},528},[129597]={{10},512},[131701]={{24},0},[132295]={{11},512},[143368]={{24},0},[143369]={{24},0}},
}

local Cache = ClassSpellCache.SpellData


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