TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
npc_professions.cpp File Reference
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "Player.h"
#include "SpellInfo.h"
#include "WorldSession.h"
+ Include dependency graph for npc_professions.cpp:

Classes

class  npc_prof_alchemy
 
class  npc_prof_blacksmith
 
class  npc_engineering_tele_trinket
 
class  npc_prof_leather
 
class  npc_prof_tailor
 

Macros

#define TALK_MUST_UNLEARN_WEAPON   "You must forget your weapon type specialty before I can help you. Go to Everlook in Winterspring and seek help there."
 
#define TALK_HAMMER_LEARN   "Ah, a seasoned veteran you once were. I know you are capable, you merely need to ask and I shall teach you the way of the hammersmith."
 
#define TALK_AXE_LEARN   "Ah, a seasoned veteran you once were. I know you are capable, you merely need to ask and I shall teach you the way of the axesmith."
 
#define TALK_SWORD_LEARN   "Ah, a seasoned veteran you once were. I know you are capable, you merely need to ask and I shall teach you the way of the swordsmith."
 
#define TALK_HAMMER_UNLEARN   "Forgetting your Hammersmithing skill is not something to do lightly. If you choose to abandon it you will forget all recipes that require Hammersmithing to create!"
 
#define TALK_AXE_UNLEARN   "Forgetting your Axesmithing skill is not something to do lightly. If you choose to abandon it you will forget all recipes that require Axesmithing to create!"
 
#define TALK_SWORD_UNLEARN   "Forgetting your Swordsmithing skill is not something to do lightly. If you choose to abandon it you will forget all recipes that require Swordsmithing to create!"
 
#define GOSSIP_SENDER_LEARN   50
 
#define GOSSIP_SENDER_UNLEARN   51
 
#define GOSSIP_SENDER_CHECK   52
 
#define GOSSIP_LEARN_POTION   "Please teach me how to become a Master of Potions, Lauranna"
 
#define GOSSIP_UNLEARN_POTION   "I wish to unlearn Potion Mastery"
 
#define GOSSIP_LEARN_TRANSMUTE   "Please teach me how to become a Master of Transmutations, Zarevhi"
 
#define GOSSIP_UNLEARN_TRANSMUTE   "I wish to unlearn Transmutation Mastery"
 
#define GOSSIP_LEARN_ELIXIR   "Please teach me how to become a Master of Elixirs, Lorokeem"
 
#define GOSSIP_UNLEARN_ELIXIR   "I wish to unlearn Elixir Mastery"
 
#define BOX_UNLEARN_ALCHEMY_SPEC   "Do you really want to unlearn your alchemy specialty and lose all associated recipes? \n Cost: "
 
#define GOSSIP_WEAPON_LEARN   "Please teach me how to become a Weaponsmith"
 
#define GOSSIP_WEAPON_UNLEARN   "I wish to unlearn the art of Weaponsmithing"
 
#define GOSSIP_ARMOR_LEARN   "Please teach me how to become a Armorsmith"
 
#define GOSSIP_ARMOR_UNLEARN   "I wish to unlearn the art of Armorsmithing"
 
#define GOSSIP_UNLEARN_SMITH_SPEC   "I wish to unlearn my blacksmith specialty"
 
#define BOX_UNLEARN_ARMORORWEAPON   "Do you really want to unlearn your blacksmith specialty and lose all associated recipes? \n Cost: "
 
#define GOSSIP_LEARN_HAMMER   "Please teach me how to become a Hammersmith, Lilith"
 
#define GOSSIP_UNLEARN_HAMMER   "I wish to unlearn Hammersmithing"
 
#define GOSSIP_LEARN_AXE   "Please teach me how to become a Axesmith, Kilram"
 
#define GOSSIP_UNLEARN_AXE   "I wish to unlearn Axesmithing"
 
#define GOSSIP_LEARN_SWORD   "Please teach me how to become a Swordsmith, Seril"
 
#define GOSSIP_UNLEARN_SWORD   "I wish to unlearn Swordsmithing"
 
#define BOX_UNLEARN_WEAPON_SPEC   "Do you really want to unlearn your weaponsmith specialty and lose all associated recipes? \n Cost: "
 
#define GOSSIP_UNLEARN_DRAGON   "I wish to unlearn Dragonscale Leatherworking"
 
#define GOSSIP_UNLEARN_ELEMENTAL   "I wish to unlearn Elemental Leatherworking"
 
#define GOSSIP_UNLEARN_TRIBAL   "I wish to unlearn Tribal Leatherworking"
 
#define BOX_UNLEARN_LEATHER_SPEC   "Do you really want to unlearn your leatherworking specialty and lose all associated recipes? \n Cost: "
 
#define GOSSIP_LEARN_SPELLFIRE   "Please teach me how to become a Spellcloth tailor"
 
#define GOSSIP_UNLEARN_SPELLFIRE   "I wish to unlearn Spellfire Tailoring"
 
#define GOSSIP_LEARN_MOONCLOTH   "Please teach me how to become a Mooncloth tailor"
 
#define GOSSIP_UNLEARN_MOONCLOTH   "I wish to unlearn Mooncloth Tailoring"
 
#define GOSSIP_LEARN_SHADOWEAVE   "Please teach me how to become a Shadoweave tailor"
 
#define GOSSIP_UNLEARN_SHADOWEAVE   "I wish to unlearn Shadoweave Tailoring"
 
#define BOX_UNLEARN_TAILOR_SPEC   "Do you really want to unlearn your tailoring specialty and lose all associated recipes? \n Cost: "
 
#define GOSSIP_ITEM_ZAP   "This Dimensional Imploder sounds dangerous! How can I make one?"
 
#define GOSSIP_ITEM_JHORDY   "I must build a beacon for this marvelous device!"
 
#define GOSSIP_ITEM_KABLAM   "[PH] Unknown"
 

Enumerations

enum  ProfessionSpells {
  S_WEAPON = 9787, S_ARMOR = 9788, S_HAMMER = 17040, S_AXE = 17041,
  S_SWORD = 17039, S_LEARN_WEAPON = 9789, S_LEARN_ARMOR = 9790, S_LEARN_HAMMER = 39099,
  S_LEARN_AXE = 39098, S_LEARN_SWORD = 39097, S_UNLEARN_WEAPON = 36436, S_UNLEARN_ARMOR = 36435,
  S_UNLEARN_HAMMER = 36441, S_UNLEARN_AXE = 36439, S_UNLEARN_SWORD = 36438, S_REP_ARMOR = 17451,
  S_REP_WEAPON = 17452, REP_ARMOR = 46, REP_WEAPON = 289, REP_HAMMER = 569,
  REP_AXE = 570, REP_SWORD = 571, S_DRAGON = 10656, S_ELEMENTAL = 10658,
  S_TRIBAL = 10660, S_LEARN_DRAGON = 10657, S_LEARN_ELEMENTAL = 10659, S_LEARN_TRIBAL = 10661,
  S_UNLEARN_DRAGON = 36434, S_UNLEARN_ELEMENTAL = 36328, S_UNLEARN_TRIBAL = 36433, S_GOBLIN = 20222,
  S_GNOMISH = 20219, S_LEARN_GOBLIN = 20221, S_LEARN_GNOMISH = 20220, S_SPELLFIRE = 26797,
  S_MOONCLOTH = 26798, S_SHADOWEAVE = 26801, S_LEARN_SPELLFIRE = 26796, S_LEARN_MOONCLOTH = 26799,
  S_LEARN_SHADOWEAVE = 26800, S_UNLEARN_SPELLFIRE = 41299, S_UNLEARN_MOONCLOTH = 41558, S_UNLEARN_SHADOWEAVE = 41559,
  S_TRANSMUTE = 28672, S_ELIXIR = 28677, S_POTION = 28675, S_LEARN_TRANSMUTE = 28674,
  S_LEARN_ELIXIR = 28678, S_LEARN_POTION = 28676, S_UNLEARN_TRANSMUTE = 41565, S_UNLEARN_ELIXIR = 41564,
  S_UNLEARN_POTION = 41563
}
 
enum  SpecializationTrainers {
  N_TRAINER_TRANSMUTE = 22427, N_TRAINER_ELIXIR = 19052, N_TRAINER_POTION = 17909, N_TRAINER_SMITHOMNI1 = 11145,
  N_TRAINER_SMITHOMNI2 = 11176, N_TRAINER_WEAPON1 = 11146, N_TRAINER_WEAPON2 = 11178, N_TRAINER_ARMOR1 = 5164,
  N_TRAINER_ARMOR2 = 11177, N_TRAINER_HAMMER = 11191, N_TRAINER_AXE = 11192, N_TRAINER_SWORD = 11193,
  N_TRAINER_DRAGON1 = 7866, N_TRAINER_DRAGON2 = 7867, N_TRAINER_ELEMENTAL1 = 7868, N_TRAINER_ELEMENTAL2 = 7869,
  N_TRAINER_TRIBAL1 = 7870, N_TRAINER_TRIBAL2 = 7871, N_TRAINER_SPELLFIRE = 22213, N_TRAINER_MOONCLOTH = 22208,
  N_TRAINER_SHADOWEAVE = 22212
}
 
enum  SpecializationQuests { Q_MASTER_TRANSMUTE = 10899, Q_MASTER_ELIXIR = 10902, Q_MASTER_POTION = 10897 }
 
enum  EngineeringTrinkets {
  NPC_ZAP = 14742, NPC_JHORDY = 14743, NPC_KABLAM = 21493, NPC_SMILES = 21494,
  SPELL_LEARN_TO_EVERLOOK = 23490, SPELL_LEARN_TO_GADGET = 23491, SPELL_LEARN_TO_AREA52 = 36956, SPELL_LEARN_TO_TOSHLEY = 36957,
  SPELL_TO_EVERLOOK = 23486, SPELL_TO_GADGET = 23489, SPELL_TO_AREA52 = 36954, SPELL_TO_TOSHLEY = 36955
}
 

