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, char const *)
 
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 GameObjectAI * GetAI (GameObject *) const
 
- Public Member Functions inherited from ScriptObject
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
std::string const & 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 (char const *name)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (char const *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
1122: GameObjectScript("go_evil_book_for_dummies") { }
Definition GameObjectScript.h:25

Member Function Documentation

◆ HasLeatherSpecialty()

bool go_evil_book_for_dummies::HasLeatherSpecialty ( Player *  player)
inline
1125 {
1126 return (player->HasSpell(S_DRAGON) || player->HasSpell(S_ELEMENTAL) || player->HasSpell(S_TRIBAL));
1127 }
bool HasSpell(uint32 spell) const override
Definition Player.cpp:4061
@ 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.

1130 {
1131 //ENGINEERING SPEC
1132 if (player->HasSkill(SKILL_ENGINEERING) && player->GetBaseSkillValue(SKILL_ENGINEERING) >= 200 && player->GetLevel() >= 30)
1133 {
1134 if (player->GetQuestRewardStatus(3643) || player->GetQuestRewardStatus(3641) || player->GetQuestRewardStatus(3639))
1135 {
1136 if (player->HasSpell(S_GOBLIN)) // Has Goblin specialization
1137 {
1139 }
1140 else if (player->HasSpell(S_GNOMISH)) // Has Gnomish specialization
1141 {
1143 }
1144 else // does not have any specialization
1145 {
1148 }
1149 }
1150 }
1151
1152 //LEATHERWORKING SPEC
1153 if (player->HasSkill(SKILL_LEATHERWORKING) && player->GetBaseSkillValue(SKILL_LEATHERWORKING) >= 225 && player->GetLevel() >= 40)
1154 {
1155 if (!HasLeatherSpecialty(player) && (player->GetQuestRewardStatus(5141) || player->GetQuestRewardStatus(5143) || player->GetQuestRewardStatus(5144) || player->GetQuestRewardStatus(5145) || player->GetQuestRewardStatus(5146) || player->GetQuestRewardStatus(5148)))
1156 {
1160 }
1161 }
1162
1163 SendGossipMenuFor(player, player->GetGossipTextId(gameobject), gameobject->GetGUID());
1164 return true;
1165 }
@ GOSSIP_ICON_CHAT
Definition GossipDef.h:61
void AddGossipItemFor(Player *player, uint32 icon, std::string const &text, uint32 sender, uint32 action)
Definition ScriptedGossip.cpp:28
void SendGossipMenuFor(Player *player, uint32 npcTextID, ObjectGuid const &guid)
Definition ScriptedGossip.cpp:45
@ GOSSIP_ACTION_INFO_DEF
Definition ScriptedGossip.h:68
@ SKILL_LEATHERWORKING
Definition SharedDefines.h:3143
@ SKILL_ENGINEERING
Definition SharedDefines.h:3156
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:120
bool GetQuestRewardStatus(uint32 quest_id) const
Definition PlayerQuest.cpp:1489
bool HasSkill(uint32 skill) const
Definition Player.cpp:5623
uint16 GetBaseSkillValue(uint32 skill) const
Definition Player.cpp:5695
uint32 GetGossipTextId(uint32 menuId, WorldObject *source)
Definition PlayerGossip.cpp:409
uint8 GetLevel() const
Definition Unit.h:1117
bool HasLeatherSpecialty(Player *player)
Definition npc_professions.cpp:1124
#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:248
@ GOSSIP_MENU_OPTION_GO_LEARN_TRIBAL
Definition npc_professions.cpp:250
@ GOSSIP_MENU_GO_SOOTHSAYING_FOR_DUMMIES
Definition npc_professions.cpp:247
@ GOSSIP_MENU_OPTION_GO_LEARN_ELEMENTAL
Definition npc_professions.cpp:249
#define GOSSIP_SENDER_LEARN
Definition npc_professions.cpp:43
int32 DoHighUnlearnCost(Player *)
Definition npc_professions.cpp:263
#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:258

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.

1237 {
1238 ClearGossipMenuFor(player);
1239 switch (uiSender)
1240 {
1242 SendActionMenu(player, gameobject, uiAction);
1243 break;
1245 SendActionMenu(player, gameobject, uiAction);
1246 break;
1247 }
1248 return true;
1249 }
void ClearGossipMenuFor(Player *player)
Definition ScriptedGossip.cpp:22
void SendActionMenu(Player *player, GameObject *, uint32 uiAction)
Definition npc_professions.cpp:1167

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

◆ SendActionMenu()

void go_evil_book_for_dummies::SendActionMenu ( Player *  player,
GameObject *  ,
uint32  uiAction 
)
inline
1168 {
1169 switch (uiAction)
1170 {
1171 // Learn Goblin
1172 case GOSSIP_ACTION_INFO_DEF + 1:
1173 ProcessCastaction(player, nullptr, S_GOBLIN, S_LEARN_GOBLIN, DoLearnCost(player));
1174 break;
1175 // Learn Gnomish
1176 case GOSSIP_ACTION_INFO_DEF + 2:
1177 ProcessCastaction(player, nullptr, S_GNOMISH, S_LEARN_GNOMISH, DoLearnCost(player));
1178 break;
1179 //Unlearn Goblin
1180 case GOSSIP_ACTION_INFO_DEF + 3:
1181 ProcessUnlearnAction(player, nullptr, S_UNLEARN_GOBLIN, 0, DoHighUnlearnCost(player));
1182 break;
1183 //Unlearn Gnomish
1184 case GOSSIP_ACTION_INFO_DEF + 4:
1185 ProcessUnlearnAction(player, nullptr, S_UNLEARN_GNOMISH, 0, DoHighUnlearnCost(player));
1186 break;
1187 //Learn Dragon
1188 case GOSSIP_ACTION_INFO_DEF + 5:
1189 ProcessCastaction(player, nullptr, S_DRAGON, S_LEARN_DRAGON, 0);
1190 break;
1191 //Learn Elemental
1192 case GOSSIP_ACTION_INFO_DEF + 6:
1193 ProcessCastaction(player, nullptr, S_ELEMENTAL, S_LEARN_ELEMENTAL, 0);
1194 break;
1195 //Learn Tribal
1196 case GOSSIP_ACTION_INFO_DEF + 7:
1197 ProcessCastaction(player, nullptr, S_TRIBAL, S_LEARN_TRIBAL, 0);
1198 break;
1199 }
1200 }
@ 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:420
void ProcessUnlearnAction(Player *player, Creature *creature, uint32 spellId, uint32 alternativeSpellId, int32 cost)
Definition npc_professions.cpp:435

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
1203 {
1204 switch (uiAction)
1205 {
1206 // Goblin
1207 case GOSSIP_ACTION_INFO_DEF + 1:
1209 SendGossipMenuFor(player, player->GetGossipTextId(gameobject), gameobject->GetGUID());
1210 break;
1211 // Gnomish
1212 case GOSSIP_ACTION_INFO_DEF + 2:
1214 SendGossipMenuFor(player, player->GetGossipTextId(gameobject), gameobject->GetGUID());
1215 break;
1216 }
1217 }
#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
1220 {
1221 switch (uiAction)
1222 {
1223 // Goblin
1224 case GOSSIP_ACTION_INFO_DEF + 3:
1226 SendGossipMenuFor(player, player->GetGossipTextId(gameobject), gameobject->GetGUID());
1227 break;
1228 // Gnomish
1229 case GOSSIP_ACTION_INFO_DEF + 4:
1231 SendGossipMenuFor(player, player->GetGossipTextId(gameobject), gameobject->GetGUID());
1232 break;
1233 }
1234 }

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: