AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
npc_prof_leather Class Reference
Inheritance diagram for npc_prof_leather:
CreatureScript ScriptObject UpdatableScript< Creature >

Public Member Functions

 npc_prof_leather ()
 
bool HasLeatherSpecialty (Player *player)
 
bool OnGossipHello (Player *player, Creature *creature) override
 
bool OnGossipSelect (Player *player, Creature *creature, uint32, uint32 action) override
 
- Public Member Functions inherited from CreatureScript
bool IsDatabaseBound () const override
 
virtual bool OnGossipHello (Player *, Creature *)
 
virtual bool OnGossipSelect (Player *, Creature *, uint32, uint32)
 
virtual bool OnGossipSelectCode (Player *, Creature *, uint32, uint32, const char *)
 
virtual bool OnQuestAccept (Player *, Creature *, Quest const *)
 
virtual bool OnQuestSelect (Player *, Creature *, Quest const *)
 
virtual bool OnQuestComplete (Player *, Creature *, Quest const *)
 
virtual bool OnQuestReward (Player *, Creature *, Quest const *, uint32)
 
virtual uint32 GetDialogStatus (Player *, Creature *)
 
virtual CreatureAIGetAI (Creature *) const
 
virtual void OnFfaPvpStateUpdate (Creature *, bool)
 
- Public Member Functions inherited from ScriptObject
virtual bool IsDatabaseBound () const
 
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
const std::string & GetName () const
 
uint16 GetTotalAvailableHooks ()
 
- Public Member Functions inherited from UpdatableScript< Creature >
virtual void OnUpdate (Creature *, uint32)
 

Additional Inherited Members

- Protected Member Functions inherited from CreatureScript
 CreatureScript (const char *name)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name, uint16 totalAvailableHooks=0)
 
virtual ~ScriptObject ()=default
 
- Protected Member Functions inherited from UpdatableScript< Creature >
 UpdatableScript ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ npc_prof_leather()

npc_prof_leather::npc_prof_leather ( )
inline
970: CreatureScript("npc_prof_leather") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ HasLeatherSpecialty()

bool npc_prof_leather::HasLeatherSpecialty ( Player player)
inline
973 {
974 return (player->HasSpell(S_DRAGON) || player->HasSpell(S_ELEMENTAL) || player->HasSpell(S_TRIBAL));
975 }
@ S_TRIBAL
Definition: npc_professions.cpp:141
@ S_DRAGON
Definition: npc_professions.cpp:139
@ S_ELEMENTAL
Definition: npc_professions.cpp:140
bool HasSpell(uint32 spell) const override
Definition: Player.cpp:3892

References Player::HasSpell(), S_DRAGON, S_ELEMENTAL, and S_TRIBAL.

◆ OnGossipHello()

bool npc_prof_leather::OnGossipHello ( Player player,
Creature creature 
)
inlineoverridevirtual

Reimplemented from CreatureScript.