Functions

int32 DoLearnCost (Player *)
 
int32 DoHighUnlearnCost (Player *)
 
int32 DoMedUnlearnCost (Player *player)
 
int32 DoLowUnlearnCost (Player *player)
 
void ProcessCastaction (Player *player, Creature *creature, uint32 spellId, uint32 triggeredSpellId, int32 cost)
 
bool EquippedOk (Player *player, uint32 spellId)
 
void ProfessionUnlearnSpells (Player *player, uint32 type)
 
void ProcessUnlearnAction (Player *player, Creature *creature, uint32 spellId, uint32 alternativeSpellId, int32 cost)
 
void AddSC_npc_professions ()
 

Macro Definition Documentation

#define BOX_UNLEARN_ALCHEMY_SPEC   "Do you really want to unlearn your alchemy specialty and lose all associated recipes? \n Cost: "
#define BOX_UNLEARN_ARMORORWEAPON   "Do you really want to unlearn your blacksmith specialty and lose all associated recipes? \n Cost: "
#define BOX_UNLEARN_LEATHER_SPEC   "Do you really want to unlearn your leatherworking specialty and lose all associated recipes? \n Cost: "
#define BOX_UNLEARN_TAILOR_SPEC   "Do you really want to unlearn your tailoring specialty and lose all associated recipes? \n Cost: "
#define BOX_UNLEARN_WEAPON_SPEC   "Do you really want to unlearn your weaponsmith specialty and lose all associated recipes? \n Cost: "
#define GOSSIP_ARMOR_LEARN   "Please teach me how to become a Armorsmith"
#define GOSSIP_ARMOR_UNLEARN   "I wish to unlearn the art of Armorsmithing"
#define GOSSIP_ITEM_JHORDY   "I must build a beacon for this marvelous device!"
#define GOSSIP_ITEM_KABLAM   "[PH] Unknown"
#define GOSSIP_ITEM_ZAP   "This Dimensional Imploder sounds dangerous! How can I make one?"
#define GOSSIP_LEARN_AXE   "Please teach me how to become a Axesmith, Kilram"
#define GOSSIP_LEARN_ELIXIR   "Please teach me how to become a Master of Elixirs, Lorokeem"
#define GOSSIP_LEARN_HAMMER   "Please teach me how to become a Hammersmith, Lilith"
#define GOSSIP_LEARN_MOONCLOTH   "Please teach me how to become a Mooncloth tailor"
#define GOSSIP_LEARN_POTION   "Please teach me how to become a Master of Potions, Lauranna"
#define GOSSIP_LEARN_SHADOWEAVE   "Please teach me how to become a Shadoweave tailor"
#define GOSSIP_LEARN_SPELLFIRE   "Please teach me how to become a Spellcloth tailor"
#define GOSSIP_LEARN_SWORD   "Please teach me how to become a Swordsmith, Seril"
#define GOSSIP_LEARN_TRANSMUTE   "Please teach me how to become a Master of Transmutations, Zarevhi"
#define GOSSIP_SENDER_CHECK   52
#define GOSSIP_SENDER_LEARN   50
#define GOSSIP_SENDER_UNLEARN   51
#define GOSSIP_UNLEARN_AXE   "I wish to unlearn Axesmithing"
#define GOSSIP_UNLEARN_DRAGON   "I wish to unlearn Dragonscale Leatherworking"
#define GOSSIP_UNLEARN_ELEMENTAL   "I wish to unlearn Elemental Leatherworking"
#define GOSSIP_UNLEARN_ELIXIR   "I wish to unlearn Elixir Mastery"
#define GOSSIP_UNLEARN_HAMMER   "I wish to unlearn Hammersmithing"
#define GOSSIP_UNLEARN_MOONCLOTH   "I wish to unlearn Mooncloth Tailoring"
#define GOSSIP_UNLEARN_POTION   "I wish to unlearn Potion Mastery"
#define GOSSIP_UNLEARN_SHADOWEAVE   "I wish to unlearn Shadoweave Tailoring"
#define GOSSIP_UNLEARN_SMITH_SPEC   "I wish to unlearn my blacksmith specialty"
#define GOSSIP_UNLEARN_SPELLFIRE   "I wish to unlearn Spellfire Tailoring"
#define GOSSIP_UNLEARN_SWORD   "I wish to unlearn Swordsmithing"
#define GOSSIP_UNLEARN_TRANSMUTE   "I wish to unlearn Transmutation Mastery"
#define GOSSIP_UNLEARN_TRIBAL   "I wish to unlearn Tribal Leatherworking"
#define GOSSIP_WEAPON_LEARN   "Please teach me how to become a Weaponsmith"
#define GOSSIP_WEAPON_UNLEARN   "I wish to unlearn the art of Weaponsmithing"
#define TALK_AXE_LEARN   "Ah, a seasoned veteran you once were. I know you are capable, you merely need to ask and I shall teach you the way of the axesmith."
#define TALK_AXE_UNLEARN   "Forgetting your Axesmithing skill is not something to do lightly. If you choose to abandon it you will forget all recipes that require Axesmithing to create!"
#define TALK_HAMMER_LEARN   "Ah, a seasoned veteran you once were. I know you are capable, you merely need to ask and I shall teach you the way of the hammersmith."
#define TALK_HAMMER_UNLEARN   "Forgetting your Hammersmithing skill is not something to do lightly. If you choose to abandon it you will forget all recipes that require Hammersmithing to create!"
#define TALK_MUST_UNLEARN_WEAPON   "You must forget your weapon type specialty before I can help you. Go to Everlook in Winterspring and seek help there."
#define TALK_SWORD_LEARN   "Ah, a seasoned veteran you once were. I know you are capable, you merely need to ask and I shall teach you the way of the swordsmith."
#define TALK_SWORD_UNLEARN   "Forgetting your Swordsmithing skill is not something to do lightly. If you choose to abandon it you will forget all recipes that require Swordsmithing to create!"

