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 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 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
1227: GameObjectScript("go_evil_book_for_dummies") { }
Definition GameObjectScript.h:25

Member Function Documentation

◆ HasLeatherSpecialty()

bool go_evil_book_for_dummies::HasLeatherSpecialty ( Player player)
inline
1230 {
1231 return (player->HasSpell(S_DRAGON) || player->HasSpell(S_ELEMENTAL) || player->HasSpell(S_TRIBAL));
1232 }
bool HasSpell(uint32 spell) const override
Definition Player.cpp:3878
@ S_TRIBAL
Definition npc_professions.cpp:128
@ S_DRAGON
Definition npc_professions.cpp:126
@ S_ELEMENTAL
Definition npc_professions.cpp:127

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.

1235 {
1236 //ENGINEERING SPEC
1237 if (player->HasSkill(SKILL_ENGINEERING) && player->GetBaseSkillValue(SKILL_ENGINEERING) >= 225 && player->GetLevel() >= 35)
1238 {
1239 if (player->GetQuestRewardStatus(3643) || player->GetQuestRewardStatus(3641) || player->GetQuestRewardStatus(3639))
1240 {
1241 if (player->HasSpell(S_GOBLIN)) // Has Goblin specialization
1242 {
1244 }
1245 else if (player->HasSpell(S_GNOMISH)) // Has Gnomish specialization
1246 {
1248 }
1249 else // does not have any specialization
1250 {
1253 }
1254 }
1255 }
1256
1257 //LEATHERWORKING SPEC
1258 if (player->HasSkill(SKILL_LEATHERWORKING) && player->GetBaseSkillValue(SKILL_LEATHERWORKING) >= 225 && player->GetLevel() >= 40)
1259 {
1260 if (!HasLeatherSpecialty(player) && (player->GetQuestRewardStatus(5141) || player->GetQuestRewardStatus(5143) || player->GetQuestRewardStatus(5144) || player->GetQuestRewardStatus(5145) || player->GetQuestRewardStatus(5146) || player->GetQuestRewardStatus(5148)))
1261 {
1265 }
1266 }
1267
1268 SendGossipMenuFor(player, player->GetGossipTextId(gameobject), gameobject->GetGUID());
1269 return true;
1270 }
@ GOSSIP_ICON_CHAT
Definition GossipDef.h:61
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
@ SKILL_LEATHERWORKING
Definition SharedDefines.h:2910
@ SKILL_ENGINEERING
Definition SharedDefines.h:2923
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:113
bool GetQuestRewardStatus(uint32 quest_id) const
Definition PlayerQuest.cpp:1415
bool HasSkill(uint32 skill) const
Definition Player.cpp:5436
uint16 GetBaseSkillValue(uint32 skill) const
Definition Player.cpp:5508
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:1229
#define GOSSIP_UNLEARN_GNOMISH
Definition npc_professions.cpp:89
@ S_GNOMISH
Definition npc_professions.cpp:139
@ S_GOBLIN
Definition npc_professions.cpp:138
@ GOSSIP_MENU_OPTION_GO_LEARN_DRAGONSCALE
Definition npc_professions.cpp:242
@ GOSSIP_MENU_OPTION_GO_LEARN_TRIBAL
Definition npc_professions.cpp:244
@ GOSSIP_MENU_GO_SOOTHSAYING_FOR_DUMMIES
Definition npc_professions.cpp:241
@ GOSSIP_MENU_OPTION_GO_LEARN_ELEMENTAL
Definition npc_professions.cpp:243
#define GOSSIP_SENDER_LEARN
Definition npc_professions.cpp:43
int32 DoHighUnlearnCost(Player *)
Definition npc_professions.cpp:257
#define BOX_UNLEARN_ENGIN_SPEC
Definition npc_professions.cpp:91
#define GOSSIP_LEARN_GNOMISH
Definition npc_professions.cpp:87
#define GOSSIP_SENDER_UNLEARN
Definition npc_professions.cpp:44
#define BOX_LEARN_ENGIN_SPEC
Definition npc_professions.cpp:92
#define GOSSIP_LEARN_GOBLIN
Definition npc_professions.cpp:86
#define GOSSIP_UNLEARN_GOBLIN
Definition npc_professions.cpp:88
int32 DoLearnCost(Player *)
Definition npc_professions.cpp:252

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.

