local command = "learncraft" local GMonly = true --command only opens for GM local queryalchemy local querymining local queryblacksmithing local querytailoring local queryengineering local queryenchanting local queryinscription local queryjewelcrafting local queryleatherworking local ALCH = {2331, 2332, 2333, 2334, 2335, 2337, 3170, 3171, 3172, 3173, 3174, 3175, 3176, 3177, 3188, 3230, 3447, 3448, 3449, 3450, 3451, 3452, 3453, 3454, 4508, 4942, 6617, 6618, 6624, 7179, 7181, 7255, 7256, 7257, 7258, 7259, 7836, 7837, 7841, 7845, 8240, 11448, 11449, 11450, 11451, 11453, 11456, 11457, 11458, 11459, 11460, 11461, 11464, 11465, 11466, 11467, 11468, 11472, 11473, 11476, 11477, 11478, 11479, 11480, 12609, 15833, 17187, 17551, 17552, 17553, 17554, 17555, 17556, 17557, 17559, 17560, 17561, 17562, 17563, 17564, 17565, 17566, 17570, 17571, 17572, 17573, 17574, 17575, 17576, 17577, 17578, 17580, 17632, 17634, 17635, 17636, 17637, 17638, 21923, 22732, 22808, 24365, 24366, 24367, 24368, 25146, 26277, 28543, 28544, 28545, 28546, 28549, 28550, 28551, 28552, 28553, 28554, 28555, 28556, 28557, 28558, 28562, 28563, 28564, 28565, 28566, 28567, 28568, 28569, 28570, 28571, 28572, 28573, 28575, 28576, 28577, 28578, 28579, 28580, 28581, 28582, 28583, 28584, 28585, 29688, 32765, 32766, 33732, 33733, 33738, 33740, 33741, 38070, 38960, 38961, 38962, 39636, 39637, 39638, 39639, 41458, 42736, 45061, 47046, 47048, 47049, 47050, 51303, 51304, 53042, 53771, 53773, 53774, 53775, 53776, 53777, 53779, 53780, 53781, 53782, 53783, 53784, 53812, 53836, 53837, 53838, 53839, 53840, 53841, 53842, 53847, 53848, 53898, 53899, 53900, 53901, 53902, 53903, 53905, 53936, 53937, 53938, 53939, 53942, 54213, 54218, 57425, 57427, 58868, 58871, 60350, 60367, 60396, 60403, 60405, 60893, 62213, 62409, 63732, 66658, 66659, 66660, 66662, 66663, 66664, 67025, 53895, 60354, 60365, 60355, 60357, 60366, 60356, 56519, 54220, 54221, 54222, 53904, 62410, 41500, 41501, 41502, 41503, 28589, 28591, 28588, 28587, 28590, 24266, 11452, 28586}; local MINING = {50310, 2657, 2658, 2659, 3304, 3307, 3308, 3569, 10097, 10098, 16153, 29356, 29358, 29359, 29360, 29361, 29686, 35750, 35751, 49252, 49258, 55208, 55211, 70524, 14891, 22967, 46353} local TAILOR = {51309, 64730, 64729, 63742, 60994, 60993, 60990, 60971, 60969, 59589, 59588, 59587, 59586, 59585, 59584, 59583, 59582, 56039, 56034, 56031, 56030, 56029, 56028, 56027, 56026, 56025, 56024, 56023, 56022, 56021, 56020, 56019, 56018, 56015, 56014, 56010, 56008, 56007, 56003, 56002, 56001, 56000, 55995, 55943, 55941, 55925, 55924, 55923, 55922, 55921, 55920, 55919, 55914, 55913, 55911, 55910, 55908, 55907, 55906, 55904, 55903, 55902, 55901, 55900, 55899, 55898, 55777, 55769, 55642, 51308, 31460, 26772, 26771, 26770, 26765, 26764, 26746, 26745, 18453, 18451, 18450, 18449, 18446, 18444, 18442, 18441, 18438, 18437, 18424, 18423, 18421, 18420, 18417, 18416, 18415, 18414, 18413, 18411, 18410, 18409, 18407, 18406, 18403, 18402, 18401, 12092, 12088, 12079, 12077, 12074, 12073, 12072, 12070, 12069, 12067, 12065, 12061, 12053, 12050, 12049, 12048, 12046, 12045, 8804, 8799, 8791, 8776, 8774, 8772, 8770, 8766, 8764, 8762, 8760, 8758, 8489, 8483, 8467, 8465, 7624, 7623, 6690, 6521, 3915, 3914, 3871, 3866, 3865, 3861, 3859, 3855, 3852, 3850, 3848, 3845, 3843, 3842, 3841, 3840, 3839, 3813, 3757, 3755, 2964, 2406, 2402, 2401, 2399, 2397, 2396, 2395, 2394, 2393, 2392, 2386, 2385, 12052, 12082, 12076, 12071, 56017, 56016, 12055, 12086, 22813, 19435, 24902, 24901, 24903, 2389, 2403, 3758, 3844, 3847, 3849, 3851, 3854, 3856, 3857, 3858, 3860, 3862, 3863, 3864, 3868, 3869, 3870, 3872, 3873, 6686, 6688, 6692, 6693, 6695, 7629, 7630, 7633, 7639, 7643, 7892, 7893, 8780, 8782, 8784, 8786, 8789, 8793, 8795, 8797, 8802, 12047, 12056, 12059, 12060, 12064, 12066, 12075, 12078, 12080, 12081, 12084, 12085, 12086, 12089, 12091, 12093, 18403, 18404, 18405, 18406, 18407, 18408, 18409, 18410, 18411, 18412, 18413, 18414, 18415, 18416, 18417, 18418, 18419, 18420, 18421, 18422, 18423, 18424, 18434, 18436, 18437, 18438, 18439, 18440, 18441, 18442, 18444, 18445, 18446, 18447, 18448, 18449, 18450, 18451, 18452, 18453, 18454, 18455, 18456, 18457, 18458, 18560, 20848, 20849, 21945, 22759, 22866, 22867, 22868, 22869, 22870, 22902, 23662, 23663, 23664, 23665, 23666, 23667, 24091, 24092, 24093, 24901, 24902, 24903, 26085, 26087, 26403, 26407, 26747, 26749, 26750, 26751, 26752, 26753, 26754, 26755, 26756, 26757, 26758, 26759, 26760, 26761, 26762, 26763, 26773, 26774, 26775, 26776, 26777, 26778, 26779, 26780, 26781, 26782, 26783, 26784, 27658, 27659, 27660, 27724, 27725, 28210, 28480, 28481, 28482, 31373, 31430, 31431, 31432, 31433, 31434, 31435, 31437, 31438, 31440, 31441, 31442, 31443, 31444, 31448, 31449, 31450, 31451, 31452, 31453, 31454, 31455, 31456, 31459, 31461, 35836, 36315, 36316, 36317, 36318, 36686, 37873, 37882, 37883, 37884, 40020, 40021, 40023, 40024, 40060, 41205, 41206, 41207, 41208, 44950, 44958, 46128, 46129, 46130, 46131, 49677, 50194, 50644, 50647, 55993, 55994, 55995, 55996, 55997, 55998, 55999, 56000, 56001, 56002, 56003, 56004, 56005, 56006, 56007, 56009, 56011, 56016, 56017, 56018, 56019, 56020, 56021, 56022, 56023, 56024, 56025, 56026, 56027, 56028, 56029, 59390, 61309, 61442, 61446, 61451, 63203, 63204, 63205, 63206, 63924, 67064, 67065, 67066, 67079, 67144, 67145, 67146, 67147, 70550, 70551, 70552, 70553, 75596, 75597, 26086, 28209, 28207, 28205, 28208} local BLACK = {51300, 2661, 2662, 2664, 2665, 2666, 2668, 2670, 2672, 2674, 2675, 2737, 2738, 2739, 2740, 2741, 2742, 3116, 3117, 3292, 3293, 3294, 3296, 3319, 3320, 3323, 3324, 3326, 3328, 3331, 3333, 3337, 3491, 3501, 3502, 3506, 3508, 3539, 6517, 7223, 7408, 7817, 7818, 8768, 8880, 9916, 9918, 9920, 9921, 9926, 9928, 9931, 9935, 9954, 9959, 9961, 9968, 9974, 9983, 9985, 9986, 9987, 9993, 10001, 10003, 10007, 10011, 10015, 14379, 14380, 15972, 16639, 16640, 16641, 16642, 16643, 16644, 16652, 16653, 16662, 16969, 16971, 19666, 19667, 19668, 19669, 20201, 29545, 29547, 29548, 29549, 29550, 29551, 29552, 29553, 29556, 29557, 29558, 29565, 29654, 32284, 32655, 34529, 34530, 34533, 34534, 34535, 34537, 34538, 34540, 34541, 34542, 34543, 34544, 34545, 34546, 34547, 34548, 34607, 34979, 34981, 34982, 34983, 36122, 36124, 36125, 36126, 36128, 36129, 36130, 36131, 36133, 36134, 36135, 36136, 36137, 36256, 36257, 36258, 36259, 36260, 36261, 36262, 36263, 51298, 52567, 52568, 52569, 52570, 52571, 52572, 54550, 54551, 54552, 54553, 54554, 54555, 54556, 54557, 54917, 54918, 54941, 54944, 54945, 54946, 54947, 54948, 54949, 55013, 55014, 55015, 55017, 55055, 55056, 55057, 55058, 55174, 55177, 55179, 55181, 55182, 55183, 55184, 55185, 55186, 55187, 55200, 55201, 55202, 55203, 55204, 55206, 55298, 55300, 55301, 55302, 55303, 55304, 55305, 55306, 55307, 55308, 55309, 55310, 55311, 55312, 55369, 55370, 55371, 55372, 55373, 55374, 55375, 55376, 55377, 55628, 55641, 55656, 55732, 55834, 55835, 55839, 56234, 56280, 56357, 56400, 56549, 56550, 56551, 56552, 56553, 56554, 56555, 56556, 59405, 59406, 59436, 59438, 59440, 59441, 59442, 61008, 61009, 61010, 63182, 2667, 2673, 3295, 3297, 3321, 3325, 3330, 3334, 3336, 3492, 3493, 3494, 3495, 3496, 3497, 3498, 3500, 3503, 3504, 3505, 3507, 3511, 3513, 3515, 6518, 7221, 7222, 7224, 8367, 9811, 9813, 9814, 9818, 9820, 9933, 9937, 9939, 9945, 9950, 9952, 9964, 9966, 9970, 9995, 9997, 10005, 10009, 10013, 11454, 11643, 12259, 15292, 15293, 15294, 15295, 15296, 15973, 16642, 16643, 16644, 16645, 16646, 16647, 16648, 16649, 16650, 16651, 16652, 16653, 16654, 16655, 16656, 16657, 16658, 16659, 16660, 16661, 16662, 16663, 16664, 16665, 16667, 16724, 16725, 16726, 16728, 16729, 16730, 16731, 16732, 16741, 16742, 16744, 16745, 16746, 16969, 16970, 16971, 16973, 16978, 16983, 16984, 16985, 16988, 16990, 16991, 16992, 16993, 16994, 16995, 20872, 20873, 20874, 20876, 20890, 20897, 21161, 21640, 21913, 22757, 23628, 23629, 23632, 23633, 23636, 23637, 23638, 23639, 23650, 23652, 23653, 24136, 24137, 24138, 24139, 24140, 24141, 24399, 24912, 24913, 24914, 27585, 27586, 27587, 27588, 27589, 27590, 27829, 27830, 27832, 28461, 28462, 28463, 29566, 29568, 29569, 29571, 29603, 29605, 29606, 29608, 29610, 29611, 29613, 29614, 29615, 29616, 29617, 29619, 29620, 29621, 29622, 29628, 29629, 29630, 29642, 29643, 29645, 29648, 29649, 29656, 29657, 29658, 29662, 29663, 29664, 29668, 29669, 29671, 29672, 29692, 29693, 29694, 29695, 29696, 29697, 29698, 29699, 29700, 29728, 29729, 32285, 32656, 32657, 34608, 36389, 36390, 36391, 36392, 38473, 38475, 38476, 38477, 38478, 38479, 40033, 40034, 40035, 40036, 41132, 41133, 41134, 41135, 42662, 42688, 43549, 43846, 46140, 46141, 46142, 46144, 54978, 54979, 54980, 54981, 62202, 63187, 63188, 63189, 63190, 63191, 63192, 67091, 67092, 67093, 67094, 67095, 67096, 67130, 67131, 67132, 67133, 67134, 67135, 70562, 70563, 70565, 70566, 70567, 70568, 28242, 28244, 28243, 9980, 9979, 9972, 9957} local ENCHANT = {7420, 7426, 7428, 7443, 7454, 7457, 7745, 7748, 7766, 7771, 7776, 7779, 7782, 7786, 7788, 7793, 7795, 7857, 7859, 7861, 7863, 7867, 13378, 13380, 13419, 13421, 13464, 13485, 13501, 13503, 13522, 13529, 13536, 13538, 13607, 13612, 13617, 13620, 13622, 13626, 13628, 13631, 13635, 13637, 13640, 13642, 13644, 13646, 13648, 13653, 13655, 13657, 13659, 13661, 13663, 13687, 13689, 13693, 13695, 13698, 13700, 13702, 13746, 13794, 13815, 13817, 13822, 13836, 13841, 13846, 13858, 13868, 13882, 13887, 13890, 13898, 13905, 13915, 13917, 13931, 13933, 13935, 13937, 13939, 13941, 13943, 13945, 13947, 13948, 14293, 14807, 14809, 14810, 15596, 17180, 17181, 20008, 20009, 20010, 20011, 20012, 20013, 20014, 20015, 20016, 20017, 20020, 20023, 20024, 20025, 20026, 20028, 20029, 20030, 20031, 20032, 20033, 20034, 20035, 20036, 20051, 21931, 22749, 22750, 23799, 23800, 23801, 23802, 23803, 23804, 25072, 25073, 25074, 25078, 25079, 25080, 25081, 25082, 25083, 25084, 25086, 25124, 25125, 25126, 25127, 25128, 25129, 25130, 27837, 27899, 27905, 27906, 27911, 27913, 27914, 27917, 27920, 27924, 27926, 27927, 27944, 27945, 27946, 27947, 27948, 27950, 27951, 27954, 27957, 27958, 27960, 27961, 27962, 27967, 27968, 27971, 27972, 27975, 27977, 27981, 27982, 27984, 28003, 28004, 28016, 28019, 28022, 28027, 28028, 32664, 32665, 32667, 33990, 33991, 33992, 33993, 33994, 33995, 33996, 33997, 33999, 34001, 34002, 34003, 34004, 34005, 34006, 34007, 34008, 34009, 34010, 42613, 42615, 42620, 42974, 44383, 44483, 44484, 44488, 44489, 44492, 44494, 44500, 44506, 44508, 44509, 44510, 44513, 44524, 44528, 44529, 44555, 44556, 44575, 44576, 44582, 44584, 44588, 44589, 44590, 44591, 44592, 44593, 44595, 44596, 44598, 44616, 44621, 44623, 44625, 44629, 44630, 44631, 44633, 44635, 44636, 44645, 45765, 46578, 46594, 47051, 47672, 47766, 47898, 47899, 47900, 47901, 51312, 59619, 59621, 59625, 59636, 60606, 60609, 60616, 60619, 60621, 60623, 60653, 60663, 60668, 60691, 60692, 60707, 60714, 60763, 60767, 62256, 62257, 62948, 62959, 63746, 64441, 64579, 69412, 71692} local ENG = {51306, 12584, 12585, 12586, 12589, 12590, 12591, 12594, 12595, 12596, 12599, 12603, 12615, 12618, 12619, 12621, 12622, 12715, 12717, 12718, 12754, 12755, 12758, 12759, 12760, 12895, 12897, 12899, 12902, 12903, 12905, 12906, 12907, 12908, 15255, 19567, 19788, 19790, 19791, 19792, 19794, 19795, 19800, 19825, 23070, 23071, 30303, 30304, 30305, 30306, 30307, 30308, 30309, 30310, 30311, 30312, 30346, 30558, 30560, 30563, 30565, 30566, 30568, 30569, 30570, 30574, 30575, 36954, 36955, 3922, 3923, 3924, 3925, 3926, 3929, 3930, 3931, 3932, 3934, 3936, 3937, 3938, 3941, 3942, 3945, 3946, 3947, 3949, 3950, 3953, 3955, 3956, 3958, 3961, 3962, 3963, 3965, 3967, 3973, 3977, 3978, 39971, 39973, 40274, 41307, 41311, 41312, 41314, 41315, 41316, 41317, 41318, 41319, 41320, 41321, 44155, 44157, 53281, 54353, 54736, 54793, 54998, 54999, 55002, 55016, 56349, 56459, 56460, 56461, 56462, 56463, 56464, 56465, 56466, 56467, 56468, 56469, 56470, 56471, 56472, 56473, 56474, 56475, 56476, 56477, 56478, 56479, 56480, 56481, 56483, 56484, 56486, 56487, 56514, 56574, 60874, 61464, 61471, 61481, 61482, 61483, 62271, 63750, 63765, 63770, 6458, 67326, 67839, 67920, 7430, 8334, 8895, 9271, 72953, 72952, 68067, 60867, 60866, 46697, 46116, 46115, 46114, 46113, 46112, 46111, 46110, 46109, 46108, 46107, 46106, 44391, 43676, 39895, 32814, 30556, 30555, 30552, 30551, 30549, 30548, 30547, 30349, 30348, 30347, 30344, 30341, 30337, 30334, 30332, 30329, 30325, 30318, 30317, 30316, 30315, 30314, 30313, 28327, 26443, 26442, 26428, 26427, 26426, 26425, 26424, 26423, 26422, 26421, 26420, 26418, 26417, 26416, 24357, 24356, 23507, 23129, 23096, 23082, 23081, 23080, 23079, 23078, 23077, 23069, 23068, 23067, 23066, 22797, 22795, 22793, 21940, 19833, 19831, 19830, 19819, 19815, 19814, 19799, 19796, 19793, 15633, 15628, 12624, 12620, 12617, 12616, 12614, 12607, 12597, 12587, 9273, 9269, 8339, 8243, 3979, 3972, 3971, 3969, 3968, 3966, 3960, 3959, 3957, 3954, 3952, 3944, 3940, 3939, 3933, 3928, 12716, 13240, 23486, 23489, 26011, 55252, 22704} local INSCRIPTION = {45363, 45376, 45377, 45378, 45379, 45380, 48121, 48247, 48248, 50598, 50599, 50600, 50601, 50602, 50603, 50604, 50605, 50606, 50607, 50608, 50609, 50610, 50611, 50612, 50614, 50616, 50617, 50618, 50619, 50620, 52739, 52840, 52843, 53462, 56943, 56945, 56948, 56951, 56952, 56953, 56955, 56956, 56957, 56959, 56961, 56963, 56968, 56971, 56972, 56973, 56974, 56976, 56978, 56979, 56980, 56981, 56982, 56984, 56985, 56987, 56991, 56994, 56995, 56997, 57000, 57001, 57002, 57003, 57004, 57005, 57006, 57007, 57008, 57009, 57020, 57022, 57023, 57024, 57025, 57026, 57027, 57029, 57030, 57031, 57032, 57033, 57036, 57113, 57114, 57119, 57120, 57121, 57122, 57123, 57125, 57129, 57131, 57132, 57133, 57151, 57154, 57156, 57157, 57158, 57161, 57162, 57163, 57165, 57167, 57168, 57172, 57183, 57184, 57185, 57186, 57187, 57188, 57192, 57194, 57196, 57197, 57198, 57200, 57201, 57210, 57213, 57216, 57219, 57221, 57222, 57224, 57225, 57226, 57227, 57236, 57238, 57239, 57240, 57241, 57242, 57244, 57245, 57246, 57248, 57249, 57251, 57252, 57257, 57259, 57262, 57265, 57266, 57269, 57270, 57271, 57272, 57274, 57275, 57277, 57703, 57704, 57706, 57707, 57708, 57709, 57710, 57711, 57712, 57713, 57714, 57715, 57716, 58472, 58473, 58476, 58478, 58480, 58481, 58482, 58483, 58484, 58485, 58486, 58487, 58488, 58489, 58490, 58491, 58565, 59338, 59339, 59340, 59387, 59475, 59478, 59480, 59484, 59486, 59487, 59488, 59489, 59490, 59491, 59493, 59494, 59495, 59496, 59497, 59498, 59499, 59500, 59501, 59502, 59503, 59504, 60336, 60337, 61117, 61118, 61119, 61120, 61177, 61288, 62162, 64053, 64258, 64259, 64260, 64261, 64262, 64266, 64267, 67600, 69385, 56944, 56946, 56947, 56949, 56950, 56954, 56958, 56960, 56965, 56975, 56977, 56980, 56983, 56986, 56987, 56988, 56989, 56990, 56996, 56998, 56999, 57006, 57010, 57011, 57012, 57013, 57014, 57019, 57021, 57028, 57034, 57035, 57036, 57112, 57115, 57116, 57117, 57124, 57126, 57127, 57128, 57130, 57152, 57153, 57155, 57159, 57160, 57164, 57166, 57169, 57170, 57181, 57189, 57190, 57191, 57193, 57195, 57198, 57199, 57202, 57207, 57208, 57209, 57211, 57212, 57214, 57215, 57217, 57218, 57220, 57223, 57225, 57228, 57229, 57230, 57232, 57233, 57234, 57235, 57237, 57243, 57247, 57248, 57250, 57253, 57258, 57260, 57261, 57263, 57264, 57267, 57268, 57273, 57276, 57719, 58286, 58287, 58288, 58289, 58296, 58297, 58298, 58299, 58300, 58301, 58302, 58303, 58305, 58306, 58307, 58308, 58310, 58311, 58312, 58313, 58314, 58315, 58316, 58317, 58318, 58319, 58320, 58321, 58322, 58323, 58324, 58325, 58326, 58327, 58328, 58329, 58330, 58331, 58332, 58333, 58336, 58337, 58338, 58339, 58340, 58341, 58342, 58343, 58344, 58345, 58346, 58347, 59315, 59326, 59559, 59560, 59561, 61677, 68166, 64051, 71101, 71015, 71102, 64246, 64247, 64248, 64249, 64250, 64251, 64252, 64253, 64254, 64255, 64256, 64257, 64268, 64270, 64271, 64273, 64274, 64275, 64276, 64277, 64278, 64279, 64280, 64281, 64282, 64283, 64284, 64285, 64286, 64287, 64288, 64289, 64291, 64294, 64295, 64296, 64297, 64298, 64299, 64300, 64302, 64303, 64304, 64305, 64307, 64308, 64309, 64310, 64311, 64312, 64313, 64314, 64315, 64316, 64317, 64318, 65245, } local JEWEL = {51311, 25246, 25278, 25280, 25283, 25284, 25287, 25305, 25317, 25318, 25321, 25490, 25498, 25613, 25615, 25620, 25621, 26872, 26874, 26876, 26880, 26883, 26885, 26902, 26903, 26907, 26908, 26911, 26916, 26926, 26927, 26928, 28896, 28899, 28901, 28903, 28905, 28910, 28914, 28916, 28917, 28925, 28936, 28938, 28948, 28950, 28953, 31048, 31049, 31050, 31051, 31052, 31252, 32178, 32179, 32801, 32807, 32808, 32809, 34069, 34590, 34955, 34959, 34960, 34961, 36523, 36524, 36525, 36526, 37818, 38068, 38175, 40514, 41414, 41415, 41418, 41420, 41429, 47280, 51310, 53831, 53832, 53834, 53835, 53843, 53844, 53845, 53852, 53853, 53854, 53855, 53856, 53859, 53860, 53861, 53862, 53863, 53864, 53866, 53867, 53868, 53870, 53871, 53872, 53873, 53874, 53876, 53878, 53880, 53881, 53882, 53883, 53886, 53887, 53889, 53890, 53891, 53892, 53893, 53894, 53916, 53918, 53920, 53922, 53923, 53925, 53926, 53927, 53928, 53930, 53931, 53934, 53940, 53941, 53947, 53953, 53956, 53969, 53989, 54007, 54017, 55386, 55394, 55399, 55402, 56193, 56194, 56195, 56196, 56197, 56199, 56201, 56202, 56203, 56205, 56206, 56208, 56530, 56531, 58141, 58142, 58143, 58144, 58145, 58146, 59759, 62242, 62941, 63743, 64725, 64726, 64727, 64728, 25320, 25323, 25339, 25610, 25612, 25617, 25618, 25619, 25622, 26873, 26875, 26878, 26881, 26882, 26887, 26896, 26897, 26900, 26906, 26909, 26910, 26912, 26914, 26915, 28903, 28905, 28906, 28907, 28910, 28912, 28914, 28915, 28916, 28917, 28918, 28924, 28925, 28927, 28933, 28936, 28938, 28944, 28947, 28948, 28950, 28953, 28955, 28957, 31053, 31054, 31055, 31056, 31057, 31058, 31060, 31061, 31062, 31063, 31064, 31065, 31066, 31067, 31068, 31070, 31071, 31072, 31076, 31077, 31078, 31079, 31080, 31081, 31082, 31083, 31084, 31085, 31087, 31088, 31089, 31090, 31091, 31092, 31094, 31095, 31096, 31097, 31098, 31099, 31100, 31101, 31102, 31103, 31104, 31105, 31106, 31107, 31108, 31109, 31110, 31111, 31112, 31113, 31149, 32866, 32867, 32868, 32869, 32870, 32871, 32872, 32873, 32874, 34069, 34590, 37855, 38503, 38504, 39451, 39452, 39455, 39458, 39462, 39463, 39466, 39467, 39470, 39471, 39705, 39706, 39710, 39711, 39712, 39713, 39714, 39715, 39716, 39717, 39718, 39719, 39720, 39721, 39722, 39723, 39724, 39725, 39727, 39728, 39729, 39730, 39731, 39732, 39733, 39734, 39735, 39736, 39737, 39738, 39739, 39740, 39741, 39742, 39961, 39963, 42558, 42588, 42589, 42590, 42591, 42592, 42593, 43493, 44794, 46122, 46123, 46124, 46125, 46126, 46127, 46403, 46404, 46405, 46597, 46601, 46775, 46776, 46777, 46778, 46779, 46803, 47053, 47054, 47055, 47056, 48789, 53830, 53857, 53865, 53869, 53875, 53877, 53879, 53884, 53885, 53888, 53917, 53919, 53921, 53924, 53929, 53932, 53933, 53943, 53945, 53946, 53948, 53949, 53950, 53951, 53952, 53954, 53955, 53957, 53958, 53959, 53960, 53961, 53962, 53963, 53964, 53965, 53966, 53967, 53968, 53970, 53971, 53972, 53973, 53974, 53975, 53976, 53977, 53978, 53979, 53980, 53981, 53982, 53983, 53984, 53985, 53986, 53987, 53988, 53990, 53991, 53992, 53993, 53994, 53995, 53996, 53997, 53998, 54000, 54001, 54002, 54003, 54004, 54005, 54006, 54008, 54009, 54010, 54011, 54012, 54013, 54014, 54019, 54023, 55384, 55387, 55388, 55389, 55390, 55392, 55393, 55395, 55396, 55397, 55398, 55400, 55401, 55403, 55404, 55405, 55407, 56049, 56052, 56053, 56054, 56055, 56056, 56074, 56076, 56077, 56079, 56081, 56083, 56084, 56085, 56086, 56087, 56088, 56089, 56496, 56497, 56498, 56499, 56500, 56501, 58147, 58148, 58149, 58150, 58492, 58507, 58954, 66338, 66428, 66429, 66430, 66431, 66432, 66433, 66434, 66435, 66436, 66437, 66438, 66439, 66440, 66441, 66442, 66443, 66444, 66445, 66446, 66447, 66448, 66449, 66450, 66451, 66452, 66453, 66497, 66498, 66499, 66500, 66501, 66502, 66503, 66504, 66505, 66506, 66553, 66554, 66555, 66556, 66557, 66558, 66559, 66560, 66561, 66562, 66563, 66564, 66565, 66566, 66567, 66568, 66569, 66570, 66571, 66572, 66573, 66574, 66575, 66576, 66577, 66578, 66579, 66580, 66581, 66582, 66583, 66584, 66585, 66586, 66587, 68253} local LEATHER = {51302, 10660, 10658, 10656,10482, 10487, 10499, 10507, 10511, 10518, 10548, 10552, 10556, 10558, 10619, 10621, 10630, 10632, 10647, 10650, 10663, 14930, 14932, 19047, 19052, 19055, 19058, 19065, 19071, 19072, 19082, 19083, 19091, 19092, 19098, 19102, 19103, 20648, 20649, 20650, 2153, 2154, 2159, 2160, 2161, 2162, 2165, 2166, 2167, 2168, 22331, 24654, 24655, 32454, 32455, 32456, 32462, 32463, 32464, 32465, 32466, 32467, 32468, 32469, 32470, 32471, 32472, 32473, 32478, 32479, 32480, 32481, 32550, 35540, 35575, 35576, 35577, 35580, 35582, 35584, 35585, 35587, 35588, 35589, 35590, 35591, 36074, 36075, 36076, 36077, 36078, 36079, 3753, 3756, 3759, 3760, 3761, 3763, 3764, 3766, 3768, 3770, 3774, 3776, 3780, 3812, 3816, 3817, 3818, 44343, 44344, 44770, 44970, 45100, 50936, 50938, 50939, 50940, 50941, 50942, 50943, 50944, 50945, 50946, 50947, 50948, 50949, 50950, 50951, 50952, 50953, 50954, 50955, 50956, 50957, 50958, 50959, 50960, 50961, 50962, 50963, 50964, 50965, 50966, 50967, 51301, 51568, 51569, 51570, 51571, 51572, 55199, 57683, 57690, 57691, 60583, 60584, 60599, 60600, 60601, 60604, 60605, 60607, 60608, 60611, 60613, 60620, 60622, 60624, 60627, 60629, 60630, 60631, 60637, 60640, 60643, 60649, 60651, 60652, 60655, 60658, 60660, 60665, 60666, 60669, 60671, 62448, 64661, 6661, 69386, 69388, 7135, 7147, 7151, 7156, 9060, 9062, 9065, 9068, 9074, 9145, 9193, 9194, 9196, 9198, 9201, 9206, 10490, 10509, 10516, 10520, 10525, 10529, 10531, 10533, 10542, 10544, 10546, 10554, 10560, 10562, 10564, 10566, 10568, 10570, 10572, 10574, 19048, 19049, 19050, 19051, 19052, 19053, 19054, 19055, 19059, 19060, 19061, 19062, 19063, 19064, 19065, 19066, 19067, 19068, 19070, 19071, 19072, 19073, 19074, 19075, 19076, 19077, 19078, 19079, 19080, 19081, 19082, 19083, 19084, 19085, 19086, 19087, 19088, 19089, 19090, 19091, 19092, 19094, 19095, 19097, 19098, 19100, 19101, 19102, 19103, 19104, 19106, 19107, 20853, 20854, 20855, 2158, 2163, 2164, 2169, 21943, 22711, 22727, 22921, 22922, 22923, 22926, 22927, 22928, 23190, 23399, 23703, 23704, 23705, 23706, 23707, 23708, 23709, 23710, 24121, 24122, 24123, 24124, 24125, 24703, 24846, 24847, 24848, 24849, 24850, 24851, 24940, 26279, 28472, 28473, 28474, 32455, 32457, 32458, 32461, 32482, 32485, 32487, 32488, 32489, 32490, 32493, 32494, 32495, 32496, 32497, 32498, 32499, 32500, 32501, 32502, 32503, 35520, 35521, 35522, 35523, 35524, 35525, 35526, 35527, 35528, 35529, 35530, 35531, 35532, 35533, 35534, 35535, 35536, 35537, 35538, 35539, 35543, 35544, 35549, 35554, 35555, 35557, 35558, 35559, 35560, 35561, 35562, 35563, 35564, 35567, 35568, 35572, 35573, 35574, 36349, 36351, 36352, 36353, 36355, 36357, 36358, 36359, 3762, 3765, 3767, 3769, 3771, 3772, 3773, 3775, 3777, 3778, 3779, 39997, 40001, 40002, 40003, 40004, 40005, 40006, 4096, 4097, 41156, 41157, 41158, 41160, 41161, 41162, 41163, 41164, 42546, 42731, 44359, 44768, 44953, 45117, 46132, 46133, 46134, 46135, 46136, 46137, 46138, 46139, 50970, 50971, 51568, 5244, 52733, 57692, 57694, 57696, 57699, 57701, 60645, 60647, 60697, 60702, 60703, 60704, 60705, 60706, 60711, 60712, 60715, 60716, 60718, 60720, 60721, 60723, 60725, 60727, 60728, 60729, 60730, 60731, 60732, 60734, 60735, 60737, 60743, 60746, 60747, 60748, 60749, 60750, 60751, 60752, 60754, 60755, 60756, 60757, 60758, 60759, 60760, 60761, 60996, 60997, 60998, 60999, 61000, 61002, 62176, 62177, 63194, 63195, 63196, 63197, 63198, 63199, 63200, 63201, 6702, 6703, 6704, 6705, 67080, 67081, 67082, 67083, 67084, 67085, 67086, 67087, 67136, 67137, 67138, 67139, 67140, 67141, 67142, 67143, 70554, 70555, 70556, 70557, 70558, 70559, 70560, 70561, 7133, 7149, 7153, 7953, 7954, 7955, 8322, 9064, 9070, 9072, 9146, 9147, 9148, 9149, 9195, 9197, 9202, 9207, 9208, 28219, 28220, 28221, 28223, 28222, 28224, 19093, 22815} local COOK = {51296, 18261, 21175, 2539, 2541, 2544, 2546, 2795, 3412, 37836, 4094, 42296, 42302, 42305, 45549, 45550, 45551, 45552, 45553, 45554, 45560, 45561, 45562, 45563, 45564, 45565, 45566, 45569, 51295, 54256, 54257, 58065, 64358, 6499, 6500, 15853, 15855, 15856, 15861, 15863, 15865, 15906, 15910, 15915, 15933, 15935, 18238, 18239, 18240, 18241, 18242, 18243, 18244, 18245, 18246, 18247, 20626, 20916, 21143, 21144, 22480, 22761, 24418, 2542, 2543, 2545, 2547, 2548, 2549, 25659, 25704, 25954, 2795, 28267, 33276, 33277, 33278, 33279, 33284, 33285, 33286, 33287, 33288, 33289, 33290, 33291, 33292, 33293, 33294, 33295, 33296, 3370, 3371, 3372, 3373, 3376, 3377, 3397, 3398, 3399, 3400, 36210, 38867, 38868, 4094, 43707, 43758, 43761, 43765, 43772, 43779, 45022, 45555, 45556, 45557, 45558, 45559, 45567, 45568, 45570, 45571, 45695, 46684, 46688, 53056, 57423, 57433, 57434, 57435, 57436, 57437, 57438, 57439, 57440, 57441, 57442, 57443, 58512, 58521, 58523, 58525, 58527, 58528, 62044, 62045, 62049, 62050, 62051, 62350, 6412, 6413, 6414, 6415, 6416, 6417, 6418, 6419, 6501, 65454, 66034, 66035, 66036, 66037, 66038, 7213, 7751, 7752, 7753, 7754, 7755, 7827, 7828, 8238, 8607, 9513, 13028, 64054, 24801, 57421} local AID = {45542, 10840, 10841, 10847, 18629, 18630, 27032, 27033, 3276, 3277, 3278, 3280, 45545, 50299, 54254, 54255, 7928, 7929, 7934, 7935, 23787, 45546} local FISH = {51294, 43308} local function Elunaload(event) local worldSQL = [[ CREATE TABLE IF NOT EXISTS `profession_max` (`guid` int(11) unsigned NOT NULL, `alchemy` int(11) NOT NULL DEFAULT 0, `mining` int(11) NOT NULL DEFAULT 0, `blacksmithing` int(11) NOT NULL DEFAULT 0, `tailoring` int(11) NOT NULL DEFAULT 0, `engineering` int(11) NOT NULL DEFAULT 0, `enchanting` int(11) NOT NULL DEFAULT 0, `inscription` int(11) NOT NULL DEFAULT 0, `jewelcrafting` int(11) NOT NULL DEFAULT 0, `leatherworking` int(11) NOT NULL DEFAULT 0, `cooking` int(11) NOT NULL DEFAULT 0, `firstaid` int(11) NOT NULL DEFAULT 0, `fishing` int(11) NOT NULL DEFAULT 0) ENGINE=InnoDB DEFAULT CHARSET=utf8;]] WorldDBQuery(worldSQL) end local function SKULY2(eventid, delay, repeats, player) if not GMonly then player:SendBroadcastMessage("|cff3399FF You can access Professions menu by typing |cff00cc00 .menu |cff3399FF in chat.") end end local firstlogin = false local function OnFirstLogin(event, player) if event == 30 then firstlogin = true end player:RegisterEvent(SKULY2, 10000, 1, player) end local function OnLogin(event, player) if not firstlogin then player:RegisterEvent(SKULY2, 10000, 1, player) else firstlogin = false end end local function getPlayerCharacterGUID(player) query = CharDBQuery(string.format("SELECT guid FROM characters WHERE name='%s'", player:GetName())) if query then local row = query:GetRow() return tonumber(row["guid"]) end return nil end local function Hello(event, player) player:GossipClearMenu() local query = WorldDBQuery(string.format("SELECT guid FROM profession_max WHERE guid=%i", getPlayerCharacterGUID(player))) local mingmrank = 3 if not query then WorldDBExecute(string.format("INSERT INTO profession_max (guid) VALUES (%i)", getPlayerCharacterGUID(player))) end player:GossipMenuAddItem(0, "Crafting", 0, 90) player:GossipMenuAddItem(0, "Gathering", 0, 80) player:GossipMenuAddItem(0, "Secondary", 0, 70) player:GossipMenuAddItem(0, "[Exit Menu]", 0, 99) player:GossipSendMenu(1, player, 10001) player:GossipSendMenu(1, player, 10001) end local function OnSelect(event, player, _, sender, intid, code) player:GossipClearMenu() local queryalchemy = WorldDBQuery(string.format("SELECT * FROM profession_max WHERE guid=%i AND alchemy=1", getPlayerCharacterGUID(player))) local queryblacksmithing = WorldDBQuery(string.format("SELECT * FROM profession_max WHERE guid=%i AND blacksmithing=1", getPlayerCharacterGUID(player))) local querytailoring = WorldDBQuery(string.format("SELECT * FROM profession_max WHERE guid=%i AND tailoring=1", getPlayerCharacterGUID(player))) local queryengineering = WorldDBQuery(string.format("SELECT * FROM profession_max WHERE guid=%i AND engineering=1", getPlayerCharacterGUID(player))) local queryenchanting = WorldDBQuery(string.format("SELECT * FROM profession_max WHERE guid=%i AND enchanting=1", getPlayerCharacterGUID(player))) local queryinscription = WorldDBQuery(string.format("SELECT * FROM profession_max WHERE guid=%i AND inscription=1", getPlayerCharacterGUID(player))) local queryjewelcrafting = WorldDBQuery(string.format("SELECT * FROM profession_max WHERE guid=%i AND jewelcrafting=1", getPlayerCharacterGUID(player))) local queryleatherworking = WorldDBQuery(string.format("SELECT * FROM profession_max WHERE guid=%i AND leatherworking=1", getPlayerCharacterGUID(player))) local querymining = WorldDBQuery(string.format("SELECT * FROM profession_max WHERE guid=%i AND mining=1", getPlayerCharacterGUID(player))) local querycooking = WorldDBQuery(string.format("SELECT * FROM profession_max WHERE guid=%i AND cooking=1", getPlayerCharacterGUID(player))) local queryfirstaid = WorldDBQuery(string.format("SELECT * FROM profession_max WHERE guid=%i AND firstaid=1", getPlayerCharacterGUID(player))) local queryfishing = WorldDBQuery(string.format("SELECT * FROM profession_max WHERE guid=%i AND fishing=1", getPlayerCharacterGUID(player))) local skinval = player:GetSkillValue( 393 ) local herbval = player:GetSkillValue( 182 ) local x = player:GetX() local y = player:GetY() local z = player:GetZ() local o = player:GetO() local level = player:GetLevel() local currentgold = player:GetCoinage() local mingmrank = 3 local class = player:GetClass() local gold = 10000 if(intid == 70) then if not querycooking then player:GossipMenuAddItem(0, "Cooking", 0, 12) end if not queryfirstaid then player:GossipMenuAddItem(0, "First aid", 0, 13) end if not queryfishing then player:GossipMenuAddItem(0, "Fishing", 0, 14) end player:GossipMenuAddItem(0, "Back", 0, 98) player:GossipSendMenu(1, player, 10001) end if(intid == 90) then if not queryalchemy then player:GossipMenuAddItem(0, "Alchemy", 0, 1) end if not queryblacksmithing then player:GossipMenuAddItem(0, "Blacksmithing", 0, 5) end if not queryenchanting then player:GossipMenuAddItem(0, "Enchanting", 0, 6) end if not queryengineering then player:GossipMenuAddItem(0, "Engineering", 0, 7) end if not queryinscription then player:GossipMenuAddItem(0, "Inscription", 0, 9) end if not queryjewelcrafting then player:GossipMenuAddItem(0, "Jewelcrafting", 0, 10) end if not queryleatherworking then player:GossipMenuAddItem(0, "Leatherworking", 0, 11) end if not querytailoring then player:GossipMenuAddItem(0, "Tailoring", 0, 3) end player:GossipMenuAddItem(0, "Back", 0, 98) player:GossipSendMenu(1, player, 10001) end if(intid == 80) then if herbval < 450 then player:GossipMenuAddItem(0, "Herbalism", 0, 8) end if not querymining then player:GossipMenuAddItem(0, "Mining", 0, 2) end if skinval < 450 then player:GossipMenuAddItem(0, "Skining", 0, 4) end player:GossipMenuAddItem(0, "Back", 0, 98) player:GossipSendMenu(1, player, 10001) end if(intid == 1) then for k,v in pairs(ALCH) do player:LearnSpell(v) end player:SetSkill( 171, 0, 450, 450 ) if not queryalchemy then WorldDBExecute(string.format("UPDATE profession_max SET guid = %i, alchemy=1", getPlayerCharacterGUID(player))) end player:GossipComplete() end if(intid == 2) then for k,v in pairs(MINING) do player:LearnSpell(v) end player:SetSkill( 186, 0, 450, 450 ) if not querymining then WorldDBExecute(string.format("UPDATE profession_max SET guid = %i, mining=1", getPlayerCharacterGUID(player))) end player:CastSpell( player, 43979, true ) player:GossipComplete() end if(intid == 3) then for k,v in pairs(TAILOR) do player:LearnSpell(v) end player:SetSkill( 197, 0, 450, 450 ) if not querytailoring then WorldDBExecute(string.format("UPDATE profession_max SET guid = %i, tailoring=1", getPlayerCharacterGUID(player))) end player:GossipComplete() end if(intid == 4) then player:SetSkill( 393, 0, 450, 450 ) if not player:HasSpell(50305) then player:LearnSpell(50305) end player:GossipComplete() end if(intid == 5) then for k,v in pairs(BLACK) do player:LearnSpell(v) end player:SetSkill( 164, 0, 450, 450 ) if not queryblacksmithing then WorldDBExecute(string.format("UPDATE profession_max SET guid = %i, blacksmithing=1", getPlayerCharacterGUID(player))) end player:GossipComplete() end if(intid == 6) then for k,v in pairs(ENCHANT) do player:LearnSpell(v) end player:SetSkill( 333, 0, 450, 450 ) if not queryenchanting then WorldDBExecute(string.format("UPDATE profession_max SET guid = %i, enchanting=1", getPlayerCharacterGUID(player))) end player:GossipComplete() end if(intid == 7) then for k,v in pairs(ENG) do player:LearnSpell(v) end player:SetSkill( 202, 0, 450, 450 ) if not queryengineering then WorldDBExecute(string.format("UPDATE profession_max SET guid = %i, engineering=1", getPlayerCharacterGUID(player))) end player:GossipComplete() end if(intid == 8) then player:SetSkill( 182, 0, 450, 450 ) if not player:HasSpell(50300) then player:LearnSpell(50300) end player:GossipComplete() end if(intid == 9) then for k,v in pairs(INSCRIPTION) do player:LearnSpell(v) end player:SetSkill( 773, 0, 450, 450 ) if not queryinscription then WorldDBExecute(string.format("UPDATE profession_max SET guid = %i, inscription=1", getPlayerCharacterGUID(player))) end player:GossipComplete() end if(intid == 10) then for k,v in pairs(JEWEL) do player:LearnSpell(v) end player:SetSkill( 755, 0, 450, 450 ) if not queryjewelcrafting then WorldDBExecute(string.format("UPDATE profession_max SET guid = %i, jewelcrafting=1", getPlayerCharacterGUID(player))) end player:GossipComplete() end if(intid == 11) then for k,v in pairs(LEATHER) do player:LearnSpell(v) end player:SetSkill( 165, 0, 450, 450 ) if not queryleatherworking then WorldDBExecute(string.format("UPDATE profession_max SET guid = %i, leatherworking=1", getPlayerCharacterGUID(player))) end player:GossipComplete() end if(intid == 12) then for k,v in pairs(COOK) do player:LearnSpell(v) end player:SetSkill( 185, 0, 450, 450 ) if not querycooking then WorldDBExecute(string.format("UPDATE profession_max SET guid = %i, cooking=1", getPlayerCharacterGUID(player))) end player:GossipComplete() end if(intid == 13) then for k,v in pairs(AID) do player:LearnSpell(v) end player:SetSkill( 129, 0, 450, 450 ) if not queryfirstaid then WorldDBExecute(string.format("UPDATE profession_max SET guid = %i, firstaid=1", getPlayerCharacterGUID(player))) end player:GossipComplete() end if(intid == 14) then for k,v in pairs(FISH) do player:LearnSpell(v) end player:SetSkill( 356, 0, 450, 450 ) if not queryfishing then WorldDBExecute(string.format("UPDATE profession_max SET guid = %i, fishing=1", getPlayerCharacterGUID(player))) end player:GossipComplete() end if(intid == 98) then Hello(event, player) end if(intid == 99) then player:GossipComplete() end end local function ProfMenu(event, player, message, Type, lang) if (message:lower() == command) then local mingmrank = 3 if (GMonly and player:GetGMRank() < mingmrank) then player:SendBroadcastMessage("|cff5af304Only a GM can use this command.|r") return false else Hello(event, player) return false end end end RegisterServerEvent(33, Elunaload) RegisterPlayerEvent(30, OnFirstLogin) RegisterPlayerEvent(3, OnLogin) RegisterPlayerEvent(42, ProfMenu) RegisterPlayerGossipEvent(10001, 2, OnSelect)