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{
40 ObjectGuid guid;
41 recvData >> guid;
42 uint32 questStatus = DIALOG_STATUS_NONE;
43
45 if (!questGiver)
46 {
47 TC_LOG_INFO("network", "Error in CMSG_QUESTGIVER_STATUS_QUERY, called for non-existing questgiver ({})", guid.ToString());
48 return;
49 }
50
51 switch (questGiver->GetTypeId())
52 {
53 case TYPEID_UNIT:
54 {
55 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for npc {}", questGiver->GetGUID().ToString());
56 if (!questGiver->ToCreature()->IsHostileTo(_player)) // do not show quest status to enemies
57 questStatus = _player->GetQuestDialogStatus(questGiver);
58 break;
59 }
61 {
62 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for GameObject {}", questGiver->GetGUID().ToString());
63 questStatus = _player->GetQuestDialogStatus(questGiver);
64 break;
65 }
66 default:
67 TC_LOG_ERROR("network", "QuestGiver called for unexpected type {}", questGiver->GetTypeId());
68 break;
69 }
70
71 // inform client about status of quest
73}
74
76{
77 ObjectGuid guid;
78 recvData >> guid;
79
80 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_HELLO {}", guid.ToString());
81
83 if (!creature)
84 {
85 TC_LOG_DEBUG("network", "WORLD: HandleQuestgiverHelloOpcode - {} not found or you can't interact with him.",
86 guid.ToString());
87 return;
88 }
89
90 // remove fake death
91 if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
93
94 // Stop the npc if moving
95 if (uint32 pause = creature->GetMovementTemplate().GetInteractionPauseTimer())
96 creature->PauseMovement(pause);
97 creature->SetHomePosition(creature->GetPosition());
98
100 if (creature->AI()->OnGossipHello(_player))
101 return;
102
103 _player->PrepareGossipMenu(creature, creature->GetCreatureTemplate()->GossipMenuId, true);
104 _player->SendPreparedGossip(creature);
105}
106
108{
109 ObjectGuid guid;
110 uint32 questId;
111 uint32 startCheat;
112 recvData >> guid >> questId >> startCheat;
113
114 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_ACCEPT_QUEST {}, quest = {}, startCheat = {}", guid.ToString(), questId, startCheat);
115
116 Object* object;
117 if (!guid.IsPlayer())
119 else
120 object = ObjectAccessor::FindPlayer(guid);
121
122 auto CLOSE_GOSSIP_CLEAR_SHARING_INFO = ([this]()
123 {
126 });
127
128 // no or incorrect quest giver
129 if (!object)
130 {
131 CLOSE_GOSSIP_CLEAR_SHARING_INFO();
132 return;
133 }
134
135 if (Player* playerQuestObject = object->ToPlayer())
136 {
137 if ((!_player->GetPlayerSharingQuest().IsEmpty() && _player->GetPlayerSharingQuest() != guid) || !playerQuestObject->CanShareQuest(questId))
138 {
139 CLOSE_GOSSIP_CLEAR_SHARING_INFO();
140 return;
141 }
142 if (!_player->IsInSameRaidWith(playerQuestObject))
143 {
144 CLOSE_GOSSIP_CLEAR_SHARING_INFO();
145 return;
146 }
147 }
148 else
149 {
150 if (!object->hasQuest(questId))
151 {
152 CLOSE_GOSSIP_CLEAR_SHARING_INFO();
153 return;
154 }
155 }
156
157 // some kind of WPE protection
159 {
160 CLOSE_GOSSIP_CLEAR_SHARING_INFO();
161 return;
162 }
163
164 if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId))
165 {
166 // prevent cheating
167 if (!GetPlayer()->CanTakeQuest(quest, true))
168 {
169 CLOSE_GOSSIP_CLEAR_SHARING_INFO();
170 return;
171 }
172
174 {
176 if (player)
177 {
180 }
181 }
182
183 if (_player->CanAddQuest(quest, true))
184 {
185 _player->AddQuestAndCheckCompletion(quest, object);
186
187 if (quest->HasFlag(QUEST_FLAGS_PARTY_ACCEPT))
188 {
189 if (Group* group = _player->GetGroup())
190 {
191 for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next())
192 {
193 Player* player = itr->GetSource();
194
195 if (!player || player == _player || !player->IsInMap(_player)) // not self and in same map
196 continue;
197
198 if (player->CanTakeQuest(quest, true))
199 {
200 player->SetQuestSharingInfo(_player->GetGUID(), questId);
201
202 // need confirmation that any gossip window will close
204
205 _player->SendQuestConfirmAccept(quest, player);
206 }
207 }
208 }
209 }
210
212
213 if (quest->GetSrcSpell() > 0)
214 _player->CastSpell(_player, quest->GetSrcSpell(), true);
215
216 return;
217 }
218 }
219
220 CLOSE_GOSSIP_CLEAR_SHARING_INFO();
221}
222
224{
225 ObjectGuid guid;
226 uint32 questId;
227 uint8 unk1;
228 recvData >> guid >> questId >> unk1;
229 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_QUERY_QUEST npc = {}, quest = {}, unk1 = {}", guid.ToString(), questId, unk1);
230
231 // Verify that the guid is valid and is a questgiver or involved in the requested quest
233 if (!object || (!object->hasQuest(questId) && !object->hasInvolvedQuest(questId)))
234 {
236 return;
237 }
238
239 if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId))
240 {
241 if (!_player->CanTakeQuest(quest, true))
242 return;
243
244 if (quest->IsAutoAccept() && _player->CanAddQuest(quest, true))
245 _player->AddQuestAndCheckCompletion(quest, object);
246
247 if (quest->IsAutoComplete())
248 _player->PlayerTalkClass->SendQuestGiverRequestItems(quest, object->GetGUID(), _player->CanCompleteQuest(quest->GetQuestId()), true);
249 else
251 }
252}
253
255{
256 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUEST_QUERY quest = {}", query.QuestID);
257
258 if (Quest const* quest = sObjectMgr->GetQuestTemplate(query.QuestID))
260}
261
263{
264 uint32 questId, reward;
265 ObjectGuid guid;
266 recvData >> guid >> questId >> reward;
267
268 if (reward >= QUEST_REWARD_CHOICES_COUNT)
269 {
270 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);
271 return;
272 }
273
274 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_CHOOSE_REWARD npc = {}, quest = {}, reward = {}", guid.ToString(), questId, reward);
275
276 Quest const* quest = sObjectMgr->GetQuestTemplate(questId);
277 if (!quest)
278 return;
279
281 if (!object || !object->hasInvolvedQuest(questId))
282 return;
283
284 // some kind of WPE protection
286 return;
287
288 if ((!_player->CanSeeStartQuest(quest) && _player->GetQuestStatus(questId) == QUEST_STATUS_NONE) ||
290 {
291 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)",
292 _player->GetName(), _player->GetGUID().ToString(), questId);
293 return;
294 }
295
296 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
297 {
298 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
299 {
300 _player->RewardQuest(quest, reward, object);
301
302 switch (object->GetTypeId())
303 {
304 case TYPEID_UNIT:
305 {
306 Creature* questgiver = object->ToCreature();
307 // Send next quest
308 if (Quest const* nextQuest = _player->GetNextQuest(questgiver, quest))
309 {
310 // Only send the quest to the player if the conditions are met
311 if (_player->CanTakeQuest(nextQuest, false))
312 {
313 if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true))
314 _player->AddQuestAndCheckCompletion(nextQuest, object);
315
316 _player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, guid, true);
317 }
318 }
319
321 questgiver->AI()->OnQuestReward(_player, quest, reward);
322 break;
323 }
325 {
326 GameObject* questGiver = object->ToGameObject();
327 // Send next quest
328 if (Quest const* nextQuest = _player->GetNextQuest(questGiver, quest))
329 {
330 // Only send the quest to the player if the conditions are met
331 if (_player->CanTakeQuest(nextQuest, false))
332 {
333 if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true))
334 _player->AddQuestAndCheckCompletion(nextQuest, object);
335
336 _player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, guid, true);
337 }
338 }
339
341 questGiver->AI()->OnQuestReward(_player, quest, reward);
342 break;
343 }
344 default:
345 break;
346 }
347 }
348 }
349 else
351}
352
354{
355 uint32 questId;
356 ObjectGuid guid;
357 recvData >> guid >> questId;
358
359 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_REQUEST_REWARD npc = {}, quest = {}", guid.ToString(), questId);
360
362 if (!object || !object->hasInvolvedQuest(questId))
363 return;
364
365 // some kind of WPE protection
367 return;
368
369 if (_player->CanCompleteQuest(questId))
370 _player->CompleteQuest(questId);
371
373 return;
374
375 if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId))
377}
378
380{
381 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_CANCEL");
382
384}
385
387{
388 uint8 slot1, slot2;
389 recvData >> slot1 >> slot2;
390
391 if (slot1 == slot2 || slot1 >= MAX_QUEST_LOG_SIZE || slot2 >= MAX_QUEST_LOG_SIZE)
392 return;
393
394 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTLOG_SWAP_QUEST slot 1 = {}, slot 2 = {}", slot1, slot2);
395
396 GetPlayer()->SwapQuestSlot(slot1, slot2);
397}
398
400{
401 uint8 slot;
402 recvData >> slot;
403
404 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTLOG_REMOVE_QUEST slot = {}", slot);
405
406 if (slot < MAX_QUEST_LOG_SIZE)
407 {
408 if (uint32 questId = _player->GetQuestSlotQuestId(slot))
409 {
410 if (!_player->TakeQuestSourceItem(questId, true))
411 return; // can't un-equip some items, reject quest cancel
412
413 if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId))
414 {
415 if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED))
416 _player->RemoveTimedQuest(questId);
417
418 if (quest->HasFlag(QUEST_FLAGS_FLAGS_PVP))
419 {
422 }
423 }
424
425 _player->TakeQuestSourceItem(questId, true); // remove quest src item from player
426 _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.
427 _player->RemoveActiveQuest(questId);
429
430 TC_LOG_INFO("network", "Player {} abandoned quest {}", _player->GetGUID().ToString(), questId);
431
432 if (sWorld->getBoolConfig(CONFIG_QUEST_ENABLE_QUEST_TRACKER)) // check if Quest Tracker is enabled
433 {
434 // prepare Quest Tracker datas
436 stmt->setUInt32(0, questId);
437 stmt->setUInt32(1, _player->GetGUID().GetCounter());
438
439 // add to Quest Tracker
440 CharacterDatabase.Execute(stmt);
441 }
442
443 sScriptMgr->OnQuestStatusChange(_player, questId);
444 }
445
446 _player->SetQuestSlot(slot, 0);
447
449 }
450}
451
453{
454 uint32 questId;
455 recvData >> questId;
456
457 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUEST_CONFIRM_ACCEPT quest = {}", questId);
458
459 if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId))
460 {
461 if (!quest->HasFlag(QUEST_FLAGS_PARTY_ACCEPT))
462 return;
463
465 if (!originalPlayer)
466 return;
467
468 if (!_player->IsInSameRaidWith(originalPlayer))
469 return;
470
471 if (!originalPlayer->IsActiveQuest(questId))
472 return;
473
474 if (!_player->CanTakeQuest(quest, true))
475 return;
476
477 if (_player->CanAddQuest(quest, true))
478 {
479 _player->AddQuestAndCheckCompletion(quest, nullptr); // NULL, this prevent DB script from duplicate running
480
481 if (quest->GetSrcSpell() > 0)
482 _player->CastSpell(_player, quest->GetSrcSpell(), true);
483 }
484 }
485
487}
488
490{
491 uint32 questId;
492 ObjectGuid guid;
493
494 recvData >> guid >> questId;
495
496 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc = {}, quest = {}", guid.ToString(), questId);
497
498 Quest const* quest = sObjectMgr->GetQuestTemplate(questId);
499 if (!quest)
500 return;
501
503
504 if (!object)
505 return;
506
508 {
509 if (!object->hasInvolvedQuest(questId))
510 return;
511
512 // some kind of WPE protection
514 return;
515 }
516 else
517 {
518 // Do not allow completing quests on other players.
519 if (guid != _player->GetGUID())
520 return;
521 }
522
524 {
525 TC_LOG_ERROR("entities.player.cheat", "Possible hacking attempt: Player {} [{}] tried to complete quest [entry: {}] without being in possession of the quest!",
526 _player->GetName(), _player->GetGUID().ToString(), questId);
527 return;
528 }
529
531 bg->HandleQuestComplete(questId, _player);
532
534 {
535 if (quest->IsRepeatable())
537 else
538 _player->PlayerTalkClass->SendQuestGiverRequestItems(quest, guid, _player->CanRewardQuest(quest, false), false);
539 }
540 else
541 {
542 if (quest->GetReqItemsCount()) // some items required
543 _player->PlayerTalkClass->SendQuestGiverRequestItems(quest, guid, _player->CanRewardQuest(quest, false), false);
544 else // no items required
546 }
547}
548
550{
551 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_QUEST_AUTOLAUNCH");
552}
553
555{
556 uint32 questId;
557 recvPacket >> questId;
558
559 if (!_player->CanShareQuest(questId))
560 return;
561
562 TC_LOG_DEBUG("network", "WORLD: Received CMSG_PUSHQUESTTOPARTY questId = {}", questId);
563
564 Quest const* quest = sObjectMgr->GetQuestTemplate(questId);
565 if (!quest)
566 return;
567
568 Player * const sender = GetPlayer();
569
570 Group* group = sender->GetGroup();
571 if (!group)
572 {
574 return;
575 }
576
577 for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next())
578 {
579 Player* receiver = itr->GetSource();
580
581 if (!receiver || receiver == sender)
582 continue;
583
584 if (!receiver->GetPlayerSharingQuest().IsEmpty())
585 {
587 continue;
588 }
589
590 switch (receiver->GetQuestStatus(questId))
591 {
593 {
595 continue;
596 }
599 {
601 continue;
602 }
603 default:
604 break;
605 }
606
607 if (!receiver->SatisfyQuestLog(false))
608 {
610 continue;
611 }
612
613 if (!receiver->SatisfyQuestDay(quest, false))
614 {
616 continue;
617 }
618
619 if (!receiver->CanTakeQuest(quest, false))
620 {
622 continue;
623 }
624
626
627 if (quest->IsAutoComplete() && quest->IsRepeatable() && !quest->IsDailyOrWeekly())
628 receiver->PlayerTalkClass->SendQuestGiverRequestItems(quest, sender->GetGUID(), receiver->CanCompleteRepeatableQuest(quest), true);
629 else
630 {
631 receiver->SetQuestSharingInfo(sender->GetGUID(), questId);
632 receiver->PlayerTalkClass->SendQuestGiverQuestDetails(quest, receiver->GetGUID(), true);
633 if (quest->IsAutoAccept() && receiver->CanAddQuest(quest, true) && receiver->CanTakeQuest(quest, true))
634 {
635 receiver->AddQuestAndCheckCompletion(quest, sender);
637 receiver->ClearQuestSharingInfo();
638 }
639 }
640 }
641}
642
644{
645 ObjectGuid guid;
646 uint32 questId;
647 uint8 msg;
648 recvPacket >> guid >> questId >> msg;
649
650 TC_LOG_DEBUG("network", "WORLD: Received MSG_QUEST_PUSH_RESULT");
651
653 return;
654
655 if (_player->GetPlayerSharingQuest() == guid)
656 {
657 Player* player = ObjectAccessor::FindPlayer(guid);
658 if (player)
659 player->SendPushToPartyResponse(_player, static_cast<QuestShareMessages>(msg));
660 }
661
663}
664
666{
667 TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY");
668
670}
671
673{
674 size_t rew_count = _player->GetRewardedQuestCount();
675
676 WorldPacket data(SMSG_QUERY_QUESTS_COMPLETED_RESPONSE, 4 + 4 * rew_count);
677 data << uint32(rew_count);
678
679 RewardedQuestSet const& rewQuests = _player->getRewardedQuests();
680 for (RewardedQuestSet::const_iterator itr = rewQuests.begin(); itr != rewQuests.end(); ++itr)
681 data << uint32(*itr);
682
683 SendPacket(&data);
684}
@ 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
std::set< uint32 > RewardedQuestSet
Definition Player.h:485
@ QUEST_FLAGS_PARTY_ACCEPT
Definition QuestDef.h:134
@ QUEST_FLAGS_FLAGS_PVP
Definition QuestDef.h:146
@ QUEST_FLAGS_AUTOCOMPLETE
Definition QuestDef.h:149
#define MAX_QUEST_LOG_SIZE
Definition QuestDef.h:36
@ QUEST_STATUS_REWARDED
Definition QuestDef.h:110
@ QUEST_STATUS_INCOMPLETE
Definition QuestDef.h:107
@ QUEST_STATUS_NONE
Definition QuestDef.h:104
@ QUEST_STATUS_COMPLETE
Definition QuestDef.h:105
QuestShareMessages
Definition QuestDef.h:68
@ QUEST_PARTY_MSG_FINISH_QUEST
Definition QuestDef.h:76
@ QUEST_PARTY_MSG_CANT_TAKE_QUEST
Definition QuestDef.h:70
@ QUEST_PARTY_MSG_NOT_ELIGIBLE_TODAY
Definition QuestDef.h:80
@ QUEST_PARTY_MSG_BUSY
Definition QuestDef.h:73
@ QUEST_PARTY_MSG_ACCEPT_QUEST
Definition QuestDef.h:71
@ QUEST_PARTY_MSG_HAVE_QUEST
Definition QuestDef.h:75
@ QUEST_PARTY_MSG_SHARING_QUEST
Definition QuestDef.h:69
@ QUEST_PARTY_MSG_LOG_FULL
Definition QuestDef.h:74
@ QUEST_PARTY_MSG_NOT_IN_PARTY
Definition QuestDef.h:79
#define QUEST_REWARD_CHOICES_COUNT
Definition QuestDef.h:41
@ DIALOG_STATUS_NONE
Definition QuestDef.h:116
@ QUEST_SPECIAL_FLAGS_TIMED
Definition QuestDef.h:174
#define sScriptMgr
Definition ScriptMgr.h:1168
@ SPELL_AURA_FEIGN_DEATH
@ UNIT_NPC_FLAG_QUESTGIVER
@ UNIT_STATE_DIED
Definition Unit.h:220
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:293
CreatureTemplate const * GetCreatureTemplate() const
Definition Creature.h:186
CreatureMovementData const & GetMovementTemplate() const
CreatureAI * AI() const
Definition Creature.h:154
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:186
static GameObject * ToGameObject(Object *o)
Definition Object.h:198
virtual bool hasQuest(uint32) const
Definition Object.h:155
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:156
static Player * ToPlayer(Object *o)
Definition Object.h:180
void SendCloseGossip()
void SendQuestGiverOfferReward(Quest const *quest, ObjectGuid npcGUID, bool autoLaunched) const
void SendQuestGiverQuestDetails(Quest const *quest, ObjectGuid npcGUID, bool activateAccept) const
void SendQuestGiverRequestItems(Quest const *quest, ObjectGuid npcGUID, bool canComplete, bool closeOnCancel) const
void ClearMenus()
void SendQuestGiverStatus(uint8 questStatus, ObjectGuid npcGUID) const
void SendQuestQueryResponse(Quest const *quest) const
bool CanInteractWithQuestGiver(Object *questGiver) const
Definition Player.cpp:2076
void RewardQuest(Quest const *quest, uint32 reward, Object *questGiver, bool announce=true)
Definition Player.cpp:14843
bool HasPvPForcingQuest() const
Definition Player.cpp:16695
bool IsInSameRaidWith(Player const *p) const
Definition Player.cpp:2297
RewardedQuestSet const & getRewardedQuests() const
Definition Player.h:1414
void UpdatePvPState(bool onlyFFA=false)
Definition Player.cpp:21644
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, WorldObject *ref=nullptr)
Definition Player.cpp:24940
bool CanCompleteQuest(uint32 quest_id)
Definition Player.cpp:14491
void SendPreparedGossip(WorldObject *source)
Definition Player.cpp:14052
bool CanSeeStartQuest(Quest const *quest) const
Definition Player.cpp:14441
QuestGiverStatus GetQuestDialogStatus(Object *questGiver)
Definition Player.cpp:15783
bool SatisfyQuestDay(Quest const *qInfo, bool msg) const
Definition Player.cpp:15491
bool CanRewardQuest(Quest const *quest, bool msg)
Definition Player.cpp:14580
bool CanAddQuest(Quest const *quest, bool msg) const
Definition Player.cpp:14467
void CompleteQuest(uint32 quest_id)
Definition Player.cpp:14804
bool SatisfyQuestLog(bool msg) const
Definition Player.cpp:15156
void SendQuestConfirmAccept(Quest const *quest, Player *pReceiver) const
Definition Player.cpp:16569
uint32 GetQuestSlotQuestId(uint16 slot) const
Definition Player.cpp:15944
void SwapQuestSlot(uint16 slot1, uint16 slot2)
Definition Player.cpp:15996
bool CanShareQuest(uint32 questId) const
Definition Player.cpp:15656
Creature * GetNPCIfCanInteractWith(ObjectGuid const &guid, NPCFlags npcFlags) const
Definition Player.cpp:2094
Quest const * GetNextQuest(Object const *questGiver, Quest const *quest) const
Definition Player.cpp:14415
Battleground * GetBattleground() const
Definition Player.cpp:23049
void SetQuestSlot(uint16 slot, uint32 quest_id, uint32 timer=0)
Definition Player.cpp:15964
bool IsActiveQuest(uint32 quest_id) const
Definition Player.cpp:14410
Group * GetGroup()
Definition Player.h:2171
PvPInfo pvpInfo
Definition Player.h:1582
void AddQuestAndCheckCompletion(Quest const *quest, Object *questGiver)
Definition Player.cpp:14624
void SetQuestSharingInfo(ObjectGuid guid, uint32 id)
Definition Player.h:1358
void ClearQuestSharingInfo()
Definition Player.h:1359
bool CanTakeQuest(Quest const *quest, bool msg) const
Definition Player.cpp:14455
void SendPushToPartyResponse(Player const *player, QuestShareMessages msg) const
Definition Player.cpp:16590
bool TakeQuestSourceItem(uint32 questId, bool msg)
Definition Player.cpp:15592
void RemoveActiveQuest(uint32 questId, bool update=true)
Definition Player.cpp:15693
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition Player.cpp:15642
bool CanCompleteRepeatableQuest(Quest const *quest)
Definition Player.cpp:14561
void RemoveTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
Definition Player.cpp:24930
void AbandonQuest(uint32 quest_id)
Definition Player.cpp:15089
size_t GetRewardedQuestCount() const
Definition Player.h:1417
ObjectGuid GetPlayerSharingQuest() const
Definition Player.h:1357
void RemoveTimedQuest(uint32 questId)
Definition Player.h:1365
void PrepareGossipMenu(WorldObject *source, uint32 menuId=0, bool showQuests=false)
Definition Player.cpp:13886
void SendQuestGiverStatusMultiple()
Definition Player.cpp:16651
PlayerMenu * PlayerTalkClass
Definition Player.h:1969
void setUInt32(uint8 index, uint32 value)
bool HasFlag(uint32 flag) const
Definition QuestDef.h:219
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:293
void RemoveAurasByType(AuraType auraType, std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3765
void PauseMovement(uint32 timer=0, uint8 slot=0, bool forced=true)
Definition Unit.cpp:10327
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
bool IsHostileTo(WorldObject const *target) const
Definition Object.cpp:2796
std::string const & GetName() const
Definition Object.h:382
bool IsInMap(WorldObject const *obj) const
Definition Object.cpp:1160
void HandleQuestQueryOpcode(WorldPackets::Quest::QueryQuestInfo &query)
void HandleQueryQuestsCompleted(WorldPacket &recvData)
void SendPacket(WorldPacket const *packet)
Send a packet to the client.
void HandleQuestConfirmAccept(WorldPacket &recvData)
void HandleQuestLogRemoveQuest(WorldPacket &recvData)
void HandleQuestgiverQuestAutoLaunch(WorldPacket &recvPacket)
void HandleQuestgiverAcceptQuestOpcode(WorldPacket &recvPacket)
Player * GetPlayer() const
void HandleQuestgiverStatusQueryOpcode(WorldPacket &recvPacket)
void HandleQuestgiverCompleteQuest(WorldPacket &recvData)
void HandleQuestgiverHelloOpcode(WorldPacket &recvPacket)
void HandleQuestgiverRequestRewardOpcode(WorldPacket &recvPacket)
void HandleQuestLogSwapQuest(WorldPacket &recvData)
void HandleQuestPushResult(WorldPacket &recvPacket)
Player * _player
void HandleQuestgiverQueryQuestOpcode(WorldPacket &recvPacket)
void HandleQuestgiverChooseRewardOpcode(WorldPacket &recvPacket)
void HandlePushQuestToParty(WorldPacket &recvPacket)
void HandleQuestgiverCancel(WorldPacket &recvData)
void HandleQuestgiverStatusMultipleQuery(WorldPacket &recvPacket)
@ SMSG_QUERY_QUESTS_COMPLETED_RESPONSE
Definition Opcodes.h:1310
#define sWorld
Definition World.h:900
@ 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:244
bool IsInHostileArea
Definition Player.h:245