TrinityCore
Loading...
Searching...
No Matches
QuestHandler.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "WorldSession.h"
19#include "Battleground.h"
20#include "Common.h"
21#include "Creature.h"
22#include "CreatureAI.h"
23#include "DatabaseEnv.h"
24#include "GameObject.h"
25#include "GameObjectAI.h"
26#include "GossipDef.h"
27#include "Group.h"
28#include "Log.h"
29#include "ObjectAccessor.h"
30#include "ObjectMgr.h"
31#include "Player.h"
32#include "QuestDef.h"
33#include "QuestPackets.h"
34#include "ScriptMgr.h"
35#include "World.h"
36#include "WorldPacket.h"
37
39{
41
43 if (!questGiver)
44 {
45 TC_LOG_INFO("network", "Error in CMSG_QUESTGIVER_STATUS_QUERY, called for non-existing questgiver ({})", packet.QuestGiverGUID.ToString());
46 return;
47 }
48
49 switch (questGiver->GetTypeId())
50 {
51 case TYPEID_UNIT:
52 {
53 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for npc {}", questGiver->GetGUID().ToString());
54 if (!questGiver->ToCreature()->IsHostileTo(_player)) // do not show quest status to enemies
55 questStatus = _player->GetQuestDialogStatus(questGiver);
56 break;
57 }
59 {
60 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for GameObject {}", questGiver->GetGUID().ToString());
61 questStatus = _player->GetQuestDialogStatus(questGiver);
62 break;
63 }
64 default:
65 TC_LOG_ERROR("network", "QuestGiver called for unexpected type {}", questGiver->GetTypeId());
66 break;
67 }
68
69 // inform client about status of quest
71}
72
74{
75 ObjectGuid guid;
76 recvData >> guid;
77
78 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_HELLO {}", guid.ToString());
79
81 if (!creature)
82 {
83 TC_LOG_DEBUG("network", "WORLD: HandleQuestgiverHelloOpcode - {} not found or you can't interact with him.",
84 guid.ToString());
85 return;
86 }
87
88 // remove fake death
89 if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
91
92 // Stop the npc if moving
93 if (uint32 pause = creature->GetMovementTemplate().GetInteractionPauseTimer())
94 creature->PauseMovement(pause);
95 creature->SetHomePosition(creature->GetPosition());
96
98 if (creature->AI()->OnGossipHello(_player))
99 return;
100
101 _player->PrepareGossipMenu(creature, creature->GetCreatureTemplate()->GossipMenuId, true);
102 _player->SendPreparedGossip(creature);
103}
104
106{
107 ObjectGuid guid;
108 uint32 questId;
109 uint32 startCheat;
110 recvData >> guid >> questId >> startCheat;
111
112 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_ACCEPT_QUEST {}, quest = {}, startCheat = {}", guid.ToString(), questId, startCheat);
113
114 Object* object;
115 if (!guid.IsPlayer())
117 else
118 object = ObjectAccessor::FindPlayer(guid);
119
120 auto CLOSE_GOSSIP_CLEAR_SHARING_INFO = ([this]()
121 {
124 });
125
126 // no or incorrect quest giver
127 if (!object)
128 {
129 CLOSE_GOSSIP_CLEAR_SHARING_INFO();
130 return;
131 }
132
133 if (Player* playerQuestObject = object->ToPlayer())
134 {
135 if ((!_player->GetPlayerSharingQuest().IsEmpty() && _player->GetPlayerSharingQuest() != guid) || !playerQuestObject->CanShareQuest(questId))
136 {
137 CLOSE_GOSSIP_CLEAR_SHARING_INFO();
138 return;
139 }
140 if (!_player->IsInSameRaidWith(playerQuestObject))
141 {
142 CLOSE_GOSSIP_CLEAR_SHARING_INFO();
143 return;
144 }
145 }
146 else
147 {
148 if (!object->hasQuest(questId))
149 {
150 CLOSE_GOSSIP_CLEAR_SHARING_INFO();
151 return;
152 }
153 }
154
155 // some kind of WPE protection
157 {
158 CLOSE_GOSSIP_CLEAR_SHARING_INFO();
159 return;
160 }
161
162 if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId))
163 {
164 // prevent cheating
165 if (!GetPlayer()->CanTakeQuest(quest, true))
166 {
167 CLOSE_GOSSIP_CLEAR_SHARING_INFO();
168 return;
169 }
170
172 {
174 if (player)
175 {
178 }
179 }
180
181 if (_player->CanAddQuest(quest, true))
182 {
183 _player->AddQuestAndCheckCompletion(quest, object);
184
185 if (quest->HasFlag(QUEST_FLAGS_PARTY_ACCEPT))
186 {
187 if (Group* group = _player->GetGroup())
188 {
189 for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next())
190 {
191 Player* player = itr->GetSource();
192
193 if (!player || player == _player || !player->IsInMap(_player)) // not self and in same map
194 continue;
195
196 if (player->CanTakeQuest(quest, true))
197 {
198 player->SetQuestSharingInfo(_player->GetGUID(), questId);
199
200 // need confirmation that any gossip window will close
202
203 _player->SendQuestConfirmAccept(quest, player);
204 }
205 }
206 }
207 }
208
210
211 if (quest->GetSrcSpell() > 0)
212 _player->CastSpell(_player, quest->GetSrcSpell(), true);
213
214 return;
215 }
216 }
217
218 CLOSE_GOSSIP_CLEAR_SHARING_INFO();
219}
220
222{
223 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_QUERY_QUEST QuestGiverGUID = {}, QuestID = {}, RespondToGiver = {}", packet.QuestGiverGUID.ToString(), packet.QuestID, packet.RespondToGiver);
224
225 // Verify that the guid is valid and is a questgiver or involved in the requested quest
227 if (!object || (!object->hasQuest(packet.QuestID) && !object->hasInvolvedQuest(packet.QuestID)))
228 {
230 return;
231 }
232
233 if (Quest const* quest = sObjectMgr->GetQuestTemplate(packet.QuestID))
234 {
235 if (!_player->CanTakeQuest(quest, true))
236 return;
237
238 if (quest->IsAutoAccept() && _player->CanAddQuest(quest, true))
239 _player->AddQuestAndCheckCompletion(quest, object);
240
241 if (quest->IsAutoComplete())
242 _player->PlayerTalkClass->SendQuestGiverRequestItems(quest, object->GetGUID(), _player->CanCompleteQuest(quest->GetQuestId()), true);
243 else
245 }
246}
247
249{
250 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUEST_QUERY quest = {}", query.QuestID);
251
252 if (Quest const* quest = sObjectMgr->GetQuestTemplate(query.QuestID))
254}
255
257{
258 uint32 questId, reward;
259 ObjectGuid guid;
260 recvData >> guid >> questId >> reward;
261
262 if (reward >= QUEST_REWARD_CHOICES_COUNT)
263 {
264 TC_LOG_ERROR("entities.player.cheat", "Error in CMSG_QUESTGIVER_CHOOSE_REWARD: player {} {} tried to get invalid reward ({}) (possible packet-hacking detected)", _player->GetName(), _player->GetGUID().ToString(), reward);
265 return;
266 }
267
268 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_CHOOSE_REWARD npc = {}, quest = {}, reward = {}", guid.ToString(), questId, reward);
269
270 Quest const* quest = sObjectMgr->GetQuestTemplate(questId);
271 if (!quest)
272 return;
273
275 if (!object || !object->hasInvolvedQuest(questId))
276 return;
277
278 // some kind of WPE protection
280 return;
281
282 if ((!_player->CanSeeStartQuest(quest) && _player->GetQuestStatus(questId) == QUEST_STATUS_NONE) ||
284 {
285 TC_LOG_ERROR("entities.player.cheat", "Error in QUEST_STATUS_COMPLETE: player {} {} tried to complete quest {}, but is not allowed to do so (possible packet-hacking or high latency)",
286 _player->GetName(), _player->GetGUID().ToString(), questId);
287 return;
288 }
289
290 if (_player->CanRewardQuest(quest, true)) // First, check if player is allowed to turn the quest in (all objectives completed). If not, we send players to the offer reward screen
291 {
292 if (_player->CanRewardQuest(quest, reward, true)) // Then check if player can receive the reward item (if inventory is not full, if player doesn't have too many unique items, and so on). If not, the client will close the gossip window
293 {
294 _player->RewardQuest(quest, reward, object);
295
296 switch (object->GetTypeId())
297 {
298 case TYPEID_UNIT:
299 {
300 Creature* questgiver = object->ToCreature();
301 // Send next quest
302 if (Quest const* nextQuest = _player->GetNextQuest(questgiver, quest))
303 {
304 // Only send the quest to the player if the conditions are met
305 if (_player->CanTakeQuest(nextQuest, false))
306 {
307 if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true))
308 _player->AddQuestAndCheckCompletion(nextQuest, object);
309
310 _player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, guid, true);
311 }
312 }
313
315 questgiver->AI()->OnQuestReward(_player, quest, reward);
316 break;
317 }
319 {
320 GameObject* questGiver = object->ToGameObject();
321 // Send next quest
322 if (Quest const* nextQuest = _player->GetNextQuest(questGiver, quest))
323 {
324 // Only send the quest to the player if the conditions are met
325 if (_player->CanTakeQuest(nextQuest, false))
326 {
327 if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true))
328 _player->AddQuestAndCheckCompletion(nextQuest, object);
329
330 _player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, guid, true);
331 }
332 }
333
335 questGiver->AI()->OnQuestReward(_player, quest, reward);
336 break;
337 }
338 default:
339 break;
340 }
341 }
342 }
343 else
345}
346
348{
349 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_REQUEST_REWARD npc = {}, quest = {}", packet.QuestGiverGUID.ToString(), packet.QuestID);
350
352 if (!object || !object->hasInvolvedQuest(packet.QuestID))
353 return;
354
355 // some kind of WPE protection
357 return;
358
359 if (_player->CanCompleteQuest(packet.QuestID))
361
363 return;
364
365 if (Quest const* quest = sObjectMgr->GetQuestTemplate(packet.QuestID))
367}
368
370{
371 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_CANCEL");
372
374}
375
377{
378 uint8 slot1, slot2;
379 recvData >> slot1 >> slot2;
380
381 if (slot1 == slot2 || slot1 >= MAX_QUEST_LOG_SIZE || slot2 >= MAX_QUEST_LOG_SIZE)
382 return;
383
384 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTLOG_SWAP_QUEST slot 1 = {}, slot 2 = {}", slot1, slot2);
385
386 GetPlayer()->SwapQuestSlot(slot1, slot2);
387}
388
390{
391 uint8 slot;
392 recvData >> slot;
393
394 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTLOG_REMOVE_QUEST slot = {}", slot);
395
396 if (slot < MAX_QUEST_LOG_SIZE)
397 {
398 if (uint32 questId = _player->GetQuestSlotQuestId(slot))
399 {
400 if (!_player->TakeQuestSourceItem(questId, true))
401 return; // can't un-equip some items, reject quest cancel
402
403 if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId))
404 {
405 if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED))
406 _player->RemoveTimedQuest(questId);
407
408 if (quest->HasFlag(QUEST_FLAGS_FLAGS_PVP))
409 {
412 }
413 }
414
415 _player->TakeQuestSourceItem(questId, true); // remove quest src item from player
416 _player->AbandonQuest(questId); // remove all quest items player received before abandoning quest. Note, this does not remove normal drop items that happen to be quest requirements.
417 _player->RemoveActiveQuest(questId);
419
420 TC_LOG_INFO("network", "Player {} abandoned quest {}", _player->GetGUID().ToString(), questId);
421
422 if (sWorld->getBoolConfig(CONFIG_QUEST_ENABLE_QUEST_TRACKER)) // check if Quest Tracker is enabled
423 {
424 // prepare Quest Tracker datas
426 stmt->setUInt32(0, questId);
427 stmt->setUInt32(1, _player->GetGUID().GetCounter());
428
429 // add to Quest Tracker
430 CharacterDatabase.Execute(stmt);
431 }
432
433 sScriptMgr->OnQuestStatusChange(_player, questId);
434 }
435
436 _player->SetQuestSlot(slot, 0);
437
439 }
440}
441
443{
444 uint32 questId;
445 recvData >> questId;
446
447 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUEST_CONFIRM_ACCEPT quest = {}", questId);
448
449 if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId))
450 {
451 if (!quest->HasFlag(QUEST_FLAGS_PARTY_ACCEPT))
452 return;
453
455 if (!originalPlayer)
456 return;
457
458 if (!_player->IsInSameRaidWith(originalPlayer))
459 return;
460
461 if (!originalPlayer->IsActiveQuest(questId))
462 return;
463
464 if (!_player->CanTakeQuest(quest, true))
465 return;
466
467 if (_player->CanAddQuest(quest, true))
468 {
469 _player->AddQuestAndCheckCompletion(quest, nullptr); // NULL, this prevent DB script from duplicate running
470
471 if (quest->GetSrcSpell() > 0)
472 _player->CastSpell(_player, quest->GetSrcSpell(), true);
473 }
474 }
475
477}
478
480{
481 uint32 questId;
482 ObjectGuid guid;
483
484 recvData >> guid >> questId;
485
486 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc = {}, quest = {}", guid.ToString(), questId);
487
488 Quest const* quest = sObjectMgr->GetQuestTemplate(questId);
489 if (!quest)
490 return;
491
493
494 if (!object)
495 return;
496
498 {
499 if (!object->hasInvolvedQuest(questId))
500 return;
501
502 // some kind of WPE protection
504 return;
505 }
506 else
507 {
508 // Do not allow completing quests on other players.
509 if (guid != _player->GetGUID())
510 return;
511 }
512
514 {
515 TC_LOG_ERROR("entities.player.cheat", "Possible hacking attempt: Player {} [{}] tried to complete quest [entry: {}] without being in possession of the quest!",
516 _player->GetName(), _player->GetGUID().ToString(), questId);
517 return;
518 }
519
521 bg->HandleQuestComplete(questId, _player);
522
524 {
525 if (quest->IsRepeatable())
527 else
528 _player->PlayerTalkClass->SendQuestGiverRequestItems(quest, guid, _player->CanRewardQuest(quest, false), false);
529 }
530 else
531 {
532 if (quest->GetReqItemsCount()) // some items required
533 _player->PlayerTalkClass->SendQuestGiverRequestItems(quest, guid, _player->CanRewardQuest(quest, false), false);
534 else // no items required
536 }
537}
538
540{
541 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_QUEST_AUTOLAUNCH");
542}
543
545{
546 uint32 questId;
547 recvPacket >> questId;
548
549 if (!_player->CanShareQuest(questId))
550 return;
551
552 TC_LOG_DEBUG("network", "WORLD: Received CMSG_PUSHQUESTTOPARTY questId = {}", questId);
553
554 Quest const* quest = sObjectMgr->GetQuestTemplate(questId);
555 if (!quest)
556 return;
557
558 Player * const sender = GetPlayer();
559
560 Group* group = sender->GetGroup();
561 if (!group)
562 {
564 return;
565 }
566
567 for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next())
568 {
569 Player* receiver = itr->GetSource();
570
571 if (!receiver || receiver == sender)
572 continue;
573
574 if (!receiver->GetPlayerSharingQuest().IsEmpty())
575 {
577 continue;
578 }
579
580 switch (receiver->GetQuestStatus(questId))
581 {
583 {
585 continue;
586 }
589 {
591 continue;
592 }
593 default:
594 break;
595 }
596
597 if (!receiver->SatisfyQuestLog(false))
598 {
600 continue;
601 }
602
603 if (!receiver->SatisfyQuestDay(quest, false))
604 {
606 continue;
607 }
608
609 if (!receiver->CanTakeQuest(quest, false))
610 {
612 continue;
613 }
614
616
617 if (quest->IsAutoComplete() && quest->IsRepeatable() && !quest->IsDailyOrWeekly())
618 receiver->PlayerTalkClass->SendQuestGiverRequestItems(quest, sender->GetGUID(), receiver->CanCompleteRepeatableQuest(quest), true);
619 else
620 {
621 receiver->SetQuestSharingInfo(sender->GetGUID(), questId);
622 receiver->PlayerTalkClass->SendQuestGiverQuestDetails(quest, receiver->GetGUID(), true);
623 if (quest->IsAutoAccept() && receiver->CanAddQuest(quest, true) && receiver->CanTakeQuest(quest, true))
624 {
625 receiver->AddQuestAndCheckCompletion(quest, sender);
627 receiver->ClearQuestSharingInfo();
628 }
629 }
630 }
631}
632
634{
635 ObjectGuid guid;
636 uint32 questId;
637 uint8 msg;
638 recvPacket >> guid >> questId >> msg;
639
640 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUEST_PUSH_RESULT");
641
643 return;
644
645 if (_player->GetPlayerSharingQuest() == guid)
646 {
647 Player* player = ObjectAccessor::FindPlayer(guid);
648 if (player)
649 player->SendPushToPartyResponse(_player, static_cast<QuestShareMessages>(msg));
650 }
651
653}
654
656{
657 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY");
658
660}
661
663{
664 WorldPackets::Quest::QueryQuestsCompletedResponse queryQuestsCompletedResponse;
665 queryQuestsCompletedResponse.QuestsCompleted = &_player->getRewardedQuests();
666 SendPacket(queryQuestsCompletedResponse.Write());
667}
@ CHAR_UPD_QUEST_TRACK_ABANDON_TIME
@ ACHIEVEMENT_TIMED_TYPE_QUEST
Definition DBCEnums.h:123
@ ACHIEVEMENT_CRITERIA_TYPE_QUEST_ABANDONED
Definition DBCEnums.h:227
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
uint8_t uint8
Definition Define.h:135
uint32_t uint32
Definition Define.h:133
#define TC_LOG_DEBUG(filterType__,...)
Definition Log.h:156
#define TC_LOG_ERROR(filterType__,...)
Definition Log.h:165
#define TC_LOG_INFO(filterType__,...)
Definition Log.h:159
@ TYPEID_GAMEOBJECT
Definition ObjectGuid.h:40
@ TYPEID_UNIT
Definition ObjectGuid.h:38
@ TYPEMASK_ITEM
Definition ObjectGuid.h:50
@ TYPEMASK_UNIT
Definition ObjectGuid.h:52
@ TYPEMASK_GAMEOBJECT
Definition ObjectGuid.h:54
#define sObjectMgr
Definition ObjectMgr.h:1721
@ QUEST_FLAGS_PARTY_ACCEPT
Definition QuestDef.h:133
@ QUEST_FLAGS_FLAGS_PVP
Definition QuestDef.h:145
@ QUEST_FLAGS_AUTOCOMPLETE
Definition QuestDef.h:148
QuestGiverStatus
Definition QuestDef.h:114
@ DIALOG_STATUS_NONE
Definition QuestDef.h:115
#define MAX_QUEST_LOG_SIZE
Definition QuestDef.h:36
@ QUEST_STATUS_REWARDED
Definition QuestDef.h:109
@ QUEST_STATUS_INCOMPLETE
Definition QuestDef.h:106
@ QUEST_STATUS_NONE
Definition QuestDef.h:103
@ QUEST_STATUS_COMPLETE
Definition QuestDef.h:104
QuestShareMessages
Definition QuestDef.h:67
@ QUEST_PARTY_MSG_FINISH_QUEST
Definition QuestDef.h:75
@ QUEST_PARTY_MSG_CANT_TAKE_QUEST
Definition QuestDef.h:69
@ QUEST_PARTY_MSG_NOT_ELIGIBLE_TODAY
Definition QuestDef.h:79
@ QUEST_PARTY_MSG_BUSY
Definition QuestDef.h:72
@ QUEST_PARTY_MSG_ACCEPT_QUEST
Definition QuestDef.h:70
@ QUEST_PARTY_MSG_HAVE_QUEST
Definition QuestDef.h:74
@ QUEST_PARTY_MSG_SHARING_QUEST
Definition QuestDef.h:68
@ QUEST_PARTY_MSG_LOG_FULL
Definition QuestDef.h:73
@ QUEST_PARTY_MSG_NOT_IN_PARTY
Definition QuestDef.h:78
#define QUEST_REWARD_CHOICES_COUNT
Definition QuestDef.h:41
@ QUEST_SPECIAL_FLAGS_TIMED
Definition QuestDef.h:173
#define sScriptMgr
Definition ScriptMgr.h:1168
@ SPELL_AURA_FEIGN_DEATH
@ UNIT_NPC_FLAG_QUESTGIVER
@ UNIT_STATE_DIED
Definition Unit.h:234
virtual bool OnGossipHello(Player *)
Definition CreatureAI.h:216
virtual void OnQuestReward(Player *, Quest const *, uint32)
Definition CreatureAI.h:228
void SetHomePosition(float x, float y, float z, float o)
Definition Creature.h:302
CreatureTemplate const * GetCreatureTemplate() const
Definition Creature.h:195
CreatureMovementData const & GetMovementTemplate() const
CreatureAI * AI() const
Definition Creature.h:163
virtual void OnQuestReward(Player *, Quest const *, uint32)
GameObjectAI * AI() const
Definition GameObject.h:275
Definition Group.h:165
GroupReference * GetFirstMember()
Definition Group.h:247
LowType GetCounter() const
Definition ObjectGuid.h:156
bool IsEmpty() const
Definition ObjectGuid.h:172
bool IsPlayer() const
Definition ObjectGuid.h:179
std::string ToString() const
static Creature * ToCreature(Object *o)
Definition Object.h:189
static GameObject * ToGameObject(Object *o)
Definition Object.h:201
virtual bool hasQuest(uint32) const
Definition Object.h:158
TypeID GetTypeId() const
Definition Object.h:93
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:78
virtual bool hasInvolvedQuest(uint32) const
Definition Object.h:159
static Player * ToPlayer(Object *o)
Definition Object.h:183
void SendCloseGossip()
void SendQuestGiverQuestDetails(Quest const *quest, ObjectGuid npcGUID, bool autoLaunched) const
void SendQuestGiverOfferReward(Quest const *quest, ObjectGuid npcGUID, bool autoLaunched) const
void ClearMenus()
void SendQuestQueryResponse(Quest const *quest) const
void SendQuestGiverStatus(QuestGiverStatus questStatus, ObjectGuid npcGUID) const
void SendQuestGiverRequestItems(Quest const *quest, ObjectGuid npcGUID, bool canComplete, bool autoLaunched) const
bool CanInteractWithQuestGiver(Object *questGiver) const
Definition Player.cpp:2108
void RewardQuest(Quest const *quest, uint32 reward, Object *questGiver, bool announce=true)
Definition Player.cpp:14862
bool HasPvPForcingQuest() const
Definition Player.cpp:16700
bool IsInSameRaidWith(Player const *p) const
Definition Player.cpp:2329
RewardedQuestSet const & getRewardedQuests() const
Definition Player.h:1398
void UpdatePvPState(bool onlyFFA=false)
Definition Player.cpp:21641
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, WorldObject *ref=nullptr)
Definition Player.cpp:24914
bool CanCompleteQuest(uint32 quest_id)
Definition Player.cpp:14492
void SendPreparedGossip(WorldObject *source)
Definition Player.cpp:14053
bool CanSeeStartQuest(Quest const *quest) const
Definition Player.cpp:14442
QuestGiverStatus GetQuestDialogStatus(Object *questGiver)
Definition Player.cpp:15796
bool SatisfyQuestDay(Quest const *qInfo, bool msg) const
Definition Player.cpp:15504
bool CanRewardQuest(Quest const *quest, bool msg)
Definition Player.cpp:14581
bool CanAddQuest(Quest const *quest, bool msg) const
Definition Player.cpp:14468
void CompleteQuest(uint32 quest_id)
Definition Player.cpp:14805
bool SatisfyQuestLog(bool msg) const
Definition Player.cpp:15169
void SendQuestConfirmAccept(Quest const *quest, Player *pReceiver) const
Definition Player.cpp:16588
uint32 GetQuestSlotQuestId(uint16 slot) const
Definition Player.cpp:15957
void SwapQuestSlot(uint16 slot1, uint16 slot2)
Definition Player.cpp:16009
bool CanShareQuest(uint32 questId) const
Definition Player.cpp:15669
Creature * GetNPCIfCanInteractWith(ObjectGuid const &guid, NPCFlags npcFlags) const
Definition Player.cpp:2126
Quest const * GetNextQuest(Object const *questGiver, Quest const *quest) const
Definition Player.cpp:14416
Battleground * GetBattleground() const
Definition Player.cpp:23024
void SetQuestSlot(uint16 slot, uint32 quest_id, uint32 timer=0)
Definition Player.cpp:15977
bool IsActiveQuest(uint32 quest_id) const
Definition Player.cpp:14411
Group * GetGroup()
Definition Player.h:2159
PvPInfo pvpInfo
Definition Player.h:1567
void AddQuestAndCheckCompletion(Quest const *quest, Object *questGiver)
Definition Player.cpp:14625
void SetQuestSharingInfo(ObjectGuid guid, uint32 id)
Definition Player.h:1342
void ClearQuestSharingInfo()
Definition Player.h:1343
bool CanTakeQuest(Quest const *quest, bool msg) const
Definition Player.cpp:14456
void SendPushToPartyResponse(Player const *player, QuestShareMessages msg) const
Definition Player.cpp:16609
bool TakeQuestSourceItem(uint32 questId, bool msg)
Definition Player.cpp:15605
void RemoveActiveQuest(uint32 questId, bool update=true)
Definition Player.cpp:15706
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition Player.cpp:15655
bool CanCompleteRepeatableQuest(Quest const *quest)
Definition Player.cpp:14562
void RemoveTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
Definition Player.cpp:24904
void AbandonQuest(uint32 quest_id)
Definition Player.cpp:15102
ObjectGuid GetPlayerSharingQuest() const
Definition Player.h:1341
void RemoveTimedQuest(uint32 questId)
Definition Player.h:1349
void PrepareGossipMenu(WorldObject *source, uint32 menuId=0, bool showQuests=false)
Definition Player.cpp:13887
void SendQuestGiverStatusMultiple()
Definition Player.cpp:16670
PlayerMenu * PlayerTalkClass
Definition Player.h:1956
void setUInt32(uint8 index, uint32 value)
uint32 GetReqItemsCount() const
Definition QuestDef.h:322
bool IsRepeatable() const
Definition QuestDef.h:285
bool IsAutoComplete() const
Definition QuestDef.cpp:315
bool IsAutoAccept() const
Definition QuestDef.cpp:310
bool IsDailyOrWeekly() const
Definition QuestDef.h:295
bool HasFlag(QuestFlags flag) const
Definition QuestDef.h:216
void RemoveAurasByType(AuraType auraType, std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3788
void PauseMovement(uint32 timer=0, uint8 slot=0, bool forced=true)
Definition Unit.cpp:10304
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2833
bool IsHostileTo(WorldObject const *target) const
Definition Object.cpp:2797
std::string const & GetName() const
Definition Object.h:384
bool IsInMap(WorldObject const *obj) const
Definition Object.cpp:1161
void HandleQuestQueryOpcode(WorldPackets::Quest::QueryQuestInfo &query)
void HandleQuestgiverRequestRewardOpcode(WorldPackets::Quest::QuestGiverRequestReward &packet)
void SendPacket(WorldPacket const *packet)
Send a packet to the client.
void HandleQuestConfirmAccept(WorldPacket &recvData)
void HandleQuestLogRemoveQuest(WorldPacket &recvData)
void HandleQuestgiverQuestAutoLaunch(WorldPacket &recvPacket)
void HandleQuestgiverStatusMultipleQuery(WorldPackets::Quest::QuestGiverStatusMultipleQuery &packet)
void HandleQuestgiverAcceptQuestOpcode(WorldPacket &recvPacket)
Player * GetPlayer() const
void HandleQuestgiverCompleteQuest(WorldPacket &recvData)
void HandleQuestgiverHelloOpcode(WorldPacket &recvPacket)
void HandleQueryQuestsCompleted(WorldPackets::Quest::QueryQuestsCompleted &queryQuestsCompleted)
void HandleQuestgiverStatusQueryOpcode(WorldPackets::Quest::QuestGiverStatusQuery &packet)
void HandleQuestLogSwapQuest(WorldPacket &recvData)
void HandleQuestPushResult(WorldPacket &recvPacket)
Player * _player
void HandleQuestgiverChooseRewardOpcode(WorldPacket &recvPacket)
void HandlePushQuestToParty(WorldPacket &recvPacket)
void HandleQuestgiverCancel(WorldPacket &recvData)
void HandleQuestgiverQueryQuestOpcode(WorldPackets::Quest::QuestGiverQueryQuest &packet)
#define sWorld
Definition World.h:901
@ CONFIG_QUEST_ENABLE_QUEST_TRACKER
Definition World.h:154
TC_GAME_API Object * GetObjectByTypeMask(WorldObject const &, ObjectGuid const &, uint32 typemask)
TC_GAME_API Player * FindPlayer(ObjectGuid const &)
uint32 GetInteractionPauseTimer() const
void GetPosition(float &x, float &y) const
Definition Position.h:84
bool IsHostile
Definition Player.h:246
bool IsInHostileArea
Definition Player.h:247