1342 {
1343 ClearGossipMenuFor(player);
1344 switch (uiSender)
1345 {
1347 SendActionMenu(player, gameobject, uiAction);
1348 break;
1350 SendActionMenu(player, gameobject, uiAction);
1351 break;
1352 }
1353 return true;
1354 }
void ClearGossipMenuFor(Player *player)
Definition ScriptedGossip.cpp:22
void SendActionMenu(Player *player, GameObject *, uint32 uiAction)
Definition npc_professions.cpp:1272

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

◆ SendActionMenu()

void go_evil_book_for_dummies::SendActionMenu ( Player player,
GameObject ,
uint32  uiAction 
)
inline
1273 {
1274 switch (uiAction)
1275 {
1276 // Learn Goblin
1277 case GOSSIP_ACTION_INFO_DEF + 1:
1278 ProcessCastaction(player, nullptr, S_GOBLIN, S_LEARN_GOBLIN, DoLearnCost(player));
1279 break;
1280 // Learn Gnomish
1281 case GOSSIP_ACTION_INFO_DEF + 2:
1282 ProcessCastaction(player, nullptr, S_GNOMISH, S_LEARN_GNOMISH, DoLearnCost(player));
1283 break;
1284 //Unlearn Goblin
1285 case GOSSIP_ACTION_INFO_DEF + 3:
1286 ProcessUnlearnAction(player, nullptr, S_UNLEARN_GOBLIN, 0, DoHighUnlearnCost(player));
1287 break;
1288 //Unlearn Gnomish
1289 case GOSSIP_ACTION_INFO_DEF + 4:
1290 ProcessUnlearnAction(player, nullptr, S_UNLEARN_GNOMISH, 0, DoHighUnlearnCost(player));
1291 break;
1292 //Learn Dragon
1293 case GOSSIP_ACTION_INFO_DEF + 5:
1294 ProcessCastaction(player, nullptr, S_DRAGON, S_LEARN_DRAGON, 0);
1295 break;
1296 //Learn Elemental
1297 case GOSSIP_ACTION_INFO_DEF + 6:
1298 ProcessCastaction(player, nullptr, S_ELEMENTAL, S_LEARN_ELEMENTAL, 0);
1299 break;
1300 //Learn Tribal
1301 case GOSSIP_ACTION_INFO_DEF + 7:
1302 ProcessCastaction(player, nullptr, S_TRIBAL, S_LEARN_TRIBAL, 0);
1303 break;
1304 }
1305 }
@ S_LEARN_DRAGON
Definition npc_professions.cpp:130
@ S_LEARN_GNOMISH
Definition npc_professions.cpp:142
@ S_LEARN_GOBLIN
Definition npc_professions.cpp:141
@ S_LEARN_ELEMENTAL
Definition npc_professions.cpp:131
@ S_UNLEARN_GOBLIN
Definition npc_professions.cpp:147
@ S_UNLEARN_GNOMISH
Definition npc_professions.cpp:148
@ S_LEARN_TRIBAL
Definition npc_professions.cpp:132
void ProcessCastaction(Player *player, Creature *creature, uint32 spellId, uint32 triggeredSpellId, int32 cost)
Definition npc_professions.cpp:414
void ProcessUnlearnAction(Player *player, Creature *creature, uint32 spellId, uint32 alternativeSpellId, int32 cost)
Definition npc_professions.cpp:429

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
1308 {
1309 switch (uiAction)
1310 {
1311 // Goblin
1312 case GOSSIP_ACTION_INFO_DEF + 1:
1314 SendGossipMenuFor(player, player->GetGossipTextId(gameobject), gameobject->GetGUID());
1315 break;
1316 // Gnomish
1317 case GOSSIP_ACTION_INFO_DEF + 2:
1319 SendGossipMenuFor(player, player->GetGossipTextId(gameobject), gameobject->GetGUID());
1320 break;
1321 }
1322 }
#define GOSSIP_SENDER_CHECK
Definition npc_professions.cpp:45

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
1325 {
1326 switch (uiAction)
1327 {
1328 // Goblin
1329 case GOSSIP_ACTION_INFO_DEF + 3:
1331 SendGossipMenuFor(player, player->GetGossipTextId(gameobject), gameobject->GetGUID());
1332 break;
1333 // Gnomish
1334 case GOSSIP_ACTION_INFO_DEF + 4:
1336 SendGossipMenuFor(player, player->GetGossipTextId(gameobject), gameobject->GetGUID());
1337 break;
1338 }
1339 }

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


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