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;
36 case TRADESKILL_ALCHEMY
:
37 spell_apprentice
= 2259;
38 spell_journeyman
= 3101;
40 spell_artisan
= 11611;
41 spell_master
= 28596; // teached by 28597
43 case TRADESKILL_BLACKSMITHING
:
44 spell_apprentice
= 2018;
45 spell_journeyman
= 3100;
47 spell_artisan
= 11454;
48 spell_master
= 29844; // teached by 29845
50 case TRADESKILL_COOKING
:
51 spell_apprentice
= 2550;
52 spell_journeyman
= 3102;
54 spell_artisan
= 18260;
55 spell_master
= 33359; // teached by 33361
57 case TRADESKILL_ENCHANTING
:
58 spell_apprentice
= 7411;
59 spell_journeyman
= 7412;
61 spell_artisan
= 13920;
62 spell_master
= 28029; // teached by 28030
64 case TRADESKILL_ENGINEERING
:
65 spell_apprentice
= 4036;
66 spell_journeyman
= 4037;
68 spell_artisan
= 12656;
69 spell_master
= 30350; // teached by 30351
71 case TRADESKILL_FIRSTAID
:
72 spell_apprentice
= 3273;
73 spell_journeyman
= 3274;
75 spell_artisan
= 10846;
76 spell_master
= 27028; // teached by 27029
78 case TRADESKILL_HERBALISM
:
79 spell_apprentice
= 2372;
80 spell_journeyman
= 2373;
82 spell_artisan
= 11994;
85 case TRADESKILL_LEATHERWORKING
:
86 spell_apprentice
= 2108;
87 spell_journeyman
= 3104;
89 spell_artisan
= 10662;
90 spell_master
= 32549; // teached by 32550
92 case TRADESKILL_POISONS
:
99 case TRADESKILL_TAILORING
:
100 spell_apprentice
= 3908;
101 spell_journeyman
= 3909;
103 spell_artisan
= 12180;
104 spell_master
= 26790; // teached by 26791
106 case TRADESKILL_MINING
:
107 spell_apprentice
= 2581;
108 spell_journeyman
= 2582;
110 spell_artisan
= 10249;
111 spell_master
= 29354; // teached by 29355
113 case TRADESKILL_FISHING
:
114 spell_apprentice
= 7733;
115 spell_journeyman
= 7734;
117 spell_artisan
= 18249;
118 spell_master
= 33098; // teached by 33100
120 case TRADESKILL_SKINNING
:
121 spell_apprentice
= 8615;
122 spell_journeyman
= 8619;
124 spell_artisan
= 10769;
125 spell_master
= 32679; // teached by 32678
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
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
;