TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
npc_prof_leather Class Reference

Public Member Functions

 npc_prof_leather ()
 
bool OnGossipHello (Player *player, Creature *creature) override
 
void SendActionMenu (Player *player, Creature *creature, uint32 action)
 
void SendConfirmUnlearn (Player *player, Creature *creature, uint32 action)
 
bool OnGossipSelect (Player *player, Creature *creature, uint32 sender, uint32 action) override
 
- Public Member Functions inherited from CreatureScript
virtual bool OnDummyEffect (Unit *, uint32, SpellEffIndex, Creature *)
 
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 OnQuestReward (Player *, Creature *, Quest const *, uint32)
 
virtual uint32 GetDialogStatus (Player *, Creature *)
 
virtual CreatureAIGetAI (Creature *) const
 
- Public Member Functions inherited from UnitScript
virtual void OnHeal (Unit *, Unit *, uint32 &)
 
virtual void OnDamage (Unit *, Unit *, uint32 &)
 
virtual void ModifyPeriodicDamageAurasTick (Unit *, Unit *, uint32 &)
 
virtual void ModifyMeleeDamage (Unit *, Unit *, uint32 &)
 
virtual void ModifySpellDamageTaken (Unit *, Unit *, int32 &)
 
- Public Member Functions inherited from ScriptObject
const std::string & GetName () const
 
- 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 UnitScript
 UnitScript (const char *name, bool addToScripts=true)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name)
 
virtual ~ScriptObject ()
 
- Protected Member Functions inherited from UpdatableScript< Creature >
 UpdatableScript ()
 
virtual ~UpdatableScript ()
 

Constructor & Destructor Documentation

npc_prof_leather::npc_prof_leather ( )
inline
936 : CreatureScript("npc_prof_leather") { }
CreatureScript(const char *name)
Definition: ScriptMgr.cpp:1586

Member Function Documentation

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

Reimplemented from CreatureScript.

939  {
940  if (creature->IsQuestGiver())
941  player->PrepareQuestMenu(creature->GetGUID());
942 
943  if (creature->IsVendor())
945 
946  if (creature->IsTrainer())
948 
949  if (player->HasSkill(SKILL_LEATHERWORKING) && player->GetBaseSkillValue(SKILL_LEATHERWORKING) >= 250 && player->getLevel() > 49)
950  {
951  switch (creature->GetEntry())
952  {
953  case N_TRAINER_DRAGON1:
954  case N_TRAINER_DRAGON2:
955  if (player->HasSpell(S_DRAGON))
957  break;
960  if (player->HasSpell(S_ELEMENTAL))
962  break;
963  case N_TRAINER_TRIBAL1:
964  case N_TRAINER_TRIBAL2:
965  if (player->HasSpell(S_TRIBAL))
967  break;
968  }
969  }
970 
971  player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
972  return true;
973  }
bool IsVendor() const
Definition: Unit.h:1564
Definition: npc_professions.cpp:138
#define GOSSIP_SENDER_UNLEARN
Definition: npc_professions.cpp:58
Definition: ScriptedGossip.h:71
Definition: npc_professions.cpp:140
Definition: GossipDef.h:62
Definition: ScriptedGossip.h:59
#define GOSSIP_TEXT_BROWSE_GOODS
Definition: ScriptedGossip.h:26
Definition: SharedDefines.h:3929
Definition: npc_professions.cpp:207
bool IsQuestGiver() const
Definition: Unit.h:1566
Definition: npc_professions.cpp:206
Definition: GossipDef.h:60
#define GOSSIP_UNLEARN_ELEMENTAL
Definition: npc_professions.cpp:92
Definition: npc_professions.cpp:203
Definition: ScriptedGossip.h:60
Definition: npc_professions.cpp:208
Definition: ScriptedGossip.h:73
#define GOSSIP_TEXT_TRAIN
Definition: ScriptedGossip.h:27
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: GossipDef.h:59
#define GOSSIP_UNLEARN_TRIBAL
Definition: npc_professions.cpp:93
uint32 GetEntry() const
Definition: Object.h:107
bool IsTrainer() const
Definition: Unit.h:1565
Definition: npc_professions.cpp:139
Definition: npc_professions.cpp:205
Definition: npc_professions.cpp:204
#define GOSSIP_UNLEARN_DRAGON
Definition: npc_professions.cpp:91

+ Here is the call graph for this function:

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

Reimplemented from CreatureScript.

