AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
go_evil_book_for_dummies Class Reference
Inheritance diagram for go_evil_book_for_dummies:
GameObjectScript ScriptObject UpdatableScript< GameObject >

Public Member Functions

 go_evil_book_for_dummies ()
 
bool HasLeatherSpecialty (Player *player)
 
bool OnGossipHello (Player *player, GameObject *gameobject) override
 
void SendActionMenu (Player *player, GameObject *, uint32 uiAction)
 
void SendConfirmLearn (Player *player, GameObject *gameobject, uint32 uiAction)
 
void SendConfirmUnlearn (Player *player, GameObject *gameobject, uint32 uiAction)
 
bool OnGossipSelect (Player *player, GameObject *gameobject, uint32 uiSender, uint32 uiAction) override
 
- Public Member Functions inherited from GameObjectScript
bool IsDatabaseBound () const override
 
virtual bool OnGossipHello (Player *, GameObject *)
 
virtual bool OnGossipSelect (Player *, GameObject *, uint32, uint32)
 
virtual bool OnGossipSelectCode (Player *, GameObject *, uint32, uint32, const char *)
 
virtual bool OnQuestAccept (Player *, GameObject *, Quest const *)
 
virtual bool OnQuestReward (Player *, GameObject *, Quest const *, uint32)
 
virtual uint32 GetDialogStatus (Player *, GameObject *)
 
virtual void OnDestroyed (GameObject *, Player *)
 
virtual void OnDamaged (GameObject *, Player *)
 
virtual void OnModifyHealth (GameObject *, Unit *, int32 &, SpellInfo const *)
 
virtual void OnLootStateChanged (GameObject *, uint32, Unit *)
 
virtual void OnGameObjectStateChanged (GameObject *, uint32)
 
virtual GameObjectAIGetAI (GameObject *) const
 
- 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< GameObject >
virtual void OnUpdate (GameObject *, uint32)
 

Additional Inherited Members

- Protected Member Functions inherited from GameObjectScript
 GameObjectScript (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< GameObject >
 UpdatableScript ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ go_evil_book_for_dummies()

go_evil_book_for_dummies::go_evil_book_for_dummies ( )
inline
1240: GameObjectScript("go_evil_book_for_dummies") { }
Definition: GameObjectScript.h:25

Member Function Documentation

◆ HasLeatherSpecialty()

bool go_evil_book_for_dummies::HasLeatherSpecialty ( Player player)
inline
1243 {
1244 return (player->HasSpell(S_DRAGON) || player->HasSpell(S_ELEMENTAL) || player->HasSpell(S_TRIBAL));
1245 }
@ 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.

Referenced by OnGossipHello().

◆ OnGossipHello()

bool go_evil_book_for_dummies::OnGossipHello ( Player player,
GameObject gameobject 
)
inlineoverridevirtual

Reimplemented from GameObjectScript.

1248 {
1249 //ENGINEERING SPEC
1250 if (player->HasSkill(SKILL_ENGINEERING) && player->GetBaseSkillValue(SKILL_ENGINEERING) >= 225 && player->GetLevel() >= 35)
1251 {
1252 if (player->GetQuestRewardStatus(3643) || player->GetQuestRewardStatus(3641) || player->GetQuestRewardStatus(3639))
1253 {
1254 if (player->HasSpell(S_GOBLIN)) // Has Goblin specialization
1255 {
1257 }
1258 else if (player->HasSpell(S_GNOMISH)) // Has Gnomish specialization
1259 {
1261 }
1262 else // does not have any specialization
1263 {
1266 }
1267 }
1268 }
1269
1270 //LEATHERWORKING SPEC
1271 if (player->HasSkill(SKILL_LEATHERWORKING) && player->GetBaseSkillValue(SKILL_LEATHERWORKING) >= 225 && player->GetLevel() >= 40)
1272 {
1273 if (!HasLeatherSpecialty(player) && (player->GetQuestRewardStatus(5141) || player->GetQuestRewardStatus(5143) || player->GetQuestRewardStatus(5144) || player->GetQuestRewardStatus(5145) || player->GetQuestRewardStatus(5146) || player->GetQuestRewardStatus(5148)))
1274 {
1278 }
1279 }
1280
1281 SendGossipMenuFor(player, player->GetGossipTextId(gameobject), gameobject->GetGUID());
1282 return true;
1283 }
#define GOSSIP_UNLEARN_GNOMISH
Definition: npc_professions.cpp:102
@ S_GNOMISH
Definition: npc_professions.cpp:152
@ S_GOBLIN
Definition: npc_professions.cpp:151
@ GOSSIP_MENU_OPTION_GO_LEARN_DRAGONSCALE
Definition: npc_professions.cpp:255
@ GOSSIP_MENU_OPTION_GO_LEARN_TRIBAL
Definition: npc_professions.cpp:257
@ GOSSIP_MENU_GO_SOOTHSAYING_FOR_DUMMIES
Definition: npc_professions.cpp:254
@ GOSSIP_MENU_OPTION_GO_LEARN_ELEMENTAL
Definition: npc_professions.cpp:256
#define GOSSIP_SENDER_LEARN
Definition: npc_professions.cpp:56
int32 DoHighUnlearnCost(Player *)
Definition: npc_professions.cpp:270
#define BOX_UNLEARN_ENGIN_SPEC
Definition: npc_professions.cpp:104
#define GOSSIP_LEARN_GNOMISH
Definition: npc_professions.cpp:100
#define GOSSIP_SENDER_UNLEARN
Definition: npc_professions.cpp:57
#define BOX_LEARN_ENGIN_SPEC
Definition: npc_professions.cpp:105
#define GOSSIP_LEARN_GOBLIN
Definition: npc_professions.cpp:99
#define GOSSIP_UNLEARN_GOBLIN
Definition: npc_professions.cpp:101
int32 DoLearnCost(Player *)
Definition: npc_professions.cpp:265
@ SKILL_LEATHERWORKING
Definition: SharedDefines.h:2910
@ SKILL_ENGINEERING
Definition: SharedDefines.h:2923
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
@ GOSSIP_ACTION_INFO_DEF
Definition: ScriptedGossip.h:68
@ GOSSIP_ICON_CHAT
Definition: GossipDef.h:61
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
bool GetQuestRewardStatus(uint32 quest_id) const
Definition: PlayerQuest.cpp:1414
bool HasSkill(uint32 skill) const
Definition: Player.cpp:5447
uint16 GetBaseSkillValue(uint32 skill) const
Definition: Player.cpp:5519
uint32 GetGossipTextId(uint32 menuId, WorldObject *source)
Definition: PlayerGossip.cpp:404
uint8 GetLevel() const
Definition: Unit.h:1024
bool HasLeatherSpecialty(Player *player)
Definition: npc_professions.cpp:1242

References AddGossipItemFor(), BOX_LEARN_ENGIN_SPEC, BOX_UNLEARN_ENGIN_SPEC, DoHighUnlearnCost(), DoLearnCost(), Player::GetBaseSkillValue(), Player::GetGossipTextId(), Object::GetGUID(), Unit::GetLevel(), Player::GetQuestRewardStatus(), GOSSIP_ACTION_INFO_DEF, GOSSIP_ICON_CHAT, GOSSIP_LEARN_GNOMISH, GOSSIP_LEARN_GOBLIN, GOSSIP_MENU_GO_SOOTHSAYING_FOR_DUMMIES, GOSSIP_MENU_OPTION_GO_LEARN_DRAGONSCALE, GOSSIP_MENU_OPTION_GO_LEARN_ELEMENTAL, GOSSIP_MENU_OPTION_GO_LEARN_TRIBAL, GOSSIP_SENDER_LEARN, GOSSIP_SENDER_UNLEARN, GOSSIP_UNLEARN_GNOMISH, GOSSIP_UNLEARN_GOBLIN, HasLeatherSpecialty(), Player::HasSkill(), Player::HasSpell(), S_GNOMISH, S_GOBLIN, SendGossipMenuFor(), SKILL_ENGINEERING, and SKILL_LEATHERWORKING.

◆ OnGossipSelect()

bool go_evil_book_for_dummies::OnGossipSelect ( Player player,
GameObject gameobject,
uint32  uiSender,
uint32  uiAction 
)
inlineoverridevirtual

Reimplemented from GameObjectScript.

1355 {
1356 ClearGossipMenuFor(player);
1357 switch (uiSender)
1358 {
1360 SendActionMenu(player, gameobject, uiAction);
1361 break;
1363 SendActionMenu(player, gameobject, uiAction);
1364 break;
1365 }
1366 return true;
1367 }
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
void SendActionMenu(Player *player, GameObject *, uint32 uiAction)
Definition: npc_professions.cpp:1285

References ClearGossipMenuFor(), GOSSIP_SENDER_LEARN, GOSSIP_SENDER_UNLEARN, and SendActionMenu().

◆ SendActionMenu()

void go_evil_book_for_dummies::SendActionMenu ( Player player,
GameObject ,
uint32  uiAction 
)
inline
1286 {
1287 switch (uiAction)
1288 {
1289 // Learn Goblin
1290 case GOSSIP_ACTION_INFO_DEF + 1:
1291 ProcessCastaction(player, nullptr, S_GOBLIN, S_LEARN_GOBLIN, DoLearnCost(player));
1292 break;
1293 // Learn Gnomish
1294 case GOSSIP_ACTION_INFO_DEF + 2:
1295 ProcessCastaction(player, nullptr, S_GNOMISH, S_LEARN_GNOMISH, DoLearnCost(player));
1296 break;
1297 //Unlearn Goblin
1298 case GOSSIP_ACTION_INFO_DEF + 3:
1299 ProcessUnlearnAction(player, nullptr, S_UNLEARN_GOBLIN, 0, DoHighUnlearnCost(player));
1300 break;
1301 //Unlearn Gnomish
1302 case GOSSIP_ACTION_INFO_DEF + 4:
1303 ProcessUnlearnAction(player, nullptr, S_UNLEARN_GNOMISH, 0, DoHighUnlearnCost(player));
1304 break;
1305 //Learn Dragon
1306 case GOSSIP_ACTION_INFO_DEF + 5:
1307 ProcessCastaction(player, nullptr, S_DRAGON, S_LEARN_DRAGON, 0);
1308 break;
1309 //Learn Elemental
1310 case GOSSIP_ACTION_INFO_DEF + 6:
1311 ProcessCastaction(player, nullptr, S_ELEMENTAL, S_LEARN_ELEMENTAL, 0);
1312 break;
1313 //Learn Tribal
1314 case GOSSIP_ACTION_INFO_DEF + 7:
1315 ProcessCastaction(player, nullptr, S_TRIBAL, S_LEARN_TRIBAL, 0);
1316 break;
1317 }
1318 }
@ S_LEARN_DRAGON
Definition: npc_professions.cpp:143
@ S_LEARN_GNOMISH
Definition: npc_professions.cpp:155
@ S_LEARN_GOBLIN
Definition: npc_professions.cpp:154
@ S_LEARN_ELEMENTAL
Definition: npc_professions.cpp:144
@ S_UNLEARN_GOBLIN
Definition: npc_professions.cpp:160
@ S_UNLEARN_GNOMISH
Definition: npc_professions.cpp:161
@ S_LEARN_TRIBAL
Definition: npc_professions.cpp:145
void ProcessCastaction(Player *player, Creature *creature, uint32 spellId, uint32 triggeredSpellId, int32 cost)
Definition: npc_professions.cpp:427
void ProcessUnlearnAction(Player *player, Creature *creature, uint32 spellId, uint32 alternativeSpellId, int32 cost)
Definition: npc_professions.cpp:442

References DoHighUnlearnCost(), DoLearnCost(), GOSSIP_ACTION_INFO_DEF, ProcessCastaction(), ProcessUnlearnAction(), S_DRAGON, S_ELEMENTAL, S_GNOMISH, S_GOBLIN, S_LEARN_DRAGON, S_LEARN_ELEMENTAL, S_LEARN_GNOMISH, S_LEARN_GOBLIN, S_LEARN_TRIBAL, S_TRIBAL, S_UNLEARN_GNOMISH, and S_UNLEARN_GOBLIN.

Referenced by OnGossipSelect().

◆ SendConfirmLearn()

void go_evil_book_for_dummies::SendConfirmLearn ( Player player,
GameObject gameobject,
uint32  uiAction 
)
inline
1321 {
1322 switch (uiAction)
1323 {
1324 // Goblin
1325 case GOSSIP_ACTION_INFO_DEF + 1:
1327 SendGossipMenuFor(player, player->GetGossipTextId(gameobject), gameobject->GetGUID());
1328 break;
1329 // Gnomish
1330 case GOSSIP_ACTION_INFO_DEF + 2:
1332 SendGossipMenuFor(player, player->GetGossipTextId(gameobject), gameobject->GetGUID());
1333 break;
1334 }
1335 }
#define GOSSIP_SENDER_CHECK
Definition: npc_professions.cpp:58

References AddGossipItemFor(), Player::GetGossipTextId(), Object::GetGUID(), GOSSIP_ACTION_INFO_DEF, GOSSIP_ICON_CHAT, GOSSIP_LEARN_GNOMISH, GOSSIP_LEARN_GOBLIN, GOSSIP_SENDER_CHECK, and SendGossipMenuFor().

◆ SendConfirmUnlearn()

void go_evil_book_for_dummies::SendConfirmUnlearn ( Player player,
GameObject gameobject,
uint32  uiAction 
)
inline
1338 {
1339 switch (uiAction)
1340 {
1341 // Goblin
1342 case GOSSIP_ACTION_INFO_DEF + 3:
1344 SendGossipMenuFor(player, player->GetGossipTextId(gameobject), gameobject->GetGUID());
1345 break;
1346 // Gnomish
1347 case GOSSIP_ACTION_INFO_DEF + 4:
1349 SendGossipMenuFor(player, player->GetGossipTextId(gameobject), gameobject->GetGUID());
1350 break;
1351 }
1352 }

References AddGossipItemFor(), BOX_UNLEARN_ENGIN_SPEC, DoHighUnlearnCost(), Player::GetGossipTextId(), Object::GetGUID(), GOSSIP_ACTION_INFO_DEF, GOSSIP_SENDER_CHECK, GOSSIP_UNLEARN_GNOMISH, GOSSIP_UNLEARN_GOBLIN, and SendGossipMenuFor().