978 {
979 ClearGossipMenuFor(player);
980
981 if (creature->IsQuestGiver())
982 {
983 player->PrepareQuestMenu(creature->GetGUID());
984 }
985
986 switch (creature->GetEntry())
987 {
988 case N_TRAINER_DRAGON1: //Peter Galen
989 case N_TRAINER_DRAGON2: //Thorkaf Dragoneye
991 break;
992 case N_TRAINER_ELEMENTAL1: //Sarah Tanner
993 case N_TRAINER_ELEMENTAL2: //Brumn Winterhoof
995 break;
996 case N_TRAINER_TRIBAL1: //Caryssia Moonhunter
997 case N_TRAINER_TRIBAL2: //Se'Jib
999 break;
1000 }
1001
1002 if (player->HasSkill(SKILL_LEATHERWORKING) && player->GetBaseSkillValue(SKILL_LEATHERWORKING) >= 225 && player->GetLevel() > 40)
1003 {
1004 switch (creature->GetEntry())
1005 {
1006 case N_TRAINER_DRAGON1: //Peter Galen
1007 case N_TRAINER_DRAGON2: //Thorkaf Dragoneye
1008 if (player->HasSpell(S_DRAGON))
1010 break;
1011 case N_TRAINER_ELEMENTAL1: //Sarah Tanner
1012 case N_TRAINER_ELEMENTAL2: //Brumn Winterhoof
1013 if (player->HasSpell(S_ELEMENTAL))
1015 break;
1016 case N_TRAINER_TRIBAL1: //Caryssia Moonhunter
1017 case N_TRAINER_TRIBAL2: //Se'Jib
1018 if (player->HasSpell(S_TRIBAL))
1020 break;
1021 }
1022 }
1023
1024 SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
1025 return true;
1026 }
@ GOSSIP_MENU_PETER_GALEN
Definition: npc_professions.cpp:234
@ GOSSIP_MENU_UNLEARN_CONFIRM_ELEMENTAL
Definition: npc_professions.cpp:242
@ GOSSIP_MENU_SARAH_TANNER
Definition: npc_professions.cpp:237
@ GOSSIP_MENU_UNLEARN_CONFIRM_TRIBAL
Definition: npc_professions.cpp:243
@ GOSSIP_MENU_OPTION_TRAIN
Definition: npc_professions.cpp:245
@ GOSSIP_MENU_THORKAF_DRAGONEYE
Definition: npc_professions.cpp:235
@ GOSSIP_MENU_OPTION_CONFIRM_UNLEARN_TRIBAL
Definition: npc_professions.cpp:248
@ GOSSIP_MENU_UNLEARN_CONFIRM_DRAGONSCALE
Definition: npc_professions.cpp:241
@ GOSSIP_MENU_OPTION_CONFIRM_UNLEARN_ELEMENTAL
Definition: npc_professions.cpp:247
@ GOSSIP_MENU_OPTION_CONFIRM_UNLEARN_DRAGONSCALE
Definition: npc_professions.cpp:246
@ GOSSIP_MENU_BRUMN_WINTERHOOF
Definition: npc_professions.cpp:236
@ GOSSIP_MENU_SEJIB
Definition: npc_professions.cpp:239
@ GOSSIP_MENU_CARYSSIA_MOONHUNTER
Definition: npc_professions.cpp:238
@ N_TRAINER_ELEMENTAL1
Definition: npc_professions.cpp:208
@ N_TRAINER_TRIBAL1
Definition: npc_professions.cpp:210
@ N_TRAINER_DRAGON1
Definition: npc_professions.cpp:206
@ N_TRAINER_DRAGON2
Definition: npc_professions.cpp:207
@ N_TRAINER_ELEMENTAL2
Definition: npc_professions.cpp:209
@ N_TRAINER_TRIBAL2
Definition: npc_professions.cpp:211
@ SKILL_LEATHERWORKING
Definition: SharedDefines.h:2910
void SendGossipMenuFor(Player *player, uint32 npcTextID, ObjectGuid const guid)
Definition: ScriptedGossip.cpp:45
void AddGossipItemFor(Player *player, uint32 icon, std::string const &text, uint32 sender, uint32 action)
Definition: ScriptedGossip.cpp:28
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
@ GOSSIP_SENDER_MAIN
Definition: ScriptedGossip.h:70
@ GOSSIP_ACTION_TRAIN
Definition: ScriptedGossip.h:57
uint32 GetEntry() const
Definition: Object.h:115
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
bool HasSkill(uint32 skill) const
Definition: Player.cpp:5447
uint16 GetBaseSkillValue(uint32 skill) const
Definition: Player.cpp:5519
void PrepareQuestMenu(ObjectGuid guid)
Definition: PlayerQuest.cpp:39
uint32 GetGossipTextId(uint32 menuId, WorldObject *source)
Definition: PlayerGossip.cpp:404
bool IsQuestGiver() const
Definition: Unit.h:762
uint8 GetLevel() const
Definition: Unit.h:1024

References AddGossipItemFor(), ClearGossipMenuFor(), Player::GetBaseSkillValue(), Object::GetEntry(), Player::GetGossipTextId(), Object::GetGUID(), Unit::GetLevel(), GOSSIP_ACTION_TRAIN, GOSSIP_MENU_BRUMN_WINTERHOOF, GOSSIP_MENU_CARYSSIA_MOONHUNTER, GOSSIP_MENU_OPTION_CONFIRM_UNLEARN_DRAGONSCALE, GOSSIP_MENU_OPTION_CONFIRM_UNLEARN_ELEMENTAL, GOSSIP_MENU_OPTION_CONFIRM_UNLEARN_TRIBAL, GOSSIP_MENU_OPTION_TRAIN, GOSSIP_MENU_PETER_GALEN, GOSSIP_MENU_SARAH_TANNER, GOSSIP_MENU_SEJIB, GOSSIP_MENU_THORKAF_DRAGONEYE, GOSSIP_MENU_UNLEARN_CONFIRM_DRAGONSCALE, GOSSIP_MENU_UNLEARN_CONFIRM_ELEMENTAL, GOSSIP_MENU_UNLEARN_CONFIRM_TRIBAL, GOSSIP_SENDER_MAIN, Player::HasSkill(), Player::HasSpell(), Unit::IsQuestGiver(), N_TRAINER_DRAGON1, N_TRAINER_DRAGON2, N_TRAINER_ELEMENTAL1, N_TRAINER_ELEMENTAL2, N_TRAINER_TRIBAL1, N_TRAINER_TRIBAL2, Player::PrepareQuestMenu(), S_DRAGON, S_ELEMENTAL, S_TRIBAL, SendGossipMenuFor(), and SKILL_LEATHERWORKING.

