Initial Patch of Auction House bot rev. 135
[auctionmangos.git] / src / bindings / universal / Scripts / sc_defines.cpp
blob67f03a6e2a725699eae281d2f0c2b79bbfe623a6
1 /*
2 * Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #include "sc_defines.h"
21 #include "../../game/Player.h"
23 uint32 GetSkillLevel(Player *player,uint32 trskill)
25 // Returns the level of some tradetrskill known by player
26 // Need to add missing spells
28 uint32 spell_apprentice = 0;
29 uint32 spell_journeyman = 0;
30 uint32 spell_expert = 0;
31 uint32 spell_artisan = 0;
32 uint32 spell_master = 0;
34 switch(trskill)
36 case TRADESKILL_ALCHEMY:
37 spell_apprentice = 2259;
38 spell_journeyman = 3101;
39 spell_expert = 3464;
40 spell_artisan = 11611;
41 spell_master = 28596; // teached by 28597
42 break;
43 case TRADESKILL_BLACKSMITHING:
44 spell_apprentice = 2018;
45 spell_journeyman = 3100;
46 spell_expert = 8768;
47 spell_artisan = 11454;
48 spell_master = 29844; // teached by 29845
49 break;
50 case TRADESKILL_COOKING:
51 spell_apprentice = 2550;
52 spell_journeyman = 3102;
53 spell_expert = 3413;
54 spell_artisan = 18260;
55 spell_master = 33359; // teached by 33361
56 break;
57 case TRADESKILL_ENCHANTING:
58 spell_apprentice = 7411;
59 spell_journeyman = 7412;
60 spell_expert = 7413;
61 spell_artisan = 13920;
62 spell_master = 28029; // teached by 28030
63 break;
64 case TRADESKILL_ENGINEERING:
65 spell_apprentice = 4036;
66 spell_journeyman = 4037;
67 spell_expert = 4038;
68 spell_artisan = 12656;
69 spell_master = 30350; // teached by 30351
70 break;
71 case TRADESKILL_FIRSTAID:
72 spell_apprentice = 3273;
73 spell_journeyman = 3274;
74 spell_expert = 7924;
75 spell_artisan = 10846;
76 spell_master = 27028; // teached by 27029
77 break;
78 case TRADESKILL_HERBALISM:
79 spell_apprentice = 2372;
80 spell_journeyman = 2373;
81 spell_expert = 3571;
82 spell_artisan = 11994;
83 spell_master = 0;
84 break;
85 case TRADESKILL_LEATHERWORKING:
86 spell_apprentice = 2108;
87 spell_journeyman = 3104;
88 spell_expert = 20649;
89 spell_artisan = 10662;
90 spell_master = 32549; // teached by 32550
91 break;
92 case TRADESKILL_POISONS:
93 spell_apprentice = 0;
94 spell_journeyman = 0;
95 spell_expert = 0;
96 spell_artisan = 0;
97 spell_master = 0;
98 break;
99 case TRADESKILL_TAILORING:
100 spell_apprentice = 3908;
101 spell_journeyman = 3909;
102 spell_expert = 3910;
103 spell_artisan = 12180;
104 spell_master = 26790; // teached by 26791
105 break;
106 case TRADESKILL_MINING:
107 spell_apprentice = 2581;
108 spell_journeyman = 2582;
109 spell_expert = 3568;
110 spell_artisan = 10249;
111 spell_master = 29354; // teached by 29355
112 break;
113 case TRADESKILL_FISHING:
114 spell_apprentice = 7733;
115 spell_journeyman = 7734;
116 spell_expert = 7736;
117 spell_artisan = 18249;
118 spell_master = 33098; // teached by 33100
119 break;
120 case TRADESKILL_SKINNING:
121 spell_apprentice = 8615;
122 spell_journeyman = 8619;
123 spell_expert = 8620;
124 spell_artisan = 10769;
125 spell_master = 32679; // teached by 32678
126 break;
127 case TRADESKILL_JEWELCRAFTING:
128 spell_apprentice = 25229; // teached by 25245
129 spell_journeyman = 25230; // teached by 25246
130 spell_expert = 28894; // teached by 28896
131 spell_artisan = 28895; // teached by 28899
132 spell_master = 28897; // teached by 28901
133 break;
136 if (player->HasSpell(spell_master))
137 return TRADESKILL_LEVEL_MASTER;
139 if (player->HasSpell(spell_artisan))
140 return TRADESKILL_LEVEL_ARTISAN;
142 if (player->HasSpell(spell_expert))
143 return TRADESKILL_LEVEL_EXPERT;
145 if (player->HasSpell(spell_journeyman))
146 return TRADESKILL_LEVEL_JOURNEYMAN;
148 if (player->HasSpell(spell_apprentice))
149 return TRADESKILL_LEVEL_APPRENTICE;
151 return TRADESKILL_LEVEL_NONE;