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 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
 
- 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)
 
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
1239: GameObjectScript("go_evil_book_for_dummies") { }
Definition: ScriptMgr.h:759

Member Function Documentation

◆ HasLeatherSpecialty()

bool go_evil_book_for_dummies::HasLeatherSpecialty ( Player player)
inline
1242 {
1243 return (player->HasSpell(S_DRAGON) || player->HasSpell(S_ELEMENTAL) || player->HasSpell(S_TRIBAL));
1244 }
@ S_TRIBAL
Definition: npc_professions.cpp:140
@ S_DRAGON
Definition: npc_professions.cpp:138
@ S_ELEMENTAL
Definition: npc_professions.cpp:139
bool HasSpell(uint32 spell) const override
Definition: Player.cpp:3818

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.

1247 {
1248 //ENGINEERING SPEC
1249 if (player->HasSkill(SKILL_ENGINEERING) && player->GetBaseSkillValue(SKILL_ENGINEERING) >= 225 && player->GetLevel() >= 35)
1250 {
1251 if (player->GetQuestRewardStatus(3643) || player->GetQuestRewardStatus(3641) || player->GetQuestRewardStatus(3639))
1252 {
1253 if (player->HasSpell(S_GOBLIN)) // Has Goblin specialization
1254 {
1256 }
1257 else if (player->HasSpell(S_GNOMISH)) // Has Gnomish specialization
1258 {
1260 }
1261 else // does not have any specialization
1262 {
1265 }
1266 }
1267 }
1268
1269 //LEATHERWORKING SPEC
1270 if (player->HasSkill(SKILL_LEATHERWORKING) && player->GetBaseSkillValue(SKILL_LEATHERWORKING) >= 225 && player->GetLevel() >= 40)
1271 {
1272 if (!HasLeatherSpecialty(player) && (player->GetQuestRewardStatus(5141) || player->GetQuestRewardStatus(5143) || player->GetQuestRewardStatus(5144) || player->GetQuestRewardStatus(5145) || player->GetQuestRewardStatus(5146) || player->GetQuestRewardStatus(5148)))
1273 {
1277 }
1278 }
1279
1280 SendGossipMenuFor(player, player->GetGossipTextId(gameobject), gameobject->GetGUID());
1281 return true;
1282 }
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:60
#define GOSSIP_UNLEARN_GNOMISH
Definition: npc_professions.cpp:101
@ S_GNOMISH
Definition: npc_professions.cpp:151
@ S_GOBLIN
Definition: npc_professions.cpp:150
@ GOSSIP_MENU_OPTION_GO_LEARN_DRAGONSCALE
Definition: npc_professions.cpp:254
@ GOSSIP_MENU_OPTION_GO_LEARN_TRIBAL
Definition: npc_professions.cpp:256
@ GOSSIP_MENU_GO_SOOTHSAYING_FOR_DUMMIES
Definition: npc_professions.cpp:253
@ GOSSIP_MENU_OPTION_GO_LEARN_ELEMENTAL
Definition: npc_professions.cpp:255
#define GOSSIP_SENDER_LEARN
Definition: npc_professions.cpp:55
int32 DoHighUnlearnCost(Player *)
Definition: npc_professions.cpp:269
#define BOX_UNLEARN_ENGIN_SPEC
Definition: npc_professions.cpp:103
#define GOSSIP_LEARN_GNOMISH
Definition: npc_professions.cpp:99
#define GOSSIP_SENDER_UNLEARN
Definition: npc_professions.cpp:56
#define BOX_LEARN_ENGIN_SPEC
Definition: npc_professions.cpp:104
#define GOSSIP_LEARN_GOBLIN
Definition: npc_professions.cpp:98
#define GOSSIP_UNLEARN_GOBLIN
Definition: npc_professions.cpp:100
int32 DoLearnCost(Player *)
Definition: npc_professions.cpp:264
@ SKILL_LEATHERWORKING
Definition: SharedDefines.h:2882
@ SKILL_ENGINEERING
Definition: SharedDefines.h:2895
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
bool GetQuestRewardStatus(uint32 quest_id) const
Definition: PlayerQuest.cpp:1399
bool HasSkill(uint32 skill) const
Definition: Player.cpp:5333
uint16 GetBaseSkillValue(uint32 skill) const
Definition: Player.cpp:5405
uint32 GetGossipTextId(uint32 menuId, WorldObject *source)
Definition: PlayerGossip.cpp:405
uint8 GetLevel() const
Definition: Unit.h:1420
bool HasLeatherSpecialty(Player *player)
Definition: npc_professions.cpp:1241

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.

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

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

◆ SendActionMenu()

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

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
1320 {
1321 switch (uiAction)
1322 {
1323 // Goblin
1324 case GOSSIP_ACTION_INFO_DEF + 1:
1326 SendGossipMenuFor(player, player->GetGossipTextId(gameobject), gameobject->GetGUID());
1327 break;
1328 // Gnomish
1329 case GOSSIP_ACTION_INFO_DEF + 2:
1331 SendGossipMenuFor(player, player->GetGossipTextId(gameobject), gameobject->GetGUID());
1332 break;
1333 }
1334 }
#define GOSSIP_SENDER_CHECK
Definition: npc_professions.cpp:57

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
1337 {
1338 switch (uiAction)
1339 {
1340 // Goblin
1341 case GOSSIP_ACTION_INFO_DEF + 3:
1343 SendGossipMenuFor(player, player->GetGossipTextId(gameobject), gameobject->GetGUID());
1344 break;
1345 // Gnomish
1346 case GOSSIP_ACTION_INFO_DEF + 4:
1348 SendGossipMenuFor(player, player->GetGossipTextId(gameobject), gameobject->GetGUID());
1349 break;
1350 }
1351 }

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().