Enumeration Type Documentation

Enumerator
NPC_ZAP 
NPC_JHORDY 
NPC_KABLAM 
NPC_SMILES 
SPELL_LEARN_TO_EVERLOOK 
SPELL_LEARN_TO_GADGET 
SPELL_LEARN_TO_AREA52 
SPELL_LEARN_TO_TOSHLEY 
SPELL_TO_EVERLOOK 
SPELL_TO_GADGET 
SPELL_TO_AREA52 
SPELL_TO_TOSHLEY 
820 {
821  NPC_ZAP = 14742,
822  NPC_JHORDY = 14743,
823  NPC_KABLAM = 21493,
824  NPC_SMILES = 21494,
825 
826  SPELL_LEARN_TO_EVERLOOK = 23490,
827  SPELL_LEARN_TO_GADGET = 23491,
828  SPELL_LEARN_TO_AREA52 = 36956,
829  SPELL_LEARN_TO_TOSHLEY = 36957,
830 
831  SPELL_TO_EVERLOOK = 23486,
832  SPELL_TO_GADGET = 23489,
833  SPELL_TO_AREA52 = 36954,
834  SPELL_TO_TOSHLEY = 36955,
835 };
Definition: npc_professions.cpp:826
Definition: npc_professions.cpp:827
Definition: npc_professions.cpp:829
Definition: npc_professions.cpp:831
Definition: npc_professions.cpp:833
Definition: npc_professions.cpp:828
Definition: npc_professions.cpp:832
Definition: npc_professions.cpp:821
Definition: npc_professions.cpp:824
Definition: npc_professions.cpp:834
Definition: npc_professions.cpp:823
Definition: npc_professions.cpp:822
Enumerator
S_WEAPON 
S_ARMOR 
S_HAMMER 
S_AXE 
S_SWORD 
S_LEARN_WEAPON 
S_LEARN_ARMOR 
S_LEARN_HAMMER 
S_LEARN_AXE 
S_LEARN_SWORD 
S_UNLEARN_WEAPON 
S_UNLEARN_ARMOR 
S_UNLEARN_HAMMER 
S_UNLEARN_AXE 
S_UNLEARN_SWORD 
S_REP_ARMOR 
S_REP_WEAPON 
REP_ARMOR 
REP_WEAPON 
REP_HAMMER 
REP_AXE 
REP_SWORD 
S_DRAGON 
S_ELEMENTAL 
S_TRIBAL 
S_LEARN_DRAGON 
S_LEARN_ELEMENTAL 
S_LEARN_TRIBAL 
S_UNLEARN_DRAGON 
S_UNLEARN_ELEMENTAL 
S_UNLEARN_TRIBAL 
S_GOBLIN 
S_GNOMISH 
S_LEARN_GOBLIN 
S_LEARN_GNOMISH 
S_SPELLFIRE 
S_MOONCLOTH 
S_SHADOWEAVE 
S_LEARN_SPELLFIRE 
S_LEARN_MOONCLOTH 
S_LEARN_SHADOWEAVE 
S_UNLEARN_SPELLFIRE 
S_UNLEARN_MOONCLOTH 
S_UNLEARN_SHADOWEAVE 
S_TRANSMUTE 
S_ELIXIR 
S_POTION 
S_LEARN_TRANSMUTE 
S_LEARN_ELIXIR 
S_LEARN_POTION 
S_UNLEARN_TRANSMUTE 
S_UNLEARN_ELIXIR 
S_UNLEARN_POTION 
110 {
111  S_WEAPON = 9787,
112  S_ARMOR = 9788,
113  S_HAMMER = 17040,
114  S_AXE = 17041,
115  S_SWORD = 17039,
116 
117  S_LEARN_WEAPON = 9789,
118  S_LEARN_ARMOR = 9790,
119  S_LEARN_HAMMER = 39099,
120  S_LEARN_AXE = 39098,
121  S_LEARN_SWORD = 39097,
122 
123  S_UNLEARN_WEAPON = 36436,
124  S_UNLEARN_ARMOR = 36435,
125  S_UNLEARN_HAMMER = 36441,
126  S_UNLEARN_AXE = 36439,
127  S_UNLEARN_SWORD = 36438,
128 
129  S_REP_ARMOR = 17451,
130  S_REP_WEAPON = 17452,
131 
132  REP_ARMOR = 46,
133  REP_WEAPON = 289,
134  REP_HAMMER = 569,
135  REP_AXE = 570,
136  REP_SWORD = 571,
137 
138  S_DRAGON = 10656,
139  S_ELEMENTAL = 10658,
140  S_TRIBAL = 10660,
141 
142  S_LEARN_DRAGON = 10657,
143  S_LEARN_ELEMENTAL = 10659,
144  S_LEARN_TRIBAL = 10661,
145 
146  S_UNLEARN_DRAGON = 36434,
147  S_UNLEARN_ELEMENTAL = 36328,
148  S_UNLEARN_TRIBAL = 36433,
149 
150  S_GOBLIN = 20222,
151  S_GNOMISH = 20219,
152 
153  S_LEARN_GOBLIN = 20221,
154  S_LEARN_GNOMISH = 20220,
155 
156  S_SPELLFIRE = 26797,
157  S_MOONCLOTH = 26798,
158  S_SHADOWEAVE = 26801,
159 
160  S_LEARN_SPELLFIRE = 26796,
161  S_LEARN_MOONCLOTH = 26799,
162  S_LEARN_SHADOWEAVE = 26800,
163 
164  S_UNLEARN_SPELLFIRE = 41299,
165  S_UNLEARN_MOONCLOTH = 41558,
166  S_UNLEARN_SHADOWEAVE = 41559,
167 
168  S_TRANSMUTE = 28672,
169  S_ELIXIR = 28677,
170  S_POTION = 28675,
171 
172  S_LEARN_TRANSMUTE = 28674,
173  S_LEARN_ELIXIR = 28678,
174  S_LEARN_POTION = 28676,
175 
176  S_UNLEARN_TRANSMUTE = 41565,
177  S_UNLEARN_ELIXIR = 41564,
178  S_UNLEARN_POTION = 41563,
179 };
Definition: npc_professions.cpp:138
Definition: npc_professions.cpp:124
Definition: npc_professions.cpp:146
Definition: npc_professions.cpp:144
Definition: npc_professions.cpp:140
Definition: npc_professions.cpp:119
Definition: npc_professions.cpp:117
Definition: npc_professions.cpp:148
Definition: npc_professions.cpp:158
Definition: npc_professions.cpp:169
Definition: npc_professions.cpp:123
Definition: npc_professions.cpp:160
Definition: npc_professions.cpp:178
Definition: npc_professions.cpp:126
Definition: npc_professions.cpp:166
Definition: npc_professions.cpp:129
Definition: npc_professions.cpp:112
Definition: npc_professions.cpp:130
Definition: npc_professions.cpp:156
Definition: npc_professions.cpp:176
Definition: npc_professions.cpp:153
Definition: npc_professions.cpp:150
Definition: npc_professions.cpp:177
Definition: npc_professions.cpp:161
Definition: npc_professions.cpp:114
Definition: npc_professions.cpp:172
Definition: npc_professions.cpp:143
Definition: npc_professions.cpp:154
Definition: npc_professions.cpp:142
Definition: npc_professions.cpp:165
Definition: npc_professions.cpp:127
Definition: npc_professions.cpp:121
Definition: npc_professions.cpp:151
Definition: npc_professions.cpp:113
Definition: npc_professions.cpp:115
Definition: npc_professions.cpp:136
Definition: npc_professions.cpp:173
Definition: npc_professions.cpp:164
Definition: npc_professions.cpp:132
Definition: npc_professions.cpp:157
Definition: npc_professions.cpp:135
Definition: npc_professions.cpp:147
Definition: npc_professions.cpp:168
Definition: npc_professions.cpp:174
Definition: npc_professions.cpp:139
Definition: npc_professions.cpp:120
Definition: npc_professions.cpp:125
Definition: npc_professions.cpp:170
Definition: npc_professions.cpp:134
Definition: npc_professions.cpp:162
Definition: npc_professions.cpp:133
Definition: npc_professions.cpp:118
Definition: npc_professions.cpp:111
Enumerator
Q_MASTER_TRANSMUTE 
Q_MASTER_ELIXIR 
Q_MASTER_POTION 
220 {
221  /* Alchemy */
222  Q_MASTER_TRANSMUTE = 10899,
223  Q_MASTER_ELIXIR = 10902,
224  Q_MASTER_POTION = 10897,
225 };
Definition: npc_professions.cpp:223
Definition: npc_professions.cpp:224
Definition: npc_professions.cpp:222
Enumerator
N_TRAINER_TRANSMUTE 
N_TRAINER_ELIXIR 
N_TRAINER_POTION 
N_TRAINER_SMITHOMNI1 
N_TRAINER_SMITHOMNI2 
N_TRAINER_WEAPON1 
N_TRAINER_WEAPON2 
N_TRAINER_ARMOR1 
N_TRAINER_ARMOR2 
N_TRAINER_HAMMER 
N_TRAINER_AXE 
N_TRAINER_SWORD 
N_TRAINER_DRAGON1 
N_TRAINER_DRAGON2 
N_TRAINER_ELEMENTAL1 
N_TRAINER_ELEMENTAL2 
N_TRAINER_TRIBAL1 
N_TRAINER_TRIBAL2 
N_TRAINER_SPELLFIRE 
N_TRAINER_MOONCLOTH 
N_TRAINER_SHADOWEAVE 
185 {
186  /* Alchemy */
187  N_TRAINER_TRANSMUTE = 22427, // Zarevhi
188  N_TRAINER_ELIXIR = 19052, // Lorokeem
189  N_TRAINER_POTION = 17909, // Lauranna Thar'well
190 
191  /* Blacksmithing */
192  N_TRAINER_SMITHOMNI1 = 11145, // Myolor Sunderfury
193  N_TRAINER_SMITHOMNI2 = 11176, // Krathok Moltenfist
194  N_TRAINER_WEAPON1 = 11146, // Ironus Coldsteel
195  N_TRAINER_WEAPON2 = 11178, // Borgosh Corebender
196  N_TRAINER_ARMOR1 = 5164, // Grumnus Steelshaper
197  N_TRAINER_ARMOR2 = 11177, // Okothos Ironrager
198  N_TRAINER_HAMMER = 11191, // Lilith the Lithe
199  N_TRAINER_AXE = 11192, // Kilram
200  N_TRAINER_SWORD = 11193, // Seril Scourgebane
201 
202  /* Leatherworking */
203  N_TRAINER_DRAGON1 = 7866, // Peter Galen
204  N_TRAINER_DRAGON2 = 7867, // Thorkaf Dragoneye
205  N_TRAINER_ELEMENTAL1 = 7868, // Sarah Tanner
206  N_TRAINER_ELEMENTAL2 = 7869, // Brumn Winterhoof
207  N_TRAINER_TRIBAL1 = 7870, // Caryssia Moonhunter
208  N_TRAINER_TRIBAL2 = 7871, // Se'Jib
209 
210  /* Tailoring */
211  N_TRAINER_SPELLFIRE = 22213, // Gidge Spellweaver
212  N_TRAINER_MOONCLOTH = 22208, // Nasmara Moonsong
213  N_TRAINER_SHADOWEAVE = 22212, // Andrion Darkspinner
214 };
Definition: npc_professions.cpp:198
Definition: npc_professions.cpp:187
Definition: npc_professions.cpp:199
Definition: npc_professions.cpp:194
Definition: npc_professions.cpp:195
Definition: npc_professions.cpp:197
Definition: npc_professions.cpp:207
Definition: npc_professions.cpp:206
Definition: npc_professions.cpp:203
Definition: npc_professions.cpp:211
Definition: npc_professions.cpp:212
Definition: npc_professions.cpp:208
Definition: npc_professions.cpp:189
Definition: npc_professions.cpp:193
Definition: npc_professions.cpp:196
Definition: npc_professions.cpp:200
Definition: npc_professions.cpp:213
Definition: npc_professions.cpp:205
Definition: npc_professions.cpp:192
Definition: npc_professions.cpp:188
Definition: npc_professions.cpp:204

Function Documentation

void AddSC_npc_professions ( )
1214 {
1215  new npc_prof_alchemy();
1216  new npc_prof_blacksmith();
1218  new npc_prof_leather();
1219  new npc_prof_tailor();
1220 }
Definition: npc_professions.cpp:424
Definition: npc_professions.cpp:933
Definition: npc_professions.cpp:589
Definition: npc_professions.cpp:841
Definition: npc_professions.cpp:1051

+ Here is the caller graph for this function:

int32 DoHighUnlearnCost ( Player *  )
237 {
238  return 1500000;
239 }

+ Here is the caller graph for this function:

int32 DoLearnCost ( Player *  )
232 {
233  return 200000;
234 }

+ Here is the caller graph for this function:

int32 DoLowUnlearnCost ( Player *  player)
253 {
254  uint8 level = player->getLevel();
255  if (level < 66)
256  return 50000;
257  else
258  return 100000;
259 }
uint8_t uint8
Definition: Define.h:152

+ Here is the caller graph for this function:

int32 DoMedUnlearnCost ( Player *  player)
242 {
243  uint8 level = player->getLevel();
244  if (level < 51)
245  return 250000;
246  else if (level < 66)
247  return 500000;
248  else
249  return 1000000;
250 }
uint8_t uint8
Definition: Define.h:152

