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

Member Function Documentation

◆ HasLeatherSpecialty()

bool go_evil_book_for_dummies::HasLeatherSpecialty ( Player player)
inline
1116 {
1117 return (player->HasSpell(S_DRAGON) || player->HasSpell(S_ELEMENTAL) || player->HasSpell(S_TRIBAL));
1118 }
bool HasSpell(uint32 spell) const override
Definition Player.cpp:4039
@ 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.

1121 {
1122 //ENGINEERING SPEC
1123 if (player->HasSkill(SKILL_ENGINEERING) && player->GetBaseSkillValue(SKILL_ENGINEERING) >= 200 && player->GetLevel() >= 30)
1124 {
1125 if (player->GetQuestRewardStatus(3643) || player->GetQuestRewardStatus(3641) || player->GetQuestRewardStatus(3639))
1126 {
1127 if (player->HasSpell(S_GOBLIN)) // Has Goblin specialization
1128 {
1130 }
1131 else if (player->HasSpell(S_GNOMISH)) // Has Gnomish specialization
1132 {
1134 }
1135 else // does not have any specialization
1136 {
1139 }
1140 }
1141 }
1142
1143 //LEATHERWORKING SPEC
1144 if (player->HasSkill(SKILL_LEATHERWORKING) && player->GetBaseSkillValue(SKILL_LEATHERWORKING) >= 225 && player->GetLevel() >= 40)
1145 {
1146 if (!HasLeatherSpecialty(player) && (player->GetQuestRewardStatus(5141) || player->GetQuestRewardStatus(5143) || player->GetQuestRewardStatus(5144) || player->GetQuestRewardStatus(5145) || player->GetQuestRewardStatus(5146) || player->GetQuestRewardStatus(5148)))
1147 {
1151 }
1152 }
1153
1154 SendGossipMenuFor(player, player->GetGossipTextId(gameobject), gameobject->GetGUID());
1155 return true;
1156 }
@ 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:114
bool GetQuestRewardStatus(uint32 quest_id) const
Definition PlayerQuest.cpp:1474
bool HasSkill(uint32 skill) const
Definition Player.cpp:5589
uint16 GetBaseSkillValue(uint32 skill) const
Definition Player.cpp:5661
uint32 GetGossipTextId(uint32 menuId, WorldObject *source)
Definition PlayerGossip.cpp:409
uint8 GetLevel() const
Definition Unit.h:1104
bool HasLeatherSpecialty(Player *player)
Definition npc_professions.cpp:1115
#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.

1228 {
1229 ClearGossipMenuFor(player);
1230 switch (uiSender)
1231 {
1233 SendActionMenu(player, gameobject, uiAction);
1234 break;
1236 SendActionMenu(player, gameobject, uiAction);
1237 break;
1238 }
1239 return true;
1240 }
void ClearGossipMenuFor(Player *player)
Definition ScriptedGossip.cpp:22
void SendActionMenu(Player *player, GameObject *, uint32 uiAction)
Definition npc_professions.cpp:1158

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

◆ SendActionMenu()

void go_evil_book_for_dummies::SendActionMenu ( Player player,
GameObject ,
uint32  uiAction 
)
inline
1159 {
1160 switch (uiAction)
1161 {
1162 // Learn Goblin
1163 case GOSSIP_ACTION_INFO_DEF + 1:
1164 ProcessCastaction(player, nullptr, S_GOBLIN, S_LEARN_GOBLIN, DoLearnCost(player));
1165 break;
1166 // Learn Gnomish
1167 case GOSSIP_ACTION_INFO_DEF + 2:
1168 ProcessCastaction(player, nullptr, S_GNOMISH, S_LEARN_GNOMISH, DoLearnCost(player));
1169 break;
1170 //Unlearn Goblin
1171 case GOSSIP_ACTION_INFO_DEF + 3:
1172 ProcessUnlearnAction(player, nullptr, S_UNLEARN_GOBLIN, 0, DoHighUnlearnCost(player));
1173 break;
1174 //Unlearn Gnomish
1175 case GOSSIP_ACTION_INFO_DEF + 4:
1176 ProcessUnlearnAction(player, nullptr, S_UNLEARN_GNOMISH, 0, DoHighUnlearnCost(player));
1177 break;
1178 //Learn Dragon
1179 case GOSSIP_ACTION_INFO_DEF + 5:
1180 ProcessCastaction(player, nullptr, S_DRAGON, S_LEARN_DRAGON, 0);
1181 break;
1182 //Learn Elemental
1183 case GOSSIP_ACTION_INFO_DEF + 6:
1184 ProcessCastaction(player, nullptr, S_ELEMENTAL, S_LEARN_ELEMENTAL, 0);
1185 break;
1186 //Learn Tribal
1187 case GOSSIP_ACTION_INFO_DEF + 7:
1188 ProcessCastaction(player, nullptr, S_TRIBAL, S_LEARN_TRIBAL, 0);
1189 break;
1190 }
1191 }
@ 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
1194 {
1195 switch (uiAction)
1196 {
1197 // Goblin
1198 case GOSSIP_ACTION_INFO_DEF + 1:
1200 SendGossipMenuFor(player, player->GetGossipTextId(gameobject), gameobject->GetGUID());
1201 break;
1202 // Gnomish
1203 case GOSSIP_ACTION_INFO_DEF + 2:
1205 SendGossipMenuFor(player, player->GetGossipTextId(gameobject), gameobject->GetGUID());
1206 break;
1207 }
1208 }
#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
1211 {
1212 switch (uiAction)
1213 {
1214 // Goblin
1215 case GOSSIP_ACTION_INFO_DEF + 3:
1217 SendGossipMenuFor(player, player->GetGossipTextId(gameobject), gameobject->GetGUID());
1218 break;
1219 // Gnomish
1220 case GOSSIP_ACTION_INFO_DEF + 4:
1222 SendGossipMenuFor(player, player->GetGossipTextId(gameobject), gameobject->GetGUID());
1223 break;
1224 }
1225 }

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: