root/trunk/src/bindings/interface/Scripts/sc_defines.cpp

Revision 44, 5.3 kB (checked in by yumileroy, 17 years ago)

[svn] * Merge Temp dev SVN with Assembla.
* Changes include:

  • Implementation of w12x's Outdoor PvP and Game Event Systems.
  • Temporary removal of IRC Chat Bot (until infinite loop when disabled is fixed).
  • All mangos -> trinity (to convert your mangos_string table, please run mangos_string_to_trinity_string.sql).
  • Improved Config cleanup.
  • And many more changes.

Original author: Seline
Date: 2008-10-14 11:57:03-05:00

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