◆ OnGossipSelect()

bool npc_prof_leather::OnGossipSelect ( Player player,
Creature creature,
uint32  ,
uint32  action 
)
inlineoverridevirtual

Reimplemented from CreatureScript.

1029 {
1030 ClearGossipMenuFor(player);
1031
1032 switch (action)
1033 {
1035 player->GetSession()->SendTrainerList(creature->GetGUID());
1036 break;
1040 break;
1044 break;
1048 break;
1049 case GOSSIP_ACTION_INFO_DEF + 1:
1050 ProcessUnlearnAction(player, creature, S_UNLEARN_DRAGON, 0, DoMedUnlearnCost(player));
1051 break;
1052 case GOSSIP_ACTION_INFO_DEF + 2:
1053 ProcessUnlearnAction(player, creature, S_UNLEARN_ELEMENTAL, 0, DoMedUnlearnCost(player));
1054 break;
1055 case GOSSIP_ACTION_INFO_DEF + 3:
1056 ProcessUnlearnAction(player, creature, S_UNLEARN_TRIBAL, 0, DoMedUnlearnCost(player));
1057 break;
1058 }
1059 return true;
1060 }
@ S_UNLEARN_TRIBAL
Definition: npc_professions.cpp:149
@ S_UNLEARN_DRAGON
Definition: npc_professions.cpp:147
@ S_UNLEARN_ELEMENTAL
Definition: npc_professions.cpp:148
@ GOSSIP_TEXT_UNLEARN_CONFIRM_TRIBAL
Definition: npc_professions.cpp:252
@ GOSSIP_TEXT_UNLEARN_CONFIRM_DRAGONSCALE
Definition: npc_professions.cpp:250
@ GOSSIP_TEXT_UNLEARN_CONFIRM_ELEMENTAL
Definition: npc_professions.cpp:251
int32 DoMedUnlearnCost(Player *player)
Definition: npc_professions.cpp:275
void ProcessUnlearnAction(Player *player, Creature *creature, uint32 spellId, uint32 alternativeSpellId, int32 cost)
Definition: npc_professions.cpp:442
@ GOSSIP_ACTION_INFO_DEF
Definition: ScriptedGossip.h:68
WorldSession * GetSession() const
Definition: Player.h:1998
void SendTrainerList(ObjectGuid guid)
Definition: NPCHandler.cpp:87

References AddGossipItemFor(), ClearGossipMenuFor(), DoMedUnlearnCost(), Object::GetGUID(), Player::GetSession(), GOSSIP_ACTION_INFO_DEF, GOSSIP_ACTION_TRAIN, GOSSIP_MENU_OPTION_CONFIRM_UNLEARN_DRAGONSCALE, GOSSIP_MENU_OPTION_CONFIRM_UNLEARN_ELEMENTAL, GOSSIP_MENU_OPTION_CONFIRM_UNLEARN_TRIBAL, GOSSIP_MENU_UNLEARN_CONFIRM_DRAGONSCALE, GOSSIP_MENU_UNLEARN_CONFIRM_ELEMENTAL, GOSSIP_MENU_UNLEARN_CONFIRM_TRIBAL, GOSSIP_SENDER_MAIN, GOSSIP_TEXT_UNLEARN_CONFIRM_DRAGONSCALE, GOSSIP_TEXT_UNLEARN_CONFIRM_ELEMENTAL, GOSSIP_TEXT_UNLEARN_CONFIRM_TRIBAL, ProcessUnlearnAction(), S_UNLEARN_DRAGON, S_UNLEARN_ELEMENTAL, S_UNLEARN_TRIBAL, SendGossipMenuFor(), and WorldSession::SendTrainerList().