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 OnGossipSelectCode (Player *, Creature *, uint32, uint32, char const *)
 
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 CreatureAI * GetAI (Creature *) const
 
virtual void OnFfaPvpStateUpdate (Creature *, bool)
 
- Public Member Functions inherited from ScriptObject
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
std::string const & 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 (char const *name)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (char const *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
852: CreatureScript("npc_prof_leather") { }
Definition CreatureScript.h:25

Member Function Documentation

◆ HasLeatherSpecialty()

bool npc_prof_leather::HasLeatherSpecialty ( Player *  player)
inline
855 {
856 return (player->HasSpell(S_DRAGON) || player->HasSpell(S_ELEMENTAL) || player->HasSpell(S_TRIBAL));
857 }
bool HasSpell(uint32 spell) const override
Definition Player.cpp:4061
@ S_TRIBAL
Definition npc_professions.cpp:128
@ S_DRAGON
Definition npc_professions.cpp:126
@ S_ELEMENTAL
Definition npc_professions.cpp:127

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

◆ OnGossipHello()

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

Reimplemented from CreatureScript.

860 {
861 ClearGossipMenuFor(player);
862
863 if (creature->IsQuestGiver())
864 {
865 player->PrepareQuestMenu(creature->GetGUID());
866 }
867
868 switch (creature->GetEntry())
869 {
870 case N_TRAINER_DRAGON1: //Peter Galen
871 case N_TRAINER_DRAGON2: //Thorkaf Dragoneye
873 break;
874 case N_TRAINER_ELEMENTAL1: //Sarah Tanner
875 case N_TRAINER_ELEMENTAL2: //Brumn Winterhoof
877 break;
878 case N_TRAINER_TRIBAL1: //Caryssia Moonhunter
879 case N_TRAINER_TRIBAL2: //Se'Jib
881 break;
882 }
883
884 if (player->HasSkill(SKILL_LEATHERWORKING) && player->GetBaseSkillValue(SKILL_LEATHERWORKING) >= 225 && player->GetLevel() > 40)
885 {
886 switch (creature->GetEntry())
887 {
888 case N_TRAINER_DRAGON1: //Peter Galen
889 case N_TRAINER_DRAGON2: //Thorkaf Dragoneye
890 if (player->HasSpell(S_DRAGON))
892 break;
893 case N_TRAINER_ELEMENTAL1: //Sarah Tanner
894 case N_TRAINER_ELEMENTAL2: //Brumn Winterhoof
895 if (player->HasSpell(S_ELEMENTAL))
897 break;
898 case N_TRAINER_TRIBAL1: //Caryssia Moonhunter
899 case N_TRAINER_TRIBAL2: //Se'Jib
900 if (player->HasSpell(S_TRIBAL))
902 break;
903 }
904 }
905
906 SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
907 return true;
908 }
void AddGossipItemFor(Player *player, uint32 icon, std::string const &text, uint32 sender, uint32 action)
Definition ScriptedGossip.cpp:28
void SendGossipMenuFor(Player *player, uint32 npcTextID, ObjectGuid const &guid)
Definition ScriptedGossip.cpp:45
void ClearGossipMenuFor(Player *player)
Definition ScriptedGossip.cpp:22
@ GOSSIP_SENDER_MAIN
Definition ScriptedGossip.h:70
@ GOSSIP_ACTION_TRAIN
Definition ScriptedGossip.h:57
@ SKILL_LEATHERWORKING
Definition SharedDefines.h:3143
uint32 GetEntry() const
Definition Object.h:123
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:120
bool HasSkill(uint32 skill) const
Definition Player.cpp:5623
uint16 GetBaseSkillValue(uint32 skill) const
Definition Player.cpp:5695
void PrepareQuestMenu(ObjectGuid guid)
Definition PlayerQuest.cpp:40
uint32 GetGossipTextId(uint32 menuId, WorldObject *source)
Definition PlayerGossip.cpp:409
bool IsQuestGiver() const
Definition Unit.h:811
uint8 GetLevel() const
Definition Unit.h:1117
@ GOSSIP_MENU_PETER_GALEN
Definition npc_professions.cpp:227
@ GOSSIP_MENU_UNLEARN_CONFIRM_ELEMENTAL
Definition npc_professions.cpp:235
@ GOSSIP_MENU_SARAH_TANNER
Definition npc_professions.cpp:230
@ GOSSIP_MENU_UNLEARN_CONFIRM_TRIBAL
Definition npc_professions.cpp:236
@ GOSSIP_MENU_OPTION_TRAIN
Definition npc_professions.cpp:238
@ GOSSIP_MENU_THORKAF_DRAGONEYE
Definition npc_professions.cpp:228
@ GOSSIP_MENU_OPTION_CONFIRM_UNLEARN_TRIBAL
Definition npc_professions.cpp:241
@ GOSSIP_MENU_UNLEARN_CONFIRM_DRAGONSCALE
Definition npc_professions.cpp:234
@ GOSSIP_MENU_OPTION_CONFIRM_UNLEARN_ELEMENTAL
Definition npc_professions.cpp:240
@ GOSSIP_MENU_OPTION_CONFIRM_UNLEARN_DRAGONSCALE
Definition npc_professions.cpp:239
@ GOSSIP_MENU_BRUMN_WINTERHOOF
Definition npc_professions.cpp:229
@ GOSSIP_MENU_SEJIB
Definition npc_professions.cpp:232
@ GOSSIP_MENU_CARYSSIA_MOONHUNTER
Definition npc_professions.cpp:231
@ N_TRAINER_ELEMENTAL1
Definition npc_professions.cpp:195
@ N_TRAINER_TRIBAL1
Definition npc_professions.cpp:197
@ N_TRAINER_DRAGON1
Definition npc_professions.cpp:193
@ N_TRAINER_DRAGON2
Definition npc_professions.cpp:194
@ N_TRAINER_ELEMENTAL2
Definition npc_professions.cpp:196
@ N_TRAINER_TRIBAL2
Definition npc_professions.cpp:198

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.

911 {
912 ClearGossipMenuFor(player);
913
914 switch (action)
915 {
917 player->GetSession()->SendTrainerList(creature);
918 break;
922 break;
926 break;
930 break;
931 case GOSSIP_ACTION_INFO_DEF + 1:
932 ProcessUnlearnAction(player, creature, S_UNLEARN_DRAGON, 0, DoMedUnlearnCost(player));
933 break;
934 case GOSSIP_ACTION_INFO_DEF + 2:
935 ProcessUnlearnAction(player, creature, S_UNLEARN_ELEMENTAL, 0, DoMedUnlearnCost(player));
936 break;
937 case GOSSIP_ACTION_INFO_DEF + 3:
938 ProcessUnlearnAction(player, creature, S_UNLEARN_TRIBAL, 0, DoMedUnlearnCost(player));
939 break;
940 }
941 return true;
942 }
@ GOSSIP_ACTION_INFO_DEF
Definition ScriptedGossip.h:68
WorldSession * GetSession() const
Definition Player.h:2032
void SendTrainerList(Creature *npc)
Definition NPCHandler.cpp:93
@ S_UNLEARN_TRIBAL
Definition npc_professions.cpp:136
@ S_UNLEARN_DRAGON
Definition npc_professions.cpp:134
@ S_UNLEARN_ELEMENTAL
Definition npc_professions.cpp:135
@ GOSSIP_TEXT_UNLEARN_CONFIRM_TRIBAL
Definition npc_professions.cpp:245
@ GOSSIP_TEXT_UNLEARN_CONFIRM_DRAGONSCALE
Definition npc_professions.cpp:243
@ GOSSIP_TEXT_UNLEARN_CONFIRM_ELEMENTAL
Definition npc_professions.cpp:244
int32 DoMedUnlearnCost(Player *player)
Definition npc_professions.cpp:268
void ProcessUnlearnAction(Player *player, Creature *creature, uint32 spellId, uint32 alternativeSpellId, int32 cost)
Definition npc_professions.cpp:435

References AddGossipItemFor(), ClearGossipMenuFor(), DoMedUnlearnCost(), 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().


The documentation for this class was generated from the following file: