TrinityCore
npc_professions.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18/* ScriptData
19SDName: Npc_Professions
20SD%Complete: 80
21SDComment: Provides learn/unlearn/relearn-options for professions. Not supported: Unlearn engineering, re-learn engineering, re-learn leatherworking.
22SDCategory: NPCs
23EndScriptData */
24
25#include "ScriptMgr.h"
26#include "Item.h"
27#include "Log.h"
28#include "Player.h"
29#include "ScriptedCreature.h"
30#include "ScriptedGossip.h"
31#include "SpellInfo.h"
32#include "SpellMgr.h"
33#include "WorldSession.h"
34
35/*
36A few notes for future developement:
37- A full implementation of gossip for GO's is required. They must have the same scripting capabilities as creatures. Basically,
38there is no difference here (except that default text is chosen with `gameobject_template`.`data3` (for GO type2, different dataN for a few others)
39- It's possible blacksmithing still require some tweaks and adjustments due to the way we _have_ to use reputation.
40*/
41
42/*###
43# to be removed from here (->ncp_text). This is data for database projects.
44###*/
45#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."
46
47#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."
48#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."
49#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."
50
51#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!"
52#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!"
53#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!"
54
55/*###
56# generic defines
57###*/
58
59#define GOSSIP_SENDER_LEARN 50
60#define GOSSIP_SENDER_UNLEARN 51
61#define GOSSIP_SENDER_CHECK 52
62
63/*###
64# gossip item and box texts
65###*/
66
67#define GOSSIP_LEARN_POTION "Please teach me how to become a Master of Potions, Lauranna"
68#define GOSSIP_UNLEARN_POTION "I wish to unlearn Potion Mastery"
69#define GOSSIP_LEARN_TRANSMUTE "Please teach me how to become a Master of Transmutations, Zarevhi"
70#define GOSSIP_UNLEARN_TRANSMUTE "I wish to unlearn Transmutation Mastery"
71#define GOSSIP_LEARN_ELIXIR "Please teach me how to become a Master of Elixirs, Lorokeem"
72#define GOSSIP_UNLEARN_ELIXIR "I wish to unlearn Elixir Mastery"
73
74#define BOX_UNLEARN_ALCHEMY_SPEC "Do you really want to unlearn your alchemy specialty and lose all associated recipes? \n Cost: "
75
76#define GOSSIP_WEAPON_LEARN "Please teach me how to become a Weaponsmith"
77#define GOSSIP_WEAPON_UNLEARN "I wish to unlearn the art of Weaponsmithing"
78#define GOSSIP_ARMOR_LEARN "Please teach me how to become a Armorsmith"
79#define GOSSIP_ARMOR_UNLEARN "I wish to unlearn the art of Armorsmithing"
80
81#define GOSSIP_UNLEARN_SMITH_SPEC "I wish to unlearn my blacksmith specialty"
82#define BOX_UNLEARN_ARMORORWEAPON "Do you really want to unlearn your blacksmith specialty and lose all associated recipes? \n Cost: "
83
84#define GOSSIP_LEARN_HAMMER "Please teach me how to become a Hammersmith, Lilith"
85#define GOSSIP_UNLEARN_HAMMER "I wish to unlearn Hammersmithing"
86#define GOSSIP_LEARN_AXE "Please teach me how to become a Axesmith, Kilram"
87#define GOSSIP_UNLEARN_AXE "I wish to unlearn Axesmithing"
88#define GOSSIP_LEARN_SWORD "Please teach me how to become a Swordsmith, Seril"
89#define GOSSIP_UNLEARN_SWORD "I wish to unlearn Swordsmithing"
90
91#define BOX_UNLEARN_WEAPON_SPEC "Do you really want to unlearn your weaponsmith specialty and lose all associated recipes? \n Cost: "
92
93#define GOSSIP_UNLEARN_DRAGON "I wish to unlearn Dragonscale Leatherworking"
94#define GOSSIP_UNLEARN_ELEMENTAL "I wish to unlearn Elemental Leatherworking"
95#define GOSSIP_UNLEARN_TRIBAL "I wish to unlearn Tribal Leatherworking"
96
97#define BOX_UNLEARN_LEATHER_SPEC "Do you really want to unlearn your leatherworking specialty and lose all associated recipes? \n Cost: "
98
99#define GOSSIP_LEARN_SPELLFIRE "Please teach me how to become a Spellcloth tailor"
100#define GOSSIP_UNLEARN_SPELLFIRE "I wish to unlearn Spellfire Tailoring"
101#define GOSSIP_LEARN_MOONCLOTH "Please teach me how to become a Mooncloth tailor"
102#define GOSSIP_UNLEARN_MOONCLOTH "I wish to unlearn Mooncloth Tailoring"
103#define GOSSIP_LEARN_SHADOWEAVE "Please teach me how to become a Shadoweave tailor"
104#define GOSSIP_UNLEARN_SHADOWEAVE "I wish to unlearn Shadoweave Tailoring"
105
106#define BOX_UNLEARN_TAILOR_SPEC "Do you really want to unlearn your tailoring specialty and lose all associated recipes? \n Cost: "
107
108/*###
109# spells defines
110###*/
112{
113 S_WEAPON = 9787,
114 S_ARMOR = 9788,
115 S_HAMMER = 17040,
116 S_AXE = 17041,
117 S_SWORD = 17039,
118
122 S_LEARN_AXE = 39098,
124
130
131 S_REP_ARMOR = 17451,
133
137 REP_AXE = 570,
139
140 S_DRAGON = 10656,
141 S_ELEMENTAL = 10658,
142 S_TRIBAL = 10660,
143
147
151
152 S_GOBLIN = 20222,
153 S_GNOMISH = 20219,
154
157
158 S_SPELLFIRE = 26797,
159 S_MOONCLOTH = 26798,
161
165
169
170 S_TRANSMUTE = 28672,
171 S_ELIXIR = 28677,
172 S_POTION = 28675,
173
177
181};
182
183/*###
184# specialization trainers
185###*/
187{
188 /* Alchemy */
189 N_TRAINER_TRANSMUTE = 22427, // Zarevhi
190 N_TRAINER_ELIXIR = 19052, // Lorokeem
191 N_TRAINER_POTION = 17909, // Lauranna Thar'well
193
194 /* Blacksmithing */
195 N_TRAINER_SMITHOMNI1 = 11145, // Myolor Sunderfury
196 N_TRAINER_SMITHOMNI2 = 11176, // Krathok Moltenfist
197 N_TRAINER_WEAPON1 = 11146, // Ironus Coldsteel
198 N_TRAINER_WEAPON2 = 11178, // Borgosh Corebender
199 N_TRAINER_ARMOR1 = 5164, // Grumnus Steelshaper
200 N_TRAINER_ARMOR2 = 11177, // Okothos Ironrager
201 N_TRAINER_HAMMER = 11191, // Lilith the Lithe
202 N_TRAINER_AXE = 11192, // Kilram
203 N_TRAINER_SWORD = 11193, // Seril Scourgebane
205
206 /* Leatherworking */
207 N_TRAINER_DRAGON1 = 7866, // Peter Galen
208 N_TRAINER_DRAGON2 = 7867, // Thorkaf Dragoneye
209 N_TRAINER_ELEMENTAL1 = 7868, // Sarah Tanner
210 N_TRAINER_ELEMENTAL2 = 7869, // Brumn Winterhoof
211 N_TRAINER_TRIBAL1 = 7870, // Caryssia Moonhunter
212 N_TRAINER_TRIBAL2 = 7871, // Se'Jib
214
215 /* Tailoring */
216 N_TRAINER_SPELLFIRE = 22213, // Gidge Spellweaver
217 N_TRAINER_MOONCLOTH = 22208, // Nasmara Moonsong
218 N_TRAINER_SHADOWEAVE = 22212, // Andrion Darkspinner
220};
221
222/*###
223# specialization quests
224###*/
226{
227 /* Alchemy */
231};
232
233/*###
234# formulas to calculate unlearning cost
235###*/
236
237int32 DoLearnCost(Player* /*player*/) //tailor, alchemy
238{
239 return 200000;
240}
241
242int32 DoHighUnlearnCost(Player* /*player*/) //tailor, alchemy
243{
244 return 1500000;
245}
246
247int32 DoMedUnlearnCost(Player* player) //blacksmith, leatherwork
248{
249 uint8 level = player->GetLevel();
250 if (level < 51)
251 return 250000;
252 else if (level < 66)
253 return 500000;
254 else
255 return 1000000;
256}
257
258int32 DoLowUnlearnCost(Player* player) //blacksmith
259{
260 uint8 level = player->GetLevel();
261 if (level < 66)
262 return 50000;
263 else
264 return 100000;
265}
266
267void ProcessCastaction(Player* player, Creature* creature, uint32 spellId, uint32 triggeredSpellId, int32 cost)
268{
269 if (!(spellId && player->HasSpell(spellId)) && player->HasEnoughMoney((int64)cost))
270 {
271 player->CastSpell(player, triggeredSpellId, true);
272 player->ModifyMoney(-cost);
273 }
274 else
275 player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, 0, 0);
276 CloseGossipMenuFor(player);
277}
278
279/*###
280# unlearning related profession spells
281###*/
282
283bool EquippedOk(Player* player, uint32 spellId)
284{
285 SpellInfo const* spell = sSpellMgr->GetSpellInfo(spellId, DIFFICULTY_NONE);
286 if (!spell)
287 return false;
288
289 for (SpellEffectInfo const& spellEffectInfo : spell->GetEffects())
290 {
291 uint32 reqSpell = spellEffectInfo.TriggerSpell;
292 if (!reqSpell)
293 continue;
294
295 Item* item = nullptr;
297 {
298 item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, j);
299 if (item && item->GetTemplate()->GetRequiredSpell() == reqSpell)
300 {
301 //player has item equipped that require specialty. Not allow to unlearn, player has to unequip first
302 TC_LOG_DEBUG("scripts", "player attempt to unlearn spell {}, but item {} is equipped.", reqSpell, item->GetEntry());
303 return false;
304 }
305 }
306 }
307 return true;
308}
309
311{
312 switch (type)
313 {
314 case S_UNLEARN_WEAPON: // S_UNLEARN_WEAPON
315 player->RemoveSpell(36125); // Light Earthforged Blade
316 player->RemoveSpell(36128); // Light Emberforged Hammer
317 player->RemoveSpell(36126); // Light Skyforged Axe
318 break;
319 case S_UNLEARN_ARMOR: // S_UNLEARN_ARMOR
320 player->RemoveSpell(36122); // Earthforged Leggings
321 player->RemoveSpell(36129); // Heavy Earthforged Breastplate
322 player->RemoveSpell(36130); // Stormforged Hauberk
323 player->RemoveSpell(34533); // Breastplate of Kings
324 player->RemoveSpell(34529); // Nether Chain Shirt
325 player->RemoveSpell(34534); // Bulwark of Kings
326 player->RemoveSpell(36257); // Bulwark of the Ancient Kings
327 player->RemoveSpell(36256); // Embrace of the Twisting Nether
328 player->RemoveSpell(34530); // Twisting Nether Chain Shirt
329 player->RemoveSpell(36124); // Windforged Leggings
330 break;
331 case S_UNLEARN_HAMMER: // S_UNLEARN_HAMMER
332 player->RemoveSpell(36262); // Dragonstrike
333 player->RemoveSpell(34546); // Dragonmaw
334 player->RemoveSpell(34545); // Drakefist Hammer
335 player->RemoveSpell(36136); // Lavaforged Warhammer
336 player->RemoveSpell(34547); // Thunder
337 player->RemoveSpell(34567); // Deep Thunder
338 player->RemoveSpell(36263); // Stormherald
339 player->RemoveSpell(36137); // Great Earthforged Hammer
340 break;
341 case S_UNLEARN_AXE: // S_UNLEARN_AXE
342 player->RemoveSpell(36260); // Wicked Edge of the Planes
343 player->RemoveSpell(34562); // Black Planar Edge
344 player->RemoveSpell(34541); // The Planar Edge
345 player->RemoveSpell(36134); // Stormforged Axe
346 player->RemoveSpell(36135); // Skyforged Great Axe
347 player->RemoveSpell(36261); // Bloodmoon
348 player->RemoveSpell(34543); // Lunar Crescent
349 player->RemoveSpell(34544); // Mooncleaver
350 break;
351 case S_UNLEARN_SWORD: // S_UNLEARN_SWORD
352 player->RemoveSpell(36258); // Blazefury
353 player->RemoveSpell(34537); // Blazeguard
354 player->RemoveSpell(34535); // Fireguard
355 player->RemoveSpell(36131); // Windforged Rapier
356 player->RemoveSpell(36133); // Stoneforged Claymore
357 player->RemoveSpell(34538); // Lionheart Blade
358 player->RemoveSpell(34540); // Lionheart Champion
359 player->RemoveSpell(36259); // Lionheart Executioner
360 break;
361 case S_UNLEARN_DRAGON: // S_UNLEARN_DRAGON
362 player->RemoveSpell(36076); // Dragonstrike Leggings
363 player->RemoveSpell(36079); // Golden Dragonstrike Breastplate
364 player->RemoveSpell(35576); // Ebon Netherscale Belt
365 player->RemoveSpell(35577); // Ebon Netherscale Bracers
366 player->RemoveSpell(35575); // Ebon Netherscale Breastplate
367 player->RemoveSpell(35582); // Netherstrike Belt
368 player->RemoveSpell(35584); // Netherstrike Bracers
369 player->RemoveSpell(35580); // Netherstrike Breastplate
370 break;
371 case S_UNLEARN_ELEMENTAL: // S_UNLEARN_ELEMENTAL
372 player->RemoveSpell(36074); // Blackstorm Leggings
373 player->RemoveSpell(36077); // Primalstorm Breastplate
374 player->RemoveSpell(35590); // Primalstrike Belt
375 player->RemoveSpell(35591); // Primalstrike Bracers
376 player->RemoveSpell(35589); // Primalstrike Vest
377 break;
378 case S_UNLEARN_TRIBAL: // S_UNLEARN_TRIBAL
379 player->RemoveSpell(35585); // Windhawk Hauberk
380 player->RemoveSpell(35587); // Windhawk Belt
381 player->RemoveSpell(35588); // Windhawk Bracers
382 player->RemoveSpell(36075); // Wildfeather Leggings
383 player->RemoveSpell(36078); // Living Crystal Breastplate
384 break;
385 case S_UNLEARN_SPELLFIRE: // S_UNLEARN_SPELLFIRE
386 player->RemoveSpell(26752); // Spellfire Belt
387 player->RemoveSpell(26753); // Spellfire Gloves
388 player->RemoveSpell(26754); // Spellfire Robe
389 break;
390 case S_UNLEARN_MOONCLOTH: // S_UNLEARN_MOONCLOTH
391 player->RemoveSpell(26760); // Primal Mooncloth Belt
392 player->RemoveSpell(26761); // Primal Mooncloth Shoulders
393 player->RemoveSpell(26762); // Primal Mooncloth Robe
394 break;
395 case S_UNLEARN_SHADOWEAVE: // S_UNLEARN_SHADOWEAVE
396 player->RemoveSpell(26756); // Frozen Shadoweave Shoulders
397 player->RemoveSpell(26757); // Frozen Shadoweave Boots
398 player->RemoveSpell(26758); // Frozen Shadoweave Robe
399 break;
400 }
401}
402
403void ProcessUnlearnAction(Player* player, Creature* creature, uint32 spellId, uint32 alternativeSpellId, int32 cost)
404{
405 if (EquippedOk(player, spellId))
406 {
407 if (player->HasEnoughMoney(int64(cost)))
408 {
409 player->CastSpell(player, spellId, true);
410 ProfessionUnlearnSpells(player, spellId);
411 player->ModifyMoney(-int64(cost));
412 if (alternativeSpellId)
413 creature->CastSpell(player, alternativeSpellId, true);
414 }
415 else
416 player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, 0, 0);
417 }
418 else
419 player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, nullptr, nullptr);
420 CloseGossipMenuFor(player);
421}
422
423/*###
424# start menues alchemy
425###*/
426
428{
429public:
430 npc_prof_alchemy() : CreatureScript("npc_prof_alchemy") { }
431
433 {
434 npc_prof_alchemyAI(Creature* creature) : ScriptedAI(creature) { }
435
436 inline bool HasAlchemySpell(Player* player)
437 {
438 return (player->HasSpell(S_TRANSMUTE) || player->HasSpell(S_ELIXIR) || player->HasSpell(S_POTION));
439 }
440
441 bool OnGossipHello(Player* player) override
442 {
443 if (me->IsQuestGiver())
444 player->PrepareQuestMenu(me->GetGUID());
445
446 if (me->IsVendor())
448
449 if (me->IsTrainer())
451
452 if (player->HasSkill(SKILL_ALCHEMY) && player->GetBaseSkillValue(SKILL_ALCHEMY) >= 350 && player->GetLevel() > 67)
453 {
455 {
456 switch (me->GetEntry())
457 {
458 case N_TRAINER_TRANSMUTE: //Zarevhi
459 if (!HasAlchemySpell(player))
461 if (player->HasSpell(S_TRANSMUTE))
463 break;
464 case N_TRAINER_ELIXIR: //Lorokeem
465 if (!HasAlchemySpell(player))
467 if (player->HasSpell(S_ELIXIR))
469 break;
470 case N_TRAINER_POTION: //Lauranna Thar'well
471 if (!HasAlchemySpell(player))
473 if (player->HasSpell(S_POTION))
475 break;
476 }
477 }
478 }
479
480 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
481 return true;
482 }
483
484 void SendActionMenu(Player* player, uint32 action)
485 {
486 switch (action)
487 {
489 player->GetSession()->SendListInventory(me->GetGUID());
490 break;
493 break;
494 //Learn Alchemy
495 case GOSSIP_ACTION_INFO_DEF + 1:
497 break;
498 case GOSSIP_ACTION_INFO_DEF + 2:
500 break;
501 case GOSSIP_ACTION_INFO_DEF + 3:
503 break;
504 //Unlearn Alchemy
505 case GOSSIP_ACTION_INFO_DEF + 4:
507 break;
508 case GOSSIP_ACTION_INFO_DEF + 5:
510 break;
511 case GOSSIP_ACTION_INFO_DEF + 6:
513 break;
514 }
515 }
516
517 void SendConfirmLearn(Player* player, uint32 action)
518 {
519 if (action)
520 {
521 switch (me->GetEntry())
522 {
525 //unknown textID ()
526 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
527 break;
528 case N_TRAINER_ELIXIR:
530 //unknown textID ()
531 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
532 break;
533 case N_TRAINER_POTION:
535 //unknown textID ()
536 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
537 break;
538 }
539 }
540 }
541
542 void SendConfirmUnlearn(Player* player, uint32 action)
543 {
544 if (action)
545 {
546 switch (me->GetEntry())
547 {
550 //unknown textID ()
551 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
552 break;
553 case N_TRAINER_ELIXIR:
555 //unknown textID ()
556 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
557 break;
558 case N_TRAINER_POTION:
560 //unknown textID ()
561 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
562 break;
563 }
564 }
565 }
566
567 bool OnGossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
568 {
569 uint32 const sender = player->PlayerTalkClass->GetGossipOptionSender(gossipListId);
570 uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
571 ClearGossipMenuFor(player);
572 switch (sender)
573 {
575 SendActionMenu(player, action);
576 break;
577
579 SendConfirmLearn(player, action);
580 break;
581
583 SendConfirmUnlearn(player, action);
584 break;
585
587 SendActionMenu(player, action);
588 break;
589 }
590 return true;
591 }
592 };
593
594 CreatureAI* GetAI(Creature* creature) const override
595 {
596 return new npc_prof_alchemyAI(creature);
597 }
598};
599
600/*###
601# start menues blacksmith
602###*/
603
605{
606public:
607 npc_prof_blacksmith() : CreatureScript("npc_prof_blacksmith") { }
608
610 {
611 npc_prof_blacksmithAI(Creature* creature) : ScriptedAI(creature) { }
612
613 inline bool HasWeaponSub(Player* player)
614 {
615 return (player->HasSpell(S_HAMMER) || player->HasSpell(S_AXE) || player->HasSpell(S_SWORD));
616 }
617
618 bool OnGossipHello(Player* player) override
619 {
620 if (me->IsQuestGiver())
621 player->PrepareQuestMenu(me->GetGUID());
622
623 if (me->IsVendor())
625
626 if (me->IsTrainer())
628
629 uint32 creatureId = me->GetEntry();
630 //WEAPONSMITH & ARMORSMITH
631 if (player->GetBaseSkillValue(SKILL_BLACKSMITHING) >= 225)
632 {
633 switch (creatureId)
634 {
637 if (!player->HasSpell(S_ARMOR) && !player->HasSpell(S_WEAPON) && player->GetReputationRank(REP_ARMOR) >= REP_FRIENDLY)
639 if (!player->HasSpell(S_WEAPON) && !player->HasSpell(S_ARMOR) && player->GetReputationRank(REP_WEAPON) >= REP_FRIENDLY)
641 break;
644 if (player->HasSpell(S_WEAPON))
646 break;
647 case N_TRAINER_ARMOR1:
648 case N_TRAINER_ARMOR2:
649 if (player->HasSpell(S_ARMOR))
651 break;
652 }
653 }
654 //WEAPONSMITH SPEC
655 if (player->HasSpell(S_WEAPON) && player->GetLevel() > 49 && player->GetBaseSkillValue(SKILL_BLACKSMITHING) >= 250)
656 {
657 switch (creatureId)
658 {
659 case N_TRAINER_HAMMER:
660 if (!HasWeaponSub(player))
662 if (player->HasSpell(S_HAMMER))
664 break;
665 case N_TRAINER_AXE:
666 if (!HasWeaponSub(player))
668 if (player->HasSpell(S_AXE))
670 break;
671 case N_TRAINER_SWORD:
672 if (!HasWeaponSub(player))
674 if (player->HasSpell(S_SWORD))
676 break;
677 }
678 }
679
680 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
681 return true;
682 }
683
684 void SendActionMenu(Player* player, uint32 action)
685 {
686 switch (action)
687 {
689 player->GetSession()->SendListInventory(me->GetGUID());
690 break;
693 break;
694 //Learn Armor/Weapon
695 case GOSSIP_ACTION_INFO_DEF + 1:
696 if (!player->HasSpell(S_ARMOR))
697 {
698 player->CastSpell(player, S_LEARN_ARMOR, true);
699 //_Creature->CastSpell(player, S_REP_ARMOR, true);
700 }
701 CloseGossipMenuFor(player);
702 break;
703 case GOSSIP_ACTION_INFO_DEF + 2:
704 if (!player->HasSpell(S_WEAPON))
705 {
706 player->CastSpell(player, S_LEARN_WEAPON, true);
707 //_Creature->CastSpell(player, S_REP_WEAPON, true);
708 }
709 CloseGossipMenuFor(player);
710 break;
711 //Unlearn Armor/Weapon
712 case GOSSIP_ACTION_INFO_DEF + 3:
713 if (HasWeaponSub(player))
714 {
715 //unknown textID (TALK_MUST_UNLEARN_WEAPON)
716 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
717 }
718 else
720 break;
721 case GOSSIP_ACTION_INFO_DEF + 4:
723 break;
724 //Learn Hammer/Axe/Sword
725 case GOSSIP_ACTION_INFO_DEF + 5:
726 player->CastSpell(player, S_LEARN_HAMMER, true);
727 CloseGossipMenuFor(player);
728 break;
729 case GOSSIP_ACTION_INFO_DEF + 6:
730 player->CastSpell(player, S_LEARN_AXE, true);
731 CloseGossipMenuFor(player);
732 break;
733 case GOSSIP_ACTION_INFO_DEF + 7:
734 player->CastSpell(player, S_LEARN_SWORD, true);
735 CloseGossipMenuFor(player);
736 break;
737 //Unlearn Hammer/Axe/Sword
738 case GOSSIP_ACTION_INFO_DEF + 8:
740 break;
741 case GOSSIP_ACTION_INFO_DEF + 9:
743 break;
744 case GOSSIP_ACTION_INFO_DEF + 10:
746 break;
747 }
748 }
749
750 void SendConfirmLearn(Player* player, uint32 action)
751 {
752 if (action)
753 {
754 switch (me->GetEntry())
755 {
756 case N_TRAINER_HAMMER:
758 //unknown textID (TALK_HAMMER_LEARN)
759 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
760 break;
761 case N_TRAINER_AXE:
763 //unknown textID (TALK_AXE_LEARN)
764 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
765 break;
766 case N_TRAINER_SWORD:
768 //unknown textID (TALK_SWORD_LEARN)
769 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
770 break;
771 }
772 }
773 }
774
775 void SendConfirmUnlearn(Player* player, uint32 action)
776 {
777 if (action)
778 {
779 switch (me->GetEntry())
780 {
783 case N_TRAINER_ARMOR1:
784 case N_TRAINER_ARMOR2:
786 //unknown textID (TALK_UNLEARN_AXEORWEAPON)
787 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
788 break;
789
790 case N_TRAINER_HAMMER:
792 //unknown textID (TALK_HAMMER_UNLEARN)
793 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
794 break;
795 case N_TRAINER_AXE:
797 //unknown textID (TALK_AXE_UNLEARN)
798 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
799 break;
800 case N_TRAINER_SWORD:
802 //unknown textID (TALK_SWORD_UNLEARN)
803 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
804 break;
805 }
806 }
807 }
808
809 bool OnGossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
810 {
811 uint32 const sender = player->PlayerTalkClass->GetGossipOptionSender(gossipListId);
812 uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
813 ClearGossipMenuFor(player);
814 switch (sender)
815 {
817 SendActionMenu(player, action);
818 break;
819
821 SendConfirmLearn(player, action);
822 break;
823
825 SendConfirmUnlearn(player, action);
826 break;
827
829 SendActionMenu(player, action);
830 break;
831 }
832 return true;
833 }
834 };
835
836 CreatureAI* GetAI(Creature* creature) const override
837 {
838 return new npc_prof_blacksmithAI(creature);
839 }
840};
841
842/*###
843# engineering trinkets
844###*/
845
847{
848 NPC_ZAP = 14742,
849 NPC_JHORDY = 14743,
850 NPC_KABLAM = 21493,
851 NPC_SMILES = 21494,
852
857
862};
863
864#define GOSSIP_ITEM_ZAP "This Dimensional Imploder sounds dangerous! How can I make one?"
865#define GOSSIP_ITEM_JHORDY "I must build a beacon for this marvelous device!"
866#define GOSSIP_ITEM_KABLAM "[PH] Unknown"
867
869{
870public:
871 npc_engineering_tele_trinket() : CreatureScript("npc_engineering_tele_trinket") { }
872
874 {
876
877 bool CanLearn(Player* player, uint32 textId, uint32 altTextId, uint32 skillValue, uint32 reqSpellId, uint32 spellId, uint32& npcTextId)
878 {
879 bool res = false;
880 npcTextId = textId;
881 if (player->GetBaseSkillValue(SKILL_ENGINEERING) >= skillValue && player->HasSpell(reqSpellId))
882 {
883 if (!player->HasSpell(spellId))
884 res = true;
885 else
886 npcTextId = altTextId;
887 }
888 return res;
889 }
890
891 bool OnGossipHello(Player* player) override
892 {
893 uint32 npcTextId = 0;
894 std::string gossipItem;
895 bool canLearn = false;
896
897 if (player->HasSkill(SKILL_ENGINEERING))
898 {
899 switch (me->GetEntry())
900 {
901 case NPC_ZAP:
902 canLearn = CanLearn(player, 6092, 0, 260, S_GOBLIN, SPELL_TO_EVERLOOK, npcTextId);
903 if (canLearn)
904 gossipItem = GOSSIP_ITEM_ZAP;
905 break;
906 case NPC_JHORDY:
907 canLearn = CanLearn(player, 7251, 7252, 260, S_GNOMISH, SPELL_TO_GADGET, npcTextId);
908 if (canLearn)
909 gossipItem = GOSSIP_ITEM_JHORDY;
910 break;
911 case NPC_KABLAM:
912 canLearn = CanLearn(player, 10365, 0, 350, S_GOBLIN, SPELL_TO_AREA52, npcTextId);
913 if (canLearn)
914 gossipItem = GOSSIP_ITEM_KABLAM;
915 break;
916 case NPC_SMILES:
917 canLearn = CanLearn(player, 10363, 0, 350, S_GNOMISH, SPELL_TO_TOSHLEY, npcTextId);
918 if (canLearn)
919 gossipItem = GOSSIP_ITEM_KABLAM;
920 break;
921 }
922 }
923
924 if (canLearn)
926
927 SendGossipMenuFor(player, npcTextId ? npcTextId : player->GetGossipTextId(me), me->GetGUID());
928 return true;
929 }
930
931 bool OnGossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
932 {
933 uint32 const sender = player->PlayerTalkClass->GetGossipOptionSender(gossipListId);
934 uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
935 ClearGossipMenuFor(player);
936 if (action == GOSSIP_ACTION_INFO_DEF + 1)
937 CloseGossipMenuFor(player);
938
939 if (sender != me->GetEntry())
940 return true;
941
942 switch (sender)
943 {
944 case NPC_ZAP:
945 player->CastSpell(player, SPELL_LEARN_TO_EVERLOOK, false);
946 break;
947 case NPC_JHORDY:
948 player->CastSpell(player, SPELL_LEARN_TO_GADGET, false);
949 break;
950 case NPC_KABLAM:
951 player->CastSpell(player, SPELL_LEARN_TO_AREA52, false);
952 break;
953 case NPC_SMILES:
954 player->CastSpell(player, SPELL_LEARN_TO_TOSHLEY, false);
955 break;
956 }
957
958 return true;
959 }
960 };
961
962 CreatureAI* GetAI(Creature* creature) const override
963 {
964 return new npc_engineering_tele_trinketAI(creature);
965 }
966};
967
968/*###
969# start menues leatherworking
970###*/
971
973{
974public:
975 npc_prof_leather() : CreatureScript("npc_prof_leather") { }
976
978 {
979 npc_prof_leatherAI(Creature* creature) : ScriptedAI(creature) { }
980
981 bool OnGossipHello(Player* player) override
982 {
983 if (me->IsQuestGiver())
984 player->PrepareQuestMenu(me->GetGUID());
985
986 if (me->IsVendor())
988
989 if (me->IsTrainer())
991
992 if (player->HasSkill(SKILL_LEATHERWORKING) && player->GetBaseSkillValue(SKILL_LEATHERWORKING) >= 250 && player->GetLevel() > 49)
993 {
994 switch (me->GetEntry())
995 {
998 if (player->HasSpell(S_DRAGON))
1000 break;
1003 if (player->HasSpell(S_ELEMENTAL))
1005 break;
1006 case N_TRAINER_TRIBAL1:
1007 case N_TRAINER_TRIBAL2:
1008 if (player->HasSpell(S_TRIBAL))
1010 break;
1011 }
1012 }
1013
1014 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
1015 return true;
1016 }
1017
1018 void SendActionMenu(Player* player, uint32 action)
1019 {
1020 switch (action)
1021 {
1023 player->GetSession()->SendListInventory(me->GetGUID());
1024 break;
1027 break;
1028 //Unlearn Leather
1029 case GOSSIP_ACTION_INFO_DEF + 1:
1031 break;
1032 case GOSSIP_ACTION_INFO_DEF + 2:
1034 break;
1035 case GOSSIP_ACTION_INFO_DEF + 3:
1037 break;
1038 }
1039 }
1040
1041 void SendConfirmUnlearn(Player* player, uint32 action)
1042 {
1043 if (action)
1044 {
1045 switch (me->GetEntry())
1046 {
1047 case N_TRAINER_DRAGON1:
1048 case N_TRAINER_DRAGON2:
1050 //unknown textID ()
1051 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
1052 break;
1056 //unknown textID ()
1057 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
1058 break;
1059 case N_TRAINER_TRIBAL1:
1060 case N_TRAINER_TRIBAL2:
1062 //unknown textID ()
1063 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
1064 break;
1065 }
1066 }
1067 }
1068
1069 bool OnGossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
1070 {
1071 uint32 const sender = player->PlayerTalkClass->GetGossipOptionSender(gossipListId);
1072 uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
1073 ClearGossipMenuFor(player);
1074 switch (sender)
1075 {
1076 case GOSSIP_SENDER_MAIN:
1077 SendActionMenu(player, action);
1078 break;
1079
1081 SendConfirmUnlearn(player, action);
1082 break;
1083
1085 SendActionMenu(player, action);
1086 break;
1087 }
1088 return true;
1089 }
1090 };
1091
1092 CreatureAI* GetAI(Creature* creature) const override
1093 {
1094 return new npc_prof_leatherAI(creature);
1095 }
1096};
1097
1098/*###
1099# start menues tailoring
1100###*/
1101
1103{
1104public:
1105 npc_prof_tailor() : CreatureScript("npc_prof_tailor") { }
1106
1108 {
1109 npc_prof_tailorAI(Creature* creature) : ScriptedAI(creature) { }
1110
1111 inline bool HasTailorSpell(Player* player)
1112 {
1113 return (player->HasSpell(S_MOONCLOTH) || player->HasSpell(S_SHADOWEAVE) || player->HasSpell(S_SPELLFIRE));
1114 }
1115
1116 bool OnGossipHello(Player* player) override
1117 {
1118 if (me->IsQuestGiver())
1119 player->PrepareQuestMenu(me->GetGUID());
1120
1121 if (me->IsVendor())
1123
1124 if (me->IsTrainer())
1126
1127 //TAILORING SPEC
1128 if (player->HasSkill(SKILL_TAILORING) && player->GetBaseSkillValue(SKILL_TAILORING) >= 350 && player->GetLevel() > 59)
1129 {
1130 if (player->GetQuestRewardStatus(10831) || player->GetQuestRewardStatus(10832) || player->GetQuestRewardStatus(10833))
1131 {
1132 switch (me->GetEntry())
1133 {
1135 if (!HasTailorSpell(player))
1137 if (player->HasSpell(S_SPELLFIRE))
1139 break;
1141 if (!HasTailorSpell(player))
1143 if (player->HasSpell(S_MOONCLOTH))
1145 break;
1147 if (!HasTailorSpell(player))
1149 if (player->HasSpell(S_SHADOWEAVE))
1151 break;
1152 }
1153 }
1154 }
1155
1156 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
1157 return true;
1158 }
1159
1160 void SendActionMenu(Player* player, uint32 action)
1161 {
1162 switch (action)
1163 {
1165 player->GetSession()->SendListInventory(me->GetGUID());
1166 break;
1169 break;
1170 //Learn Tailor
1171 case GOSSIP_ACTION_INFO_DEF + 1:
1173 break;
1174 case GOSSIP_ACTION_INFO_DEF + 2:
1176 break;
1177 case GOSSIP_ACTION_INFO_DEF + 3:
1179 break;
1180 //Unlearn Tailor
1181 case GOSSIP_ACTION_INFO_DEF + 4:
1183 break;
1184 case GOSSIP_ACTION_INFO_DEF + 5:
1186 break;
1187 case GOSSIP_ACTION_INFO_DEF + 6:
1189 break;
1190 }
1191 }
1192
1193 void SendConfirmLearn(Player* player, uint32 action)
1194 {
1195 if (action)
1196 {
1197 switch (me->GetEntry())
1198 {
1201 //unknown textID ()
1202 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
1203 break;
1206 //unknown textID ()
1207 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
1208 break;
1211 //unknown textID ()
1212 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
1213 break;
1214 }
1215 }
1216 }
1217
1218 void SendConfirmUnlearn(Player* player, uint32 action)
1219 {
1220 if (action)
1221 {
1222 switch (me->GetEntry())
1223 {
1226 //unknown textID ()
1227 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
1228 break;
1231 //unknown textID ()
1232 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
1233 break;
1236 //unknown textID ()
1237 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
1238 break;
1239 }
1240 }
1241 }
1242
1243 bool OnGossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
1244 {
1245 uint32 const sender = player->PlayerTalkClass->GetGossipOptionSender(gossipListId);
1246 uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
1247 ClearGossipMenuFor(player);
1248 switch (sender)
1249 {
1250 case GOSSIP_SENDER_MAIN:
1251 SendActionMenu(player, action);
1252 break;
1253
1255 SendConfirmLearn(player, action);
1256 break;
1257
1259 SendConfirmUnlearn(player, action);
1260 break;
1261
1263 SendActionMenu(player, action);
1264 break;
1265 }
1266 return true;
1267 }
1268 };
1269
1270 CreatureAI* GetAI(Creature* creature) const override
1271 {
1272 return new npc_prof_tailorAI(creature);
1273 }
1274};
1275
1277{
1290
1301 GOSSIP_MENU_TAILORING = 12199
1303
1305{
1306 new npc_prof_alchemy();
1307 new npc_prof_blacksmith();
1309 new npc_prof_leather();
1310 new npc_prof_tailor();
1311}
@ DIFFICULTY_NONE
Definition: DBCEnums.h:874
uint8_t uint8
Definition: Define.h:144
int64_t int64
Definition: Define.h:137
int32_t int32
Definition: Define.h:138
uint32_t uint32
Definition: Define.h:142
@ EQUIP_ERR_CLIENT_LOCKED_OUT
Definition: ItemDefines.h:66
@ BUY_ERR_NOT_ENOUGHT_MONEY
Definition: ItemDefines.h:152
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:156
@ EQUIPMENT_SLOT_END
Definition: Player.h:650
@ EQUIPMENT_SLOT_START
Definition: Player.h:630
#define INVENTORY_SLOT_BAG_0
Definition: Player.h:625
void AddGossipItemFor(Player *player, GossipOptionNpc optionNpc, std::string text, uint32 sender, uint32 action)
void SendGossipMenuFor(Player *player, uint32 npcTextID, ObjectGuid const &guid)
void ClearGossipMenuFor(Player *player)
void CloseGossipMenuFor(Player *player)
#define GOSSIP_TEXT_TRAIN
#define GOSSIP_TEXT_BROWSE_GOODS
@ GOSSIP_SENDER_MAIN
@ GOSSIP_ACTION_TRADE
@ GOSSIP_ACTION_TRAIN
@ GOSSIP_ACTION_INFO_DEF
@ REP_FRIENDLY
@ SKILL_BLACKSMITHING
@ SKILL_LEATHERWORKING
@ SKILL_TAILORING
@ SKILL_ENGINEERING
@ SKILL_ALCHEMY
#define sSpellMgr
Definition: SpellMgr.h:849
Creature *const me
Definition: CreatureAI.h:61
Definition: Item.h:170
ItemTemplate const * GetTemplate() const
Definition: Item.cpp:1141
uint32 GetEntry() const
Definition: Object.h:161
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:159
void SendEquipError(InventoryResult msg, Item const *item1=nullptr, Item const *item2=nullptr, uint32 itemId=0) const
Definition: Player.cpp:13254
bool ModifyMoney(int64 amount, bool sendError=true)
Definition: Player.cpp:24098
bool GetQuestRewardStatus(uint32 quest_id) const
Definition: Player.cpp:16033
WorldSession * GetSession() const
Definition: Player.h:2101
Item * GetItemByPos(uint16 pos) const
Definition: Player.cpp:9582
bool HasSkill(uint32 skill) const
Definition: Player.cpp:6031
uint16 GetBaseSkillValue(uint32 skill) const
Definition: Player.cpp:6094
void SendBuyError(BuyResult msg, Creature *creature, uint32 item, uint32 param) const
Definition: Player.cpp:13300
void PrepareQuestMenu(ObjectGuid guid)
Definition: Player.cpp:14474
void RemoveSpell(uint32 spell_id, bool disabled=false, bool learn_low_rank=true, bool suppressMessaging=false)
Definition: Player.cpp:3260
ReputationRank GetReputationRank(uint32 faction_id) const
Definition: Player.cpp:6497
bool HasSpell(uint32 spell) const override
Definition: Player.cpp:3792
uint32 GetGossipTextId(uint32 menuId, WorldObject *source)
Definition: Player.cpp:14367
std::unique_ptr< PlayerMenu > PlayerTalkClass
Definition: Player.h:2380
bool HasEnoughMoney(uint64 amount) const
Definition: Player.h:1740
std::vector< SpellEffectInfo > const & GetEffects() const
Definition: SpellInfo.h:576
bool IsTrainer() const
Definition: Unit.h:993
bool IsQuestGiver() const
Definition: Unit.h:994
bool IsVendor() const
Definition: Unit.h:992
uint8 GetLevel() const
Definition: Unit.h:746
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2896
void SendListInventory(ObjectGuid guid)
void SendTrainerList(Creature *npc, uint32 trainerId)
Definition: NPCHandler.cpp:112
CreatureAI * GetAI(Creature *creature) const override
CreatureAI * GetAI(Creature *creature) const override
CreatureAI * GetAI(Creature *creature) const override
CreatureAI * GetAI(Creature *creature) const override
CreatureAI * GetAI(Creature *creature) const override
#define GOSSIP_LEARN_POTION
MultiProfessionTrainer
@ GOSSIP_OPTION_HERBALISM
@ GOSSIP_MENU_ENGINEERING
@ GOSSIP_MENU_JEWELCRAFTING
@ GOSSIP_OPTION_JEWELCRAFTING
@ GOSSIP_OPTION_INSCRIPTION
@ GOSSIP_OPTION_LEATHERWORKING
@ GOSSIP_OPTION_MINING
@ GOSSIP_MENU_ALCHEMY
@ GOSSIP_OPTION_ENGINEERING
@ GOSSIP_MENU_ENCHANTING
@ GOSSIP_MENU_TAILORING
@ GOSSIP_MENU_SKINNING
@ GOSSIP_OPTION_ENCHANTING
@ GOSSIP_MENU_MINING
@ GOSSIP_OPTION_BLACKSMITHING
@ GOSSIP_MENU_INSCRIPTION
@ GOSSIP_OPTION_TAILORING
@ GOSSIP_OPTION_MULTI
@ GOSSIP_MENU_LEATHERWORKING
@ GOSSIP_MENU_BLACKSMITHING
@ GOSSIP_OPTION_ALCHEMY
@ GOSSIP_MENU_HERBALISM
@ GOSSIP_OPTION_SKINNING
ProfessionSpells
@ S_LEARN_WEAPON
@ S_GNOMISH
@ S_LEARN_DRAGON
@ S_LEARN_GNOMISH
@ S_LEARN_GOBLIN
@ S_AXE
@ S_TRIBAL
@ S_WEAPON
@ S_GOBLIN
@ S_REP_WEAPON
@ S_SWORD
@ S_UNLEARN_SWORD
@ REP_HAMMER
@ S_LEARN_POTION
@ S_LEARN_MOONCLOTH
@ S_LEARN_ELEMENTAL
@ S_UNLEARN_WEAPON
@ S_DRAGON
@ S_MOONCLOTH
@ S_UNLEARN_SPELLFIRE
@ S_UNLEARN_TRANSMUTE
@ S_UNLEARN_SHADOWEAVE
@ S_LEARN_ARMOR
@ S_LEARN_ELIXIR
@ S_UNLEARN_TRIBAL
@ S_HAMMER
@ S_UNLEARN_HAMMER
@ S_LEARN_HAMMER
@ S_UNLEARN_DRAGON
@ REP_SWORD
@ S_LEARN_SPELLFIRE
@ S_LEARN_TRANSMUTE
@ S_LEARN_SHADOWEAVE
@ S_SPELLFIRE
@ S_ELEMENTAL
@ S_UNLEARN_ELIXIR
@ S_LEARN_AXE
@ REP_ARMOR
@ S_ELIXIR
@ S_SHADOWEAVE
@ S_UNLEARN_ELEMENTAL
@ S_TRANSMUTE
@ S_REP_ARMOR
@ REP_AXE
@ S_LEARN_SWORD
@ S_UNLEARN_MOONCLOTH
@ REP_WEAPON
@ S_ARMOR
@ S_UNLEARN_AXE
@ S_UNLEARN_ARMOR
@ S_UNLEARN_POTION
@ S_POTION
@ S_LEARN_TRIBAL
#define GOSSIP_LEARN_SPELLFIRE
#define GOSSIP_UNLEARN_SHADOWEAVE
#define GOSSIP_UNLEARN_HAMMER
#define GOSSIP_LEARN_HAMMER
#define BOX_UNLEARN_ARMORORWEAPON
#define BOX_UNLEARN_ALCHEMY_SPEC
void AddSC_npc_professions()
#define GOSSIP_UNLEARN_POTION
#define GOSSIP_SENDER_CHECK
void ProfessionUnlearnSpells(Player *player, uint32 type)
#define BOX_UNLEARN_LEATHER_SPEC
#define GOSSIP_SENDER_LEARN
int32 DoHighUnlearnCost(Player *)
#define GOSSIP_UNLEARN_AXE
#define GOSSIP_UNLEARN_SMITH_SPEC
int32 DoMedUnlearnCost(Player *player)
#define GOSSIP_ITEM_KABLAM
#define GOSSIP_LEARN_SHADOWEAVE
#define GOSSIP_ARMOR_LEARN
#define GOSSIP_LEARN_AXE
#define GOSSIP_LEARN_ELIXIR
bool EquippedOk(Player *player, uint32 spellId)
#define GOSSIP_UNLEARN_ELIXIR
#define GOSSIP_UNLEARN_MOONCLOTH
#define GOSSIP_UNLEARN_ELEMENTAL
SpecializationQuests
@ Q_MASTER_POTION
@ Q_MASTER_TRANSMUTE
@ Q_MASTER_ELIXIR
int32 DoLowUnlearnCost(Player *player)
#define GOSSIP_WEAPON_UNLEARN
void ProcessCastaction(Player *player, Creature *creature, uint32 spellId, uint32 triggeredSpellId, int32 cost)
#define GOSSIP_SENDER_UNLEARN
#define GOSSIP_UNLEARN_SPELLFIRE
#define GOSSIP_UNLEARN_DRAGON
#define BOX_UNLEARN_TAILOR_SPEC
#define GOSSIP_WEAPON_LEARN
SpecializationTrainers
@ TRAINER_ID_ALCHEMY
@ N_TRAINER_TRANSMUTE
@ N_TRAINER_SMITHOMNI1
@ N_TRAINER_SMITHOMNI2
@ TRAINER_ID_BLACKSMITHING
@ N_TRAINER_AXE
@ N_TRAINER_ELIXIR
@ N_TRAINER_SHADOWEAVE
@ TRAINER_ID_LEATHERWORKING
@ N_TRAINER_ELEMENTAL1
@ N_TRAINER_ARMOR1
@ N_TRAINER_HAMMER
@ N_TRAINER_TRIBAL1
@ N_TRAINER_POTION
@ N_TRAINER_WEAPON1
@ N_TRAINER_DRAGON1
@ N_TRAINER_MOONCLOTH
@ N_TRAINER_ARMOR2
@ TRAINER_ID_TAILORING
@ N_TRAINER_SPELLFIRE
@ N_TRAINER_DRAGON2
@ N_TRAINER_WEAPON2
@ N_TRAINER_SWORD
@ N_TRAINER_ELEMENTAL2
@ N_TRAINER_TRIBAL2
#define GOSSIP_ARMOR_UNLEARN
#define GOSSIP_UNLEARN_SWORD
#define GOSSIP_UNLEARN_TRIBAL
void ProcessUnlearnAction(Player *player, Creature *creature, uint32 spellId, uint32 alternativeSpellId, int32 cost)
#define GOSSIP_LEARN_TRANSMUTE
#define GOSSIP_LEARN_SWORD
EngineeringTrinkets
@ SPELL_LEARN_TO_EVERLOOK
@ NPC_SMILES
@ SPELL_TO_GADGET
@ NPC_ZAP
@ NPC_JHORDY
@ SPELL_TO_EVERLOOK
@ SPELL_TO_AREA52
@ SPELL_LEARN_TO_GADGET
@ SPELL_LEARN_TO_AREA52
@ SPELL_LEARN_TO_TOSHLEY
@ SPELL_TO_TOSHLEY
@ NPC_KABLAM
#define GOSSIP_ITEM_ZAP
#define BOX_UNLEARN_WEAPON_SPEC
#define GOSSIP_LEARN_MOONCLOTH
int32 DoLearnCost(Player *)
#define GOSSIP_UNLEARN_TRANSMUTE
#define GOSSIP_ITEM_JHORDY
uint32 GetRequiredSpell() const
Definition: ItemTemplate.h:793
bool CanLearn(Player *player, uint32 textId, uint32 altTextId, uint32 skillValue, uint32 reqSpellId, uint32 spellId, uint32 &npcTextId)
bool OnGossipSelect(Player *player, uint32, uint32 gossipListId) override
void SendActionMenu(Player *player, uint32 action)
void SendConfirmLearn(Player *player, uint32 action)
void SendConfirmUnlearn(Player *player, uint32 action)
bool OnGossipHello(Player *player) override
bool OnGossipSelect(Player *player, uint32, uint32 gossipListId) override
void SendActionMenu(Player *player, uint32 action)
void SendConfirmUnlearn(Player *player, uint32 action)
bool OnGossipSelect(Player *player, uint32, uint32 gossipListId) override
bool OnGossipHello(Player *player) override
void SendConfirmLearn(Player *player, uint32 action)
bool OnGossipHello(Player *player) override
bool OnGossipSelect(Player *player, uint32, uint32 gossipListId) override
void SendActionMenu(Player *player, uint32 action)
void SendConfirmUnlearn(Player *player, uint32 action)
void SendActionMenu(Player *player, uint32 action)
bool OnGossipHello(Player *player) override
void SendConfirmLearn(Player *player, uint32 action)
void SendConfirmUnlearn(Player *player, uint32 action)
bool OnGossipSelect(Player *player, uint32, uint32 gossipListId) override