64 TC_LOG_DEBUG(
"network",
"WORLD: HandleQuestgiverHelloOpcode - {} not found or you can't interact with him.",
96 auto CLOSE_GOSSIP_CLEAR_SHARING_INFO = ([
this]()
105 CLOSE_GOSSIP_CLEAR_SHARING_INFO();
113 CLOSE_GOSSIP_CLEAR_SHARING_INFO();
118 CLOSE_GOSSIP_CLEAR_SHARING_INFO();
126 CLOSE_GOSSIP_CLEAR_SHARING_INFO();
134 CLOSE_GOSSIP_CLEAR_SHARING_INFO();
141 if (!
GetPlayer()->CanTakeQuest(quest,
true))
143 CLOSE_GOSSIP_CLEAR_SHARING_INFO();
161 if (quest->IsPushedToPartyOnAccept())
165 for (
GroupReference* itr = group->GetFirstMember(); itr !=
nullptr; itr = itr->
next())
167 Player* player = itr->GetSource();
197 launchGossip(creature);
206 CLOSE_GOSSIP_CLEAR_SHARING_INFO();
229 if (quest->IsTurnIn())
252 TC_LOG_DEBUG(
"network",
"WORLD: Received CMSG_QUESTGIVER_CHOOSE_REWARD npc = {}, quest = {}, reward = {}",
268 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)",
273 bool itemValid =
false;
302 if (std::vector<QuestPackageItemEntry const*>
const* questPackageItems =
sDB2Manager.GetQuestPackageItemsFallback(quest->
GetQuestPackageID()))
318 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)",
328 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)",
333 bool currencyValid =
false;
338 currencyValid =
true;
345 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)",
372 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)",
422 TC_LOG_DEBUG(
"network",
"WORLD: Received CMSG_QUESTLOG_REMOVE_QUEST slot = {}", packet.
Entry);
482 TC_LOG_DEBUG(
"network",
"WORLD: Received CMSG_QUEST_CONFIRM_ACCEPT questId = {}", packet.
QuestID);
525 if (autoCompleteMode)
551 TC_LOG_ERROR(
"entities.player.cheat",
"Possible hacking attempt: Player {} [{}] tried to complete quest [entry: {}] without being in possession of the quest!",
614 Player* receiver = itr->GetSource();
616 if (!receiver || receiver == sender)
775 TC_LOG_ERROR(
"entities.player.cheat",
"Error in CMSG_CHOICE_RESPONSE: {} tried to respond to invalid player choice {} (allowed {}) (possible packet-hacking detected)",
785 if (!playerChoiceResponse)
787 TC_LOG_ERROR(
"entities.player.cheat",
"Error in CMSG_CHOICE_RESPONSE: {} tried to select invalid player choice response {} (possible packet-hacking detected)",
794 if (playerChoiceResponse->
Reward)
796 if (playerChoiceResponse->
Reward->TitleId)
799 if (playerChoiceResponse->
Reward->PackageId)
805 if (playerChoiceResponse->
Reward->HonorPointCount)
808 if (playerChoiceResponse->
Reward->Money)
811 if (playerChoiceResponse->
Reward->Xp)
@ CHAR_UPD_QUEST_TRACK_ABANDON_TIME
DB2Storage< CharTitlesEntry > sCharTitlesStore("CharTitles.db2", &CharTitlesLoadInfo::Instance)
DB2Storage< CurrencyTypesEntry > sCurrencyTypesStore("CurrencyTypes.db2", &CurrencyTypesLoadInfo::Instance)
DB2Storage< FactionEntry > sFactionStore("Faction.db2", &FactionLoadInfo::Instance)
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
ItemRandomBonusListId GenerateItemRandomBonusListId(uint32 item_id)
#define TC_LOG_DEBUG(filterType__,...)
#define TC_LOG_ERROR(filterType__,...)
#define TC_LOG_INFO(filterType__,...)
std::vector< ItemPosCount > ItemPosCountVec
@ PrerequisiteToRecipient
#define MAX_QUEST_LOG_SIZE
@ QUEST_FLAGS_EX_NO_ABANDON_ONCE_BEGUN
@ QUEST_STATUS_INCOMPLETE
@ QUEST_FLAGS_AUTO_COMPLETE
@ QUEST_FLAGS_LAUNCH_GOSSIP_ACCEPT
@ UNIT_NPC_FLAG_QUESTGIVER
virtual bool OnGossipHello(Player *)
void SetHomePosition(float x, float y, float z, float o)
CreatureMovementData const & GetMovementTemplate() const
GroupReference * GetFirstMember()
LowType GetCounter() const
std::string ToString() const
static Creature * ToCreature(Object *o)
static GameObject * ToGameObject(Object *o)
virtual bool hasQuest(uint32) const
static ObjectGuid GetGUID(Object const *o)
virtual bool hasInvolvedQuest(uint32) const
static Player * ToPlayer(Object *o)
void SendQuestConfirmAccept(Quest const *quest, Player *receiver) const
bool CanInteractWithQuestGiver(Object *questGiver) const
Item * StoreNewItem(ItemPosCountVec const &pos, uint32 itemId, bool update, ItemRandomBonusListId randomBonusListId=0, GuidSet const &allowedLooters=GuidSet(), ItemContext context=ItemContext::NONE, std::vector< int32 > const *bonusListIDs=nullptr, bool addToCollection=true)
bool HasPvPForcingQuest() const
bool IsInSameRaidWith(Player const *p) const
bool ModifyMoney(int64 amount, bool sendError=true)
bool CanCompleteQuest(uint32 quest_id, uint32 ignoredQuestObjectiveId=0)
Creature * GetNPCIfCanInteractWith(ObjectGuid const &guid, NPCFlags npcFlags, NPCFlags2 npcFlags2) const
void DespawnPersonalSummonsForQuest(uint32 questId)
uint16 FindQuestSlot(uint32 quest_id) const
void UpdatePvPState(bool onlyFFA=false)
void AddHonorXP(uint32 xp)
bool SatisfyQuestMinLevel(Quest const *qInfo, bool msg) const
void GiveXP(uint32 xp, Unit *victim, float group_rate=1.0f)
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)
void RewardQuestPackage(uint32 questPackageId, ItemContext context, uint32 onlyItemId=0)
bool HasSkill(uint32 skill) const
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
bool SatisfyQuestReputation(Quest const *qInfo, bool msg) const
Battleground * GetBattleground() const
bool SatisfyQuestMaxLevel(Quest const *qInfo, bool msg) const
bool IsActiveQuest(uint32 quest_id) const
bool SatisfyQuestExpansion(Quest const *qInfo, bool msg) const
void SetQuestSlot(uint16 slot, uint32 quest_id)
void AddQuestAndCheckCompletion(Quest const *quest, Object *questGiver)
void SetTitle(CharTitlesEntry const *title, bool lost=false)
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
bool UpdateSkillPro(uint16 skillId, int32 chance, uint32 step)
Group * GetGroup(Optional< uint8 > partyIndex)
void PrepareGossipMenu(WorldObject *source, uint32 menuId, bool showQuests=false)
void AbandonQuest(uint32 quest_id)
ObjectGuid GetPlayerSharingQuest() const
void RemoveTimedQuest(uint32 questId)
void SendQuestGiverStatusMultiple()
void ModifyCurrency(uint32 id, int32 amount, CurrencyGainSource gainSource=CurrencyGainSource::Cheat, CurrencyDestroyReason destroyReason=CurrencyDestroyReason::Cheat)
Modify currency amount.
InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 item, uint32 count, uint32 *no_space_count=nullptr) const
std::unique_ptr< PlayerMenu > PlayerTalkClass
ReputationMgr & GetReputationMgr()
void RewardQuest(Quest const *quest, LootItemType rewardType, uint32 rewardId, Object *questGiver, bool announce=true)
void SendNewItem(Item *item, uint32 quantity, bool received, bool created, bool broadcast=false, uint32 dungeonEncounterId=0)
uint32 GetGossipMenuForSource(WorldObject const *source) const
void setUInt32(const uint8 index, const uint32 value)
void setUInt64(const uint8 index, const uint64 value)
std::array< LootItemType, QUEST_REWARD_CHOICES_COUNT > RewardChoiceItemType
bool HasQuestObjectiveType(QuestObjectiveType type) const
std::array< uint32, QUEST_REWARD_CHOICES_COUNT > RewardChoiceItemId
uint32 GetQuestPackageID() const
QuestObjectives Objectives
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
bool ModifyReputation(FactionEntry const *factionEntry, int32 standing, bool spillOverOnly=false, bool noSpillover=false)
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)
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
GuidUnorderedSet QuestGiverGUIDs
WorldPacket const * Write() override
void HandleQuestLogRemoveQuest(WorldPackets::Quest::QuestLogRemoveQuest &packet)
void HandleRequestWorldQuestUpdate(WorldPackets::Quest::RequestWorldQuestUpdate &packet)
void HandleQuestgiverRequestRewardOpcode(WorldPackets::Quest::QuestGiverRequestReward &packet)
void HandlePushQuestToParty(WorldPackets::Quest::PushQuestToParty &packet)
void HandleQuestgiverStatusMultipleQuery(WorldPackets::Quest::QuestGiverStatusMultipleQuery &packet)
void HandleQuestgiverAcceptQuestOpcode(WorldPackets::Quest::QuestGiverAcceptQuest &packet)
void HandlePlayerChoiceResponse(WorldPackets::Quest::ChoiceResponse &choiceResponse)
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 HandleQuestgiverChooseRewardOpcode(WorldPackets::Quest::QuestGiverChooseReward &packet)
void HandleQuestgiverCompleteQuest(WorldPackets::Quest::QuestGiverCompleteQuest &packet)
void HandleQuestConfirmAccept(WorldPackets::Quest::QuestConfirmAccept &packet)
void HandleQuestgiverStatusTrackedQueryOpcode(WorldPackets::Quest::QuestGiverStatusTrackedQuery &questGiverStatusTrackedQuery)
void HandleQuestgiverQueryQuestOpcode(WorldPackets::Quest::QuestGiverQueryQuest &packet)
void HandleQuestgiverCloseQuest(WorldPackets::Quest::QuestGiverCloseQuest &questGiverCloseQuest)
@ CONFIG_QUEST_ENABLE_QUEST_TRACKER
TC_GAME_API Object * GetObjectByTypeMask(WorldObject const &, ObjectGuid const &, uint32 typemask)
TC_GAME_API Player * FindPlayer(ObjectGuid const &)
uint32 GetInteractionPauseTimer() const
std::vector< int32 > BonusListIDs
Optional< PlayerChoiceResponseReward > Reward
PlayerChoiceResponse const * GetResponseByIdentifier(int32 responseIdentifier) const
constexpr void GetPosition(float &x, float &y) const
::LootItemType LootItemType