1027  {
1028  player->PlayerTalkClass->ClearMenus();
1029  switch (sender)
1030  {
1031  case GOSSIP_SENDER_MAIN:
1032  SendActionMenu(player, creature, action);
1033  break;
1034 
1035  case GOSSIP_SENDER_UNLEARN:
1036  SendConfirmUnlearn(player, creature, action);
1037  break;
1038 
1039  case GOSSIP_SENDER_CHECK:
1040  SendActionMenu(player, creature, action);
1041  break;
1042  }
1043  return true;
1044  }
#define GOSSIP_SENDER_UNLEARN
Definition: npc_professions.cpp:58
Definition: ScriptedGossip.h:73
#define GOSSIP_SENDER_CHECK
Definition: npc_professions.cpp:59
void SendConfirmUnlearn(Player *player, Creature *creature, uint32 action)
Definition: npc_professions.cpp:998
void SendActionMenu(Player *player, Creature *creature, uint32 action)
Definition: npc_professions.cpp:975

+ Here is the call graph for this function:

void npc_prof_leather::SendActionMenu ( Player player,
Creature creature,
uint32  action 
)
inline
976  {
977  switch (action)
978  {
979  case GOSSIP_ACTION_TRADE:
980  player->GetSession()->SendListInventory(creature->GetGUID());
981  break;
982  case GOSSIP_ACTION_TRAIN:
983  player->GetSession()->SendTrainerList(creature->GetGUID());
984  break;
985  //Unlearn Leather
986  case GOSSIP_ACTION_INFO_DEF + 1:
987  ProcessUnlearnAction(player, creature, S_UNLEARN_DRAGON, 0, DoMedUnlearnCost(player));
988  break;
989  case GOSSIP_ACTION_INFO_DEF + 2:
990  ProcessUnlearnAction(player, creature, S_UNLEARN_ELEMENTAL, 0, DoMedUnlearnCost(player));
991  break;
992  case GOSSIP_ACTION_INFO_DEF + 3:
993  ProcessUnlearnAction(player, creature, S_UNLEARN_TRIBAL, 0, DoMedUnlearnCost(player));
994  break;
995  }
996  }
Definition: npc_professions.cpp:146
Definition: ScriptedGossip.h:71
Definition: npc_professions.cpp:148
Definition: ScriptedGossip.h:59
int32 DoMedUnlearnCost(Player *player)
Definition: npc_professions.cpp:241
void ProcessUnlearnAction(Player *player, Creature *creature, uint32 spellId, uint32 alternativeSpellId, int32 cost)
Definition: npc_professions.cpp:400
Definition: ScriptedGossip.h:60
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: npc_professions.cpp:147

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_prof_leather::SendConfirmUnlearn ( Player player,
Creature creature,
uint32  action 
)
inline
999  {
1000  if (action)
1001  {
1002  switch (creature->GetEntry())
1003  {
1004  case N_TRAINER_DRAGON1:
1005  case N_TRAINER_DRAGON2:
1006  player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_DRAGON, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player), false);
1007  //unknown textID ()
1008  player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
1009  break;
1010  case N_TRAINER_ELEMENTAL1:
1011  case N_TRAINER_ELEMENTAL2:
1012  player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_ELEMENTAL, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player), false);
1013  //unknown textID ()
1014  player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
1015  break;
1016  case N_TRAINER_TRIBAL1:
1017  case N_TRAINER_TRIBAL2:
1018  player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_TRIBAL, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player), false);
1019  //unknown textID ()
1020  player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
1021  break;
1022  }
1023  }
1024  }
int32 DoMedUnlearnCost(Player *player)
Definition: npc_professions.cpp:241
#define BOX_UNLEARN_LEATHER_SPEC
Definition: npc_professions.cpp:95
Definition: npc_professions.cpp:207
Definition: npc_professions.cpp:206
#define GOSSIP_UNLEARN_ELEMENTAL
Definition: npc_professions.cpp:92
Definition: npc_professions.cpp:203
Definition: npc_professions.cpp:208
ObjectGuid const & GetGUID() const
Definition: Object.h:105
#define GOSSIP_UNLEARN_TRIBAL
Definition: npc_professions.cpp:93
uint32 GetEntry() const
Definition: Object.h:107
#define GOSSIP_SENDER_CHECK
Definition: npc_professions.cpp:59
Definition: npc_professions.cpp:205
Definition: npc_professions.cpp:204
#define GOSSIP_UNLEARN_DRAGON
Definition: npc_professions.cpp:91

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


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