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

Public Member Functions

 npc_prof_tailor ()
 
bool HasTailorSpell (Player *player)
 
bool OnGossipHello (Player *player, Creature *creature) override
 
void SendActionMenu (Player *player, Creature *creature, uint32 action)
 
void SendConfirmLearn (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_tailor::npc_prof_tailor ( )
inline
1054 : CreatureScript("npc_prof_tailor") { }
CreatureScript(const char *name)
Definition: ScriptMgr.cpp:1586

Member Function Documentation

bool npc_prof_tailor::HasTailorSpell ( Player player)
inline
1057  {
1058  return (player->HasSpell(S_MOONCLOTH) || player->HasSpell(S_SHADOWEAVE) || player->HasSpell(S_SPELLFIRE));
1059  }
Definition: npc_professions.cpp:158
Definition: npc_professions.cpp:156
Definition: npc_professions.cpp:157

+ Here is the caller graph for this function:

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

Reimplemented from CreatureScript.

1062  {
1063  if (creature->IsQuestGiver())
1064  player->PrepareQuestMenu(creature->GetGUID());
1065 
1066  if (creature->IsVendor())
1068 
1069  if (creature->IsTrainer())
1071 
1072  //TAILORING SPEC
1073  if (player->HasSkill(SKILL_TAILORING) && player->GetBaseSkillValue(SKILL_TAILORING) >= 350 && player->getLevel() > 59)
1074  {
1075  if (player->GetQuestRewardStatus(10831) || player->GetQuestRewardStatus(10832) || player->GetQuestRewardStatus(10833))
1076  {
1077  switch (creature->GetEntry())
1078  {
1079  case N_TRAINER_SPELLFIRE:
1080  if (!HasTailorSpell(player))
1082  if (player->HasSpell(S_SPELLFIRE))
1084  break;
1085  case N_TRAINER_MOONCLOTH:
1086  if (!HasTailorSpell(player))
1088  if (player->HasSpell(S_MOONCLOTH))
1090  break;
1091  case N_TRAINER_SHADOWEAVE:
1092  if (!HasTailorSpell(player))
1094  if (player->HasSpell(S_SHADOWEAVE))
1096  break;
1097  }
1098  }
1099  }
1100 
1101  player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
1102  return true;
1103  }
bool IsVendor() const
Definition: Unit.h:1564
#define GOSSIP_SENDER_UNLEARN
Definition: npc_professions.cpp:58
Definition: ScriptedGossip.h:71
Definition: GossipDef.h:62
Definition: npc_professions.cpp:158
Definition: ScriptedGossip.h:59
#define GOSSIP_SENDER_LEARN
Definition: npc_professions.cpp:57
#define GOSSIP_TEXT_BROWSE_GOODS
Definition: ScriptedGossip.h:26
Definition: SharedDefines.h:3941
#define GOSSIP_UNLEARN_MOONCLOTH
Definition: npc_professions.cpp:100
#define GOSSIP_UNLEARN_SPELLFIRE
Definition: npc_professions.cpp:98
Definition: npc_professions.cpp:156
#define GOSSIP_LEARN_MOONCLOTH
Definition: npc_professions.cpp:99
bool IsQuestGiver() const
Definition: Unit.h:1566
#define GOSSIP_LEARN_SPELLFIRE
Definition: npc_professions.cpp:97
Definition: GossipDef.h:60
Definition: npc_professions.cpp:211
Definition: npc_professions.cpp:212
Definition: ScriptedGossip.h:60
Definition: ScriptedGossip.h:73
#define GOSSIP_TEXT_TRAIN
Definition: ScriptedGossip.h:27
ObjectGuid const & GetGUID() const
Definition: Object.h:105
#define GOSSIP_LEARN_SHADOWEAVE
Definition: npc_professions.cpp:101
Definition: npc_professions.cpp:157
Definition: GossipDef.h:59
uint32 GetEntry() const
Definition: Object.h:107
bool IsTrainer() const
Definition: Unit.h:1565
#define GOSSIP_UNLEARN_SHADOWEAVE
Definition: npc_professions.cpp:102
Definition: npc_professions.cpp:213
bool HasTailorSpell(Player *player)
Definition: npc_professions.cpp:1056

+ Here is the call graph for this function:

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

Reimplemented from CreatureScript.

1189  {
1190  player->PlayerTalkClass->ClearMenus();
1191  switch (sender)
1192  {
1193  case GOSSIP_SENDER_MAIN:
1194  SendActionMenu(player, creature, action);
1195  break;
1196 
1197  case GOSSIP_SENDER_LEARN:
1198  SendConfirmLearn(player, creature, action);
1199  break;
1200 
1201  case GOSSIP_SENDER_UNLEARN:
1202  SendConfirmUnlearn(player, creature, action);
1203  break;
1204 
1205  case GOSSIP_SENDER_CHECK:
1206  SendActionMenu(player, creature, action);
1207  break;
1208  }
1209  return true;
1210  }
#define GOSSIP_SENDER_UNLEARN
Definition: npc_professions.cpp:58
void SendConfirmUnlearn(Player *player, Creature *creature, uint32 action)
Definition: npc_professions.cpp:1163
#define GOSSIP_SENDER_LEARN
Definition: npc_professions.cpp:57
void SendConfirmLearn(Player *player, Creature *creature, uint32 action)
Definition: npc_professions.cpp:1138
void SendActionMenu(Player *player, Creature *creature, uint32 action)
Definition: npc_professions.cpp:1105
Definition: ScriptedGossip.h:73
#define GOSSIP_SENDER_CHECK
Definition: npc_professions.cpp:59

+ Here is the call graph for this function:

void npc_prof_tailor::SendActionMenu ( Player player,
Creature creature,
uint32  action 
)
inline
1106  {
1107  switch (action)
1108  {
1109  case GOSSIP_ACTION_TRADE:
1110  player->GetSession()->SendListInventory(creature->GetGUID());
1111  break;
1112  case GOSSIP_ACTION_TRAIN:
1113  player->GetSession()->SendTrainerList(creature->GetGUID());
1114  break;
1115  //Learn Tailor
1116  case GOSSIP_ACTION_INFO_DEF + 1:
1117  ProcessCastaction(player, creature, S_SPELLFIRE, S_LEARN_SPELLFIRE, DoLearnCost(player));
1118  break;
1119  case GOSSIP_ACTION_INFO_DEF + 2:
1120  ProcessCastaction(player, creature, S_MOONCLOTH, S_LEARN_MOONCLOTH, DoLearnCost(player));
1121  break;
1122  case GOSSIP_ACTION_INFO_DEF + 3:
1123  ProcessCastaction(player, creature, S_SHADOWEAVE, S_LEARN_SHADOWEAVE, DoLearnCost(player));
1124  break;
1125  //Unlearn Tailor
1126  case GOSSIP_ACTION_INFO_DEF + 4:
1127  ProcessUnlearnAction(player, creature, S_UNLEARN_SPELLFIRE, 0, DoHighUnlearnCost(player));
1128  break;
1129  case GOSSIP_ACTION_INFO_DEF + 5:
1130  ProcessUnlearnAction(player, creature, S_UNLEARN_MOONCLOTH, 0, DoHighUnlearnCost(player));
1131  break;
1132  case GOSSIP_ACTION_INFO_DEF + 6:
1133  ProcessUnlearnAction(player, creature, S_UNLEARN_SHADOWEAVE, 0, DoHighUnlearnCost(player));
1134  break;
1135  }
1136  }
Definition: ScriptedGossip.h:71
void ProcessCastaction(Player *player, Creature *creature, uint32 spellId, uint32 triggeredSpellId, int32 cost)
Definition: npc_professions.cpp:261
Definition: npc_professions.cpp:158
Definition: ScriptedGossip.h:59
Definition: npc_professions.cpp:160
Definition: npc_professions.cpp:166
Definition: npc_professions.cpp:156
Definition: npc_professions.cpp:161
int32 DoLearnCost(Player *)
Definition: npc_professions.cpp:231
void ProcessUnlearnAction(Player *player, Creature *creature, uint32 spellId, uint32 alternativeSpellId, int32 cost)
Definition: npc_professions.cpp:400
int32 DoHighUnlearnCost(Player *)
Definition: npc_professions.cpp:236
Definition: npc_professions.cpp:165
Definition: ScriptedGossip.h:60
Definition: npc_professions.cpp:164
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: npc_professions.cpp:157
Definition: npc_professions.cpp:162

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_prof_tailor::SendConfirmLearn ( Player player,
Creature creature,
uint32  action 
)
inline
1139  {
1140  if (action)
1141  {
1142  switch (creature->GetEntry())
1143  {
1144  case N_TRAINER_SPELLFIRE:
1145  player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_SPELLFIRE, GOSSIP_SENDER_CHECK, action);
1146  //unknown textID ()
1147  player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
1148  break;
1149  case N_TRAINER_MOONCLOTH:
1150  player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_MOONCLOTH, GOSSIP_SENDER_CHECK, action);
1151  //unknown textID ()
1152  player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
1153  break;
1154  case N_TRAINER_SHADOWEAVE:
1155  player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_SHADOWEAVE, GOSSIP_SENDER_CHECK, action);
1156  //unknown textID ()
1157  player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
1158  break;
1159  }
1160  }
1161  }
#define GOSSIP_LEARN_MOONCLOTH
Definition: npc_professions.cpp:99
#define GOSSIP_LEARN_SPELLFIRE
Definition: npc_professions.cpp:97
Definition: npc_professions.cpp:211
Definition: npc_professions.cpp:212
ObjectGuid const & GetGUID() const
Definition: Object.h:105
#define GOSSIP_LEARN_SHADOWEAVE
Definition: npc_professions.cpp:101
Definition: GossipDef.h:59
uint32 GetEntry() const
Definition: Object.h:107
#define GOSSIP_SENDER_CHECK
Definition: npc_professions.cpp:59
Definition: npc_professions.cpp:213

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_prof_tailor::SendConfirmUnlearn ( Player player,
Creature creature,
uint32  action 
)
inline
1164  {
1165  if (action)
1166  {
1167  switch (creature->GetEntry())
1168  {
1169  case N_TRAINER_SPELLFIRE:
1170  player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_SPELLFIRE, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player), false);
1171  //unknown textID ()
1172  player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
1173  break;
1174  case N_TRAINER_MOONCLOTH:
1175  player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_MOONCLOTH, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player), false);
1176  //unknown textID ()
1177  player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
1178  break;
1179  case N_TRAINER_SHADOWEAVE:
1180  player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_SHADOWEAVE, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player), false);
1181  //unknown textID ()
1182  player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
1183  break;
1184  }
1185  }
1186  }
#define BOX_UNLEARN_TAILOR_SPEC
Definition: npc_professions.cpp:104
#define GOSSIP_UNLEARN_MOONCLOTH
Definition: npc_professions.cpp:100
#define GOSSIP_UNLEARN_SPELLFIRE
Definition: npc_professions.cpp:98
int32 DoHighUnlearnCost(Player *)
Definition: npc_professions.cpp:236
Definition: npc_professions.cpp:211
Definition: npc_professions.cpp:212
ObjectGuid const & GetGUID() const
Definition: Object.h:105
uint32 GetEntry() const
Definition: Object.h:107
#define GOSSIP_SENDER_CHECK
Definition: npc_professions.cpp:59
#define GOSSIP_UNLEARN_SHADOWEAVE
Definition: npc_professions.cpp:102
Definition: npc_professions.cpp:213

+ 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: