Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
npc_professions.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6/* ScriptData
7SDName: Npc_Professions
8SD%Complete: 80
9SDComment: Provides learn/unlearn/relearn-options for professions. Not supported: Unlearn engineering, re-learn engineering, re-learn leatherworking.
10SDCategory: NPCs
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15#include "ScriptedGossip.h"
16#include "Player.h"
17#include "SpellInfo.h"
18#include "WorldSession.h"
19
20/*
21A few notes for future developement:
22- A full implementation of gossip for GO's is required. They must have the same scripting capabilities as creatures. Basically,
23there is no difference here (except that default text is chosen with `gameobject_template`.`data3` (for GO type2, different dataN for a few others)
24- It's possible blacksmithing still require some tweaks and adjustments due to the way we _have_ to use reputation.
25*/
26
27/*###
28# to be removed from here (->ncp_text). This is data for database projects.
29###*/
30#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."
31
32#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."
33#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."
34#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."
35
36#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!"
37#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!"
38#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!"
39
40/*###
41# generic defines
42###*/
43
44#define GOSSIP_SENDER_LEARN 50
45#define GOSSIP_SENDER_UNLEARN 51
46#define GOSSIP_SENDER_CHECK 52
47
48/*###
49# gossip item and box texts
50###*/
51
52#define GOSSIP_LEARN_POTION "Please teach me how to become a Master of Potions, Lauranna"
53#define GOSSIP_UNLEARN_POTION "I wish to unlearn Potion Mastery"
54#define GOSSIP_LEARN_TRANSMUTE "Please teach me how to become a Master of Transmutations, Zarevhi"
55#define GOSSIP_UNLEARN_TRANSMUTE "I wish to unlearn Transmutation Mastery"
56#define GOSSIP_LEARN_ELIXIR "Please teach me how to become a Master of Elixirs, Lorokeem"
57#define GOSSIP_UNLEARN_ELIXIR "I wish to unlearn Elixir Mastery"
58
59#define BOX_UNLEARN_ALCHEMY_SPEC "Do you really want to unlearn your alchemy specialty and lose all associated recipes? \n Cost: "
60
61#define GOSSIP_WEAPON_LEARN "Please teach me how to become a Weaponsmith"
62#define GOSSIP_WEAPON_UNLEARN "I wish to unlearn the art of Weaponsmithing"
63#define GOSSIP_ARMOR_LEARN "Please teach me how to become a Armorsmith"
64#define GOSSIP_ARMOR_UNLEARN "I wish to unlearn the art of Armorsmithing"
65
66#define GOSSIP_UNLEARN_SMITH_SPEC "I wish to unlearn my blacksmith specialty"
67#define BOX_UNLEARN_ARMORORWEAPON "Do you really want to unlearn your blacksmith specialty and lose all associated recipes? \n Cost: "
68
69#define GOSSIP_LEARN_HAMMER "Please teach me how to become a Hammersmith, Lilith"
70#define GOSSIP_UNLEARN_HAMMER "I wish to unlearn Hammersmithing"
71#define GOSSIP_LEARN_AXE "Please teach me how to become a Axesmith, Kilram"
72#define GOSSIP_UNLEARN_AXE "I wish to unlearn Axesmithing"
73#define GOSSIP_LEARN_SWORD "Please teach me how to become a Swordsmith, Seril"
74#define GOSSIP_UNLEARN_SWORD "I wish to unlearn Swordsmithing"
75
76#define BOX_UNLEARN_WEAPON_SPEC "Do you really want to unlearn your weaponsmith specialty and lose all associated recipes? \n Cost: "
77
78#define GOSSIP_UNLEARN_DRAGON "I wish to unlearn Dragonscale Leatherworking"
79#define GOSSIP_UNLEARN_ELEMENTAL "I wish to unlearn Elemental Leatherworking"
80#define GOSSIP_UNLEARN_TRIBAL "I wish to unlearn Tribal Leatherworking"
81
82#define BOX_UNLEARN_LEATHER_SPEC "Do you really want to unlearn your leatherworking specialty and lose all associated recipes? \n Cost: "
83
84#define GOSSIP_LEARN_SPELLFIRE "Please teach me how to become a Spellcloth tailor"
85#define GOSSIP_UNLEARN_SPELLFIRE "I wish to unlearn Spellfire Tailoring"
86#define GOSSIP_LEARN_MOONCLOTH "Please teach me how to become a Mooncloth tailor"
87#define GOSSIP_UNLEARN_MOONCLOTH "I wish to unlearn Mooncloth Tailoring"
88#define GOSSIP_LEARN_SHADOWEAVE "Please teach me how to become a Shadoweave tailor"
89#define GOSSIP_UNLEARN_SHADOWEAVE "I wish to unlearn Shadoweave Tailoring"
90
91#define BOX_UNLEARN_TAILOR_SPEC "Do you really want to unlearn your tailoring specialty and lose all associated recipes? \n Cost: "
92
93/*###
94# spells defines
95###*/
167
168/*###
169# formulas to calculate unlearning cost
170###*/
171
172int32 DoLearnCost(Player* /*player*/) //tailor, alchemy
173{
174 return 200000;
175}
176
177int32 DoHighUnlearnCost(Player* /*player*/) //tailor, alchemy
178{
179 return 1500000;
180}
181
182int32 DoMedUnlearnCost(Player* player) //blacksmith, leatherwork
183{
184 uint8 level = player->getLevel();
185 if (level < 51)
186 return 250000;
187 else if (level < 66)
188 return 500000;
189 else
190 return 1000000;
191}
192
193int32 DoLowUnlearnCost(Player* player) //blacksmith
194{
195 uint8 level = player->getLevel();
196 if (level < 66)
197 return 50000;
198 else
199 return 100000;
200}
201
202void ProcessCastaction(Player* player, Creature* creature, uint32 spellId, uint32 triggeredSpellId, int32 cost)
203{
204 if (!(spellId && player->HasSpell(spellId)) && player->HasEnoughMoney((int64)cost))
205 {
206 player->CastSpell(player, triggeredSpellId, true);
207 player->ModifyMoney(-cost);
208 }
209 else
211 player->CLOSE_GOSSIP_MENU();
212}
213
214/*###
215# unlearning related profession spells
216###*/
217
218bool EquippedOk(Player* player, uint32 spellId)
219{
220 SpellInfo const* spell = sSpellMgr->GetSpellInfo(spellId);
221 if (!spell)
222 return false;
223
224 for (uint8 i = 0; i < 3; ++i)
225 {
226 uint32 reqSpell = spell->Effects[i].TriggerSpell;
227 if (!reqSpell)
228 continue;
229
230 Item* item = NULL;
232 {
233 item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, j);
234 if (item && item->GetTemplate()->RequiredSpell == reqSpell)
235 {
236 //player has item equipped that require specialty. Not allow to unlearn, player has to unequip first
237 SF_LOG_DEBUG("scripts", "player attempt to unlearn spell %u, but item %u is equipped.", reqSpell, item->GetEntry());
238 return false;
239 }
240 }
241 }
242 return true;
243}
244
246{
247 switch (type)
248 {
249 case S_UNLEARN_WEAPON: // S_UNLEARN_WEAPON
250 player->removeSpell(36125); // Light Earthforged Blade
251 player->removeSpell(36128); // Light Emberforged Hammer
252 player->removeSpell(36126); // Light Skyforged Axe
253 break;
254 case S_UNLEARN_ARMOR: // S_UNLEARN_ARMOR
255 player->removeSpell(36122); // Earthforged Leggings
256 player->removeSpell(36129); // Heavy Earthforged Breastplate
257 player->removeSpell(36130); // Stormforged Hauberk
258 player->removeSpell(34533); // Breastplate of Kings
259 player->removeSpell(34529); // Nether Chain Shirt
260 player->removeSpell(34534); // Bulwark of Kings
261 player->removeSpell(36257); // Bulwark of the Ancient Kings
262 player->removeSpell(36256); // Embrace of the Twisting Nether
263 player->removeSpell(34530); // Twisting Nether Chain Shirt
264 player->removeSpell(36124); // Windforged Leggings
265 break;
266 case S_UNLEARN_HAMMER: // S_UNLEARN_HAMMER
267 player->removeSpell(36262); // Dragonstrike
268 player->removeSpell(34546); // Dragonmaw
269 player->removeSpell(34545); // Drakefist Hammer
270 player->removeSpell(36136); // Lavaforged Warhammer
271 player->removeSpell(34547); // Thunder
272 player->removeSpell(34567); // Deep Thunder
273 player->removeSpell(36263); // Stormherald
274 player->removeSpell(36137); // Great Earthforged Hammer
275 break;
276 case S_UNLEARN_AXE: // S_UNLEARN_AXE
277 player->removeSpell(36260); // Wicked Edge of the Planes
278 player->removeSpell(34562); // Black Planar Edge
279 player->removeSpell(34541); // The Planar Edge
280 player->removeSpell(36134); // Stormforged Axe
281 player->removeSpell(36135); // Skyforged Great Axe
282 player->removeSpell(36261); // Bloodmoon
283 player->removeSpell(34543); // Lunar Crescent
284 player->removeSpell(34544); // Mooncleaver
285 break;
286 case S_UNLEARN_SWORD: // S_UNLEARN_SWORD
287 player->removeSpell(36258); // Blazefury
288 player->removeSpell(34537); // Blazeguard
289 player->removeSpell(34535); // Fireguard
290 player->removeSpell(36131); // Windforged Rapier
291 player->removeSpell(36133); // Stoneforged Claymore
292 player->removeSpell(34538); // Lionheart Blade
293 player->removeSpell(34540); // Lionheart Champion
294 player->removeSpell(36259); // Lionheart Executioner
295 break;
296 case S_UNLEARN_DRAGON: // S_UNLEARN_DRAGON
297 player->removeSpell(36076); // Dragonstrike Leggings
298 player->removeSpell(36079); // Golden Dragonstrike Breastplate
299 player->removeSpell(35576); // Ebon Netherscale Belt
300 player->removeSpell(35577); // Ebon Netherscale Bracers
301 player->removeSpell(35575); // Ebon Netherscale Breastplate
302 player->removeSpell(35582); // Netherstrike Belt
303 player->removeSpell(35584); // Netherstrike Bracers
304 player->removeSpell(35580); // Netherstrike Breastplate
305 break;
306 case S_UNLEARN_ELEMENTAL: // S_UNLEARN_ELEMENTAL
307 player->removeSpell(36074); // Blackstorm Leggings
308 player->removeSpell(36077); // Primalstorm Breastplate
309 player->removeSpell(35590); // Primalstrike Belt
310 player->removeSpell(35591); // Primalstrike Bracers
311 player->removeSpell(35589); // Primalstrike Vest
312 break;
313 case S_UNLEARN_TRIBAL: // S_UNLEARN_TRIBAL
314 player->removeSpell(35585); // Windhawk Hauberk
315 player->removeSpell(35587); // Windhawk Belt
316 player->removeSpell(35588); // Windhawk Bracers
317 player->removeSpell(36075); // Wildfeather Leggings
318 player->removeSpell(36078); // Living Crystal Breastplate
319 break;
320 case S_UNLEARN_SPELLFIRE: // S_UNLEARN_SPELLFIRE
321 player->removeSpell(26752); // Spellfire Belt
322 player->removeSpell(26753); // Spellfire Gloves
323 player->removeSpell(26754); // Spellfire Robe
324 break;
325 case S_UNLEARN_MOONCLOTH: // S_UNLEARN_MOONCLOTH
326 player->removeSpell(26760); // Primal Mooncloth Belt
327 player->removeSpell(26761); // Primal Mooncloth Shoulders
328 player->removeSpell(26762); // Primal Mooncloth Robe
329 break;
330 case S_UNLEARN_SHADOWEAVE: // S_UNLEARN_SHADOWEAVE
331 player->removeSpell(26756); // Frozen Shadoweave Shoulders
332 player->removeSpell(26757); // Frozen Shadoweave Boots
333 player->removeSpell(26758); // Frozen Shadoweave Robe
334 break;
335 }
336}
337
338void ProcessUnlearnAction(Player* player, Creature* creature, uint32 spellId, uint32 alternativeSpellId, int32 cost)
339{
340 if (EquippedOk(player, spellId))
341 {
342 if (player->HasEnoughMoney(int64(cost)))
343 {
344 player->CastSpell(player, spellId, true);
345 ProfessionUnlearnSpells(player, spellId);
346 player->ModifyMoney(-int64(cost));
347 if (alternativeSpellId)
348 creature->CastSpell(player, alternativeSpellId, true);
349 }
350 else
352 }
353 else
354 player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, NULL, NULL);
355 player->CLOSE_GOSSIP_MENU();
356}
357
358/*###
359# start menues alchemy
360###*/
361
363{
364public:
365 npc_prof_alchemy() : CreatureScript("npc_prof_alchemy") { }
366
367 inline bool HasAlchemySpell(Player* player)
368 {
369 return (player->HasSpell(S_TRANSMUTE) || player->HasSpell(S_ELIXIR) || player->HasSpell(S_POTION));
370 }
371
372 bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
373 {
374 if (creature->IsQuestGiver())
375 player->PrepareQuestMenu(creature->GetGUID());
376
377 if (creature->IsVendor())
379
380 if (creature->IsTrainer())
382
383 if (player->HasSkill(SKILL_ALCHEMY) && player->GetBaseSkillValue(SKILL_ALCHEMY) >= 350 && player->getLevel() > 67)
384 {
385 if (player->GetQuestRewardStatus(10899) || player->GetQuestRewardStatus(10902) || player->GetQuestRewardStatus(10897))
386 {
387 switch (creature->GetEntry())
388 {
389 case 22427: //Zarevhi
390 if (!HasAlchemySpell(player))
392 if (player->HasSpell(S_TRANSMUTE))
394 break;
395 case 19052: //Lorokeem
396 if (!HasAlchemySpell(player))
398 if (player->HasSpell(S_ELIXIR))
400 break;
401 case 17909: //Lauranna Thar'well
402 if (!HasAlchemySpell(player))
404 if (player->HasSpell(S_POTION))
406 break;
407 }
408 }
409 }
410
411 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
412 return true;
413 }
414
415 void SendActionMenu(Player* player, Creature* creature, uint32 action)
416 {
417 switch (action)
418 {
420 player->GetSession()->SendListInventory(creature->GetGUID());
421 break;
423 player->GetSession()->SendTrainerList(creature->GetGUID());
424 break;
425 //Learn Alchemy
426 case GOSSIP_ACTION_INFO_DEF + 1:
427 ProcessCastaction(player, creature, S_TRANSMUTE, S_LEARN_TRANSMUTE, DoLearnCost(player));
428 break;
429 case GOSSIP_ACTION_INFO_DEF + 2:
430 ProcessCastaction(player, creature, S_ELIXIR, S_LEARN_ELIXIR, DoLearnCost(player));
431 break;
432 case GOSSIP_ACTION_INFO_DEF + 3:
433 ProcessCastaction(player, creature, S_POTION, S_LEARN_POTION, DoLearnCost(player));
434 break;
435 //Unlearn Alchemy
436 case GOSSIP_ACTION_INFO_DEF + 4:
437 ProcessCastaction(player, creature, 0, S_UNLEARN_TRANSMUTE, DoHighUnlearnCost(player));
438 break;
439 case GOSSIP_ACTION_INFO_DEF + 5:
440 ProcessCastaction(player, creature, 0, S_UNLEARN_ELIXIR, DoHighUnlearnCost(player));
441 break;
442 case GOSSIP_ACTION_INFO_DEF + 6:
443 ProcessCastaction(player, creature, 0, S_UNLEARN_POTION, DoHighUnlearnCost(player));
444 break;
445 }
446 }
447
448 void SendConfirmLearn(Player* player, Creature* creature, uint32 action)
449 {
450 if (action)
451 {
452 switch (creature->GetEntry())
453 {
454 case 22427:
455 player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_TRANSMUTE, GOSSIP_SENDER_CHECK, action);
456 //unknown textID ()
457 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
458 break;
459 case 19052:
460 player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_ELIXIR, GOSSIP_SENDER_CHECK, action);
461 //unknown textID ()
462 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
463 break;
464 case 17909:
465 player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_POTION, GOSSIP_SENDER_CHECK, action);
466 //unknown textID ()
467 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
468 break;
469 }
470 }
471 }
472
473 void SendConfirmUnlearn(Player* player, Creature* creature, uint32 action)
474 {
475 if (action)
476 {
477 switch (creature->GetEntry())
478 {
479 case 22427: //Zarevhi
480 player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_TRANSMUTE, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_ALCHEMY_SPEC, DoHighUnlearnCost(player), false);
481 //unknown textID ()
482 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
483 break;
484 case 19052: //Lorokeem
485 player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_ELIXIR, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_ALCHEMY_SPEC, DoHighUnlearnCost(player), false);
486 //unknown textID ()
487 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
488 break;
489 case 17909: //Lauranna Thar'well
490 player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_POTION, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_ALCHEMY_SPEC, DoHighUnlearnCost(player), false);
491 //unknown textID ()
492 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
493 break;
494 }
495 }
496 }
497
498 bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) OVERRIDE
499 {
500 player->PlayerTalkClass->ClearMenus();
501 switch (sender)
502 {
504 SendActionMenu(player, creature, action);
505 break;
506
508 SendConfirmLearn(player, creature, action);
509 break;
510
512 SendConfirmUnlearn(player, creature, action);
513 break;
514
516 SendActionMenu(player, creature, action);
517 break;
518 }
519 return true;
520 }
521};
522
523/*###
524# start menues blacksmith
525###*/
526
528{
529public:
530 npc_prof_blacksmith() : CreatureScript("npc_prof_blacksmith") { }
531
532 inline bool HasWeaponSub(Player* player)
533 {
534 return (player->HasSpell(S_HAMMER) || player->HasSpell(S_AXE) || player->HasSpell(S_SWORD));
535 }
536
537 bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
538 {
539 if (creature->IsQuestGiver())
540 player->PrepareQuestMenu(creature->GetGUID());
541
542 if (creature->IsVendor())
544
545 if (creature->IsTrainer())
547
548 uint32 creatureId = creature->GetEntry();
549 //WEAPONSMITH & ARMORSMITH
550 if (player->GetBaseSkillValue(SKILL_BLACKSMITHING) >= 225)
551 {
552 switch (creatureId)
553 {
554 case 11145: //Myolor Sunderfury
555 case 11176: //Krathok Moltenfist
556 if (!player->HasSpell(S_ARMOR) && !player->HasSpell(S_WEAPON) && player->GetReputationRank(REP_ARMOR) >= REP_FRIENDLY)
558 if (!player->HasSpell(S_WEAPON) && !player->HasSpell(S_ARMOR) && player->GetReputationRank(REP_WEAPON) >= REP_FRIENDLY)
560 break;
561 case 11146: //Ironus Coldsteel
562 case 11178: //Borgosh Corebender
563 if (player->HasSpell(S_WEAPON))
565 break;
566 case 5164: //Grumnus Steelshaper
567 case 11177: //Okothos Ironrager
568 if (player->HasSpell(S_ARMOR))
570 break;
571 }
572 }
573 //WEAPONSMITH SPEC
574 if (player->HasSpell(S_WEAPON) && player->getLevel() > 49 && player->GetBaseSkillValue(SKILL_BLACKSMITHING) >= 250)
575 {
576 switch (creatureId)
577 {
578 case 11191: //Lilith the Lithe
579 if (!HasWeaponSub(player))
581 if (player->HasSpell(S_HAMMER))
583 break;
584 case 11192: //Kilram
585 if (!HasWeaponSub(player))
587 if (player->HasSpell(S_AXE))
589 break;
590 case 11193: //Seril Scourgebane
591 if (!HasWeaponSub(player))
593 if (player->HasSpell(S_SWORD))
595 break;
596 }
597 }
598
599 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
600 return true;
601 }
602
603 void SendActionMenu(Player* player, Creature* creature, uint32 action)
604 {
605 switch (action)
606 {
608 player->GetSession()->SendListInventory(creature->GetGUID());
609 break;
611 player->GetSession()->SendTrainerList(creature->GetGUID());
612 break;
613 //Learn Armor/Weapon
614 case GOSSIP_ACTION_INFO_DEF + 1:
615 if (!player->HasSpell(S_ARMOR))
616 {
617 player->CastSpell(player, S_LEARN_ARMOR, true);
618 //_Creature->CastSpell(player, S_REP_ARMOR, true);
619 }
620 player->CLOSE_GOSSIP_MENU();
621 break;
622 case GOSSIP_ACTION_INFO_DEF + 2:
623 if (!player->HasSpell(S_WEAPON))
624 {
625 player->CastSpell(player, S_LEARN_WEAPON, true);
626 //_Creature->CastSpell(player, S_REP_WEAPON, true);
627 }
628 player->CLOSE_GOSSIP_MENU();
629 break;
630 //Unlearn Armor/Weapon
631 case GOSSIP_ACTION_INFO_DEF + 3:
632 if (HasWeaponSub(player))
633 {
634 //unknown textID (TALK_MUST_UNLEARN_WEAPON)
635 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
636 }
637 else
639 break;
640 case GOSSIP_ACTION_INFO_DEF + 4:
642 break;
643 //Learn Hammer/Axe/Sword
644 case GOSSIP_ACTION_INFO_DEF + 5:
645 player->CastSpell(player, S_LEARN_HAMMER, true);
646 player->CLOSE_GOSSIP_MENU();
647 break;
648 case GOSSIP_ACTION_INFO_DEF + 6:
649 player->CastSpell(player, S_LEARN_AXE, true);
650 player->CLOSE_GOSSIP_MENU();
651 break;
652 case GOSSIP_ACTION_INFO_DEF + 7:
653 player->CastSpell(player, S_LEARN_SWORD, true);
654 player->CLOSE_GOSSIP_MENU();
655 break;
656 //Unlearn Hammer/Axe/Sword
657 case GOSSIP_ACTION_INFO_DEF + 8:
658 ProcessUnlearnAction(player, creature, S_UNLEARN_HAMMER, 0, DoMedUnlearnCost(player));
659 break;
660 case GOSSIP_ACTION_INFO_DEF + 9:
661 ProcessUnlearnAction(player, creature, S_UNLEARN_AXE, 0, DoMedUnlearnCost(player));
662 break;
663 case GOSSIP_ACTION_INFO_DEF + 10:
664 ProcessUnlearnAction(player, creature, S_UNLEARN_SWORD, 0, DoMedUnlearnCost(player));
665 break;
666 }
667 }
668
669 void SendConfirmLearn(Player* player, Creature* creature, uint32 action)
670 {
671 if (action)
672 {
673 switch (creature->GetEntry())
674 {
675 case 11191:
676 player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_HAMMER, GOSSIP_SENDER_CHECK, action);
677 //unknown textID (TALK_HAMMER_LEARN)
678 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
679 break;
680 case 11192:
681 player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_AXE, GOSSIP_SENDER_CHECK, action);
682 //unknown textID (TALK_AXE_LEARN)
683 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
684 break;
685 case 11193:
686 player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_SWORD, GOSSIP_SENDER_CHECK, action);
687 //unknown textID (TALK_SWORD_LEARN)
688 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
689 break;
690 }
691 }
692 }
693
694 void SendConfirmUnlearn(Player* player, Creature* creature, uint32 action)
695 {
696 if (action)
697 {
698 switch (creature->GetEntry())
699 {
700 case 11146: //Ironus Coldsteel
701 case 11178: //Borgosh Corebender
702 case 5164: //Grumnus Steelshaper
703 case 11177: //Okothos Ironrager
704 player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_SMITH_SPEC, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_ARMORORWEAPON, DoLowUnlearnCost(player), false);
705 //unknown textID (TALK_UNLEARN_AXEORWEAPON)
706 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
707 break;
708
709 case 11191:
710 player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_HAMMER, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_WEAPON_SPEC, DoMedUnlearnCost(player), false);
711 //unknown textID (TALK_HAMMER_UNLEARN)
712 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
713 break;
714 case 11192:
715 player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_AXE, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_WEAPON_SPEC, DoMedUnlearnCost(player), false);
716 //unknown textID (TALK_AXE_UNLEARN)
717 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
718 break;
719 case 11193:
720 player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_SWORD, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_WEAPON_SPEC, DoMedUnlearnCost(player), false);
721 //unknown textID (TALK_SWORD_UNLEARN)
722 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
723 break;
724 }
725 }
726 }
727
728 bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) OVERRIDE
729 {
730 player->PlayerTalkClass->ClearMenus();
731 switch (sender)
732 {
734 SendActionMenu(player, creature, action);
735 break;
736
738 SendConfirmLearn(player, creature, action);
739 break;
740
742 SendConfirmUnlearn(player, creature, action);
743 break;
744
746 SendActionMenu(player, creature, action);
747 break;
748 }
749 return true;
750 }
751};
752
753/*###
754# engineering trinkets
755###*/
756
774
775#define GOSSIP_ITEM_ZAP "This Dimensional Imploder sounds dangerous! How can I make one?"
776#define GOSSIP_ITEM_JHORDY "I must build a beacon for this marvelous device!"
777#define GOSSIP_ITEM_KABLAM "[PH] Unknown"
778
780{
781public:
782 npc_engineering_tele_trinket() : CreatureScript("npc_engineering_tele_trinket") { }
783
784 bool CanLearn(Player* player, uint32 textId, uint32 altTextId, uint32 skillValue, uint32 reqSpellId, uint32 spellId, uint32& npcTextId)
785 {
786 bool res = false;
787 npcTextId = textId;
788 if (player->GetBaseSkillValue(SKILL_ENGINEERING) >= skillValue && player->HasSpell(reqSpellId))
789 {
790 if (!player->HasSpell(spellId))
791 res = true;
792 else
793 npcTextId = altTextId;
794 }
795 return res;
796 }
797
798 bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
799 {
800 uint32 npcTextId = 0;
801 std::string gossipItem;
802 bool canLearn = false;
803
804 if (player->HasSkill(SKILL_ENGINEERING))
805 {
806 switch (creature->GetEntry())
807 {
808 case NPC_ZAP:
809 canLearn = CanLearn(player, 6092, 0, 260, S_GOBLIN, SPELL_TO_EVERLOOK, npcTextId);
810 if (canLearn)
811 gossipItem = GOSSIP_ITEM_ZAP;
812 break;
813 case NPC_JHORDY:
814 canLearn = CanLearn(player, 7251, 7252, 260, S_GNOMISH, SPELL_TO_GADGET, npcTextId);
815 if (canLearn)
816 gossipItem = GOSSIP_ITEM_JHORDY;
817 break;
818 case NPC_KABLAM:
819 canLearn = CanLearn(player, 10365, 0, 350, S_GOBLIN, SPELL_TO_AREA52, npcTextId);
820 if (canLearn)
821 gossipItem = GOSSIP_ITEM_KABLAM;
822 break;
823 case NPC_SMILES:
824 canLearn = CanLearn(player, 10363, 0, 350, S_GNOMISH, SPELL_TO_TOSHLEY, npcTextId);
825 if (canLearn)
826 gossipItem = GOSSIP_ITEM_KABLAM;
827 break;
828 }
829 }
830
831 if (canLearn)
832 player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, gossipItem, creature->GetEntry(), GOSSIP_ACTION_INFO_DEF + 1);
833
834 player->SEND_GOSSIP_MENU(npcTextId ? npcTextId : player->GetGossipTextId(creature), creature->GetGUID());
835 return true;
836 }
837
838 bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) OVERRIDE
839 {
840 player->PlayerTalkClass->ClearMenus();
841 if (action == GOSSIP_ACTION_INFO_DEF + 1)
842 player->CLOSE_GOSSIP_MENU();
843
844 if (sender != creature->GetEntry())
845 return true;
846
847 switch (sender)
848 {
849 case NPC_ZAP:
850 player->CastSpell(player, SPELL_LEARN_TO_EVERLOOK, false);
851 break;
852 case NPC_JHORDY:
853 player->CastSpell(player, SPELL_LEARN_TO_GADGET, false);
854 break;
855 case NPC_KABLAM:
856 player->CastSpell(player, SPELL_LEARN_TO_AREA52, false);
857 break;
858 case NPC_SMILES:
859 player->CastSpell(player, SPELL_LEARN_TO_TOSHLEY, false);
860 break;
861 }
862
863 return true;
864 }
865};
866
867/*###
868# start menues leatherworking
869###*/
870
872{
873public:
874 npc_prof_leather() : CreatureScript("npc_prof_leather") { }
875
876 bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
877 {
878 if (creature->IsQuestGiver())
879 player->PrepareQuestMenu(creature->GetGUID());
880
881 if (creature->IsVendor())
883
884 if (creature->IsTrainer())
886
887 if (player->HasSkill(SKILL_LEATHERWORKING) && player->GetBaseSkillValue(SKILL_LEATHERWORKING) >= 250 && player->getLevel() > 49)
888 {
889 switch (creature->GetEntry())
890 {
891 case 7866: //Peter Galen
892 case 7867: //Thorkaf Dragoneye
893 if (player->HasSpell(S_DRAGON))
895 break;
896 case 7868: //Sarah Tanner
897 case 7869: //Brumn Winterhoof
898 if (player->HasSpell(S_ELEMENTAL))
900 break;
901 case 7870: //Caryssia Moonhunter
902 case 7871: //Se'Jib
903 if (player->HasSpell(S_TRIBAL))
905 break;
906 }
907 }
908
909 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
910 return true;
911 }
912
913 void SendActionMenu(Player* player, Creature* creature, uint32 action)
914 {
915 switch (action)
916 {
918 player->GetSession()->SendListInventory(creature->GetGUID());
919 break;
921 player->GetSession()->SendTrainerList(creature->GetGUID());
922 break;
923 //Unlearn Leather
924 case GOSSIP_ACTION_INFO_DEF + 1:
925 ProcessUnlearnAction(player, creature, S_UNLEARN_DRAGON, 0, DoMedUnlearnCost(player));
926 break;
927 case GOSSIP_ACTION_INFO_DEF + 2:
928 ProcessUnlearnAction(player, creature, S_UNLEARN_ELEMENTAL, 0, DoMedUnlearnCost(player));
929 break;
930 case GOSSIP_ACTION_INFO_DEF + 3:
931 ProcessUnlearnAction(player, creature, S_UNLEARN_TRIBAL, 0, DoMedUnlearnCost(player));
932 break;
933 }
934 }
935
936 void SendConfirmUnlearn(Player* player, Creature* creature, uint32 action)
937 {
938 if (action)
939 {
940 switch (creature->GetEntry())
941 {
942 case 7866: //Peter Galen
943 case 7867: //Thorkaf Dragoneye
944 player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_DRAGON, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player), false);
945 //unknown textID ()
946 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
947 break;
948 case 7868: //Sarah Tanner
949 case 7869: //Brumn Winterhoof
950 player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_ELEMENTAL, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player), false);
951 //unknown textID ()
952 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
953 break;
954 case 7870: //Caryssia Moonhunter
955 case 7871: //Se'Jib
956 player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_TRIBAL, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player), false);
957 //unknown textID ()
958 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
959 break;
960 }
961 }
962 }
963
964 bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) OVERRIDE
965 {
966 player->PlayerTalkClass->ClearMenus();
967 switch (sender)
968 {
970 SendActionMenu(player, creature, action);
971 break;
972
974 SendConfirmUnlearn(player, creature, action);
975 break;
976
978 SendActionMenu(player, creature, action);
979 break;
980 }
981 return true;
982 }
983};
984
985/*###
986# start menues tailoring
987###*/
988
990{
991public:
992 npc_prof_tailor() : CreatureScript("npc_prof_tailor") { }
993
994 inline bool HasTailorSpell(Player* player)
995 {
996 return (player->HasSpell(S_MOONCLOTH) || player->HasSpell(S_SHADOWEAVE) || player->HasSpell(S_SPELLFIRE));
997 }
998
999 bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
1000 {
1001 if (creature->IsQuestGiver())
1002 player->PrepareQuestMenu(creature->GetGUID());
1003
1004 if (creature->IsVendor())
1006
1007 if (creature->IsTrainer())
1009
1010 //TAILORING SPEC
1011 if (player->HasSkill(SKILL_TAILORING) && player->GetBaseSkillValue(SKILL_TAILORING) >= 350 && player->getLevel() > 59)
1012 {
1013 if (player->GetQuestRewardStatus(10831) || player->GetQuestRewardStatus(10832) || player->GetQuestRewardStatus(10833))
1014 {
1015 switch (creature->GetEntry())
1016 {
1017 case 22213: //Gidge Spellweaver
1018 if (!HasTailorSpell(player))
1020 if (player->HasSpell(S_SPELLFIRE))
1022 break;
1023 case 22208: //Nasmara Moonsong
1024 if (!HasTailorSpell(player))
1026 if (player->HasSpell(S_MOONCLOTH))
1028 break;
1029 case 22212: //Andrion Darkspinner
1030 if (!HasTailorSpell(player))
1032 if (player->HasSpell(S_SHADOWEAVE))
1034 break;
1035 }
1036 }
1037 }
1038
1039 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
1040 return true;
1041 }
1042
1043 void SendActionMenu(Player* player, Creature* creature, uint32 action)
1044 {
1045 switch (action)
1046 {
1048 player->GetSession()->SendListInventory(creature->GetGUID());
1049 break;
1051 player->GetSession()->SendTrainerList(creature->GetGUID());
1052 break;
1053 //Learn Tailor
1054 case GOSSIP_ACTION_INFO_DEF + 1:
1055 ProcessCastaction(player, creature, S_SPELLFIRE, S_LEARN_SPELLFIRE, DoLearnCost(player));
1056 break;
1057 case GOSSIP_ACTION_INFO_DEF + 2:
1058 ProcessCastaction(player, creature, S_MOONCLOTH, S_LEARN_MOONCLOTH, DoLearnCost(player));
1059 break;
1060 case GOSSIP_ACTION_INFO_DEF + 3:
1061 ProcessCastaction(player, creature, S_SHADOWEAVE, S_LEARN_SHADOWEAVE, DoLearnCost(player));
1062 break;
1063 //Unlearn Tailor
1064 case GOSSIP_ACTION_INFO_DEF + 4:
1065 ProcessUnlearnAction(player, creature, S_UNLEARN_SPELLFIRE, 0, DoHighUnlearnCost(player));
1066 break;
1067 case GOSSIP_ACTION_INFO_DEF + 5:
1068 ProcessUnlearnAction(player, creature, S_UNLEARN_MOONCLOTH, 0, DoHighUnlearnCost(player));
1069 break;
1070 case GOSSIP_ACTION_INFO_DEF + 6:
1071 ProcessUnlearnAction(player, creature, S_UNLEARN_SHADOWEAVE, 0, DoHighUnlearnCost(player));
1072 break;
1073 }
1074 }
1075
1076 void SendConfirmLearn(Player* player, Creature* creature, uint32 action)
1077 {
1078 if (action)
1079 {
1080 switch (creature->GetEntry())
1081 {
1082 case 22213:
1083 player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_SPELLFIRE, GOSSIP_SENDER_CHECK, action);
1084 //unknown textID ()
1085 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
1086 break;
1087 case 22208:
1088 player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_MOONCLOTH, GOSSIP_SENDER_CHECK, action);
1089 //unknown textID ()
1090 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
1091 break;
1092 case 22212:
1093 player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_SHADOWEAVE, GOSSIP_SENDER_CHECK, action);
1094 //unknown textID ()
1095 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
1096 break;
1097 }
1098 }
1099 }
1100
1101 void SendConfirmUnlearn(Player* player, Creature* creature, uint32 action)
1102 {
1103 if (action)
1104 {
1105 switch (creature->GetEntry())
1106 {
1107 case 22213: //Gidge Spellweaver
1108 player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_SPELLFIRE, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player), false);
1109 //unknown textID ()
1110 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
1111 break;
1112 case 22208: //Nasmara Moonsong
1113 player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_MOONCLOTH, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player), false);
1114 //unknown textID ()
1115 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
1116 break;
1117 case 22212: //Andrion Darkspinner
1118 player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_SHADOWEAVE, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player), false);
1119 //unknown textID ()
1120 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
1121 break;
1122 }
1123 }
1124 }
1125
1126 bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) OVERRIDE
1127 {
1128 player->PlayerTalkClass->ClearMenus();
1129 switch (sender)
1130 {
1131 case GOSSIP_SENDER_MAIN:
1132 SendActionMenu(player, creature, action);
1133 break;
1134
1136 SendConfirmLearn(player, creature, action);
1137 break;
1138
1140 SendConfirmUnlearn(player, creature, action);
1141 break;
1142
1144 SendActionMenu(player, creature, action);
1145 break;
1146 }
1147 return true;
1148 }
1149};
1150
1152{
1153 new npc_prof_alchemy();
1154 new npc_prof_blacksmith();
1156 new npc_prof_leather();
1157 new npc_prof_tailor();
1158}
std::int32_t int32
Definition Define.h:73
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
std::int64_t int64
Definition Define.h:72
@ GOSSIP_ICON_CHAT
Definition GossipDef.h:46
@ GOSSIP_ICON_TRAINER
Definition GossipDef.h:49
@ GOSSIP_ICON_VENDOR
Definition GossipDef.h:47
@ BUY_ERR_NOT_ENOUGHT_MONEY
Definition Item.h:128
@ EQUIP_ERR_CLIENT_LOCKED_OUT
Definition Item.h:67
#define SF_LOG_DEBUG(filterType__,...)
Definition Log.h:134
@ EQUIPMENT_SLOT_END
Definition Player.h:708
@ EQUIPMENT_SLOT_START
Definition Player.h:688
#define INVENTORY_SLOT_BAG_0
Definition Player.h:684
#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:744
CreatureScript(const char *name)
Definition Item.h:202
ItemTemplate const * GetTemplate() const
Definition Item.cpp:528
ObjectGuid GetObjectGUID() const
Definition Object.h:123
uint64 GetGUID() const
Definition Object.h:119
uint32 GetEntry() const
Definition Object.h:125
void SendEquipError(InventoryResult msg, Item *pItem, Item *pItem2=NULL, uint32 itemid=0)
bool ModifyMoney(int64 amount, bool sendError=true)
Definition Player.cpp:18342
WorldSession * GetSession() const
Definition Player.h:2417
Item * GetItemByPos(uint16 pos) const
uint16 GetBaseSkillValue(uint32 skill) const
Definition Player.cpp:6614
void removeSpell(uint32 spell_id, bool disabled=false, bool learn_low_rank=true)
Definition Player.cpp:4073
bool HasSpell(uint32 spell) const override
Definition Player.cpp:4674
void SendBuyFailed(BuyResult msg, ObjectGuid VendorGUID, uint32 item)
Definition Player.cpp:10736
uint32 GetGossipTextId(uint32 menuId, WorldObject *source)
Definition Player.cpp:12014
bool HasEnoughMoney(uint64 amount) const
Definition Player.h:1950
uint32 TriggerSpell
Definition SpellInfo.h:108
SpellEffectInfo Effects[MAX_SPELL_EFFECTS]
Definition SpellInfo.h:255
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, uint64 originalCaster=0)
uint8 getLevel() const
Definition Unit.h:1528
void SendTrainerList(uint64 guid)
void SendListInventory(uint64 guid)
bool OnGossipHello(Player *player, Creature *creature) OVERRIDE
bool OnGossipSelect(Player *player, Creature *creature, uint32 sender, uint32 action) OVERRIDE
bool CanLearn(Player *player, uint32 textId, uint32 altTextId, uint32 skillValue, uint32 reqSpellId, uint32 spellId, uint32 &npcTextId)
void SendActionMenu(Player *player, Creature *creature, uint32 action)
bool OnGossipSelect(Player *player, Creature *creature, uint32 sender, uint32 action) OVERRIDE
bool OnGossipHello(Player *player, Creature *creature) OVERRIDE
void SendConfirmLearn(Player *player, Creature *creature, uint32 action)
bool HasAlchemySpell(Player *player)
void SendConfirmUnlearn(Player *player, Creature *creature, uint32 action)
bool OnGossipHello(Player *player, Creature *creature) OVERRIDE
bool HasWeaponSub(Player *player)
void SendConfirmUnlearn(Player *player, Creature *creature, uint32 action)
bool OnGossipSelect(Player *player, Creature *creature, uint32 sender, uint32 action) OVERRIDE
void SendConfirmLearn(Player *player, Creature *creature, uint32 action)
void SendActionMenu(Player *player, Creature *creature, uint32 action)
bool OnGossipHello(Player *player, Creature *creature) OVERRIDE
bool OnGossipSelect(Player *player, Creature *creature, uint32 sender, uint32 action) OVERRIDE
void SendConfirmUnlearn(Player *player, Creature *creature, uint32 action)
void SendActionMenu(Player *player, Creature *creature, uint32 action)
void SendActionMenu(Player *player, Creature *creature, uint32 action)
bool HasTailorSpell(Player *player)
bool OnGossipSelect(Player *player, Creature *creature, uint32 sender, uint32 action) OVERRIDE
bool OnGossipHello(Player *player, Creature *creature) OVERRIDE
void SendConfirmLearn(Player *player, Creature *creature, uint32 action)
void SendConfirmUnlearn(Player *player, Creature *creature, uint32 action)
#define GOSSIP_LEARN_POTION
ProfessionSpells
@ S_LEARN_WEAPON
@ S_GNOMISH
@ S_LEARN_DRAGON
@ S_LEARN_GNOMISH
@ S_LEARN_GOBLIN
@ 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
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
#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 RequiredSpell