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

Public Member Functions

 npc_sayge ()
 
bool OnGossipHello (Player *player, Creature *creature) override
 
void SendAction (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_sayge::npc_sayge ( )
inline
1219 : CreatureScript("npc_sayge") { }
CreatureScript(const char *name)
Definition: ScriptMgr.cpp:1586

Member Function Documentation

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

Reimplemented from CreatureScript.

1222  {
1223  if (creature->IsQuestGiver())
1224  player->PrepareQuestMenu(creature->GetGUID());
1225 
1226  if (player->GetSpellHistory()->HasCooldown(SPELL_INT) ||
1227  player->GetSpellHistory()->HasCooldown(SPELL_ARM) ||
1228  player->GetSpellHistory()->HasCooldown(SPELL_DMG) ||
1229  player->GetSpellHistory()->HasCooldown(SPELL_RES) ||
1230  player->GetSpellHistory()->HasCooldown(SPELL_STR) ||
1231  player->GetSpellHistory()->HasCooldown(SPELL_AGI) ||
1232  player->GetSpellHistory()->HasCooldown(SPELL_STM) ||
1233  player->GetSpellHistory()->HasCooldown(SPELL_SPI))
1234  player->SEND_GOSSIP_MENU(7393, creature->GetGUID());
1235  else
1236  {
1238  player->SEND_GOSSIP_MENU(7339, creature->GetGUID());
1239  }
1240 
1241  return true;
1242  }
Definition: npcs_special.cpp:1187
Definition: ScriptedGossip.h:71
Definition: npcs_special.cpp:1193
Definition: npcs_special.cpp:1192
bool IsQuestGiver() const
Definition: Unit.h:1566
#define GOSSIP_HELLO_SAYGE
Definition: npcs_special.cpp:1197
Definition: npcs_special.cpp:1189
Definition: npcs_special.cpp:1188
Definition: ScriptedGossip.h:73
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: npcs_special.cpp:1190
Definition: GossipDef.h:59
Definition: npcs_special.cpp:1186
Definition: npcs_special.cpp:1191

+ Here is the call graph for this function:

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

Reimplemented from CreatureScript.

1291  {
1292  player->PlayerTalkClass->ClearMenus();
1293  switch (sender)
1294  {
1295  case GOSSIP_SENDER_MAIN:
1296  SendAction(player, creature, action);
1297  break;
1298  case GOSSIP_SENDER_MAIN + 1:
1299  creature->CastSpell(player, SPELL_DMG, false);
1300  player->GetSpellHistory()->AddCooldown(SPELL_DMG, 0, std::chrono::hours(2));
1301  SendAction(player, creature, action);
1302  break;
1303  case GOSSIP_SENDER_MAIN + 2:
1304  creature->CastSpell(player, SPELL_RES, false);
1305  player->GetSpellHistory()->AddCooldown(SPELL_RES, 0, std::chrono::hours(2));
1306  SendAction(player, creature, action);
1307  break;
1308  case GOSSIP_SENDER_MAIN + 3:
1309  creature->CastSpell(player, SPELL_ARM, false);
1310  player->GetSpellHistory()->AddCooldown(SPELL_ARM, 0, std::chrono::hours(2));
1311  SendAction(player, creature, action);
1312  break;
1313  case GOSSIP_SENDER_MAIN + 4:
1314  creature->CastSpell(player, SPELL_SPI, false);
1315  player->GetSpellHistory()->AddCooldown(SPELL_SPI, 0, std::chrono::hours(2));
1316  SendAction(player, creature, action);
1317  break;
1318  case GOSSIP_SENDER_MAIN + 5:
1319  creature->CastSpell(player, SPELL_INT, false);
1320  player->GetSpellHistory()->AddCooldown(SPELL_INT, 0, std::chrono::hours(2));
1321  SendAction(player, creature, action);
1322  break;
1323  case GOSSIP_SENDER_MAIN + 6:
1324  creature->CastSpell(player, SPELL_STM, false);
1325  player->GetSpellHistory()->AddCooldown(SPELL_STM, 0, std::chrono::hours(2));
1326  SendAction(player, creature, action);
1327  break;
1328  case GOSSIP_SENDER_MAIN + 7:
1329  creature->CastSpell(player, SPELL_STR, false);
1330  player->GetSpellHistory()->AddCooldown(SPELL_STR, 0, std::chrono::hours(2));
1331  SendAction(player, creature, action);
1332  break;
1333  case GOSSIP_SENDER_MAIN + 8:
1334  creature->CastSpell(player, SPELL_AGI, false);
1335  player->GetSpellHistory()->AddCooldown(SPELL_AGI, 0, std::chrono::hours(2));
1336  SendAction(player, creature, action);
1337  break;
1338  }
1339  return true;
1340  }
Definition: npcs_special.cpp:1187
Definition: npcs_special.cpp:1193
Definition: npcs_special.cpp:1192
void SendAction(Player *player, Creature *creature, uint32 action)
Definition: npcs_special.cpp:1244
Definition: npcs_special.cpp:1189
Definition: npcs_special.cpp:1188
Definition: ScriptedGossip.h:73
float hours()
Definition: units.h:107
Definition: npcs_special.cpp:1190
Definition: npcs_special.cpp:1186
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:869
Definition: npcs_special.cpp:1191

+ Here is the call graph for this function:

void npc_sayge::SendAction ( Player player,
Creature creature,
uint32  action 
)
inline
1245  {
1246  switch (action)
1247  {
1248  case GOSSIP_ACTION_INFO_DEF + 1:
1253  player->SEND_GOSSIP_MENU(7340, creature->GetGUID());
1254  break;
1255  case GOSSIP_ACTION_INFO_DEF + 2:
1259  player->SEND_GOSSIP_MENU(7341, creature->GetGUID());
1260  break;
1261  case GOSSIP_ACTION_INFO_DEF + 3:
1265  player->SEND_GOSSIP_MENU(7361, creature->GetGUID());
1266  break;
1267  case GOSSIP_ACTION_INFO_DEF + 4:
1271  player->SEND_GOSSIP_MENU(7362, creature->GetGUID());
1272  break;
1273  case GOSSIP_ACTION_INFO_DEF + 5:
1277  player->SEND_GOSSIP_MENU(7363, creature->GetGUID());
1278  break;
1281  player->SEND_GOSSIP_MENU(7364, creature->GetGUID());
1282  break;
1283  case GOSSIP_ACTION_INFO_DEF + 6:
1284  creature->CastSpell(player, SPELL_FORTUNE, false);
1285  player->SEND_GOSSIP_MENU(7365, creature->GetGUID());
1286  break;
1287  }
1288  }
#define GOSSIP_SENDACTION_SAYGE3
Definition: npcs_special.cpp:1200
#define GOSSIP_SENDACTION_SAYGE12
Definition: npcs_special.cpp:1209
#define GOSSIP_SENDACTION_SAYGE9
Definition: npcs_special.cpp:1206
#define GOSSIP_SENDACTION_SAYGE16
Definition: npcs_special.cpp:1213
#define GOSSIP_SENDACTION_SAYGE13
Definition: npcs_special.cpp:1210
Definition: ScriptedGossip.h:71
#define GOSSIP_SENDACTION_SAYGE8
Definition: npcs_special.cpp:1205
#define GOSSIP_SENDACTION_SAYGE11
Definition: npcs_special.cpp:1208
#define GOSSIP_SENDACTION_SAYGE15
Definition: npcs_special.cpp:1212
#define GOSSIP_SENDACTION_SAYGE2
Definition: npcs_special.cpp:1199
Definition: npcs_special.cpp:1194
#define GOSSIP_SENDACTION_SAYGE10
Definition: npcs_special.cpp:1207
#define GOSSIP_SENDACTION_SAYGE7
Definition: npcs_special.cpp:1204
#define GOSSIP_SENDACTION_SAYGE6
Definition: npcs_special.cpp:1203
#define GOSSIP_SENDACTION_SAYGE14
Definition: npcs_special.cpp:1211
#define GOSSIP_SENDACTION_SAYGE1
Definition: npcs_special.cpp:1198
Definition: ScriptedGossip.h:73
#define GOSSIP_SENDACTION_SAYGE5
Definition: npcs_special.cpp:1202
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: GossipDef.h:59
#define GOSSIP_SENDACTION_SAYGE4
Definition: npcs_special.cpp:1201
#define GOSSIP_SENDACTION_SAYGE17
Definition: npcs_special.cpp:1214
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:869

+ Here is the call graph for this function:


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