+ Here is the caller graph for this function:

bool EquippedOk ( Player *  player,
uint32  spellId 
)
278 {
279  SpellInfo const* spell = sSpellMgr->GetSpellInfo(spellId);
280  if (!spell)
281  return false;
282 
283  for (SpellEffectInfo const* effect : spell->GetEffectsForDifficulty(DIFFICULTY_NONE))
284  {
285  if (!effect)
286  continue;
287 
288  uint32 reqSpell = effect->TriggerSpell;
289  if (!reqSpell)
290  continue;
291 
292  Item* item = NULL;
293  for (uint8 j = EQUIPMENT_SLOT_START; j < EQUIPMENT_SLOT_END; ++j)
294  {
295  item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, j);
296  if (item && item->GetTemplate()->GetRequiredSpell() == reqSpell)
297  {
298  //player has item equipped that require specialty. Not allow to unlearn, player has to unequip first
299  TC_LOG_DEBUG("scripts", "player attempt to unlearn spell %u, but item %u is equipped.", reqSpell, item->GetEntry());
300  return false;
301  }
302  }
303  }
304  return true;
305 }
Definition: DBCEnums.h:404
#define INVENTORY_SLOT_BAG_0
Definition: SpellInfo.h:326
arena_t NULL
Definition: jemalloc_internal.h:624
uint32 GetRequiredSpell() const
Definition: ItemTemplate.h:671
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Definition: Item.h:259
#define sSpellMgr
Definition: SpellMgr.h:756
Definition: SpellInfo.h:238
uint32_t uint32
Definition: Define.h:150
SpellEffectInfoVector GetEffectsForDifficulty(uint32 difficulty) const
Definition: SpellInfo.cpp:3311
uint8_t uint8
Definition: Define.h:152
uint32 GetEntry() const
Definition: Object.h:107
ItemTemplate const * GetTemplate() const
Definition: Item.cpp:547

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ProcessCastaction ( Player *  player,
Creature creature,
uint32  spellId,
uint32  triggeredSpellId,
int32  cost 
)
262 {
263  if (!(spellId && player->HasSpell(spellId)) && player->HasEnoughMoney((int64)cost))
264  {
265  player->CastSpell(player, triggeredSpellId, true);
266  player->ModifyMoney(-cost);
267  }
268  else
269  player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, 0, 0);
270  player->CLOSE_GOSSIP_MENU();
271 }
int64_t int64
Definition: Define.h:145
Definition: Item.h:152

