67 TC_LOG_DEBUG(
"network",
"WORLD: HandleQuestgiverHelloOpcode - {} not found or you can't interact with him.",
132 if (!
GetPlayer()->CanTakeQuest(quest,
true))
148 (void)CLOSE_GOSSIP_CLEAR_SHARING_INFO.release();
158 Player* player = itr.GetSource();
187 launchGossip(creature);
218 if (quest->IsTurnIn())
241 TC_LOG_DEBUG(
"network",
"WORLD: Received CMSG_QUESTGIVER_CHOOSE_REWARD npc = {}, quest = {}, reward = {}",
257 TC_LOG_ERROR(
"entities.player.cheat",
"Error in CMSG_QUESTGIVER_CHOOSE_REWARD: player {} {} tried to get invalid reward item (Item Entry: {}) for quest {} (possible packet-hacking detected)",
262 bool itemValid =
false;
291 if (std::vector<QuestPackageItemEntry const*>
const* questPackageItems =
sDB2Manager.GetQuestPackageItemsFallback(quest->
GetQuestPackageID()))
307 TC_LOG_ERROR(
"entities.player.cheat",
"Error in CMSG_QUESTGIVER_CHOOSE_REWARD: player {} {} tried to get reward item (Item Entry: {}) wich is not a reward for quest {} (possible packet-hacking detected)",
317 TC_LOG_ERROR(
"entities.player.cheat",
"Error in CMSG_QUESTGIVER_CHOOSE_REWARD: player {} {} tried to get invalid reward currency (Currency ID: {}) for quest {} (possible packet-hacking detected)",
322 bool currencyValid =
false;
327 currencyValid =
true;
334 TC_LOG_ERROR(
"entities.player.cheat",
"Error in CMSG_QUESTGIVER_CHOOSE_REWARD: player {} {} tried to get reward currency (Currency ID: {}) wich is not a reward for quest {} (possible packet-hacking detected)",
361 TC_LOG_ERROR(
"network",
"Error in QUEST_STATUS_COMPLETE: player {} {} tried to complete quest {}, but is not allowed to do so (possible packet-hacking or high latency)",
408 TC_LOG_DEBUG(
"network",
"WORLD: Received CMSG_QUESTLOG_REMOVE_QUEST slot = {}", packet.
Entry);
469 TC_LOG_DEBUG(
"network",
"WORLD: Received CMSG_QUEST_CONFIRM_ACCEPT questId = {}", packet.
QuestID);
512 if (autoCompleteMode)
538 TC_LOG_ERROR(
"entities.player.cheat",
"Possible hacking attempt: Player {} [{}] tried to complete quest [entry: {}] without being in possession of the quest!",
545 if (quest->IsRepeatable())
601 Player* receiver = itr.GetSource();
603 if (receiver == sender)
763 if (!playerChoiceData)
765 TC_LOG_ERROR(
"entities.player.cheat",
"Error in CMSG_CHOICE_RESPONSE: {} tried to respond to invalid player choice {} (none allowed)",
772 TC_LOG_ERROR(
"entities.player.cheat",
"Error in CMSG_CHOICE_RESPONSE: {} tried to respond to invalid player choice {} ({} allowed)",
779 TC_LOG_ERROR(
"entities.player.cheat",
"Error in CMSG_CHOICE_RESPONSE: {} tried to respond to expired player choice {})",
787 TC_LOG_ERROR(
"entities.player.cheat",
"Error in CMSG_CHOICE_RESPONSE: {} tried to select invalid player choice response identifier {}",
797 if (!playerChoiceResponse)
799 TC_LOG_ERROR(
"entities.player.cheat",
"Error in CMSG_CHOICE_RESPONSE: {} tried to select invalid player choice response {}",
806 TC_LOG_ERROR(
"entities.player.cheat",
"Error in CMSG_CHOICE_RESPONSE: {} tried to select disabled player choice response {}",
824 if (std::vector<uint32>
const* questLines =
sObjectMgr->GetUiMapQuestLinesList(uiMap->
ID))
826 for (
uint32 questLineId : *questLines)
829 if (questLineQuests.empty())
832 bool isQuestLineCompleted =
true;
835 if (
Quest const* quest =
sObjectMgr->GetQuestTemplate(questLineQuest->QuestID))
841 isQuestLineCompleted =
false;
845 if (!isQuestLineCompleted)
850 if (std::vector<uint32>
const* quests =
sObjectMgr->GetUiMapQuestsList(uiMap->
ID))
852 for (
uint32 questId : *quests)
855 response.
QuestIDs.push_back(questId);
879 responseInfo.
ObjectID = requestInfo.ObjectID;
885 if (spawnTrackingTemplateData && (
_player->
GetMapId() == spawnTrackingTemplateData->
MapId || activeQuestObjective))
896 for (
auto const& [spawnTrackingId, data] :
sObjectMgr->GetSpawnMetadataForSpawnTracking(requestInfo.SpawnTrackingID))
902 if (spawnData->
id !=
uint32(requestInfo.ObjectID))
905 if (spawnType != data->type)
908 if (activeQuestObjective)
@ CHAR_UPD_QUEST_TRACK_ABANDON_TIME
DB2Storage< UiMapEntry > sUiMapStore("UiMap.db2", &UiMapLoadInfo::Instance)
DB2Storage< CurrencyTypesEntry > sCurrencyTypesStore("CurrencyTypes.db2", &CurrencyTypesLoadInfo::Instance)
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
#define TC_LOG_DEBUG(filterType__, message__,...)
#define TC_LOG_ERROR(filterType__, message__,...)
#define TC_LOG_INFO(filterType__, message__,...)
std::optional< T > Optional
Optional helper class to wrap optional values within.
@ PrerequisiteToRecipient
#define MAX_QUEST_LOG_SIZE
@ QUEST_FLAGS_EX_SUPPRESS_GOSSIP_ACCEPT
@ QUEST_FLAGS_EX_NO_ABANDON_ONCE_BEGUN
@ QUEST_STATUS_INCOMPLETE
@ QUEST_FLAGS_AUTO_COMPLETE
@ QUEST_FLAGS_LAUNCH_GOSSIP_ACCEPT
@ UNIT_NPC_FLAG_QUESTGIVER
constexpr std::underlying_type< E >::type AsUnderlyingType(E enumValue)
ObjectGuid const & GetGUID() const
virtual bool OnGossipHello(Player *)
void SetHomePosition(float x, float y, float z, float o)
CreatureMovementData const & GetMovementTemplate() const
constexpr bool HasFlag(T flag) const
GroupRefManager & GetMembers()
LowType GetCounter() const
std::string ToString() const
virtual bool hasQuest(uint32) const
GameObject * ToGameObject()
virtual bool hasInvolvedQuest(uint32) const
Optional< uint32 > FindIdByClientIdentifier(uint16 clientIdentifier) const
uint32 GetChoiceId() const
Optional< SystemTimePoint > GetExpireTime() const
void SendQuestConfirmAccept(Quest const *quest, Player *receiver) const
bool CanInteractWithQuestGiver(Object *questGiver) const
bool HasPvPForcingQuest() const
bool IsInSameRaidWith(Player const *p) const
bool CanCompleteQuest(uint32 quest_id, uint32 ignoredQuestObjectiveId=0)
Creature * GetNPCIfCanInteractWith(ObjectGuid const &guid, NPCFlags npcFlags, NPCFlags2 npcFlags2) const
void DespawnPersonalSummonsForQuest(uint32 questId)
bool GetQuestRewardStatus(uint32 quest_id) const
uint16 FindQuestSlot(uint32 quest_id) const
void UpdatePvPState(bool onlyFFA=false)
bool SatisfyQuestMinLevel(Quest const *qInfo, bool msg) const
bool SatisfyQuestMinReputation(Quest const *qInfo, bool msg) const
void SendForceSpawnTrackingUpdate(uint32 questId) const
void SendPreparedGossip(WorldObject *source)
bool CanSeeStartQuest(Quest const *quest) const
bool SatisfyQuestDay(Quest const *qInfo, bool msg) const
QuestGiverStatus GetQuestDialogStatus(Object const *questGiver) const
bool CanAddQuest(Quest const *quest, bool msg) const
bool CanRewardQuest(Quest const *quest, bool msg) const
void CompleteQuest(uint32 quest_id)
uint32 GetSharedQuestID() const
bool SatisfyQuestLog(bool msg) const
uint32 GetQuestSlotQuestId(uint16 slot) const
void UpdateCriteria(CriteriaType type, uint64 miscValue1=0, uint64 miscValue2=0, uint64 miscValue3=0, WorldObject *ref=nullptr)
bool CanShareQuest(uint32 questId) const
bool SatisfyQuestRace(Quest const *qInfo, bool msg) const
bool SatisfyQuestClass(Quest const *qInfo, bool msg) const
QuestObjective const * GetActiveQuestObjectiveForSpawnTracking(uint32 spawnTrackingId) const
bool SatisfyQuestMaxLevel(Quest const *qInfo, bool msg) const
bool IsActiveQuest(uint32 quest_id) const
void PrepareQuestMenu(ObjectGuid guid)
bool SatisfyQuestExpansion(Quest const *qInfo, bool msg) const
void AddQuestAndCheckCompletion(Quest const *quest, Object *questGiver)
void SetQuestSharingInfo(ObjectGuid guid, uint32 id)
void ClearQuestSharingInfo()
bool CanTakeQuest(Quest const *quest, bool msg) const
bool TakeQuestSourceItem(uint32 questId, bool msg)
bool IsQuestObjectiveComplete(uint16 slot, Quest const *quest, QuestObjective const &objective) const
void RemoveActiveQuest(uint32 questId, bool update=true)
QuestStatus GetQuestStatus(uint32 quest_id) const
bool CanCompleteRepeatableQuest(Quest const *quest)
bool SatisfyQuestDependentQuests(Quest const *qInfo, bool msg) const
bool CanSelectQuestPackageItem(QuestPackageItemEntry const *questPackageItem) const
void SendPushToPartyResponse(Player const *player, QuestPushReason reason, Quest const *quest=nullptr) const
Group * GetGroup(Optional< uint8 > partyIndex)
bool SatisfyQuestMaxReputation(Quest const *qInfo, bool msg) const
void PrepareGossipMenu(WorldObject *source, uint32 menuId, bool showQuests=false)
void AbandonQuest(uint32 quest_id)
ObjectGuid GetPlayerSharingQuest() const
void RemoveTimedQuest(uint32 questId)
void SendPreparedQuest(WorldObject *source)
SpawnTrackingState GetSpawnTrackingStateByObjectives(uint32 spawnTrackingId, std::vector< uint32 > const &questObjectives) const
void SendQuestGiverStatusMultiple()
std::unique_ptr< PlayerMenu > PlayerTalkClass
void RewardQuest(Quest const *quest, LootItemType rewardType, uint32 rewardId, Object *questGiver, bool announce=true)
uint32 GetGossipMenuForSource(WorldObject const *source) const
void setUInt32(uint8 index, uint32 value)
void setUInt64(uint8 index, uint64 value)
std::array< LootItemType, QUEST_REWARD_CHOICES_COUNT > RewardChoiceItemType
std::array< uint32, QUEST_REWARD_CHOICES_COUNT > RewardChoiceItemId
uint32 GetQuestPackageID() const
QuestObjectives Objectives
bool IsPushedToPartyOnAccept() const
uint32 GetSrcSpell() const
bool IsRepeatable() const
int64 GetLimitTime() const
uint32 GetQuestId() const
bool IsAutoAccept() const
uint32 GetRewChoiceItemsCount() const
bool IsDailyOrWeekly() const
bool HasFlagEx(QuestFlagsEx flag) const
bool HasFlag(QuestFlags flag) const
void RemoveAurasByType(AuraType auraType, std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
void PauseMovement(uint32 timer=0, uint8 slot=0, bool forced=true)
constexpr uint32 GetMapId() const
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
std::string const & GetName() const
bool IsInMap(WorldObject const *obj) const
WorldPacket const * Write() override
ObjectGuid QuestGiverGUID
ObjectGuid QuestGiverGUID
ObjectGuid QuestGiverGUID
ObjectGuid QuestGiverGUID
ObjectGuid QuestGiverGUID
ObjectGuid QuestGiverGUID
ObjectGuid QuestGiverGUID
WorldPacket const * Write() override
std::vector< SpawnTrackingResponseInfo > SpawnTrackingResponses
std::vector< SpawnTrackingRequestInfo > SpawnTrackingRequests
WorldPacket const * Write() override
std::vector< uint32 > QuestLineXQuestIDs
std::vector< uint32 > QuestLineIDs
std::vector< uint32 > QuestIDs
WorldPacket const * Write() override
void HandleQuestLogRemoveQuest(WorldPackets::Quest::QuestLogRemoveQuest &packet)
void HandleRequestWorldQuestUpdate(WorldPackets::Quest::RequestWorldQuestUpdate &packet)
void HandleUiMapQuestLinesRequest(WorldPackets::Quest::UiMapQuestLinesRequest &uiMapQuestLinesRequest)
void HandleQuestgiverRequestRewardOpcode(WorldPackets::Quest::QuestGiverRequestReward &packet)
void HandlePushQuestToParty(WorldPackets::Quest::PushQuestToParty &packet)
void HandleSpawnTrackingUpdate(WorldPackets::Quest::SpawnTrackingUpdate &spawnTrackingUpdate)
void HandleQuestgiverStatusMultipleQuery(WorldPackets::Quest::QuestGiverStatusMultipleQuery &packet)
void HandleQuestgiverAcceptQuestOpcode(WorldPackets::Quest::QuestGiverAcceptQuest &packet)
void HandleQuestgiverHelloOpcode(WorldPackets::Quest::QuestGiverHello &packet)
std::string GetPlayerInfo() const
void HandleQuestQueryOpcode(WorldPackets::Quest::QueryQuestInfo &packet)
void HandleQuestPushResult(WorldPackets::Quest::QuestPushResult &packet)
Player * GetPlayer() const
void HandleQuestgiverStatusQueryOpcode(WorldPackets::Quest::QuestGiverStatusQuery &packet)
void SendPacket(WorldPacket const *packet, bool forced=false)
Send a packet to the client.
void HandlePlayerChoiceResponse(WorldPackets::Quest::ChoiceResponse const &choiceResponse)
void HandleQuestgiverChooseRewardOpcode(WorldPackets::Quest::QuestGiverChooseReward &packet)
void HandleQuestgiverCompleteQuest(WorldPackets::Quest::QuestGiverCompleteQuest &packet)
void HandleQuestConfirmAccept(WorldPackets::Quest::QuestConfirmAccept &packet)
void HandleQuestgiverQueryQuestOpcode(WorldPackets::Quest::QuestGiverQueryQuest &packet)
void HandleQuestgiverCloseQuest(WorldPackets::Quest::QuestGiverCloseQuest &questGiverCloseQuest)
@ CONFIG_QUEST_ENABLE_QUEST_TRACKER
SystemTimePoint GetSystemTime()
Current chrono system_clock time point.
TC_GAME_API WorldObject * GetWorldObject(WorldObject const &, ObjectGuid const &)
TC_GAME_API Object * GetObjectByTypeMask(WorldObject const &, ObjectGuid const &, uint32 typemask)
TC_GAME_API Player * FindPlayer(ObjectGuid const &)
TC_GAME_API std::span< QuestLineXQuestEntry const *const > GetQuestsForQuestLine(uint32 questLineId)
std::unique_ptr< T, Impl::stateful_unique_ptr_deleter< Ptr, Del > > make_unique_ptr_with_deleter(Ptr ptr, Del deleter)
uint32 GetInteractionPauseTimer() const
EnumFlag< PlayerChoiceResponseFlags > Flags
PlayerChoiceResponse const * GetResponse(int32 responseId) const
constexpr void GetPosition(float &x, float &y) const
::LootItemType LootItemType