diff options
| author | Shauren <shauren.trinity@gmail.com> | 2025-12-16 00:09:26 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2025-12-16 00:09:26 +0100 |
| commit | bd2b12fa36830c6b12e124359f46ac974d554080 (patch) | |
| tree | bf34422aeca361b8027256d53c80777865ae2933 /src/server/game/Quests/QuestDef.cpp | |
| parent | af57aa29dcfc9f25dba794883f0180a22ce28133 (diff) | |
Diffstat (limited to 'src/server/game/Quests/QuestDef.cpp')
| -rw-r--r-- | src/server/game/Quests/QuestDef.cpp | 47 |
1 files changed, 31 insertions, 16 deletions
diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 2903c93823f..8a18705f92d 100644 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -277,20 +277,23 @@ void Quest::LoadQuestObjective(Field* fields) obj.StorageIndex = fields[3].GetInt8(); obj.ObjectID = fields[4].GetInt32(); obj.Amount = fields[5].GetInt32(); - obj.Flags = fields[6].GetUInt32(); - obj.Flags2 = fields[7].GetUInt32(); - obj.ProgressBarWeight = fields[8].GetFloat(); - obj.Description = fields[9].GetStringView(); - - bool hasCompletionEffect = std::any_of(fields + 10, fields + 15, [](Field const& f) { return !f.IsNull(); }); + obj.SecondaryAmount = fields[6].GetInt32(); + obj.Flags = fields[7].GetUInt32(); + obj.Flags2 = fields[8].GetUInt32(); + obj.ProgressBarWeight = fields[9].GetFloat(); + obj.ParentObjectiveID = fields[10].GetInt32(); + obj.Visible = fields[11].GetBool(); + obj.Description = fields[12].GetStringView(); + + bool hasCompletionEffect = std::any_of(fields + 13, fields + 18, [](Field const& f) { return !f.IsNull(); }); if (hasCompletionEffect) { obj.CompletionEffect = new QuestObjectiveAction(); - obj.CompletionEffect->GameEventId = fields[10].GetUInt32OrNull(); - obj.CompletionEffect->SpellId = fields[11].GetUInt32OrNull(); - obj.CompletionEffect->ConversationId = fields[12].GetUInt32OrNull(); - obj.CompletionEffect->UpdatePhaseShift = fields[13].GetBool(); - obj.CompletionEffect->UpdateZoneAuras = fields[14].GetBool(); + obj.CompletionEffect->GameEventId = fields[13].GetUInt32OrNull(); + obj.CompletionEffect->SpellId = fields[14].GetUInt32OrNull(); + obj.CompletionEffect->ConversationId = fields[15].GetUInt32OrNull(); + obj.CompletionEffect->UpdatePhaseShift = fields[16].GetBool(); + obj.CompletionEffect->UpdateZoneAuras = fields[17].GetBool(); } _usedQuestObjectiveTypes[obj.Type] = true; @@ -411,6 +414,16 @@ void Quest::LoadTreasurePickers(Field* fields) _treasurePickerID.push_back(fields[1].GetInt32()); } +void Quest::LoadRewardHouseRoom(Field* fields) +{ + _rewardHouseRoomIDs.push_back(fields[1].GetInt32()); +} + +void Quest::LoadRewardHouseDecor(Field* fields) +{ + _rewardHouseDecorIDs.push_back(fields[1].GetInt32()); +} + uint32 Quest::XPValue(Player const* player) const { return XPValue(player, GetContentTuningId(), _rewardXPDifficulty, _rewardXPMultiplier, _expansion); @@ -472,7 +485,7 @@ uint32 Quest::MoneyValue(Player const* player) const uint32 Quest::MaxMoneyValue() const { uint32 value = 0; - if (Optional<ContentTuningLevels> questLevels = sDB2Manager.GetContentTuningData(GetContentTuningId(), 0)) + if (Optional<ContentTuningLevels> questLevels = sDB2Manager.GetContentTuningData(GetContentTuningId(), {})) if (QuestMoneyRewardEntry const* money = sQuestMoneyRewardStore.LookupEntry(questLevels->MaxLevel)) value = money->Difficulty[GetRewMoneyDifficulty()] * GetMoneyMultiplier(); @@ -661,18 +674,18 @@ WorldPacket Quest::BuildQueryData(LocaleConstant loc, Player* player) const response.Info.PortraitGiverName = GetPortraitGiverName(); response.Info.PortraitTurnInText = GetPortraitTurnInText(); response.Info.PortraitTurnInName = GetPortraitTurnInName(); - std::transform(GetConditionalQuestDescription().begin(), GetConditionalQuestDescription().end(), std::back_inserter(response.Info.ConditionalQuestDescription), [loc](QuestConditionalText const& text) + std::ranges::transform(GetConditionalQuestDescription(), std::back_inserter(response.Info.ConditionalQuestDescription), [loc](QuestConditionalText const& text) -> WorldPackets::Quest::ConditionalQuestText { std::string_view content = text.Text[LOCALE_enUS]; ObjectMgr::GetLocaleString(text.Text, loc, content); - return WorldPackets::Quest::ConditionalQuestText { text.PlayerConditionId, text.QuestgiverCreatureId, content }; + return { .PlayerConditionID = text.PlayerConditionId, .QuestGiverCreatureID = text.QuestgiverCreatureId, .Text = content }; }); - std::transform(GetConditionalQuestCompletionLog().begin(), GetConditionalQuestCompletionLog().end(), std::back_inserter(response.Info.ConditionalQuestCompletionLog), [loc](QuestConditionalText const& text) + std::ranges::transform(GetConditionalQuestCompletionLog(), std::back_inserter(response.Info.ConditionalQuestCompletionLog), [loc](QuestConditionalText const& text) -> WorldPackets::Quest::ConditionalQuestText { std::string_view content = text.Text[LOCALE_enUS]; ObjectMgr::GetLocaleString(text.Text, loc, content); - return WorldPackets::Quest::ConditionalQuestText { text.PlayerConditionId, text.QuestgiverCreatureId, content }; + return { .PlayerConditionID = text.PlayerConditionId, .QuestGiverCreatureID = text.QuestgiverCreatureId, .Text = content }; }); if (loc != LOCALE_enUS) @@ -779,6 +792,8 @@ WorldPacket Quest::BuildQueryData(LocaleConstant loc, Player* player) const response.Info.ManagedWorldStateID = GetManagedWorldStateId(); response.Info.QuestSessionBonus = 0; //GetQuestSessionBonus(); // this is only sent while quest session is active response.Info.QuestGiverCreatureID = 0; // only sent during npc interaction + response.Info.RewardHouseRoomIDs = GetRewardHouseRoomIds(); + response.Info.RewardHouseDecorIDs = GetRewardRewardHouseDecorIds(); for (QuestObjective const& questObjective : GetObjectives()) { |