+ Here is the caller graph for this function:

void ProcessUnlearnAction ( Player *  player,
Creature creature,
uint32  spellId,
uint32  alternativeSpellId,
int32  cost 
)
401 {
402  if (EquippedOk(player, spellId))
403  {
404  if (player->HasEnoughMoney(int64(cost)))
405  {
406  player->CastSpell(player, spellId, true);
407  ProfessionUnlearnSpells(player, spellId);
408  player->ModifyMoney(-int64(cost));
409  if (alternativeSpellId)
410  creature->CastSpell(player, alternativeSpellId, true);
411  }
412  else
413  player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, 0, 0);
414  }
415  else
416  player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, NULL, NULL);
417  player->CLOSE_GOSSIP_MENU();
418 }
int64_t int64
Definition: Define.h:145
bool EquippedOk(Player *player, uint32 spellId)
Definition: npc_professions.cpp:277
arena_t NULL
Definition: jemalloc_internal.h:624
void ProfessionUnlearnSpells(Player *player, uint32 type)
Definition: npc_professions.cpp:307
Definition: Item.h:152
int64_t int64
Definition: g3dmath.h:169
Definition: Item.h:87
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:869

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ProfessionUnlearnSpells ( Player *  player,
uint32  type 
)
308 {
309  switch (type)
310  {
311  case S_UNLEARN_WEAPON: // S_UNLEARN_WEAPON
312  player->RemoveSpell(36125); // Light Earthforged Blade
313  player->RemoveSpell(36128); // Light Emberforged Hammer
314  player->RemoveSpell(36126); // Light Skyforged Axe
315  break;
316  case S_UNLEARN_ARMOR: // S_UNLEARN_ARMOR
317  player->RemoveSpell(36122); // Earthforged Leggings
318  player->RemoveSpell(36129); // Heavy Earthforged Breastplate
319  player->RemoveSpell(36130); // Stormforged Hauberk
320  player->RemoveSpell(34533); // Breastplate of Kings
321  player->RemoveSpell(34529); // Nether Chain Shirt
322  player->RemoveSpell(34534); // Bulwark of Kings
323  player->RemoveSpell(36257); // Bulwark of the Ancient Kings
324  player->RemoveSpell(36256); // Embrace of the Twisting Nether
325  player->RemoveSpell(34530); // Twisting Nether Chain Shirt
326  player->RemoveSpell(36124); // Windforged Leggings
327  break;
328  case S_UNLEARN_HAMMER: // S_UNLEARN_HAMMER
329  player->RemoveSpell(36262); // Dragonstrike
330  player->RemoveSpell(34546); // Dragonmaw
331  player->RemoveSpell(34545); // Drakefist Hammer
332  player->RemoveSpell(36136); // Lavaforged Warhammer
333  player->RemoveSpell(34547); // Thunder
334  player->RemoveSpell(34567); // Deep Thunder
335  player->RemoveSpell(36263); // Stormherald
336  player->RemoveSpell(36137); // Great Earthforged Hammer
337  break;
338  case S_UNLEARN_AXE: // S_UNLEARN_AXE
339  player->RemoveSpell(36260); // Wicked Edge of the Planes
340  player->RemoveSpell(34562); // Black Planar Edge
341  player->RemoveSpell(34541); // The Planar Edge
342  player->RemoveSpell(36134); // Stormforged Axe
343  player->RemoveSpell(36135); // Skyforged Great Axe
344  player->RemoveSpell(36261); // Bloodmoon
345  player->RemoveSpell(34543); // Lunar Crescent
346  player->RemoveSpell(34544); // Mooncleaver
347  break;
348  case S_UNLEARN_SWORD: // S_UNLEARN_SWORD
349  player->RemoveSpell(36258); // Blazefury
350  player->RemoveSpell(34537); // Blazeguard
351  player->RemoveSpell(34535); // Fireguard
352  player->RemoveSpell(36131); // Windforged Rapier
353  player->RemoveSpell(36133); // Stoneforged Claymore
354  player->RemoveSpell(34538); // Lionheart Blade
355  player->RemoveSpell(34540); // Lionheart Champion
356  player->RemoveSpell(36259); // Lionheart Executioner
357  break;
358  case S_UNLEARN_DRAGON: // S_UNLEARN_DRAGON
359  player->RemoveSpell(36076); // Dragonstrike Leggings
360  player->RemoveSpell(36079); // Golden Dragonstrike Breastplate
361  player->RemoveSpell(35576); // Ebon Netherscale Belt
362  player->RemoveSpell(35577); // Ebon Netherscale Bracers
363  player->RemoveSpell(35575); // Ebon Netherscale Breastplate
364  player->RemoveSpell(35582); // Netherstrike Belt
365  player->RemoveSpell(35584); // Netherstrike Bracers
366  player->RemoveSpell(35580); // Netherstrike Breastplate
367  break;
368  case S_UNLEARN_ELEMENTAL: // S_UNLEARN_ELEMENTAL
369  player->RemoveSpell(36074); // Blackstorm Leggings
370  player->RemoveSpell(36077); // Primalstorm Breastplate
371  player->RemoveSpell(35590); // Primalstrike Belt
372  player->RemoveSpell(35591); // Primalstrike Bracers
373  player->RemoveSpell(35589); // Primalstrike Vest
374  break;
375  case S_UNLEARN_TRIBAL: // S_UNLEARN_TRIBAL
376  player->RemoveSpell(35585); // Windhawk Hauberk
377  player->RemoveSpell(35587); // Windhawk Belt
378  player->RemoveSpell(35588); // Windhawk Bracers
379  player->RemoveSpell(36075); // Wildfeather Leggings
380  player->RemoveSpell(36078); // Living Crystal Breastplate
381  break;
382  case S_UNLEARN_SPELLFIRE: // S_UNLEARN_SPELLFIRE
383  player->RemoveSpell(26752); // Spellfire Belt
384  player->RemoveSpell(26753); // Spellfire Gloves
385  player->RemoveSpell(26754); // Spellfire Robe
386  break;
387  case S_UNLEARN_MOONCLOTH: // S_UNLEARN_MOONCLOTH
388  player->RemoveSpell(26760); // Primal Mooncloth Belt
389  player->RemoveSpell(26761); // Primal Mooncloth Shoulders
390  player->RemoveSpell(26762); // Primal Mooncloth Robe
391  break;
392  case S_UNLEARN_SHADOWEAVE: // S_UNLEARN_SHADOWEAVE
393  player->RemoveSpell(26756); // Frozen Shadoweave Shoulders
394  player->RemoveSpell(26757); // Frozen Shadoweave Boots
395  player->RemoveSpell(26758); // Frozen Shadoweave Robe
396  break;
397  }
398 }
Definition: npc_professions.cpp:124
Definition: npc_professions.cpp:146
Definition: npc_professions.cpp:148
Definition: npc_professions.cpp:123
Definition: npc_professions.cpp:126
Definition: npc_professions.cpp:166
Definition: npc_professions.cpp:165
Definition: npc_professions.cpp:127
Definition: npc_professions.cpp:164
Definition: npc_professions.cpp:147
Definition: npc_professions.cpp:125

+ Here is the caller graph for this function: