From d8ffeed4767a42071ca075b23e3989069f91e4ab Mon Sep 17 00:00:00 2001 From: Stalker_Riddick Date: Fri, 25 Nov 2011 13:11:53 +0000 Subject: Core/Quests: Add new field RequiredClasses for quest_template Credits to NoFantasy. * SkillOrClass is converted to RequiredSkill (and then field can contain skill id only) * Field ZoneOrSort has no longer a function in quest requirement, and RequiredClasses must be used instead where class limits are expected. To restrict a quest to one class or more, use bitmask of class in RequiredClasses. RequiredSkill works like before. Signed-off-by: NoFantasy Signed-off-by: Stalker_Riddick --- src/server/game/Quests/QuestDef.cpp | 147 ++++++++++++++++++------------------ 1 file changed, 74 insertions(+), 73 deletions(-) (limited to 'src/server/game/Quests/QuestDef.cpp') diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 9650afb60e2..7cd442cd9f9 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -25,120 +25,121 @@ Quest::Quest(Field* questRecord) QuestId = questRecord[0].GetUInt32(); QuestMethod = questRecord[1].GetUInt32(); ZoneOrSort = questRecord[2].GetInt32(); - SkillOrClassMask = questRecord[3].GetInt32(); - MinLevel = questRecord[4].GetUInt32(); - MaxLevel = questRecord[5].GetUInt32(); - QuestLevel = questRecord[6].GetInt32(); - Type = questRecord[7].GetUInt32(); + MinLevel = questRecord[3].GetUInt32(); + MaxLevel = questRecord[4].GetUInt32(); + QuestLevel = questRecord[5].GetInt32(); + Type = questRecord[6].GetUInt32(); + RequiredClasses = questRecord[7].GetUInt32(); RequiredRaces = questRecord[8].GetUInt32(); - RequiredSkillValue = questRecord[9].GetUInt32(); - RepObjectiveFaction = questRecord[10].GetUInt32(); - RepObjectiveValue = questRecord[11].GetInt32(); - RepObjectiveFaction2 = questRecord[12].GetUInt32(); - RepObjectiveValue2 = questRecord[13].GetInt32(); - RequiredMinRepFaction = questRecord[14].GetUInt32(); - RequiredMinRepValue = questRecord[15].GetInt32(); - RequiredMaxRepFaction = questRecord[16].GetUInt32(); - RequiredMaxRepValue = questRecord[17].GetInt32(); - SuggestedPlayers = questRecord[18].GetUInt32(); - LimitTime = questRecord[19].GetUInt32(); - QuestFlags = questRecord[20].GetUInt32(); - uint32 SpecialFlags = questRecord[21].GetUInt16(); - CharTitleId = questRecord[22].GetUInt32(); - PlayersSlain = questRecord[23].GetUInt32(); - BonusTalents = questRecord[24].GetUInt32(); - RewArenaPoints = questRecord[25].GetInt32(); - PrevQuestId = questRecord[26].GetInt32(); - NextQuestId = questRecord[27].GetInt32(); - ExclusiveGroup = questRecord[28].GetInt32(); - NextQuestInChain = questRecord[29].GetUInt32(); - XPId = questRecord[30].GetUInt32(); - SrcItemId = questRecord[31].GetUInt32(); - SrcItemCount = questRecord[32].GetUInt32(); - SrcSpell = questRecord[33].GetUInt32(); - Title = questRecord[34].GetString(); - Details = questRecord[35].GetString(); - Objectives = questRecord[36].GetString(); - OfferRewardText = questRecord[37].GetString(); - RequestItemsText = questRecord[38].GetString(); - EndText = questRecord[39].GetString(); - CompletedText = questRecord[40].GetString(); + RequiredSkill = questRecord[9].GetUInt32(); + RequiredSkillValue = questRecord[10].GetUInt32(); + RepObjectiveFaction = questRecord[11].GetUInt32(); + RepObjectiveValue = questRecord[12].GetInt32(); + RepObjectiveFaction2 = questRecord[13].GetUInt32(); + RepObjectiveValue2 = questRecord[14].GetInt32(); + RequiredMinRepFaction = questRecord[15].GetUInt32(); + RequiredMinRepValue = questRecord[16].GetInt32(); + RequiredMaxRepFaction = questRecord[17].GetUInt32(); + RequiredMaxRepValue = questRecord[18].GetInt32(); + SuggestedPlayers = questRecord[19].GetUInt32(); + LimitTime = questRecord[20].GetUInt32(); + QuestFlags = questRecord[21].GetUInt32(); + uint32 SpecialFlags = questRecord[22].GetUInt16(); + CharTitleId = questRecord[23].GetUInt32(); + PlayersSlain = questRecord[24].GetUInt32(); + BonusTalents = questRecord[25].GetUInt32(); + RewArenaPoints = questRecord[26].GetInt32(); + PrevQuestId = questRecord[27].GetInt32(); + NextQuestId = questRecord[28].GetInt32(); + ExclusiveGroup = questRecord[29].GetInt32(); + NextQuestInChain = questRecord[30].GetUInt32(); + XPId = questRecord[31].GetUInt32(); + SrcItemId = questRecord[32].GetUInt32(); + SrcItemCount = questRecord[33].GetUInt32(); + SrcSpell = questRecord[34].GetUInt32(); + Title = questRecord[35].GetString(); + Details = questRecord[36].GetString(); + Objectives = questRecord[37].GetString(); + OfferRewardText = questRecord[38].GetString(); + RequestItemsText = questRecord[39].GetString(); + EndText = questRecord[40].GetString(); + CompletedText = questRecord[41].GetString(); for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - ObjectiveText[i] = questRecord[41+i].GetString(); + ObjectiveText[i] = questRecord[42+i].GetString(); for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) - ReqItemId[i] = questRecord[45+i].GetUInt32(); + ReqItemId[i] = questRecord[46+i].GetUInt32(); for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) - ReqItemCount[i] = questRecord[51+i].GetUInt32(); + ReqItemCount[i] = questRecord[52+i].GetUInt32(); for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i) - ReqSourceId[i] = questRecord[57+i].GetUInt32(); + ReqSourceId[i] = questRecord[58+i].GetUInt32(); for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i) - ReqSourceCount[i] = questRecord[61+i].GetUInt32(); + ReqSourceCount[i] = questRecord[62+i].GetUInt32(); for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - ReqCreatureOrGOId[i] = questRecord[65+i].GetInt32(); + ReqCreatureOrGOId[i] = questRecord[66+i].GetInt32(); for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - ReqCreatureOrGOCount[i] = questRecord[69+i].GetUInt32(); + ReqCreatureOrGOCount[i] = questRecord[70+i].GetUInt32(); for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - ReqSpell[i] = questRecord[73+i].GetUInt32(); + ReqSpell[i] = questRecord[74+i].GetUInt32(); for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) - RewChoiceItemId[i] = questRecord[77+i].GetUInt32(); + RewChoiceItemId[i] = questRecord[78+i].GetUInt32(); for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) - RewChoiceItemCount[i] = questRecord[83+i].GetUInt32(); + RewChoiceItemCount[i] = questRecord[84+i].GetUInt32(); for (int i = 0; i < QUEST_REWARDS_COUNT; ++i) - RewItemId[i] = questRecord[89+i].GetUInt32(); + RewItemId[i] = questRecord[90+i].GetUInt32(); for (int i = 0; i < QUEST_REWARDS_COUNT; ++i) - RewItemCount[i] = questRecord[93+i].GetUInt32(); + RewItemCount[i] = questRecord[94+i].GetUInt32(); for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - RewRepFaction[i] = questRecord[97+i].GetUInt32(); + RewRepFaction[i] = questRecord[98+i].GetUInt32(); for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - RewRepValueId[i] = questRecord[102+i].GetInt32(); + RewRepValueId[i] = questRecord[103+i].GetInt32(); for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - RewRepValue[i] = questRecord[107+i].GetInt32(); - - RewHonorAddition = questRecord[112].GetUInt32(); - RewHonorMultiplier = questRecord[113].GetFloat(); - RewOrReqMoney = questRecord[114].GetInt32(); - RewMoneyMaxLevel = questRecord[115].GetUInt32(); - RewSpell = questRecord[116].GetUInt32(); - RewSpellCast = questRecord[117].GetInt32(); - RewMailTemplateId = questRecord[118].GetUInt32(); - RewMailDelaySecs = questRecord[119].GetUInt32(); - PointMapId = questRecord[120].GetUInt32(); - PointX = questRecord[121].GetFloat(); - PointY = questRecord[122].GetFloat(); - PointOpt = questRecord[123].GetUInt32(); + RewRepValue[i] = questRecord[108+i].GetInt32(); + + RewHonorAddition = questRecord[113].GetUInt32(); + RewHonorMultiplier = questRecord[114].GetFloat(); + RewOrReqMoney = questRecord[115].GetInt32(); + RewMoneyMaxLevel = questRecord[116].GetUInt32(); + RewSpell = questRecord[117].GetUInt32(); + RewSpellCast = questRecord[118].GetInt32(); + RewMailTemplateId = questRecord[119].GetUInt32(); + RewMailDelaySecs = questRecord[120].GetUInt32(); + PointMapId = questRecord[121].GetUInt32(); + PointX = questRecord[122].GetFloat(); + PointY = questRecord[123].GetFloat(); + PointOpt = questRecord[124].GetUInt32(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - DetailsEmote[i] = questRecord[124+i].GetUInt32(); + DetailsEmote[i] = questRecord[125+i].GetUInt32(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - DetailsEmoteDelay[i] = questRecord[128+i].GetUInt32(); + DetailsEmoteDelay[i] = questRecord[129+i].GetUInt32(); - IncompleteEmote = questRecord[132].GetUInt32(); - CompleteEmote = questRecord[133].GetUInt32(); + IncompleteEmote = questRecord[133].GetUInt32(); + CompleteEmote = questRecord[134].GetUInt32(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - OfferRewardEmote[i] = questRecord[134+i].GetInt32(); + OfferRewardEmote[i] = questRecord[135+i].GetInt32(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - OfferRewardEmoteDelay[i] = questRecord[138+i].GetInt32(); + OfferRewardEmoteDelay[i] = questRecord[139+i].GetInt32(); - QuestStartScript = questRecord[142].GetUInt32(); - QuestCompleteScript = questRecord[143].GetUInt32(); + QuestStartScript = questRecord[143].GetUInt32(); + QuestCompleteScript = questRecord[144].GetUInt32(); QuestFlags |= SpecialFlags << 20; if (QuestFlags & QUEST_TRINITY_FLAGS_AUTO_ACCEPT) -- cgit v1.2.3 From 5a4636c145cc5e2eaab9ea8a105f61a5fef34dcd Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 26 Nov 2011 03:00:06 +0000 Subject: Core|DB/Quests: Rename and re-order fields in `quest_template` table, for the sake of consistency Order should match SMSG_QUEST_QUERY_RESPONSE --- src/server/game/Entities/Creature/GossipDef.cpp | 76 ++-- src/server/game/Entities/Player/Player.cpp | 136 +++---- src/server/game/Globals/ObjectMgr.cpp | 393 ++++++++++----------- src/server/game/Quests/QuestDef.cpp | 206 +++++------ src/server/game/Quests/QuestDef.h | 172 ++++----- .../game/Server/Protocol/Handlers/LFGHandler.cpp | 16 +- .../game/Server/Protocol/Handlers/QuestHandler.cpp | 2 +- src/server/scripts/Commands/cs_quest.cpp | 10 +- src/server/scripts/Northrend/borean_tundra.cpp | 2 +- src/server/scripts/World/go_scripts.cpp | 2 +- 10 files changed, 509 insertions(+), 506 deletions(-) (limited to 'src/server/game/Quests/QuestDef.cpp') diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp index 90011dbae22..5bf7910466c 100755 --- a/src/server/game/Entities/Creature/GossipDef.cpp +++ b/src/server/game/Entities/Creature/GossipDef.cpp @@ -337,13 +337,13 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, data << uint32(quest->GetRewChoiceItemsCount()); for (uint32 i=0; i < QUEST_REWARD_CHOICES_COUNT; ++i) { - if (!quest->RewChoiceItemId[i]) + if (!quest->RewardChoiceItemId[i]) continue; - data << uint32(quest->RewChoiceItemId[i]); - data << uint32(quest->RewChoiceItemCount[i]); + data << uint32(quest->RewardChoiceItemId[i]); + data << uint32(quest->RewardChoiceItemCount[i]); - if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RewChoiceItemId[i])) + if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RewardChoiceItemId[i])) data << uint32(itemTemplate->DisplayInfoID); else data << uint32(0x00); @@ -353,13 +353,13 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, for (uint32 i=0; i < QUEST_REWARDS_COUNT; ++i) { - if (!quest->RewItemId[i]) + if (!quest->RewardItemId[i]) continue; - data << uint32(quest->RewItemId[i]); - data << uint32(quest->RewItemCount[i]); + data << uint32(quest->RewardItemId[i]); + data << uint32(quest->RewardItemIdCount[i]); - if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RewItemId[i])) + if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RewardItemId[i])) data << uint32(itemTemplate->DisplayInfoID); else data << uint32(0); @@ -380,13 +380,13 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, data << uint32(0); // unk for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - data << uint32(quest->RewRepFaction[i]); + data << uint32(quest->RewardFactionId[i]); for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - data << int32(quest->RewRepValueId[i]); + data << int32(quest->RewardFactionValueId[i]); for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - data << int32(quest->RewRepValue[i]); + data << int32(quest->RewardFactionValueIdOverride[i]); data << uint32(QUEST_EMOTE_COUNT); for (uint32 i = 0; i < QUEST_EMOTE_COUNT; ++i) @@ -478,24 +478,24 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const { for (uint32 i = 0; i < QUEST_REWARDS_COUNT; ++i) { - data << uint32(quest->RewItemId[i]); - data << uint32(quest->RewItemCount[i]); + data << uint32(quest->RewardItemId[i]); + data << uint32(quest->RewardItemIdCount[i]); } for (uint32 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) { - data << uint32(quest->RewChoiceItemId[i]); - data << uint32(quest->RewChoiceItemCount[i]); + data << uint32(quest->RewardChoiceItemId[i]); + data << uint32(quest->RewardChoiceItemCount[i]); } } for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // reward factions ids - data << uint32(quest->RewRepFaction[i]); + data << uint32(quest->RewardFactionId[i]); for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // columnid+1 QuestFactionReward.dbc? - data << int32(quest->RewRepValueId[i]); + data << int32(quest->RewardFactionValueId[i]); for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // unk (0) - data << int32(quest->RewRepValue[i]); + data << int32(quest->RewardFactionValueIdOverride[i]); data << quest->GetPointMapId(); data << quest->GetPointX(); @@ -510,20 +510,20 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const for (uint32 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) { - if (quest->ReqCreatureOrGOId[i] < 0) - data << uint32((quest->ReqCreatureOrGOId[i] * (-1)) | 0x80000000); // client expects gameobject template id in form (id|0x80000000) + if (quest->RequiredNpcOrGo[i] < 0) + data << uint32((quest->RequiredNpcOrGo[i] * (-1)) | 0x80000000); // client expects gameobject template id in form (id|0x80000000) else - data << uint32(quest->ReqCreatureOrGOId[i]); + data << uint32(quest->RequiredNpcOrGo[i]); - data << uint32(quest->ReqCreatureOrGOCount[i]); - data << uint32(quest->ReqSourceId[i]); + data << uint32(quest->RequiredNpcOrGoCount[i]); + data << uint32(quest->RequiredSourceItemid[i]); data << uint32(0); // req source count? } for (uint32 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) { - data << uint32(quest->ReqItemId[i]); - data << uint32(quest->ReqItemCount[i]); + data << uint32(quest->RequiredItemId[i]); + data << uint32(quest->RequiredItemCount[i]); } for (uint32 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) @@ -576,10 +576,10 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, uint64 npcGUID, b data << uint32(quest->GetRewChoiceItemsCount()); for (uint32 i=0; i < quest->GetRewChoiceItemsCount(); ++i) { - data << uint32(quest->RewChoiceItemId[i]); - data << uint32(quest->RewChoiceItemCount[i]); + data << uint32(quest->RewardChoiceItemId[i]); + data << uint32(quest->RewardChoiceItemCount[i]); - if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RewChoiceItemId[i])) + if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RewardChoiceItemId[i])) data << uint32(itemTemplate->DisplayInfoID); else data << uint32(0); @@ -588,10 +588,10 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, uint64 npcGUID, b data << uint32(quest->GetRewItemsCount()); for (uint32 i = 0; i < quest->GetRewItemsCount(); ++i) { - data << uint32(quest->RewItemId[i]); - data << uint32(quest->RewItemCount[i]); + data << uint32(quest->RewardItemId[i]); + data << uint32(quest->RewardItemIdCount[i]); - if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RewItemId[i])) + if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RewardItemId[i])) data << uint32(itemTemplate->DisplayInfoID); else data << uint32(0); @@ -612,13 +612,13 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, uint64 npcGUID, b data << uint32(0); for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // reward factions ids - data << uint32(quest->RewRepFaction[i]); + data << uint32(quest->RewardFactionId[i]); for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // columnid in QuestFactionReward.dbc (zero based)? - data << int32(quest->RewRepValueId[i]); + data << int32(quest->RewardFactionValueId[i]); for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // reward reputation override? - data << uint32(quest->RewRepValue[i]); + data << uint32(quest->RewardFactionValueIdOverride[i]); _session->SendPacket(&data); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_OFFER_REWARD NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), quest->GetQuestId()); @@ -676,13 +676,13 @@ void PlayerMenu::SendQuestGiverRequestItems(Quest const* quest, uint64 npcGUID, data << uint32(quest->GetReqItemsCount()); for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) { - if (!quest->ReqItemId[i]) + if (!quest->RequiredItemId[i]) continue; - data << uint32(quest->ReqItemId[i]); - data << uint32(quest->ReqItemCount[i]); + data << uint32(quest->RequiredItemId[i]); + data << uint32(quest->RequiredItemCount[i]); - if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->ReqItemId[i])) + if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RequiredItemId[i])) data << uint32(itemTemplate->DisplayInfoID); else data << uint32(0); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 39a9264922f..9dacd76fffc 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7016,22 +7016,22 @@ void Player::RewardReputation(Quest const* quest) // quest reputation reward/loss for (uint8 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) { - if (!quest->RewRepFaction[i]) + if (!quest->RewardFactionId[i]) continue; - if (quest->RewRepValue[i]) + if (quest->RewardFactionValueIdOverride[i]) { - int32 rep = CalculateReputationGain(GetQuestLevel(quest), quest->RewRepValue[i]/100, quest->RewRepFaction[i], true, true); + int32 rep = CalculateReputationGain(GetQuestLevel(quest), quest->RewardFactionValueIdOverride[i]/100, quest->RewardFactionId[i], true, true); if (recruitAFriend) rep = int32(rep * (1 + sWorld->getRate(RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS))); - if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(quest->RewRepFaction[i])) + if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(quest->RewardFactionId[i])) GetReputationMgr().ModifyReputation(factionEntry, rep); } else { - uint32 row = ((quest->RewRepValueId[i] < 0) ? 1 : 0) + 1; - uint32 field = abs(quest->RewRepValueId[i]); + uint32 row = ((quest->RewardFactionValueId[i] < 0) ? 1 : 0) + 1; + uint32 field = abs(quest->RewardFactionValueId[i]); if (const QuestFactionRewEntry* pRow = sQuestFactionRewardStore.LookupEntry(row)) { @@ -7040,12 +7040,12 @@ void Player::RewardReputation(Quest const* quest) if (!repPoints) continue; - repPoints = CalculateReputationGain(GetQuestLevel(quest), repPoints, quest->RewRepFaction[i], true); + repPoints = CalculateReputationGain(GetQuestLevel(quest), repPoints, quest->RewardFactionId[i], true); if (recruitAFriend) repPoints = int32(repPoints * (1 + sWorld->getRate(RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS))); - if (const FactionEntry* factionEntry = sFactionStore.LookupEntry(quest->RewRepFaction[i])) + if (const FactionEntry* factionEntry = sFactionStore.LookupEntry(quest->RewardFactionId[i])) GetReputationMgr().ModifyReputation(factionEntry, repPoints); } } @@ -14589,7 +14589,7 @@ bool Player::CanCompleteQuest(uint32 quest_id) { for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++) { - if (qInfo->ReqItemCount[i]!= 0 && q_status.m_itemcount[i] < qInfo->ReqItemCount[i]) + if (qInfo->RequiredItemCount[i]!= 0 && q_status.m_itemcount[i] < qInfo->RequiredItemCount[i]) return false; } } @@ -14598,10 +14598,10 @@ bool Player::CanCompleteQuest(uint32 quest_id) { for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; i++) { - if (qInfo->ReqCreatureOrGOId[i] == 0) + if (qInfo->RequiredNpcOrGo[i] == 0) continue; - if (qInfo->ReqCreatureOrGOCount[i] != 0 && q_status.m_creatureOrGOcount[i] < qInfo->ReqCreatureOrGOCount[i]) + if (qInfo->RequiredNpcOrGoCount[i] != 0 && q_status.m_creatureOrGOcount[i] < qInfo->RequiredNpcOrGoCount[i]) return false; } } @@ -14642,7 +14642,7 @@ bool Player::CanCompleteRepeatableQuest(Quest const* quest) if (quest->HasFlag(QUEST_TRINITY_FLAGS_DELIVER)) for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++) - if (quest->ReqItemId[i] && quest->ReqItemCount[i] && !HasItemCount(quest->ReqItemId[i], quest->ReqItemCount[i])) + if (quest->RequiredItemId[i] && quest->RequiredItemCount[i] && !HasItemCount(quest->RequiredItemId[i], quest->RequiredItemCount[i])) return false; if (!CanRewardQuest(quest, false)) @@ -14670,11 +14670,11 @@ bool Player::CanRewardQuest(Quest const* quest, bool msg) { for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++) { - if (quest->ReqItemCount[i]!= 0 && - GetItemCount(quest->ReqItemId[i]) < quest->ReqItemCount[i]) + if (quest->RequiredItemCount[i]!= 0 && + GetItemCount(quest->RequiredItemId[i]) < quest->RequiredItemCount[i]) { if (msg) - SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL, quest->ReqItemId[i]); + SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL, quest->RequiredItemId[i]); return false; } } @@ -14695,13 +14695,13 @@ bool Player::CanRewardQuest(Quest const* quest, uint32 reward, bool msg) if (quest->GetRewChoiceItemsCount() > 0) { - if (quest->RewChoiceItemId[reward]) + if (quest->RewardChoiceItemId[reward]) { ItemPosCountVec dest; - InventoryResult res = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, quest->RewChoiceItemId[reward], quest->RewChoiceItemCount[reward]); + InventoryResult res = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, quest->RewardChoiceItemId[reward], quest->RewardChoiceItemCount[reward]); if (res != EQUIP_ERR_OK) { - SendEquipError(res, NULL, NULL, quest->RewChoiceItemId[reward]); + SendEquipError(res, NULL, NULL, quest->RewardChoiceItemId[reward]); return false; } } @@ -14711,13 +14711,13 @@ bool Player::CanRewardQuest(Quest const* quest, uint32 reward, bool msg) { for (uint32 i = 0; i < quest->GetRewItemsCount(); ++i) { - if (quest->RewItemId[i]) + if (quest->RewardItemId[i]) { ItemPosCountVec dest; - InventoryResult res = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, quest->RewItemId[i], quest->RewItemCount[i]); + InventoryResult res = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, quest->RewardItemId[i], quest->RewardItemIdCount[i]); if (res != EQUIP_ERR_OK) { - SendEquipError(res, NULL, NULL, quest->RewItemId[i]); + SendEquipError(res, NULL, NULL, quest->RewardItemId[i]); return false; } } @@ -14850,15 +14850,15 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver, uint32 quest_id = quest->GetQuestId(); for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) - if (quest->ReqItemId[i]) - DestroyItemCount(quest->ReqItemId[i], quest->ReqItemCount[i], true); + if (quest->RequiredItemId[i]) + DestroyItemCount(quest->RequiredItemId[i], quest->RequiredItemCount[i], true); for (uint8 i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i) { - if (quest->ReqSourceId[i]) + if (quest->RequiredSourceItemid[i]) { - uint32 count = quest->ReqSourceCount[i]; - DestroyItemCount(quest->ReqSourceId[i], count ? count : 9999, true); + uint32 count = quest->RequiredSourceItemId[i]; + DestroyItemCount(quest->RequiredSourceItemid[i], count ? count : 9999, true); } } @@ -14866,13 +14866,13 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver, if (quest->GetRewChoiceItemsCount() > 0) { - if (uint32 itemId = quest->RewChoiceItemId[reward]) + if (uint32 itemId = quest->RewardChoiceItemId[reward]) { ItemPosCountVec dest; - if (CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, quest->RewChoiceItemCount[reward]) == EQUIP_ERR_OK) + if (CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, quest->RewardChoiceItemCount[reward]) == EQUIP_ERR_OK) { Item* item = StoreNewItem(dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId)); - SendNewItem(item, quest->RewChoiceItemCount[reward], true, false); + SendNewItem(item, quest->RewardChoiceItemCount[reward], true, false); } } } @@ -14881,13 +14881,13 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver, { for (uint32 i = 0; i < quest->GetRewItemsCount(); ++i) { - if (uint32 itemId = quest->RewItemId[i]) + if (uint32 itemId = quest->RewardItemId[i]) { ItemPosCountVec dest; - if (CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, quest->RewItemCount[i]) == EQUIP_ERR_OK) + if (CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, quest->RewardItemIdCount[i]) == EQUIP_ERR_OK) { Item* item = StoreNewItem(dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId)); - SendNewItem(item, quest->RewItemCount[i], true, false); + SendNewItem(item, quest->RewardItemIdCount[i], true, false); } } } @@ -15051,13 +15051,13 @@ void Player::FailQuest(uint32 questId) // Destroy quest items on quest failure. for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - if (quest->ReqItemId[i] > 0 && quest->ReqItemCount[i] > 0) + if (quest->RequiredItemId[i] > 0 && quest->RequiredItemCount[i] > 0) // Destroy items recieved on starting the quest. - DestroyItemCount(quest->ReqItemId[i], quest->ReqItemCount[i], true, true); + DestroyItemCount(quest->RequiredItemId[i], quest->RequiredItemCount[i], true, true); for (uint8 i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i) - if (quest->ReqSourceId[i] > 0 && quest->ReqSourceCount[i] > 0) + if (quest->RequiredSourceItemid[i] > 0 && quest->RequiredSourceItemId[i] > 0) // Destroy items recieved during the quest. - DestroyItemCount(quest->ReqSourceId[i], quest->ReqSourceCount[i], true, true); + DestroyItemCount(quest->RequiredSourceItemid[i], quest->RequiredSourceItemId[i], true, true); } } @@ -15478,7 +15478,7 @@ bool Player::TakeQuestSourceItem(uint32 questId, bool msg) // exist two cases when destroy source quest item not possible: // a) non un-equippable item (equipped non-empty bag, for example) // b) when quest is started from an item and item also is needed in - // the end as ReqItemId + // the end as RequiredItemId InventoryResult res = CanUnequipItems(srcItemId, count); if (res != EQUIP_ERR_OK) { @@ -15488,7 +15488,7 @@ bool Player::TakeQuestSourceItem(uint32 questId, bool msg) } for (uint8 n = 0; n < QUEST_ITEM_OBJECTIVES_COUNT; ++n) - if (item->StartQuest == questId && srcItemId == quest->ReqItemId[n]) + if (item->StartQuest == questId && srcItemId == quest->RequiredItemId[n]) destroyItem = false; if (destroyItem) @@ -15580,7 +15580,7 @@ uint16 Player::GetReqKillOrCastCurrentCount(uint32 quest_id, int32 entry) return 0; for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j) - if (qInfo->ReqCreatureOrGOId[j] == entry) + if (qInfo->RequiredNpcOrGo[j] == entry) return m_QuestStatus[quest_id].m_creatureOrGOcount[j]; return 0; @@ -15592,10 +15592,10 @@ void Player::AdjustQuestReqItemCount(Quest const* quest, QuestStatusData& questS { for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) { - uint32 reqitemcount = quest->ReqItemCount[i]; + uint32 reqitemcount = quest->RequiredItemCount[i]; if (reqitemcount != 0) { - uint32 curitemcount = GetItemCount(quest->ReqItemId[i], true); + uint32 curitemcount = GetItemCount(quest->RequiredItemId[i], true); questStatusData.m_itemcount[i] = std::min(curitemcount, reqitemcount); m_QuestStatusSave[quest->GetQuestId()] = true; @@ -15670,10 +15670,10 @@ void Player::ItemAddedQuestCheck(uint32 entry, uint32 count) for (uint8 j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j) { - uint32 reqitem = qInfo->ReqItemId[j]; + uint32 reqitem = qInfo->RequiredItemId[j]; if (reqitem == entry) { - uint32 reqitemcount = qInfo->ReqItemCount[j]; + uint32 reqitemcount = qInfo->RequiredItemCount[j]; uint16 curitemcount = q_status.m_itemcount[j]; if (curitemcount < reqitemcount) { @@ -15708,12 +15708,12 @@ void Player::ItemRemovedQuestCheck(uint32 entry, uint32 count) for (uint8 j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j) { - uint32 reqitem = qInfo->ReqItemId[j]; + uint32 reqitem = qInfo->RequiredItemId[j]; if (reqitem == entry) { QuestStatusData& q_status = m_QuestStatus[questid]; - uint32 reqitemcount = qInfo->ReqItemCount[j]; + uint32 reqitemcount = qInfo->RequiredItemCount[j]; uint16 curitemcount; if (q_status.m_status != QUEST_STATUS_COMPLETE) curitemcount = q_status.m_itemcount[j]; @@ -15777,18 +15777,18 @@ void Player::KilledMonsterCredit(uint32 entry, uint64 guid) for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j) { // skip GO activate objective or none - if (qInfo->ReqCreatureOrGOId[j] <= 0) + if (qInfo->RequiredNpcOrGo[j] <= 0) continue; // skip Cast at creature objective - if (qInfo->ReqSpell[j] != 0) + if (qInfo->RequiredSpellCast[j] != 0) continue; - uint32 reqkill = qInfo->ReqCreatureOrGOId[j]; + uint32 reqkill = qInfo->RequiredNpcOrGo[j]; if (reqkill == real_entry) { - uint32 reqkillcount = qInfo->ReqCreatureOrGOCount[j]; + uint32 reqkillcount = qInfo->RequiredNpcOrGoCount[j]; uint16 curkillcount = q_status.m_creatureOrGOcount[j]; if (curkillcount < reqkillcount) { @@ -15874,7 +15874,7 @@ void Player::CastedCreatureOrGO(uint32 entry, uint64 guid, uint32 spell_id) for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j) { // skip kill creature objective (0) or wrong spell casts - if (qInfo->ReqSpell[j] != spell_id) + if (qInfo->RequiredSpellCast[j] != spell_id) continue; uint32 reqTarget = 0; @@ -15882,10 +15882,10 @@ void Player::CastedCreatureOrGO(uint32 entry, uint64 guid, uint32 spell_id) if (isCreature) { // creature activate objectives - if (qInfo->ReqCreatureOrGOId[j] > 0) + if (qInfo->RequiredNpcOrGo[j] > 0) { // checked at quest_template loading - reqTarget = qInfo->ReqCreatureOrGOId[j]; + reqTarget = qInfo->RequiredNpcOrGo[j]; if (reqTarget != entry) // if entry doesn't match, check for killcredits referenced in template { CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(entry); @@ -15898,16 +15898,16 @@ void Player::CastedCreatureOrGO(uint32 entry, uint64 guid, uint32 spell_id) else { // GO activate objective - if (qInfo->ReqCreatureOrGOId[j] < 0) + if (qInfo->RequiredNpcOrGo[j] < 0) // checked at quest_template loading - reqTarget = - qInfo->ReqCreatureOrGOId[j]; + reqTarget = - qInfo->RequiredNpcOrGo[j]; } // other not this creature/GO related objectives if (reqTarget != entry) continue; - uint32 reqCastCount = qInfo->ReqCreatureOrGOCount[j]; + uint32 reqCastCount = qInfo->RequiredNpcOrGoCount[j]; uint16 curCastCount = q_status.m_creatureOrGOcount[j]; if (curCastCount < reqCastCount) { @@ -15951,20 +15951,20 @@ void Player::TalkedToCreature(uint32 entry, uint64 guid) for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j) { // skip spell casts and Gameobject objectives - if (qInfo->ReqSpell[j] > 0 || qInfo->ReqCreatureOrGOId[j] < 0) + if (qInfo->RequiredSpellCast[j] > 0 || qInfo->RequiredNpcOrGo[j] < 0) continue; uint32 reqTarget = 0; - if (qInfo->ReqCreatureOrGOId[j] > 0) // creature activate objectives + if (qInfo->RequiredNpcOrGo[j] > 0) // creature activate objectives // checked at quest_template loading - reqTarget = qInfo->ReqCreatureOrGOId[j]; + reqTarget = qInfo->RequiredNpcOrGo[j]; else continue; if (reqTarget == entry) { - uint32 reqTalkCount = qInfo->ReqCreatureOrGOCount[j]; + uint32 reqTalkCount = qInfo->RequiredNpcOrGoCount[j]; uint16 curTalkCount = q_status.m_creatureOrGOcount[j]; if (curTalkCount < reqTalkCount) { @@ -16101,14 +16101,14 @@ bool Player::HasQuestForItem(uint32 itemid) const // This part for ReqItem drop for (uint8 j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j) { - if (itemid == qinfo->ReqItemId[j] && q_status.m_itemcount[j] < qinfo->ReqItemCount[j]) + if (itemid == qinfo->RequiredItemId[j] && q_status.m_itemcount[j] < qinfo->RequiredItemCount[j]) return true; } // This part - for ReqSource for (uint8 j = 0; j < QUEST_SOURCE_ITEM_IDS_COUNT; ++j) { // examined item is a source item - if (qinfo->ReqSourceId[j] == itemid) + if (qinfo->RequiredSourceItemid[j] == itemid) { ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(itemid); @@ -16117,9 +16117,9 @@ bool Player::HasQuestForItem(uint32 itemid) const return true; // allows custom amount drop when not 0 - if (qinfo->ReqSourceCount[j]) + if (qinfo->RequiredSourceItemId[j]) { - if (GetItemCount(itemid, true) < qinfo->ReqSourceCount[j]) + if (GetItemCount(itemid, true) < qinfo->RequiredSourceItemId[j]) return true; } else if (GetItemCount(itemid, true) < pProto->GetMaxStackSize()) return true; @@ -16237,7 +16237,7 @@ void Player::SendQuestUpdateAddItem(Quest const* /*quest*/, uint32 /*item_idx*/, { WorldPacket data(SMSG_QUESTUPDATE_ADD_ITEM, 0); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_ADD_ITEM"); - //data << quest->ReqItemId[item_idx]; + //data << quest->RequiredItemId[item_idx]; //data << count; GetSession()->SendPacket(&data); } @@ -16246,7 +16246,7 @@ void Player::SendQuestUpdateAddCreatureOrGo(Quest const* quest, uint64 guid, uin { ASSERT(old_count + add_count < 65536 && "mob/GO count store in 16 bits 2^16 = 65536 (0..65536)"); - int32 entry = quest->ReqCreatureOrGOId[ creatureOrGO_idx ]; + int32 entry = quest->RequiredNpcOrGo[ creatureOrGO_idx ]; if (entry < 0) // client expected gameobject template id in form (id|0x80000000) entry = (-entry) | 0x80000000; @@ -16256,7 +16256,7 @@ void Player::SendQuestUpdateAddCreatureOrGo(Quest const* quest, uint64 guid, uin data << uint32(quest->GetQuestId()); data << uint32(entry); data << uint32(old_count + add_count); - data << uint32(quest->ReqCreatureOrGOCount[ creatureOrGO_idx ]); + data << uint32(quest->RequiredNpcOrGoCount[ creatureOrGO_idx ]); data << uint64(guid); GetSession()->SendPacket(&data); @@ -22064,10 +22064,10 @@ bool Player::HasQuestForGO(int32 GOId) const for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j) { - if (qinfo->ReqCreatureOrGOId[j] >= 0) //skip non GO case + if (qinfo->RequiredNpcOrGo[j] >= 0) //skip non GO case continue; - if ((-1)*GOId == qinfo->ReqCreatureOrGOId[j] && qs.m_creatureOrGOcount[j] < qinfo->ReqCreatureOrGOCount[j]) + if ((-1)*GOId == qinfo->RequiredNpcOrGo[j] && qs.m_creatureOrGOcount[j] < qinfo->RequiredNpcOrGoCount[j]) return true; } } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index c1af7bcfed4..6b0601d9663 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -3691,42 +3691,41 @@ void ObjectMgr::LoadQuests() mExclusiveQuestGroups.clear(); - // 0 1 2 3 4 5 6 7 8 9 10 - QueryResult result = WorldDatabase.Query("SELECT entry, Method, ZoneOrSort, MinLevel, MaxLevel, QuestLevel, Type, RequiredClasses, RequiredRaces, RequiredSkill, RequiredSkillValue, " - // 11 12 13 14 15 16 17 18 19 20 - "RepObjectiveFaction, RepObjectiveValue, RepObjectiveFaction2, RepObjectiveValue2, RequiredMinRepFaction, RequiredMinRepValue, RequiredMaxRepFaction, RequiredMaxRepValue, SuggestedPlayers, LimitTime, " - // 21 22 23 24 25 26 27 28 29 30 31 32 33 34 - "QuestFlags, SpecialFlags, CharTitleId, PlayersSlain, BonusTalents, RewardArenaPoints, PrevQuestId, NextQuestId, ExclusiveGroup, NextQuestInChain, RewXPId, SrcItemId, SrcItemCount, SrcSpell, " - // 35 36 37 38 39 40 41 42 43 44 45 - "Title, Details, Objectives, OfferRewardText, RequestItemsText, EndText, CompletedText, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4, " - // 46 47 48 49 50 51 52 53 54 55 56 57 - "ReqItemId1, ReqItemId2, ReqItemId3, ReqItemId4, ReqItemId5, ReqItemId6, ReqItemCount1, ReqItemCount2, ReqItemCount3, ReqItemCount4, ReqItemCount5, ReqItemCount6, " - // 58 59 60 61 62 63 64 65 - "ReqSourceId1, ReqSourceId2, ReqSourceId3, ReqSourceId4, ReqSourceCount1, ReqSourceCount2, ReqSourceCount3, ReqSourceCount4, " - // 66 67 68 69 70 71 72 73 - "ReqCreatureOrGOId1, ReqCreatureOrGOId2, ReqCreatureOrGOId3, ReqCreatureOrGOId4, ReqCreatureOrGOCount1, ReqCreatureOrGOCount2, ReqCreatureOrGOCount3, ReqCreatureOrGOCount4, " - // 74 75 76 77 - "ReqSpellCast1, ReqSpellCast2, ReqSpellCast3, ReqSpellCast4, " - // 78 79 80 81 82 83 - "RewChoiceItemId1, RewChoiceItemId2, RewChoiceItemId3, RewChoiceItemId4, RewChoiceItemId5, RewChoiceItemId6, " - // 84 85 86 87 88 89 - "RewChoiceItemCount1, RewChoiceItemCount2, RewChoiceItemCount3, RewChoiceItemCount4, RewChoiceItemCount5, RewChoiceItemCount6, " - // 90 91 92 93 94 95 96 97 - "RewItemId1, RewItemId2, RewItemId3, RewItemId4, RewItemCount1, RewItemCount2, RewItemCount3, RewItemCount4, " - // 98 99 100 101 102 103 104 105 106 107 - "RewRepFaction1, RewRepFaction2, RewRepFaction3, RewRepFaction4, RewRepFaction5, RewRepValueId1, RewRepValueId2, RewRepValueId3, RewRepValueId4, RewRepValueId5, " - // 108 109 110 111 112 - "RewRepValue1, RewRepValue2, RewRepValue3, RewRepValue4, RewRepValue5, " - // 113 114 115 116 117 118 119 120 121 122 123 124 - "RewHonorAddition, RewHonorMultiplier, RewOrReqMoney, RewMoneyMaxLevel, RewSpell, RewSpellCast, RewMailTemplateId, RewMailDelaySecs, PointMapId, PointX, PointY, PointOpt, " - // 125 126 127 128 129 130 131 132 - "DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4, DetailsEmoteDelay1, DetailsEmoteDelay2, DetailsEmoteDelay3, DetailsEmoteDelay4, " - // 133 134 135 136 137 138 - "IncompleteEmote, CompleteEmote, OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4, " - // 139 140 141 142 - "OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4, " - // 143 144 - "StartScript, CompleteScript" + QueryResult result = WorldDatabase.Query("SELECT " + //0 1 2 3 4 5 6 7 8 9 10 11 12 + "Id, Method, Level, MinLevel, MaxLevel, ZoneOrSort, Type, SuggestedPlayers, LimitTime, RequiredClasses, RequiredRaces, RequiredSkillId, RequiredSkillPoints, " + // 13 14 15 16 17 18 19 20 + "RequiredFactionId1, RequiredFactionId2, RequiredFactionValue1, RequiredFactionValue2, RequiredMinRepFaction, RequiredMaxRepFaction, RequiredMinRepValue, RequiredMaxRepValue, " + // 21 22 23 24 25 26 27 28 29 30 31 + "PrevQuestId, NextQuestId, ExclusiveGroup, NextQuestIdChain, RewardXPId, RewardOrRequiredMoney, RewardMoneyMaxLevel, RewardSpell, RewardSpellCast, RewardHonor, RewardHonorMultiplier, " + // 32 33 34 35 36 37 38 39 40 41 42 + "RewardMailTemplateId, RewardMailDelay, SourceItemId, SourceItemCount, SourceSpellId, Flags, SpecialFlags, RewardTitleId, RequiredPlayerKills, RewardTalents, RewardArenaPoints, " + // 43 44 45 46 47 48 49 50 + "RewardItemId1, RewardItemId2, RewardItemId3, RewardItemId4, RewardItemCount1, RewardItemCount2, RewardItemCount3, RewardItemCount4, " + // 51 52 53 54 55 56 57 58 59 60 61 62 + "RewardChoiceItemId1, RewardChoiceItemId2, RewardChoiceItemId3, RewardChoiceItemId4, RewardChoiceItemId5, RewardChoiceItemId6, RewardChoiceItemCount1, RewardChoiceItemCount2, RewardChoiceItemCount3, RewardChoiceItemCount4, RewardChoiceItemCount5, RewardChoiceItemCount6, " + // 63 64 65 66 67 68 69 70 71 72 + "RewardFactionId1, RewardFactionId2, RewardFactionId3, RewardFactionId4, RewardFactionId5, RewardFactionValueId1, RewardFactionValueId2, RewardFactionValueId3, RewardFactionValueId4, RewardFactionValueId5, " + // 73 74 75 76 77 + "RewardFactionValueIdOverride1, RewardFactionValueIdOverride2, RewardFactionValueIdOverride3, RewardFactionValueIdOverride4, RewardFactionValueIdOverride5, " + // 78 79 80 81 + "PointMapId, PointX, PointY, PointOption, " + // 82 83 84 85 86 87 88 + "Title, Objectives, Details, EndText, OfferRewardText, RequestItemsText, CompletedText, " + // 89 90 91 92 93 94 95 96 + "RequiredNpcOrGo1, RequiredNpcOrGo2, RequiredNpcOrGo3, RequiredNpcOrGo4, RequiredNpcOrGoCount1, RequiredNpcOrGoCount2, RequiredNpcOrGoCount3, RequiredNpcOrGoCount4, " + // 97 98 99 100 101 102 103 104 + "RequiredSourceItemId1, RequiredSourceItemId2, RequiredSourceItemId3, RequiredSourceItemId4, RequiredSourceItemCount1, RequiredSourceItemCount2, RequiredSourceItemCount3, RequiredSourceItemCount4, " + // 105 106 107 108 109 110 111 112 113 114 115 116 + "RequiredItemId1, RequiredItemId2, RequiredItemId3, RequiredItemId4, RequiredItemId5, RequiredItemId6, RequiredItemCount1, RequiredItemCount2, RequiredItemCount3, RequiredItemCount4, RequiredItemCount5, RequiredItemCount6, " + // 117 118 119 120 121 122 123 124 125 + "RequiredSpellCast1, RequiredSpellCast2, RequiredSpellCast3, RequiredSpellCast4, Unknown0, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4, " + // 126 127 128 129 130 131 132 133 134 135 + "DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4, DetailsEmoteDelay1, DetailsEmoteDelay2, DetailsEmoteDelay3, DetailsEmoteDelay4, EmoteOnIncomplete, EmoteOnComplete, " + // 136 137 138 139 140 141 142 143 + "OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4, OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4, " + // 144 145 146 + "StartScript, CompleteScript, WDBVerified" " FROM quest_template"); if (!result) { @@ -3764,45 +3763,45 @@ void ObjectMgr::LoadQuests() sLog->outErrorDb("Quest %u has `Method` = %u, expected values are 0, 1 or 2.", qinfo->GetQuestId(), qinfo->GetQuestMethod()); } - if (qinfo->QuestFlags & ~QUEST_TRINITY_FLAGS_DB_ALLOWED) + if (qinfo->Flags & ~QUEST_TRINITY_FLAGS_DB_ALLOWED) { sLog->outErrorDb("Quest %u has `SpecialFlags` = %u > max allowed value. Correct `SpecialFlags` to value <= %u", - qinfo->GetQuestId(), qinfo->QuestFlags >> 20, QUEST_TRINITY_FLAGS_DB_ALLOWED >> 20); - qinfo->QuestFlags &= QUEST_TRINITY_FLAGS_DB_ALLOWED; + qinfo->GetQuestId(), qinfo->Flags >> 20, QUEST_TRINITY_FLAGS_DB_ALLOWED >> 20); + qinfo->Flags &= QUEST_TRINITY_FLAGS_DB_ALLOWED; } - if (qinfo->QuestFlags & QUEST_FLAGS_DAILY && qinfo->QuestFlags & QUEST_FLAGS_WEEKLY) + if (qinfo->Flags & QUEST_FLAGS_DAILY && qinfo->Flags & QUEST_FLAGS_WEEKLY) { - sLog->outErrorDb("Weekly Quest %u is marked as daily quest in `QuestFlags`, removed daily flag.", qinfo->GetQuestId()); - qinfo->QuestFlags &= ~QUEST_FLAGS_DAILY; + sLog->outErrorDb("Weekly Quest %u is marked as daily quest in `Flags`, removed daily flag.", qinfo->GetQuestId()); + qinfo->Flags &= ~QUEST_FLAGS_DAILY; } - if (qinfo->QuestFlags & QUEST_FLAGS_DAILY) + if (qinfo->Flags & QUEST_FLAGS_DAILY) { - if (!(qinfo->QuestFlags & QUEST_TRINITY_FLAGS_REPEATABLE)) + if (!(qinfo->Flags & QUEST_TRINITY_FLAGS_REPEATABLE)) { sLog->outErrorDb("Daily Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId()); - qinfo->QuestFlags |= QUEST_TRINITY_FLAGS_REPEATABLE; + qinfo->Flags |= QUEST_TRINITY_FLAGS_REPEATABLE; } } - if (qinfo->QuestFlags & QUEST_FLAGS_WEEKLY) + if (qinfo->Flags & QUEST_FLAGS_WEEKLY) { - if (!(qinfo->QuestFlags & QUEST_TRINITY_FLAGS_REPEATABLE)) + if (!(qinfo->Flags & QUEST_TRINITY_FLAGS_REPEATABLE)) { sLog->outErrorDb("Weekly Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId()); - qinfo->QuestFlags |= QUEST_TRINITY_FLAGS_REPEATABLE; + qinfo->Flags |= QUEST_TRINITY_FLAGS_REPEATABLE; } } - if (qinfo->QuestFlags & QUEST_FLAGS_AUTO_REWARDED) + if (qinfo->Flags & QUEST_FLAGS_AUTO_REWARDED) { - // at auto-reward can be rewarded only RewChoiceItemId[0] + // at auto-reward can be rewarded only RewardChoiceItemId[0] for (int j = 1; j < QUEST_REWARD_CHOICES_COUNT; ++j ) { - if (uint32 id = qinfo->RewChoiceItemId[j]) + if (uint32 id = qinfo->RewardChoiceItemId[j]) { - sLog->outErrorDb("Quest %u has `RewChoiceItemId%d` = %u but item from `RewChoiceItemId%d` can't be rewarded with quest flag QUEST_FLAGS_AUTO_REWARDED.", + sLog->outErrorDb("Quest %u has `RewardChoiceItemId%d` = %u but item from `RewardChoiceItemId%d` can't be rewarded with quest flag QUEST_FLAGS_AUTO_REWARDED.", qinfo->GetQuestId(), j+1, id, j+1); // no changes, quest ignore this data } @@ -3829,12 +3828,12 @@ void ObjectMgr::LoadQuests() qinfo->GetQuestId(), qinfo->ZoneOrSort); // no changes, quest not dependent from this value but can have problems at client (note some may be 0, we must allow this so no check) } - //check for proper RequiredSkill value (skill case) + //check for proper RequiredSkillId value (skill case) if (int32 skill_id = SkillByQuestSort(-int32(qinfo->ZoneOrSort))) { - if (qinfo->RequiredSkill != skill_id) + if (qinfo->RequiredSkillId != skill_id) { - sLog->outErrorDb("Quest %u has `ZoneOrSort` = %i but `RequiredSkill` does not have a corresponding value (%i).", + sLog->outErrorDb("Quest %u has `ZoneOrSort` = %i but `RequiredSkillId` does not have a corresponding value (%i).", qinfo->GetQuestId(), qinfo->ZoneOrSort, skill_id); //override, and force proper value here? } @@ -3859,38 +3858,38 @@ void ObjectMgr::LoadQuests() qinfo->RequiredRaces = 0; } } - // RequiredSkill, can be 0 - if (qinfo->RequiredSkill) + // RequiredSkillId, can be 0 + if (qinfo->RequiredSkillId) { - if (!sSkillLineStore.LookupEntry(qinfo->RequiredSkill)) + if (!sSkillLineStore.LookupEntry(qinfo->RequiredSkillId)) { - sLog->outErrorDb("Quest %u has `RequiredSkill` = %u but this skill does not exist", - qinfo->GetQuestId(), qinfo->RequiredSkill); + sLog->outErrorDb("Quest %u has `RequiredSkillId` = %u but this skill does not exist", + qinfo->GetQuestId(), qinfo->RequiredSkillId); } } - if (qinfo->RequiredSkillValue) + if (qinfo->RequiredSkillPoints) { - if (qinfo->RequiredSkillValue > sWorld->GetConfigMaxSkillValue()) + if (qinfo->RequiredSkillPoints > sWorld->GetConfigMaxSkillValue()) { - sLog->outErrorDb("Quest %u has `RequiredSkillValue` = %u but max possible skill is %u, quest can't be done.", - qinfo->GetQuestId(), qinfo->RequiredSkillValue, sWorld->GetConfigMaxSkillValue()); + sLog->outErrorDb("Quest %u has `RequiredSkillPoints` = %u but max possible skill is %u, quest can't be done.", + qinfo->GetQuestId(), qinfo->RequiredSkillPoints, sWorld->GetConfigMaxSkillValue()); // no changes, quest can't be done for this requirement } } // else Skill quests can have 0 skill level, this is ok - if (qinfo->RepObjectiveFaction2 && !sFactionStore.LookupEntry(qinfo->RepObjectiveFaction2)) + if (qinfo->RequiredFactionId2 && !sFactionStore.LookupEntry(qinfo->RequiredFactionId2)) { - sLog->outErrorDb("Quest %u has `RepObjectiveFaction2` = %u but faction template %u does not exist, quest can't be done.", - qinfo->GetQuestId(), qinfo->RepObjectiveFaction2, qinfo->RepObjectiveFaction2); + sLog->outErrorDb("Quest %u has `RequiredFactionId2` = %u but faction template %u does not exist, quest can't be done.", + qinfo->GetQuestId(), qinfo->RequiredFactionId2, qinfo->RequiredFactionId2); // no changes, quest can't be done for this requirement } - if (qinfo->RepObjectiveFaction && !sFactionStore.LookupEntry(qinfo->RepObjectiveFaction)) + if (qinfo->RequiredFactionId1 && !sFactionStore.LookupEntry(qinfo->RequiredFactionId1)) { - sLog->outErrorDb("Quest %u has `RepObjectiveFaction` = %u but faction template %u does not exist, quest can't be done.", - qinfo->GetQuestId(), qinfo->RepObjectiveFaction, qinfo->RepObjectiveFaction); + sLog->outErrorDb("Quest %u has `RequiredFactionId1` = %u but faction template %u does not exist, quest can't be done.", + qinfo->GetQuestId(), qinfo->RequiredFactionId1, qinfo->RequiredFactionId1); // no changes, quest can't be done for this requirement } @@ -3922,17 +3921,17 @@ void ObjectMgr::LoadQuests() // no changes, quest can't be done for this requirement } - if (!qinfo->RepObjectiveFaction && qinfo->RepObjectiveValue != 0) + if (!qinfo->RequiredFactionId1 && qinfo->RequiredFactionValue1 != 0) { - sLog->outErrorDb("Quest %u has `RepObjectiveValue` = %d but `RepObjectiveFaction` is 0, value has no effect", - qinfo->GetQuestId(), qinfo->RepObjectiveValue); + sLog->outErrorDb("Quest %u has `RequiredFactionValue1` = %d but `RequiredFactionId1` is 0, value has no effect", + qinfo->GetQuestId(), qinfo->RequiredFactionValue1); // warning } - if (!qinfo->RepObjectiveFaction2 && qinfo->RepObjectiveValue2 != 0) + if (!qinfo->RequiredFactionId2 && qinfo->RequiredFactionValue2 != 0) { - sLog->outErrorDb("Quest %u has `RepObjectiveValue2` = %d but `RepObjectiveFaction2` is 0, value has no effect", - qinfo->GetQuestId(), qinfo->RepObjectiveValue2); + sLog->outErrorDb("Quest %u has `RequiredFactionValue2` = %d but `RequiredFactionId2` is 0, value has no effect", + qinfo->GetQuestId(), qinfo->RequiredFactionValue2); // warning } @@ -3950,61 +3949,61 @@ void ObjectMgr::LoadQuests() // warning } - if (qinfo->CharTitleId && !sCharTitlesStore.LookupEntry(qinfo->CharTitleId)) + if (qinfo->RewardTitleId && !sCharTitlesStore.LookupEntry(qinfo->RewardTitleId)) { - sLog->outErrorDb("Quest %u has `CharTitleId` = %u but CharTitle Id %u does not exist, quest can't be rewarded with title.", + sLog->outErrorDb("Quest %u has `RewardTitleId` = %u but CharTitle Id %u does not exist, quest can't be rewarded with title.", qinfo->GetQuestId(), qinfo->GetCharTitleId(), qinfo->GetCharTitleId()); - qinfo->CharTitleId = 0; + qinfo->RewardTitleId = 0; // quest can't reward this title } - if (qinfo->SrcItemId) + if (qinfo->SourceItemId) { - if (!sObjectMgr->GetItemTemplate(qinfo->SrcItemId)) + if (!sObjectMgr->GetItemTemplate(qinfo->SourceItemId)) { - sLog->outErrorDb("Quest %u has `SrcItemId` = %u but item with entry %u does not exist, quest can't be done.", - qinfo->GetQuestId(), qinfo->SrcItemId, qinfo->SrcItemId); - qinfo->SrcItemId = 0; // quest can't be done for this requirement + sLog->outErrorDb("Quest %u has `SourceItemId` = %u but item with entry %u does not exist, quest can't be done.", + qinfo->GetQuestId(), qinfo->SourceItemId, qinfo->SourceItemId); + qinfo->SourceItemId = 0; // quest can't be done for this requirement } - else if (qinfo->SrcItemCount == 0) + else if (qinfo->SourceItemIdCount == 0) { - sLog->outErrorDb("Quest %u has `SrcItemId` = %u but `SrcItemCount` = 0, set to 1 but need fix in DB.", - qinfo->GetQuestId(), qinfo->SrcItemId); - qinfo->SrcItemCount = 1; // update to 1 for allow quest work for backward compatibility with DB + sLog->outErrorDb("Quest %u has `SourceItemId` = %u but `SourceItemIdCount` = 0, set to 1 but need fix in DB.", + qinfo->GetQuestId(), qinfo->SourceItemId); + qinfo->SourceItemIdCount = 1; // update to 1 for allow quest work for backward compatibility with DB } } - else if (qinfo->SrcItemCount>0) + else if (qinfo->SourceItemIdCount>0) { - sLog->outErrorDb("Quest %u has `SrcItemId` = 0 but `SrcItemCount` = %u, useless value.", - qinfo->GetQuestId(), qinfo->SrcItemCount); - qinfo->SrcItemCount=0; // no quest work changes in fact + sLog->outErrorDb("Quest %u has `SourceItemId` = 0 but `SourceItemIdCount` = %u, useless value.", + qinfo->GetQuestId(), qinfo->SourceItemIdCount); + qinfo->SourceItemIdCount=0; // no quest work changes in fact } - if (qinfo->SrcSpell) + if (qinfo->SourceSpellid) { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->SrcSpell); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->SourceSpellid); if (!spellInfo) { - sLog->outErrorDb("Quest %u has `SrcSpell` = %u but spell %u doesn't exist, quest can't be done.", - qinfo->GetQuestId(), qinfo->SrcSpell, qinfo->SrcSpell); - qinfo->SrcSpell = 0; // quest can't be done for this requirement + sLog->outErrorDb("Quest %u has `SourceSpellid` = %u but spell %u doesn't exist, quest can't be done.", + qinfo->GetQuestId(), qinfo->SourceSpellid, qinfo->SourceSpellid); + qinfo->SourceSpellid = 0; // quest can't be done for this requirement } else if (!SpellMgr::IsSpellValid(spellInfo)) { - sLog->outErrorDb("Quest %u has `SrcSpell` = %u but spell %u is broken, quest can't be done.", - qinfo->GetQuestId(), qinfo->SrcSpell, qinfo->SrcSpell); - qinfo->SrcSpell = 0; // quest can't be done for this requirement + sLog->outErrorDb("Quest %u has `SourceSpellid` = %u but spell %u is broken, quest can't be done.", + qinfo->GetQuestId(), qinfo->SourceSpellid, qinfo->SourceSpellid); + qinfo->SourceSpellid = 0; // quest can't be done for this requirement } } for (uint8 j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j) { - uint32 id = qinfo->ReqItemId[j]; + uint32 id = qinfo->RequiredItemId[j]; if (id) { - if (qinfo->ReqItemCount[j] == 0) + if (qinfo->RequiredItemCount[j] == 0) { - sLog->outErrorDb("Quest %u has `ReqItemId%d` = %u but `ReqItemCount%d` = 0, quest can't be done.", + sLog->outErrorDb("Quest %u has `RequiredItemId%d` = %u but `RequiredItemCount%d` = 0, quest can't be done.", qinfo->GetQuestId(), j+1, id, j+1); // no changes, quest can't be done for this requirement } @@ -4013,37 +4012,37 @@ void ObjectMgr::LoadQuests() if (!sObjectMgr->GetItemTemplate(id)) { - sLog->outErrorDb("Quest %u has `ReqItemId%d` = %u but item with entry %u does not exist, quest can't be done.", + sLog->outErrorDb("Quest %u has `RequiredItemId%d` = %u but item with entry %u does not exist, quest can't be done.", qinfo->GetQuestId(), j+1, id, id); - qinfo->ReqItemCount[j] = 0; // prevent incorrect work of quest + qinfo->RequiredItemCount[j] = 0; // prevent incorrect work of quest } } - else if (qinfo->ReqItemCount[j]>0) + else if (qinfo->RequiredItemCount[j]>0) { - sLog->outErrorDb("Quest %u has `ReqItemId%d` = 0 but `ReqItemCount%d` = %u, quest can't be done.", - qinfo->GetQuestId(), j+1, j+1, qinfo->ReqItemCount[j]); - qinfo->ReqItemCount[j] = 0; // prevent incorrect work of quest + sLog->outErrorDb("Quest %u has `RequiredItemId%d` = 0 but `RequiredItemCount%d` = %u, quest can't be done.", + qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredItemCount[j]); + qinfo->RequiredItemCount[j] = 0; // prevent incorrect work of quest } } for (uint8 j = 0; j < QUEST_SOURCE_ITEM_IDS_COUNT; ++j) { - uint32 id = qinfo->ReqSourceId[j]; + uint32 id = qinfo->RequiredSourceItemid[j]; if (id) { if (!sObjectMgr->GetItemTemplate(id)) { - sLog->outErrorDb("Quest %u has `ReqSourceId%d` = %u but item with entry %u does not exist, quest can't be done.", + sLog->outErrorDb("Quest %u has `RequiredSourceItemid%d` = %u but item with entry %u does not exist, quest can't be done.", qinfo->GetQuestId(), j+1, id, id); // no changes, quest can't be done for this requirement } } else { - if (qinfo->ReqSourceCount[j]>0) + if (qinfo->RequiredSourceItemId[j]>0) { - sLog->outErrorDb("Quest %u has `ReqSourceId%d` = 0 but `ReqSourceCount%d` = %u.", - qinfo->GetQuestId(), j+1, j+1, qinfo->ReqSourceCount[j]); + sLog->outErrorDb("Quest %u has `RequiredSourceItemid%d` = 0 but `RequiredSourceItemId%d` = %u.", + qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredSourceItemId[j]); // no changes, quest ignore this data } } @@ -4051,7 +4050,7 @@ void ObjectMgr::LoadQuests() for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j) { - uint32 id = qinfo->ReqSpell[j]; + uint32 id = qinfo->RequiredSpellCast[j]; if (id) { SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(id); @@ -4062,12 +4061,12 @@ void ObjectMgr::LoadQuests() continue; } - if (!qinfo->ReqCreatureOrGOId[j]) + if (!qinfo->RequiredNpcOrGo[j]) { bool found = false; for (uint8 k = 0; k < MAX_SPELL_EFFECTS; ++k) { - if ((spellInfo->Effects[k].Effect == SPELL_EFFECT_QUEST_COMPLETE && uint32(spellInfo->Effects[k].MiscValue) == qinfo->QuestId) || + if ((spellInfo->Effects[k].Effect == SPELL_EFFECT_QUEST_COMPLETE && uint32(spellInfo->Effects[k].MiscValue) == qinfo->Id) || spellInfo->Effects[k].Effect == SPELL_EFFECT_SEND_EVENT) { found = true; @@ -4079,7 +4078,7 @@ void ObjectMgr::LoadQuests() { if (!qinfo->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) { - sLog->outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT for quest %u and ReqCreatureOrGOId%d = 0, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags or ReqCreatureOrGOId%d must be fixed, quest modified to enable objective.", spellInfo->Id, qinfo->QuestId, j+1, j+1); + sLog->outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT for quest %u and RequiredNpcOrGo%d = 0, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags or RequiredNpcOrGo%d must be fixed, quest modified to enable objective.", spellInfo->Id, qinfo->Id, j+1, j+1); // this will prevent quest completing without objective const_cast(qinfo)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT); @@ -4087,7 +4086,7 @@ void ObjectMgr::LoadQuests() } else { - sLog->outErrorDb("Quest %u has `ReqSpellCast%d` = %u and ReqCreatureOrGOId%d = 0 but spell %u does not have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT effect for this quest, quest can't be done.", + sLog->outErrorDb("Quest %u has `ReqSpellCast%d` = %u and RequiredNpcOrGo%d = 0 but spell %u does not have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT effect for this quest, quest can't be done.", qinfo->GetQuestId(), j+1, id, j+1, id); // no changes, quest can't be done for this requirement } @@ -4097,19 +4096,19 @@ void ObjectMgr::LoadQuests() for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j) { - int32 id = qinfo->ReqCreatureOrGOId[j]; + int32 id = qinfo->RequiredNpcOrGo[j]; if (id < 0 && !sObjectMgr->GetGameObjectTemplate(-id)) { - sLog->outErrorDb("Quest %u has `ReqCreatureOrGOId%d` = %i but gameobject %u does not exist, quest can't be done.", + sLog->outErrorDb("Quest %u has `RequiredNpcOrGo%d` = %i but gameobject %u does not exist, quest can't be done.", qinfo->GetQuestId(), j+1, id, uint32(-id)); - qinfo->ReqCreatureOrGOId[j] = 0; // quest can't be done for this requirement + qinfo->RequiredNpcOrGo[j] = 0; // quest can't be done for this requirement } if (id > 0 && !sObjectMgr->GetCreatureTemplate(id)) { - sLog->outErrorDb("Quest %u has `ReqCreatureOrGOId%d` = %i but creature with entry %u does not exist, quest can't be done.", + sLog->outErrorDb("Quest %u has `RequiredNpcOrGo%d` = %i but creature with entry %u does not exist, quest can't be done.", qinfo->GetQuestId(), j+1, id, uint32(id)); - qinfo->ReqCreatureOrGOId[j] = 0; // quest can't be done for this requirement + qinfo->RequiredNpcOrGo[j] = 0; // quest can't be done for this requirement } if (id) @@ -4118,179 +4117,179 @@ void ObjectMgr::LoadQuests() qinfo->SetFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST | QUEST_TRINITY_FLAGS_SPEAKTO); - if (!qinfo->ReqCreatureOrGOCount[j]) + if (!qinfo->RequiredNpcOrGoCount[j]) { - sLog->outErrorDb("Quest %u has `ReqCreatureOrGOId%d` = %u but `ReqCreatureOrGOCount%d` = 0, quest can't be done.", + sLog->outErrorDb("Quest %u has `RequiredNpcOrGo%d` = %u but `RequiredNpcOrGoCount%d` = 0, quest can't be done.", qinfo->GetQuestId(), j+1, id, j+1); // no changes, quest can be incorrectly done, but we already report this } } - else if (qinfo->ReqCreatureOrGOCount[j]>0) + else if (qinfo->RequiredNpcOrGoCount[j]>0) { - sLog->outErrorDb("Quest %u has `ReqCreatureOrGOId%d` = 0 but `ReqCreatureOrGOCount%d` = %u.", - qinfo->GetQuestId(), j+1, j+1, qinfo->ReqCreatureOrGOCount[j]); + sLog->outErrorDb("Quest %u has `RequiredNpcOrGo%d` = 0 but `RequiredNpcOrGoCount%d` = %u.", + qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredNpcOrGoCount[j]); // no changes, quest ignore this data } } for (uint8 j = 0; j < QUEST_REWARD_CHOICES_COUNT; ++j) { - uint32 id = qinfo->RewChoiceItemId[j]; + uint32 id = qinfo->RewardChoiceItemId[j]; if (id) { if (!sObjectMgr->GetItemTemplate(id)) { - sLog->outErrorDb("Quest %u has `RewChoiceItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.", + sLog->outErrorDb("Quest %u has `RewardChoiceItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.", qinfo->GetQuestId(), j+1, id, id); - qinfo->RewChoiceItemId[j] = 0; // no changes, quest will not reward this + qinfo->RewardChoiceItemId[j] = 0; // no changes, quest will not reward this } - if (!qinfo->RewChoiceItemCount[j]) + if (!qinfo->RewardChoiceItemCount[j]) { - sLog->outErrorDb("Quest %u has `RewChoiceItemId%d` = %u but `RewChoiceItemCount%d` = 0, quest can't be done.", + sLog->outErrorDb("Quest %u has `RewardChoiceItemId%d` = %u but `RewardChoiceItemCount%d` = 0, quest can't be done.", qinfo->GetQuestId(), j+1, id, j+1); // no changes, quest can't be done } } - else if (qinfo->RewChoiceItemCount[j]>0) + else if (qinfo->RewardChoiceItemCount[j]>0) { - sLog->outErrorDb("Quest %u has `RewChoiceItemId%d` = 0 but `RewChoiceItemCount%d` = %u.", - qinfo->GetQuestId(), j+1, j+1, qinfo->RewChoiceItemCount[j]); + sLog->outErrorDb("Quest %u has `RewardChoiceItemId%d` = 0 but `RewardChoiceItemCount%d` = %u.", + qinfo->GetQuestId(), j+1, j+1, qinfo->RewardChoiceItemCount[j]); // no changes, quest ignore this data } } for (uint8 j = 0; j < QUEST_REWARDS_COUNT; ++j) { - uint32 id = qinfo->RewItemId[j]; + uint32 id = qinfo->RewardItemId[j]; if (id) { if (!sObjectMgr->GetItemTemplate(id)) { - sLog->outErrorDb("Quest %u has `RewItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.", + sLog->outErrorDb("Quest %u has `RewardItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.", qinfo->GetQuestId(), j+1, id, id); - qinfo->RewItemId[j] = 0; // no changes, quest will not reward this item + qinfo->RewardItemId[j] = 0; // no changes, quest will not reward this item } - if (!qinfo->RewItemCount[j]) + if (!qinfo->RewardItemIdCount[j]) { - sLog->outErrorDb("Quest %u has `RewItemId%d` = %u but `RewItemCount%d` = 0, quest will not reward this item.", + sLog->outErrorDb("Quest %u has `RewardItemId%d` = %u but `RewardItemIdCount%d` = 0, quest will not reward this item.", qinfo->GetQuestId(), j+1, id, j+1); // no changes } } - else if (qinfo->RewItemCount[j]>0) + else if (qinfo->RewardItemIdCount[j]>0) { - sLog->outErrorDb("Quest %u has `RewItemId%d` = 0 but `RewItemCount%d` = %u.", - qinfo->GetQuestId(), j+1, j+1, qinfo->RewItemCount[j]); + sLog->outErrorDb("Quest %u has `RewardItemId%d` = 0 but `RewardItemIdCount%d` = %u.", + qinfo->GetQuestId(), j+1, j+1, qinfo->RewardItemIdCount[j]); // no changes, quest ignore this data } } for (uint8 j = 0; j < QUEST_REPUTATIONS_COUNT; ++j) { - if (qinfo->RewRepFaction[j]) + if (qinfo->RewardFactionId[j]) { - if (abs(qinfo->RewRepValueId[j]) > 9) + if (abs(qinfo->RewardFactionValueId[j]) > 9) { - sLog->outErrorDb("Quest %u has RewRepValueId%d = %i. That is outside the range of valid values (-9 to 9).", qinfo->GetQuestId(), j+1, qinfo->RewRepValueId[j]); + sLog->outErrorDb("Quest %u has RewardFactionValueId%d = %i. That is outside the range of valid values (-9 to 9).", qinfo->GetQuestId(), j+1, qinfo->RewardFactionValueId[j]); } - if (!sFactionStore.LookupEntry(qinfo->RewRepFaction[j])) + if (!sFactionStore.LookupEntry(qinfo->RewardFactionId[j])) { - sLog->outErrorDb("Quest %u has `RewRepFaction%d` = %u but raw faction (faction.dbc) %u does not exist, quest will not reward reputation for this faction.", qinfo->GetQuestId(), j+1, qinfo->RewRepFaction[j], qinfo->RewRepFaction[j]); - qinfo->RewRepFaction[j] = 0; // quest will not reward this + sLog->outErrorDb("Quest %u has `RewardFactionId%d` = %u but raw faction (faction.dbc) %u does not exist, quest will not reward reputation for this faction.", qinfo->GetQuestId(), j+1, qinfo->RewardFactionId[j], qinfo->RewardFactionId[j]); + qinfo->RewardFactionId[j] = 0; // quest will not reward this } } - else if (qinfo->RewRepValue[j] != 0) + else if (qinfo->RewardFactionValueIdOverride[j] != 0) { - sLog->outErrorDb("Quest %u has `RewRepFaction%d` = 0 but `RewRepValue%d` = %i.", - qinfo->GetQuestId(), j+1, j+1, qinfo->RewRepValue[j]); + sLog->outErrorDb("Quest %u has `RewardFactionId%d` = 0 but `RewardFactionValueIdOverride%d` = %i.", + qinfo->GetQuestId(), j+1, j+1, qinfo->RewardFactionValueIdOverride[j]); // no changes, quest ignore this data } } - if (qinfo->RewSpell) + if (qinfo->RewardSpell) { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->RewSpell); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->RewardSpell); if (!spellInfo) { - sLog->outErrorDb("Quest %u has `RewSpell` = %u but spell %u does not exist, spell removed as display reward.", - qinfo->GetQuestId(), qinfo->RewSpell, qinfo->RewSpell); - qinfo->RewSpell = 0; // no spell reward will display for this quest + sLog->outErrorDb("Quest %u has `RewardSpell` = %u but spell %u does not exist, spell removed as display reward.", + qinfo->GetQuestId(), qinfo->RewardSpell, qinfo->RewardSpell); + qinfo->RewardSpell = 0; // no spell reward will display for this quest } else if (!SpellMgr::IsSpellValid(spellInfo)) { - sLog->outErrorDb("Quest %u has `RewSpell` = %u but spell %u is broken, quest will not have a spell reward.", - qinfo->GetQuestId(), qinfo->RewSpell, qinfo->RewSpell); - qinfo->RewSpell = 0; // no spell reward will display for this quest + sLog->outErrorDb("Quest %u has `RewardSpell` = %u but spell %u is broken, quest will not have a spell reward.", + qinfo->GetQuestId(), qinfo->RewardSpell, qinfo->RewardSpell); + qinfo->RewardSpell = 0; // no spell reward will display for this quest } - else if (GetTalentSpellCost(qinfo->RewSpell)) + else if (GetTalentSpellCost(qinfo->RewardSpell)) { - sLog->outErrorDb("Quest %u has `RewSpell` = %u but spell %u is talent, quest will not have a spell reward.", - qinfo->GetQuestId(), qinfo->RewSpell, qinfo->RewSpell); - qinfo->RewSpell = 0; // no spell reward will display for this quest + sLog->outErrorDb("Quest %u has `RewardSpell` = %u but spell %u is talent, quest will not have a spell reward.", + qinfo->GetQuestId(), qinfo->RewardSpell, qinfo->RewardSpell); + qinfo->RewardSpell = 0; // no spell reward will display for this quest } } - if (qinfo->RewSpellCast > 0) + if (qinfo->RewardSpellCast > 0) { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->RewSpellCast); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->RewardSpellCast); if (!spellInfo) { - sLog->outErrorDb("Quest %u has `RewSpellCast` = %u but spell %u does not exist, quest will not have a spell reward.", - qinfo->GetQuestId(), qinfo->RewSpellCast, qinfo->RewSpellCast); - qinfo->RewSpellCast = 0; // no spell will be casted on player + sLog->outErrorDb("Quest %u has `RewardSpellCast` = %u but spell %u does not exist, quest will not have a spell reward.", + qinfo->GetQuestId(), qinfo->RewardSpellCast, qinfo->RewardSpellCast); + qinfo->RewardSpellCast = 0; // no spell will be casted on player } else if (!SpellMgr::IsSpellValid(spellInfo)) { - sLog->outErrorDb("Quest %u has `RewSpellCast` = %u but spell %u is broken, quest will not have a spell reward.", - qinfo->GetQuestId(), qinfo->RewSpellCast, qinfo->RewSpellCast); - qinfo->RewSpellCast = 0; // no spell will be casted on player + sLog->outErrorDb("Quest %u has `RewardSpellCast` = %u but spell %u is broken, quest will not have a spell reward.", + qinfo->GetQuestId(), qinfo->RewardSpellCast, qinfo->RewardSpellCast); + qinfo->RewardSpellCast = 0; // no spell will be casted on player } - else if (GetTalentSpellCost(qinfo->RewSpellCast)) + else if (GetTalentSpellCost(qinfo->RewardSpellCast)) { - sLog->outErrorDb("Quest %u has `RewSpell` = %u but spell %u is talent, quest will not have a spell reward.", - qinfo->GetQuestId(), qinfo->RewSpellCast, qinfo->RewSpellCast); - qinfo->RewSpellCast = 0; // no spell will be casted on player + sLog->outErrorDb("Quest %u has `RewardSpell` = %u but spell %u is talent, quest will not have a spell reward.", + qinfo->GetQuestId(), qinfo->RewardSpellCast, qinfo->RewardSpellCast); + qinfo->RewardSpellCast = 0; // no spell will be casted on player } } - if (qinfo->RewMailTemplateId) + if (qinfo->RewardMailTemplateId) { - if (!sMailTemplateStore.LookupEntry(qinfo->RewMailTemplateId)) + if (!sMailTemplateStore.LookupEntry(qinfo->RewardMailTemplateId)) { - sLog->outErrorDb("Quest %u has `RewMailTemplateId` = %u but mail template %u does not exist, quest will not have a mail reward.", - qinfo->GetQuestId(), qinfo->RewMailTemplateId, qinfo->RewMailTemplateId); - qinfo->RewMailTemplateId = 0; // no mail will send to player - qinfo->RewMailDelaySecs = 0; // no mail will send to player + sLog->outErrorDb("Quest %u has `RewardMailTemplateId` = %u but mail template %u does not exist, quest will not have a mail reward.", + qinfo->GetQuestId(), qinfo->RewardMailTemplateId, qinfo->RewardMailTemplateId); + qinfo->RewardMailTemplateId = 0; // no mail will send to player + qinfo->RewardMailDelay = 0; // no mail will send to player } - else if (usedMailTemplates.find(qinfo->RewMailTemplateId) != usedMailTemplates.end()) + else if (usedMailTemplates.find(qinfo->RewardMailTemplateId) != usedMailTemplates.end()) { - std::map::const_iterator used_mt_itr = usedMailTemplates.find(qinfo->RewMailTemplateId); - sLog->outErrorDb("Quest %u has `RewMailTemplateId` = %u but mail template %u already used for quest %u, quest will not have a mail reward.", - qinfo->GetQuestId(), qinfo->RewMailTemplateId, qinfo->RewMailTemplateId, used_mt_itr->second); - qinfo->RewMailTemplateId = 0; // no mail will send to player - qinfo->RewMailDelaySecs = 0; // no mail will send to player + std::map::const_iterator used_mt_itr = usedMailTemplates.find(qinfo->RewardMailTemplateId); + sLog->outErrorDb("Quest %u has `RewardMailTemplateId` = %u but mail template %u already used for quest %u, quest will not have a mail reward.", + qinfo->GetQuestId(), qinfo->RewardMailTemplateId, qinfo->RewardMailTemplateId, used_mt_itr->second); + qinfo->RewardMailTemplateId = 0; // no mail will send to player + qinfo->RewardMailDelay = 0; // no mail will send to player } else - usedMailTemplates[qinfo->RewMailTemplateId] = qinfo->GetQuestId(); + usedMailTemplates[qinfo->RewardMailTemplateId] = qinfo->GetQuestId(); } - if (qinfo->NextQuestInChain) + if (qinfo->NextQuestIdChain) { - QuestMap::iterator qNextItr = mQuestTemplates.find(qinfo->NextQuestInChain); + QuestMap::iterator qNextItr = mQuestTemplates.find(qinfo->NextQuestIdChain); if (qNextItr == mQuestTemplates.end()) { - sLog->outErrorDb("Quest %u has `NextQuestInChain` = %u but quest %u does not exist, quest chain will not work.", - qinfo->GetQuestId(), qinfo->NextQuestInChain, qinfo->NextQuestInChain); - qinfo->NextQuestInChain = 0; + sLog->outErrorDb("Quest %u has `NextQuestIdChain` = %u but quest %u does not exist, quest chain will not work.", + qinfo->GetQuestId(), qinfo->NextQuestIdChain, qinfo->NextQuestIdChain); + qinfo->NextQuestIdChain = 0; } else qNextItr->second->prevChainQuests.push_back(qinfo->GetQuestId()); @@ -4327,7 +4326,7 @@ void ObjectMgr::LoadQuests() mExclusiveQuestGroups.insert(std::pair(qinfo->ExclusiveGroup, qinfo->GetQuestId())); if (qinfo->LimitTime) qinfo->SetFlag(QUEST_TRINITY_FLAGS_TIMED); - if (qinfo->PlayersSlain) + if (qinfo->RequiredPlayerKills) qinfo->SetFlag(QUEST_TRINITY_FLAGS_PLAYER_KILL); } diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 7cd442cd9f9..29bd95a73a3 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -22,128 +22,132 @@ Quest::Quest(Field* questRecord) { - QuestId = questRecord[0].GetUInt32(); - QuestMethod = questRecord[1].GetUInt32(); - ZoneOrSort = questRecord[2].GetInt32(); + Id = questRecord[0].GetUInt32(); + Method = questRecord[1].GetUInt32(); + Level = questRecord[2].GetInt32(); MinLevel = questRecord[3].GetUInt32(); MaxLevel = questRecord[4].GetUInt32(); - QuestLevel = questRecord[5].GetInt32(); + ZoneOrSort = questRecord[5].GetInt32(); Type = questRecord[6].GetUInt32(); - RequiredClasses = questRecord[7].GetUInt32(); - RequiredRaces = questRecord[8].GetUInt32(); - RequiredSkill = questRecord[9].GetUInt32(); - RequiredSkillValue = questRecord[10].GetUInt32(); - RepObjectiveFaction = questRecord[11].GetUInt32(); - RepObjectiveValue = questRecord[12].GetInt32(); - RepObjectiveFaction2 = questRecord[13].GetUInt32(); - RepObjectiveValue2 = questRecord[14].GetInt32(); - RequiredMinRepFaction = questRecord[15].GetUInt32(); - RequiredMinRepValue = questRecord[16].GetInt32(); - RequiredMaxRepFaction = questRecord[17].GetUInt32(); - RequiredMaxRepValue = questRecord[18].GetInt32(); - SuggestedPlayers = questRecord[19].GetUInt32(); - LimitTime = questRecord[20].GetUInt32(); - QuestFlags = questRecord[21].GetUInt32(); - uint32 SpecialFlags = questRecord[22].GetUInt16(); - CharTitleId = questRecord[23].GetUInt32(); - PlayersSlain = questRecord[24].GetUInt32(); - BonusTalents = questRecord[25].GetUInt32(); - RewArenaPoints = questRecord[26].GetInt32(); - PrevQuestId = questRecord[27].GetInt32(); - NextQuestId = questRecord[28].GetInt32(); - ExclusiveGroup = questRecord[29].GetInt32(); - NextQuestInChain = questRecord[30].GetUInt32(); - XPId = questRecord[31].GetUInt32(); - SrcItemId = questRecord[32].GetUInt32(); - SrcItemCount = questRecord[33].GetUInt32(); - SrcSpell = questRecord[34].GetUInt32(); - Title = questRecord[35].GetString(); - Details = questRecord[36].GetString(); - Objectives = questRecord[37].GetString(); - OfferRewardText = questRecord[38].GetString(); - RequestItemsText = questRecord[39].GetString(); - EndText = questRecord[40].GetString(); - CompletedText = questRecord[41].GetString(); + SuggestedPlayers = questRecord[7].GetUInt32(); + LimitTime = questRecord[8].GetUInt32(); + RequiredClasses = questRecord[9].GetUInt32(); + RequiredRaces = questRecord[10].GetUInt32(); + RequiredSkillId = questRecord[11].GetUInt32(); + RequiredSkillPoints = questRecord[12].GetUInt32(); + RequiredFactionId1 = questRecord[13].GetUInt32(); + RequiredFactionId2 = questRecord[14].GetUInt32(); + RequiredFactionValue1 = questRecord[15].GetInt32(); + RequiredFactionValue2 = questRecord[16].GetInt32(); + RequiredMinRepFaction = questRecord[17].GetUInt32(); + RequiredMaxRepFaction = questRecord[18].GetUInt32(); + RequiredMinRepValue = questRecord[19].GetInt32(); + RequiredMaxRepValue = questRecord[20].GetInt32(); + PrevQuestId = questRecord[21].GetInt32(); + NextQuestId = questRecord[22].GetInt32(); + ExclusiveGroup = questRecord[23].GetInt32(); + NextQuestIdChain = questRecord[24].GetUInt32(); + RewardXPId = questRecord[25].GetUInt32(); + RewardOrRequiredMoney = questRecord[26].GetInt32(); + RewardMoneyMaxLevel = questRecord[27].GetUInt32(); + RewardSpell = questRecord[28].GetUInt32(); + RewardSpellCast = questRecord[29].GetInt32(); + RewardHonor = questRecord[30].GetUInt32(); + RewardHonorMultiplier = questRecord[31].GetFloat(); + RewardMailTemplateId = questRecord[32].GetUInt32(); + RewardMailDelay = questRecord[33].GetUInt32(); + SourceItemId = questRecord[34].GetUInt32(); + SourceItemIdCount = questRecord[35].GetUInt32(); + SourceSpellid = questRecord[36].GetUInt32(); + Flags = questRecord[37].GetUInt32(); + uint32 SpecialFlags = questRecord[38].GetUInt16(); + RewardTitleId = questRecord[39].GetUInt32(); + RequiredPlayerKills = questRecord[40].GetUInt32(); + RewardTalents = questRecord[41].GetUInt32(); + RewardArenaPoints = questRecord[42].GetInt32(); - for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - ObjectiveText[i] = questRecord[42+i].GetString(); + for (int i = 0; i < QUEST_REWARDS_COUNT; ++i) + RewardItemId[i] = questRecord[43+i].GetUInt32(); - for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) - ReqItemId[i] = questRecord[46+i].GetUInt32(); + for (int i = 0; i < QUEST_REWARDS_COUNT; ++i) + RewardItemIdCount[i] = questRecord[47+i].GetUInt32(); - for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) - ReqItemCount[i] = questRecord[52+i].GetUInt32(); + for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) + RewardChoiceItemId[i] = questRecord[51+i].GetUInt32(); - for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i) - ReqSourceId[i] = questRecord[58+i].GetUInt32(); + for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) + RewardChoiceItemCount[i] = questRecord[57+i].GetUInt32(); + + for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) + RewardFactionId[i] = questRecord[63+i].GetUInt32(); - for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i) - ReqSourceCount[i] = questRecord[62+i].GetUInt32(); + for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) + RewardFactionValueId[i] = questRecord[68+i].GetInt32(); - for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - ReqCreatureOrGOId[i] = questRecord[66+i].GetInt32(); + for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) + RewardFactionValueIdOverride[i] = questRecord[73+i].GetInt32(); + + PointMapId = questRecord[78].GetUInt32(); + PointX = questRecord[79].GetFloat(); + PointY = questRecord[80].GetFloat(); + PointOption = questRecord[81].GetUInt32(); + Title = questRecord[82].GetString(); + Objectives = questRecord[83].GetString(); + Details = questRecord[84].GetString(); + EndText = questRecord[85].GetString(); + OfferRewardText = questRecord[86].GetString(); + RequestItemsText = questRecord[87].GetString(); + CompletedText = questRecord[88].GetString(); for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - ReqCreatureOrGOCount[i] = questRecord[70+i].GetUInt32(); + RequiredNpcOrGo[i] = questRecord[89+i].GetInt32(); for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - ReqSpell[i] = questRecord[74+i].GetUInt32(); + RequiredNpcOrGoCount[i] = questRecord[93+i].GetUInt32(); - for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) - RewChoiceItemId[i] = questRecord[78+i].GetUInt32(); + for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i) + RequiredSourceItemid[i] = questRecord[97+i].GetUInt32(); - for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) - RewChoiceItemCount[i] = questRecord[84+i].GetUInt32(); + for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i) + RequiredSourceItemId[i] = questRecord[101+i].GetUInt32(); - for (int i = 0; i < QUEST_REWARDS_COUNT; ++i) - RewItemId[i] = questRecord[90+i].GetUInt32(); + for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) + RequiredItemId[i] = questRecord[105+i].GetUInt32(); - for (int i = 0; i < QUEST_REWARDS_COUNT; ++i) - RewItemCount[i] = questRecord[94+i].GetUInt32(); + for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) + RequiredItemCount[i] = questRecord[111+i].GetUInt32(); - for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - RewRepFaction[i] = questRecord[98+i].GetUInt32(); + for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) + RequiredSpellCast[i] = questRecord[117+i].GetUInt32(); - for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - RewRepValueId[i] = questRecord[103+i].GetInt32(); + // int8 Unknown0 = questRecord[121].GetUInt32(); - for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - RewRepValue[i] = questRecord[108+i].GetInt32(); - - RewHonorAddition = questRecord[113].GetUInt32(); - RewHonorMultiplier = questRecord[114].GetFloat(); - RewOrReqMoney = questRecord[115].GetInt32(); - RewMoneyMaxLevel = questRecord[116].GetUInt32(); - RewSpell = questRecord[117].GetUInt32(); - RewSpellCast = questRecord[118].GetInt32(); - RewMailTemplateId = questRecord[119].GetUInt32(); - RewMailDelaySecs = questRecord[120].GetUInt32(); - PointMapId = questRecord[121].GetUInt32(); - PointX = questRecord[122].GetFloat(); - PointY = questRecord[123].GetFloat(); - PointOpt = questRecord[124].GetUInt32(); + for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) + ObjectiveText[i] = questRecord[122+i].GetString(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - DetailsEmote[i] = questRecord[125+i].GetUInt32(); + DetailsEmote[i] = questRecord[126+i].GetUInt32(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - DetailsEmoteDelay[i] = questRecord[129+i].GetUInt32(); + DetailsEmoteDelay[i] = questRecord[130+i].GetUInt32(); - IncompleteEmote = questRecord[133].GetUInt32(); - CompleteEmote = questRecord[134].GetUInt32(); + EmoteOnIncomplete = questRecord[134].GetUInt32(); + EmoteOnComplete = questRecord[135].GetUInt32(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - OfferRewardEmote[i] = questRecord[135+i].GetInt32(); + OfferRewardEmote[i] = questRecord[136+i].GetInt32(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - OfferRewardEmoteDelay[i] = questRecord[139+i].GetInt32(); + OfferRewardEmoteDelay[i] = questRecord[140+i].GetInt32(); + + StartScript = questRecord[144].GetUInt32(); + CompleteScript = questRecord[145].GetUInt32(); - QuestStartScript = questRecord[143].GetUInt32(); - QuestCompleteScript = questRecord[144].GetUInt32(); + // int32 WDBVerified = questRecord[146].GetInt32(); - QuestFlags |= SpecialFlags << 20; - if (QuestFlags & QUEST_TRINITY_FLAGS_AUTO_ACCEPT) - QuestFlags |= QUEST_FLAGS_AUTO_ACCEPT; + Flags |= SpecialFlags << 20; + if (Flags & QUEST_TRINITY_FLAGS_AUTO_ACCEPT) + Flags |= QUEST_FLAGS_AUTO_ACCEPT; m_reqitemscount = 0; m_reqCreatureOrGOcount = 0; @@ -151,19 +155,19 @@ Quest::Quest(Field* questRecord) m_rewchoiceitemscount = 0; for (int i=0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) - if (ReqItemId[i]) + if (RequiredItemId[i]) ++m_reqitemscount; for (int i=0; i < QUEST_OBJECTIVES_COUNT; ++i) - if (ReqCreatureOrGOId[i]) + if (RequiredNpcOrGo[i]) ++m_reqCreatureOrGOcount; for (int i=0; i < QUEST_REWARDS_COUNT; ++i) - if (RewItemId[i]) + if (RewardItemId[i]) ++m_rewitemscount; for (int i=0; i < QUEST_REWARD_CHOICES_COUNT; ++i) - if (RewChoiceItemId[i]) + if (RewardChoiceItemId[i]) ++m_rewchoiceitemscount; } @@ -171,7 +175,7 @@ uint32 Quest::XPValue(Player* player) const { if (player) { - int32 quest_level = (QuestLevel == -1 ? player->getLevel() : QuestLevel); + int32 quest_level = (Level == -1 ? player->getLevel() : Level); const QuestXPEntry* xpentry = sQuestXPStore.LookupEntry(quest_level); if (!xpentry) return 0; @@ -182,7 +186,7 @@ uint32 Quest::XPValue(Player* player) const else if (diffFactor > 10) diffFactor = 10; - uint32 xp = diffFactor * xpentry->Exp[XPId] / 10; + uint32 xp = diffFactor * xpentry->Exp[RewardXPId] / 10; if (xp <= 100) xp = 5 * ((xp + 2) / 5); else if (xp <= 500) @@ -200,15 +204,15 @@ uint32 Quest::XPValue(Player* player) const int32 Quest::GetRewOrReqMoney() const { - if (RewOrReqMoney <= 0) - return RewOrReqMoney; + if (RewardOrRequiredMoney <= 0) + return RewardOrRequiredMoney; - return int32(RewOrReqMoney * sWorld->getRate(RATE_DROP_MONEY)); + return int32(RewardOrRequiredMoney * sWorld->getRate(RATE_DROP_MONEY)); } bool Quest::IsAutoComplete() const { - return QuestMethod == 0 || HasFlag(QUEST_FLAGS_AUTOCOMPLETE); + return Method == 0 || HasFlag(QUEST_FLAGS_AUTOCOMPLETE); } bool Quest::IsAllowedInRaid() const diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index 895b87f4465..fc9a432a11b 100755 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -141,7 +141,7 @@ enum __QuestFlags QUEST_FLAGS_UNAVAILABLE = 0x00004000, // Used on quests that are not generically available QUEST_FLAGS_WEEKLY = 0x00008000, QUEST_FLAGS_AUTOCOMPLETE = 0x00010000, // auto complete - QUEST_FLAGS_SPECIAL_ITEM = 0x00020000, // has something to do with ReqItemId and SrcItemId + QUEST_FLAGS_SPECIAL_ITEM = 0x00020000, // has something to do with RequiredItemId and SourceItemId QUEST_FLAGS_OBJ_TEXT = 0x00040000, // use Objective text as Complete text QUEST_FLAGS_AUTO_ACCEPT = 0x00080000, // The client recognizes this flag as auto-accept. However, NONE of the current quests (3.3.5a) have this flag. Maybe blizz used to use it, or will use it in the future. @@ -185,25 +185,25 @@ class Quest Quest(Field* questRecord); uint32 XPValue(Player* player) const; - bool HasFlag(uint32 flag) const { return (QuestFlags & flag) != 0; } - void SetFlag(uint32 flag) { QuestFlags |= flag; } + bool HasFlag(uint32 flag) const { return (Flags & flag) != 0; } + void SetFlag(uint32 flag) { Flags |= flag; } // table data accessors: - uint32 GetQuestId() const { return QuestId; } - uint32 GetQuestMethod() const { return QuestMethod; } + uint32 GetQuestId() const { return Id; } + uint32 GetQuestMethod() const { return Method; } int32 GetZoneOrSort() const { return ZoneOrSort; } uint32 GetMinLevel() const { return MinLevel; } uint32 GetMaxLevel() const { return MaxLevel; } - uint32 GetQuestLevel() const { return QuestLevel; } + uint32 GetQuestLevel() const { return Level; } uint32 GetType() const { return Type; } uint32 GetRequiredClasses() const { return RequiredClasses; } uint32 GetRequiredRaces() const { return RequiredRaces; } - uint32 GetRequiredSkill() const { return RequiredSkill; } - uint32 GetRequiredSkillValue() const { return RequiredSkillValue; } - uint32 GetRepObjectiveFaction() const { return RepObjectiveFaction; } - int32 GetRepObjectiveValue() const { return RepObjectiveValue; } - uint32 GetRepObjectiveFaction2() const { return RepObjectiveFaction2; } - int32 GetRepObjectiveValue2() const { return RepObjectiveValue2; } + uint32 GetRequiredSkill() const { return RequiredSkillId; } + uint32 GetRequiredSkillValue() const { return RequiredSkillPoints; } + uint32 GetRepObjectiveFaction() const { return RequiredFactionId1; } + int32 GetRepObjectiveValue() const { return RequiredFactionValue1; } + uint32 GetRepObjectiveFaction2() const { return RequiredFactionId2; } + int32 GetRepObjectiveValue2() const { return RequiredFactionValue2; } uint32 GetRequiredMinRepFaction() const { return RequiredMinRepFaction; } int32 GetRequiredMinRepValue() const { return RequiredMinRepValue; } uint32 GetRequiredMaxRepFaction() const { return RequiredMaxRepFaction; } @@ -213,15 +213,15 @@ class Quest int32 GetPrevQuestId() const { return PrevQuestId; } int32 GetNextQuestId() const { return NextQuestId; } int32 GetExclusiveGroup() const { return ExclusiveGroup; } - uint32 GetNextQuestInChain() const { return NextQuestInChain; } - uint32 GetCharTitleId() const { return CharTitleId; } - uint32 GetPlayersSlain() const { return PlayersSlain; } - uint32 GetBonusTalents() const { return BonusTalents; } - int32 GetRewArenaPoints() const {return RewArenaPoints; } - uint32 GetXPId() const { return XPId; } - uint32 GetSrcItemId() const { return SrcItemId; } - uint32 GetSrcItemCount() const { return SrcItemCount; } - uint32 GetSrcSpell() const { return SrcSpell; } + uint32 GetNextQuestInChain() const { return NextQuestIdChain; } + uint32 GetCharTitleId() const { return RewardTitleId; } + uint32 GetPlayersSlain() const { return RequiredPlayerKills; } + uint32 GetBonusTalents() const { return RewardTalents; } + int32 GetRewArenaPoints() const {return RewardArenaPoints; } + uint32 GetXPId() const { return RewardXPId; } + uint32 GetSrcItemId() const { return SourceItemId; } + uint32 GetSrcItemCount() const { return SourceItemIdCount; } + uint32 GetSrcSpell() const { return SourceSpellid; } std::string GetTitle() const { return Title; } std::string GetDetails() const { return Details; } std::string GetObjectives() const { return Objectives; } @@ -230,50 +230,50 @@ class Quest std::string GetEndText() const { return EndText; } std::string GetCompletedText() const { return CompletedText; } int32 GetRewOrReqMoney() const; - uint32 GetRewHonorAddition() const { return RewHonorAddition; } - float GetRewHonorMultiplier() const { return RewHonorMultiplier; } - uint32 GetRewMoneyMaxLevel() const { return RewMoneyMaxLevel; } + uint32 GetRewHonorAddition() const { return RewardHonor; } + float GetRewHonorMultiplier() const { return RewardHonorMultiplier; } + uint32 GetRewMoneyMaxLevel() const { return RewardMoneyMaxLevel; } // use in XP calculation at client - uint32 GetRewSpell() const { return RewSpell; } - int32 GetRewSpellCast() const { return RewSpellCast; } - uint32 GetRewMailTemplateId() const { return RewMailTemplateId; } - uint32 GetRewMailDelaySecs() const { return RewMailDelaySecs; } + uint32 GetRewSpell() const { return RewardSpell; } + int32 GetRewSpellCast() const { return RewardSpellCast; } + uint32 GetRewMailTemplateId() const { return RewardMailTemplateId; } + uint32 GetRewMailDelaySecs() const { return RewardMailDelay; } uint32 GetPointMapId() const { return PointMapId; } float GetPointX() const { return PointX; } float GetPointY() const { return PointY; } - uint32 GetPointOpt() const { return PointOpt; } - uint32 GetIncompleteEmote() const { return IncompleteEmote; } - uint32 GetCompleteEmote() const { return CompleteEmote; } - uint32 GetQuestStartScript() const { return QuestStartScript; } - uint32 GetQuestCompleteScript() const { return QuestCompleteScript; } - bool IsRepeatable() const { return QuestFlags & QUEST_TRINITY_FLAGS_REPEATABLE; } + uint32 GetPointOpt() const { return PointOption; } + uint32 GetIncompleteEmote() const { return EmoteOnIncomplete; } + uint32 GetCompleteEmote() const { return EmoteOnComplete; } + uint32 GetQuestStartScript() const { return StartScript; } + uint32 GetQuestCompleteScript() const { return CompleteScript; } + bool IsRepeatable() const { return Flags & QUEST_TRINITY_FLAGS_REPEATABLE; } bool IsAutoComplete() const; - uint32 GetFlags() const { return QuestFlags; } - bool IsDaily() const { return QuestFlags & QUEST_FLAGS_DAILY; } - bool IsWeekly() const { return QuestFlags & QUEST_FLAGS_WEEKLY; } - bool IsDailyOrWeekly() const { return QuestFlags & (QUEST_FLAGS_DAILY | QUEST_FLAGS_WEEKLY); } - bool IsAutoAccept() const { return QuestFlags & QUEST_FLAGS_AUTO_ACCEPT; } + uint32 GetFlags() const { return Flags; } + bool IsDaily() const { return Flags & QUEST_FLAGS_DAILY; } + bool IsWeekly() const { return Flags & QUEST_FLAGS_WEEKLY; } + bool IsDailyOrWeekly() const { return Flags & (QUEST_FLAGS_DAILY | QUEST_FLAGS_WEEKLY); } + bool IsAutoAccept() const { return Flags & QUEST_FLAGS_AUTO_ACCEPT; } bool IsRaidQuest() const { return Type == QUEST_TYPE_RAID || Type == QUEST_TYPE_RAID_10 || Type == QUEST_TYPE_RAID_25; } bool IsAllowedInRaid() const; - bool IsDFQuest() const { return QuestFlags & QUEST_TRINITY_FLAGS_DF_QUEST; } + bool IsDFQuest() const { return Flags & QUEST_TRINITY_FLAGS_DF_QUEST; } uint32 CalculateHonorGain(uint8 level) const; // multiple values std::string ObjectiveText[QUEST_OBJECTIVES_COUNT]; - uint32 ReqItemId[QUEST_ITEM_OBJECTIVES_COUNT]; - uint32 ReqItemCount[QUEST_ITEM_OBJECTIVES_COUNT]; - uint32 ReqSourceId[QUEST_SOURCE_ITEM_IDS_COUNT]; - uint32 ReqSourceCount[QUEST_SOURCE_ITEM_IDS_COUNT]; - int32 ReqCreatureOrGOId[QUEST_OBJECTIVES_COUNT]; // >0 Creature <0 Gameobject - uint32 ReqCreatureOrGOCount[QUEST_OBJECTIVES_COUNT]; - uint32 ReqSpell[QUEST_OBJECTIVES_COUNT]; - uint32 RewChoiceItemId[QUEST_REWARD_CHOICES_COUNT]; - uint32 RewChoiceItemCount[QUEST_REWARD_CHOICES_COUNT]; - uint32 RewItemId[QUEST_REWARDS_COUNT]; - uint32 RewItemCount[QUEST_REWARDS_COUNT]; - uint32 RewRepFaction[QUEST_REPUTATIONS_COUNT]; - int32 RewRepValueId[QUEST_REPUTATIONS_COUNT]; - int32 RewRepValue[QUEST_REPUTATIONS_COUNT]; + uint32 RequiredItemId[QUEST_ITEM_OBJECTIVES_COUNT]; + uint32 RequiredItemCount[QUEST_ITEM_OBJECTIVES_COUNT]; + uint32 RequiredSourceItemid[QUEST_SOURCE_ITEM_IDS_COUNT]; + uint32 RequiredSourceItemId[QUEST_SOURCE_ITEM_IDS_COUNT]; + int32 RequiredNpcOrGo[QUEST_OBJECTIVES_COUNT]; // >0 Creature <0 Gameobject + uint32 RequiredNpcOrGoCount[QUEST_OBJECTIVES_COUNT]; + uint32 RequiredSpellCast[QUEST_OBJECTIVES_COUNT]; + uint32 RewardChoiceItemId[QUEST_REWARD_CHOICES_COUNT]; + uint32 RewardChoiceItemCount[QUEST_REWARD_CHOICES_COUNT]; + uint32 RewardItemId[QUEST_REWARDS_COUNT]; + uint32 RewardItemIdCount[QUEST_REWARDS_COUNT]; + uint32 RewardFactionId[QUEST_REPUTATIONS_COUNT]; + int32 RewardFactionValueId[QUEST_REPUTATIONS_COUNT]; + int32 RewardFactionValueIdOverride[QUEST_REPUTATIONS_COUNT]; uint32 DetailsEmote[QUEST_EMOTE_COUNT]; uint32 DetailsEmoteDelay[QUEST_EMOTE_COUNT]; uint32 OfferRewardEmote[QUEST_EMOTE_COUNT]; @@ -298,40 +298,40 @@ class Quest // table data protected: - uint32 QuestId; - uint32 QuestMethod; + uint32 Id; + uint32 Method; int32 ZoneOrSort; uint32 MinLevel; uint32 MaxLevel; - int32 QuestLevel; + int32 Level; uint32 Type; uint32 RequiredClasses; uint32 RequiredRaces; - uint32 RequiredSkill; - uint32 RequiredSkillValue; - uint32 RepObjectiveFaction; - int32 RepObjectiveValue; - uint32 RepObjectiveFaction2; - int32 RepObjectiveValue2; + uint32 RequiredSkillId; + uint32 RequiredSkillPoints; + uint32 RequiredFactionId1; + int32 RequiredFactionValue1; + uint32 RequiredFactionId2; + int32 RequiredFactionValue2; uint32 RequiredMinRepFaction; int32 RequiredMinRepValue; uint32 RequiredMaxRepFaction; int32 RequiredMaxRepValue; uint32 SuggestedPlayers; uint32 LimitTime; - uint32 QuestFlags; - uint32 CharTitleId; - uint32 PlayersSlain; - uint32 BonusTalents; - int32 RewArenaPoints; + uint32 Flags; + uint32 RewardTitleId; + uint32 RequiredPlayerKills; + uint32 RewardTalents; + int32 RewardArenaPoints; int32 PrevQuestId; int32 NextQuestId; int32 ExclusiveGroup; - uint32 NextQuestInChain; - uint32 XPId; - uint32 SrcItemId; - uint32 SrcItemCount; - uint32 SrcSpell; + uint32 NextQuestIdChain; + uint32 RewardXPId; + uint32 SourceItemId; + uint32 SourceItemIdCount; + uint32 SourceSpellid; std::string Title; std::string Details; std::string Objectives; @@ -339,22 +339,22 @@ class Quest std::string RequestItemsText; std::string EndText; std::string CompletedText; - uint32 RewHonorAddition; - float RewHonorMultiplier; - int32 RewOrReqMoney; - uint32 RewMoneyMaxLevel; - uint32 RewSpell; - int32 RewSpellCast; - uint32 RewMailTemplateId; - uint32 RewMailDelaySecs; + uint32 RewardHonor; + float RewardHonorMultiplier; + int32 RewardOrRequiredMoney; + uint32 RewardMoneyMaxLevel; + uint32 RewardSpell; + int32 RewardSpellCast; + uint32 RewardMailTemplateId; + uint32 RewardMailDelay; uint32 PointMapId; float PointX; float PointY; - uint32 PointOpt; - uint32 IncompleteEmote; - uint32 CompleteEmote; - uint32 QuestStartScript; - uint32 QuestCompleteScript; + uint32 PointOption; + uint32 EmoteOnIncomplete; + uint32 EmoteOnComplete; + uint32 StartScript; + uint32 CompleteScript; }; struct QuestStatusData diff --git a/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp b/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp index 1ff1181bc6a..3df59b9bba1 100755 --- a/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp @@ -205,14 +205,14 @@ void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recv_data ItemTemplate const* iProto = NULL; for (uint8 i = 0; i < QUEST_REWARDS_COUNT; ++i) { - if (!qRew->RewItemId[i]) + if (!qRew->RewardItemId[i]) continue; - iProto = sObjectMgr->GetItemTemplate(qRew->RewItemId[i]); + iProto = sObjectMgr->GetItemTemplate(qRew->RewardItemId[i]); - data << uint32(qRew->RewItemId[i]); + data << uint32(qRew->RewardItemId[i]); data << uint32(iProto ? iProto->DisplayInfoID : 0); - data << uint32(qRew->RewItemCount[i]); + data << uint32(qRew->RewardItemIdCount[i]); } } } @@ -495,14 +495,14 @@ void WorldSession::SendLfgPlayerReward(uint32 rdungeonEntry, uint32 sdungeonEntr ItemTemplate const* iProto = NULL; for (uint8 i = 0; i < QUEST_REWARDS_COUNT; ++i) { - if (!qRew->RewItemId[i]) + if (!qRew->RewardItemId[i]) continue; - iProto = sObjectMgr->GetItemTemplate(qRew->RewItemId[i]); + iProto = sObjectMgr->GetItemTemplate(qRew->RewardItemId[i]); - data << uint32(qRew->RewItemId[i]); + data << uint32(qRew->RewardItemId[i]); data << uint32(iProto ? iProto->DisplayInfoID : 0); - data << uint32(qRew->RewItemCount[i]); + data << uint32(qRew->RewardItemIdCount[i]); } } SendPacket(&data); diff --git a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp b/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp index fbd6c23d20f..e0bcadc89e9 100755 --- a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp @@ -200,7 +200,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data) bool destroyItem = true; for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) { - if ((qInfo->ReqItemId[i] == ((Item*)pObject)->GetEntry()) && (((Item*)pObject)->GetTemplate()->MaxCount > 0)) + if ((qInfo->RequiredItemId[i] == ((Item*)pObject)->GetEntry()) && (((Item*)pObject)->GetTemplate()->MaxCount > 0)) { destroyItem = false; break; diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp index b1a3f55314c..3d437e473f7 100644 --- a/src/server/scripts/Commands/cs_quest.cpp +++ b/src/server/scripts/Commands/cs_quest.cpp @@ -176,8 +176,8 @@ public: // Add quest items for quests that require items for (uint8 x = 0; x < QUEST_ITEM_OBJECTIVES_COUNT; ++x) { - uint32 id = quest->ReqItemId[x]; - uint32 count = quest->ReqItemCount[x]; + uint32 id = quest->RequiredItemId[x]; + uint32 count = quest->RequiredItemCount[x]; if (!id || !count) continue; @@ -195,10 +195,10 @@ public: // All creature/GO slain/casted (not required, but otherwise it will display "Creature slain 0/10") for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) { - int32 creature = quest->ReqCreatureOrGOId[i]; - uint32 creaturecount = quest->ReqCreatureOrGOCount[i]; + int32 creature = quest->RequiredNpcOrGo[i]; + uint32 creaturecount = quest->RequiredNpcOrGoCount[i]; - if (uint32 spell_id = quest->ReqSpell[i]) + if (uint32 spell_id = quest->RequiredSpellCast[i]) { for (uint16 z = 0; z < creaturecount; ++z) player->CastedCreatureOrGO(creature, 0, spell_id); diff --git a/src/server/scripts/Northrend/borean_tundra.cpp b/src/server/scripts/Northrend/borean_tundra.cpp index 9c40fbb3f82..96f1cb49b84 100644 --- a/src/server/scripts/Northrend/borean_tundra.cpp +++ b/src/server/scripts/Northrend/borean_tundra.cpp @@ -2125,7 +2125,7 @@ public: { Quest const* qInfo = sObjectMgr->GetQuestTemplate(QUEST_YOU_RE_NOT_SO_BIG_NOW); if (qInfo) - CAST_PLR(killer)->KilledMonsterCredit(qInfo->ReqCreatureOrGOId[0], 0); + CAST_PLR(killer)->KilledMonsterCredit(qInfo->RequiredNpcOrGo[0], 0); } } }; diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index f83b728ee01..3bb969977b6 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -1009,7 +1009,7 @@ public: if (qInfo) { //TODO: prisoner should help player for a short period of time - player->KilledMonsterCredit(qInfo->ReqCreatureOrGOId[0], 0); + player->KilledMonsterCredit(qInfo->RequiredNpcOrGo[0], 0); pPrisoner->DisappearAndDie(); } return true; -- cgit v1.2.3 From 711858c43bdf58fe309a2a23cfc674bb1bbf894f Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 26 Nov 2011 14:49:15 +0000 Subject: Core/Quests: Update `quest_template` and SMSG_QUEST_QUERY_RESPONSE TODO: - Validate SkillId and reward it - Validate Currency, add it to the requires and reward it (after being able to read currency dbc) - Update other quest related opcodes --- sql/updates/world/2011_11_24_01_world_command.sql | 2 - .../2011_11_24_02_world_player_xp_for_level.sql | 7 - .../2011_11_25_02_world_item_script_names.sql | 17 -- .../world/2011_11_25_02_world_item_template.sql | 48 ----- .../2011_11_25_02_world_item_template_addon.sql | 38 ---- .../world/4.x/2011_11_24_01_world_command.sql | 2 + .../2011_11_24_02_world_player_xp_for_level.sql | 7 + .../4.x/2011_11_25_02_world_item_script_names.sql | 17 ++ .../4.x/2011_11_25_02_world_item_template.sql | 48 +++++ .../2011_11_25_02_world_item_template_addon.sql | 38 ++++ .../4.x/2011_12_26_02_world_quest_template.sql | 31 +++ src/server/game/Entities/Creature/GossipDef.cpp | 46 ++++- src/server/game/Entities/Player/Player.cpp | 16 +- src/server/game/Globals/ObjectMgr.cpp | 209 ++++++++++++++++++--- src/server/game/Quests/QuestDef.cpp | 134 ++++++++----- src/server/game/Quests/QuestDef.h | 62 ++++-- 16 files changed, 512 insertions(+), 210 deletions(-) delete mode 100644 sql/updates/world/2011_11_24_01_world_command.sql delete mode 100644 sql/updates/world/2011_11_24_02_world_player_xp_for_level.sql delete mode 100644 sql/updates/world/2011_11_25_02_world_item_script_names.sql delete mode 100644 sql/updates/world/2011_11_25_02_world_item_template.sql delete mode 100644 sql/updates/world/2011_11_25_02_world_item_template_addon.sql create mode 100644 sql/updates/world/4.x/2011_11_24_01_world_command.sql create mode 100644 sql/updates/world/4.x/2011_11_24_02_world_player_xp_for_level.sql create mode 100644 sql/updates/world/4.x/2011_11_25_02_world_item_script_names.sql create mode 100644 sql/updates/world/4.x/2011_11_25_02_world_item_template.sql create mode 100644 sql/updates/world/4.x/2011_11_25_02_world_item_template_addon.sql create mode 100644 sql/updates/world/4.x/2011_12_26_02_world_quest_template.sql (limited to 'src/server/game/Quests/QuestDef.cpp') diff --git a/sql/updates/world/2011_11_24_01_world_command.sql b/sql/updates/world/2011_11_24_01_world_command.sql deleted file mode 100644 index 849a7538621..00000000000 --- a/sql/updates/world/2011_11_24_01_world_command.sql +++ /dev/null @@ -1,2 +0,0 @@ -UPDATE `command` SET `help`='Syntax: .account set addon [$account] #addon\n\nSet user (possible targeted) expansion addon level allowed. Addon values: 0 - normal, 1 - tbc, 2 - wotlk, 3 - cata.' WHERE `name`='account set addon'; -UPDATE `command` SET `help`='Syntax: .account addon #addon\nSet expansion addon level allowed. Addon values: 0 - normal, 1 - tbc, 2 - wotlk, 3 - cata.' WHERE `name`='account addon'; diff --git a/sql/updates/world/2011_11_24_02_world_player_xp_for_level.sql b/sql/updates/world/2011_11_24_02_world_player_xp_for_level.sql deleted file mode 100644 index d108b01824d..00000000000 --- a/sql/updates/world/2011_11_24_02_world_player_xp_for_level.sql +++ /dev/null @@ -1,7 +0,0 @@ -DELETE FROM `player_xp_for_level` WHERE `lvl` BETWEEN 80 AND 84; -INSERT INTO `player_xp_for_level` (`lvl`, `xp_for_next_level`) VALUES -(80, 1686300), -(81, 2121500), -(82, 4004000), -(83, 5203400), -(84, 9165100); diff --git a/sql/updates/world/2011_11_25_02_world_item_script_names.sql b/sql/updates/world/2011_11_25_02_world_item_script_names.sql deleted file mode 100644 index aaf843b91ae..00000000000 --- a/sql/updates/world/2011_11_25_02_world_item_script_names.sql +++ /dev/null @@ -1,17 +0,0 @@ -DROP TABLE IF EXISTS `item_script_names`; -CREATE TABLE `item_script_names` ( -`Id` int(10) unsigned not null, -`ScriptName` varchar(64) not null, -PRIMARY KEY(`Id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; - -INSERT INTO `item_script_names` -SELECT -`item_template`.`entry` AS `Id`, -`item_template`.`ScriptName` AS `ScriptName` -FROM -`item_template` -WHERE -length(`item_template`.`ScriptName`)>0; - -ALTER TABLE `item_template` DROP `ScriptName`; diff --git a/sql/updates/world/2011_11_25_02_world_item_template.sql b/sql/updates/world/2011_11_25_02_world_item_template.sql deleted file mode 100644 index 8a047ed9d11..00000000000 --- a/sql/updates/world/2011_11_25_02_world_item_template.sql +++ /dev/null @@ -1,48 +0,0 @@ -ALTER TABLE `item_template` - ADD `stat_unk1_1` int(11) not null default 0 AFTER `stat_value1`, - ADD `stat_unk2_1` int(11) not null default 0 AFTER `stat_unk1_1`, - ADD `stat_unk1_2` int(11) not null default 0 AFTER `stat_value2`, - ADD `stat_unk2_2` int(11) not null default 0 AFTER `stat_unk1_2`, - ADD `stat_unk1_3` int(11) not null default 0 AFTER `stat_value3`, - ADD `stat_unk2_3` int(11) not null default 0 AFTER `stat_unk1_3`, - ADD `stat_unk1_4` int(11) not null default 0 AFTER `stat_value4`, - ADD `stat_unk2_4` int(11) not null default 0 AFTER `stat_unk1_4`, - ADD `stat_unk1_5` int(11) not null default 0 AFTER `stat_value5`, - ADD `stat_unk2_5` int(11) not null default 0 AFTER `stat_unk1_5`, - ADD `stat_unk1_6` int(11) not null default 0 AFTER `stat_value6`, - ADD `stat_unk2_6` int(11) not null default 0 AFTER `stat_unk1_6`, - ADD `stat_unk1_7` int(11) not null default 0 AFTER `stat_value7`, - ADD `stat_unk2_7` int(11) not null default 0 AFTER `stat_unk1_7`, - ADD `stat_unk1_8` int(11) not null default 0 AFTER `stat_value8`, - ADD `stat_unk2_8` int(11) not null default 0 AFTER `stat_unk1_8`, - ADD `stat_unk1_9` int(11) not null default 0 AFTER `stat_value9`, - ADD `stat_unk2_9` int(11) not null default 0 AFTER `stat_unk1_9`, - ADD `stat_unk1_10` int(11) not null default 0 AFTER `stat_value10`, - ADD `stat_unk2_10` int(11) not null default 0 AFTER `stat_unk1_10`, - DROP `StatsCount`, - DROP `ScalingStatValue`, - CHANGE `dmg_type1` `DamageType` tinyint(3) unsigned not null default 0 AFTER `ScalingStatDistribution`, - DROP `dmg_min1`, - DROP `dmg_max1`, - DROP `dmg_min2`, - DROP `dmg_max2`, - DROP `dmg_type2`, - DROP `armor`, - DROP `holy_res`, - DROP `fire_res`, - DROP `nature_res`, - DROP `frost_res`, - DROP `shadow_res`, - DROP `arcane_res`, - DROP `ammo_type`, - DROP `spellppmRate_1`, - DROP `spellppmRate_2`, - DROP `spellppmRate_3`, - DROP `spellppmRate_4`, - DROP `spellppmRate_5`, - DROP `block`, - DROP `RequiredDisenchantSkill`, - DROP `DisenchantId`, - ADD `StatScalingFactor` float not null default 0 AFTER `HolidayId`, - ADD `Field130` int(11) not null default 0 AFTER `StatScalingFactor`, - ADD `Field131` int(11) not null default 0 AFTER `Field130`; diff --git a/sql/updates/world/2011_11_25_02_world_item_template_addon.sql b/sql/updates/world/2011_11_25_02_world_item_template_addon.sql deleted file mode 100644 index 2d99d9fc610..00000000000 --- a/sql/updates/world/2011_11_25_02_world_item_template_addon.sql +++ /dev/null @@ -1,38 +0,0 @@ -DROP TABLE IF EXISTS `item_template_addon`; -CREATE TABLE `item_template_addon` ( -`Id` int(10) unsigned not null, -`BuyCount` tinyint(3) unsigned not null default 1, -`FoodType` tinyint(3) unsigned not null default 0, -`MinMoneyLoot` int(10) unsigned not null default 0, -`MaxMoneyLoot` int(10) unsigned not null default 0, -`SpellPPMChance` float unsigned not null default 0, -PRIMARY KEY(`Id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; - -INSERT INTO `item_template_addon` -SELECT -`item_template`.`entry` AS `Id`, -`item_template`.`BuyCount` AS `BuyCount`, -`item_template`.`FoodType` AS `FoodType`, -`item_template`.`minMoneyLoot` AS `MinMoneyLoot`, -`item_template`.`maxMoneyLoot` AS `MaxMoneyLoot`, -ABS(IF(`item_template`.`spelltrigger_1`=2, `item_template`.`spellppmRate_1`, - IF (`item_template`.`spelltrigger_2`=2, `item_template`.`spellppmRate_2`, - IF (`item_template`.`spelltrigger_3`=2, `item_template`.`spellppmRate_3`, - IF (`item_template`.`spelltrigger_4`=2, `item_template`.`spellppmRate_4`, - IF (`item_template`.`spelltrigger_5`=2, `item_template`.`spellppmRate_5`, 0)))))) - AS `SpellPPMChance` -FROM -`item_template` -HAVING -- need to use having due to `SpellPPMChance` usage which is not an actual field in table -`item_template`.`BuyCount`!=1 OR -`item_template`.`FoodType`!=0 OR -(`item_template`.`minMoneyLoot`!=0 AND -`item_template`.`maxMoneyLoot`!=0) OR -`SpellPPMChance`!=0; - -ALTER TABLE `item_template` - DROP `BuyCount`, - DROP `FoodType`, - DROP `minMoneyLoot`, - DROP `maxMoneyLoot`; diff --git a/sql/updates/world/4.x/2011_11_24_01_world_command.sql b/sql/updates/world/4.x/2011_11_24_01_world_command.sql new file mode 100644 index 00000000000..849a7538621 --- /dev/null +++ b/sql/updates/world/4.x/2011_11_24_01_world_command.sql @@ -0,0 +1,2 @@ +UPDATE `command` SET `help`='Syntax: .account set addon [$account] #addon\n\nSet user (possible targeted) expansion addon level allowed. Addon values: 0 - normal, 1 - tbc, 2 - wotlk, 3 - cata.' WHERE `name`='account set addon'; +UPDATE `command` SET `help`='Syntax: .account addon #addon\nSet expansion addon level allowed. Addon values: 0 - normal, 1 - tbc, 2 - wotlk, 3 - cata.' WHERE `name`='account addon'; diff --git a/sql/updates/world/4.x/2011_11_24_02_world_player_xp_for_level.sql b/sql/updates/world/4.x/2011_11_24_02_world_player_xp_for_level.sql new file mode 100644 index 00000000000..d108b01824d --- /dev/null +++ b/sql/updates/world/4.x/2011_11_24_02_world_player_xp_for_level.sql @@ -0,0 +1,7 @@ +DELETE FROM `player_xp_for_level` WHERE `lvl` BETWEEN 80 AND 84; +INSERT INTO `player_xp_for_level` (`lvl`, `xp_for_next_level`) VALUES +(80, 1686300), +(81, 2121500), +(82, 4004000), +(83, 5203400), +(84, 9165100); diff --git a/sql/updates/world/4.x/2011_11_25_02_world_item_script_names.sql b/sql/updates/world/4.x/2011_11_25_02_world_item_script_names.sql new file mode 100644 index 00000000000..aaf843b91ae --- /dev/null +++ b/sql/updates/world/4.x/2011_11_25_02_world_item_script_names.sql @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS `item_script_names`; +CREATE TABLE `item_script_names` ( +`Id` int(10) unsigned not null, +`ScriptName` varchar(64) not null, +PRIMARY KEY(`Id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; + +INSERT INTO `item_script_names` +SELECT +`item_template`.`entry` AS `Id`, +`item_template`.`ScriptName` AS `ScriptName` +FROM +`item_template` +WHERE +length(`item_template`.`ScriptName`)>0; + +ALTER TABLE `item_template` DROP `ScriptName`; diff --git a/sql/updates/world/4.x/2011_11_25_02_world_item_template.sql b/sql/updates/world/4.x/2011_11_25_02_world_item_template.sql new file mode 100644 index 00000000000..8a047ed9d11 --- /dev/null +++ b/sql/updates/world/4.x/2011_11_25_02_world_item_template.sql @@ -0,0 +1,48 @@ +ALTER TABLE `item_template` + ADD `stat_unk1_1` int(11) not null default 0 AFTER `stat_value1`, + ADD `stat_unk2_1` int(11) not null default 0 AFTER `stat_unk1_1`, + ADD `stat_unk1_2` int(11) not null default 0 AFTER `stat_value2`, + ADD `stat_unk2_2` int(11) not null default 0 AFTER `stat_unk1_2`, + ADD `stat_unk1_3` int(11) not null default 0 AFTER `stat_value3`, + ADD `stat_unk2_3` int(11) not null default 0 AFTER `stat_unk1_3`, + ADD `stat_unk1_4` int(11) not null default 0 AFTER `stat_value4`, + ADD `stat_unk2_4` int(11) not null default 0 AFTER `stat_unk1_4`, + ADD `stat_unk1_5` int(11) not null default 0 AFTER `stat_value5`, + ADD `stat_unk2_5` int(11) not null default 0 AFTER `stat_unk1_5`, + ADD `stat_unk1_6` int(11) not null default 0 AFTER `stat_value6`, + ADD `stat_unk2_6` int(11) not null default 0 AFTER `stat_unk1_6`, + ADD `stat_unk1_7` int(11) not null default 0 AFTER `stat_value7`, + ADD `stat_unk2_7` int(11) not null default 0 AFTER `stat_unk1_7`, + ADD `stat_unk1_8` int(11) not null default 0 AFTER `stat_value8`, + ADD `stat_unk2_8` int(11) not null default 0 AFTER `stat_unk1_8`, + ADD `stat_unk1_9` int(11) not null default 0 AFTER `stat_value9`, + ADD `stat_unk2_9` int(11) not null default 0 AFTER `stat_unk1_9`, + ADD `stat_unk1_10` int(11) not null default 0 AFTER `stat_value10`, + ADD `stat_unk2_10` int(11) not null default 0 AFTER `stat_unk1_10`, + DROP `StatsCount`, + DROP `ScalingStatValue`, + CHANGE `dmg_type1` `DamageType` tinyint(3) unsigned not null default 0 AFTER `ScalingStatDistribution`, + DROP `dmg_min1`, + DROP `dmg_max1`, + DROP `dmg_min2`, + DROP `dmg_max2`, + DROP `dmg_type2`, + DROP `armor`, + DROP `holy_res`, + DROP `fire_res`, + DROP `nature_res`, + DROP `frost_res`, + DROP `shadow_res`, + DROP `arcane_res`, + DROP `ammo_type`, + DROP `spellppmRate_1`, + DROP `spellppmRate_2`, + DROP `spellppmRate_3`, + DROP `spellppmRate_4`, + DROP `spellppmRate_5`, + DROP `block`, + DROP `RequiredDisenchantSkill`, + DROP `DisenchantId`, + ADD `StatScalingFactor` float not null default 0 AFTER `HolidayId`, + ADD `Field130` int(11) not null default 0 AFTER `StatScalingFactor`, + ADD `Field131` int(11) not null default 0 AFTER `Field130`; diff --git a/sql/updates/world/4.x/2011_11_25_02_world_item_template_addon.sql b/sql/updates/world/4.x/2011_11_25_02_world_item_template_addon.sql new file mode 100644 index 00000000000..2d99d9fc610 --- /dev/null +++ b/sql/updates/world/4.x/2011_11_25_02_world_item_template_addon.sql @@ -0,0 +1,38 @@ +DROP TABLE IF EXISTS `item_template_addon`; +CREATE TABLE `item_template_addon` ( +`Id` int(10) unsigned not null, +`BuyCount` tinyint(3) unsigned not null default 1, +`FoodType` tinyint(3) unsigned not null default 0, +`MinMoneyLoot` int(10) unsigned not null default 0, +`MaxMoneyLoot` int(10) unsigned not null default 0, +`SpellPPMChance` float unsigned not null default 0, +PRIMARY KEY(`Id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; + +INSERT INTO `item_template_addon` +SELECT +`item_template`.`entry` AS `Id`, +`item_template`.`BuyCount` AS `BuyCount`, +`item_template`.`FoodType` AS `FoodType`, +`item_template`.`minMoneyLoot` AS `MinMoneyLoot`, +`item_template`.`maxMoneyLoot` AS `MaxMoneyLoot`, +ABS(IF(`item_template`.`spelltrigger_1`=2, `item_template`.`spellppmRate_1`, + IF (`item_template`.`spelltrigger_2`=2, `item_template`.`spellppmRate_2`, + IF (`item_template`.`spelltrigger_3`=2, `item_template`.`spellppmRate_3`, + IF (`item_template`.`spelltrigger_4`=2, `item_template`.`spellppmRate_4`, + IF (`item_template`.`spelltrigger_5`=2, `item_template`.`spellppmRate_5`, 0)))))) + AS `SpellPPMChance` +FROM +`item_template` +HAVING -- need to use having due to `SpellPPMChance` usage which is not an actual field in table +`item_template`.`BuyCount`!=1 OR +`item_template`.`FoodType`!=0 OR +(`item_template`.`minMoneyLoot`!=0 AND +`item_template`.`maxMoneyLoot`!=0) OR +`SpellPPMChance`!=0; + +ALTER TABLE `item_template` + DROP `BuyCount`, + DROP `FoodType`, + DROP `minMoneyLoot`, + DROP `maxMoneyLoot`; diff --git a/sql/updates/world/4.x/2011_12_26_02_world_quest_template.sql b/sql/updates/world/4.x/2011_12_26_02_world_quest_template.sql new file mode 100644 index 00000000000..b43abd6f85d --- /dev/null +++ b/sql/updates/world/4.x/2011_12_26_02_world_quest_template.sql @@ -0,0 +1,31 @@ +ALTER TABLE `quest_template` ADD COLUMN `MinimapTargetMark` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `SpecialFlags`, + ADD COLUMN `RewardSkillId` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardArenaPoints`, + ADD COLUMN `RewardSkillPoints` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardSkillId`, + ADD COLUMN `RewardReputationMask` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardSkillPoints`, + ADD COLUMN `QuestGiverPortrait` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardReputationMask`, + ADD COLUMN `QuestTurnInPortrait` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `QuestGiverPortrait`, + ADD COLUMN `RequiredSpell` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredItemCount6`, + ADD COLUMN `RewardCurrencyId1` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `ObjectiveText4`, + ADD COLUMN `RewardCurrencyId2` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyId1`, + ADD COLUMN `RewardCurrencyId3` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyId2`, + ADD COLUMN `RewardCurrencyId4` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyId3`, + ADD COLUMN `RewardCurrencyCount1` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyId4`, + ADD COLUMN `RewardCurrencyCount2` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyCount1`, + ADD COLUMN `RewardCurrencyCount3` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyCount2`, + ADD COLUMN `RewardCurrencyCount4` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyCount3`, + ADD COLUMN `RequiredCurrencyId1` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyCount4`, + ADD COLUMN `RequiredCurrencyId2` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredCurrencyId1`, + ADD COLUMN `RequiredCurrencyId3` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredCurrencyId2`, + ADD COLUMN `RequiredCurrencyId4` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredCurrencyId3`, + ADD COLUMN `RequiredCurrencyCount1` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredCurrencyId4`, + ADD COLUMN `RequiredCurrencyCount2` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredCurrencyCount1`, + ADD COLUMN `RequiredCurrencyCount3` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredCurrencyCount2`, + ADD COLUMN `RequiredCurrencyCount4` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredCurrencyCount3`, + ADD COLUMN `QuestGiverTextWindow` TEXT NULL DEFAULT NULL AFTER `RequiredCurrencyCount4`, + ADD COLUMN `QuestGiverTargetName` TEXT NULL DEFAULT NULL AFTER `QuestGiverTextWindow`, + ADD COLUMN `QuestTurnTextWindow` TEXT NULL DEFAULT NULL AFTER `QuestGiverTargetName`, + ADD COLUMN `QuestTurnTargetName` TEXT NULL DEFAULT NULL AFTER `QuestTurnTextWindow`, + ADD COLUMN `SoundAccept` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '890' AFTER `QuestTurnTargetName`, + ADD COLUMN `SoundTurnIn` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '878' AFTER `SoundAccept`; + +ALTER TABLE `quest_template` DROP COLUMN `Unknown0`; -- Not found on 422 diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp index 5bf7910466c..1b1c86fe00d 100755 --- a/src/server/game/Entities/Creature/GossipDef.cpp +++ b/src/server/game/Entities/Creature/GossipDef.cpp @@ -401,11 +401,17 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const { + // SMSG_QUEST_QUERY_RESPONSE - Updated to 422 + std::string questTitle = quest->GetTitle(); std::string questDetails = quest->GetDetails(); std::string questObjectives = quest->GetObjectives(); std::string questEndText = quest->GetEndText(); std::string questCompletedText = quest->GetCompletedText(); + std::string questGiverTextWindow = quest->GetQuestGiverTextWindow(); + std::string questGiverTargetName = quest->GetQuestGiverTargetName(); + std::string questTurnTextWindow = quest->GetQuestTurnTextWindow(); + std::string questTurnTargetName = quest->GetQuestTurnTargetName(); std::string questObjectiveText[QUEST_OBJECTIVES_COUNT]; for (uint32 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) @@ -421,6 +427,10 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const ObjectMgr::GetLocaleString(localeData->Objectives, locale, questObjectives); ObjectMgr::GetLocaleString(localeData->EndText, locale, questEndText); ObjectMgr::GetLocaleString(localeData->CompletedText, locale, questCompletedText); + ObjectMgr::GetLocaleString(localeData->QuestGiverTextWindow, locale, questGiverTextWindow); + ObjectMgr::GetLocaleString(localeData->QuestGiverTargetName, locale, questGiverTargetName); + ObjectMgr::GetLocaleString(localeData->QuestTurnTextWindow, locale, questTurnTextWindow); + ObjectMgr::GetLocaleString(localeData->QuestTurnTargetName, locale, questTurnTargetName); for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) ObjectMgr::GetLocaleString(localeData->ObjectiveText[i], locale, questObjectiveText[i]); @@ -461,11 +471,16 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const data << float(0); // new reward honor (multipled by ~62 at client side) data << uint32(quest->GetSrcItemId()); // source item id data << uint32(quest->GetFlags() & 0xFFFF); // quest flags + data << uint32(quest->GetMinimapTargetMark()); // minimap target mark (skull, etc. missing enum) data << uint32(quest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles) data << uint32(quest->GetPlayersSlain()); // players slain data << uint32(quest->GetBonusTalents()); // bonus talents data << uint32(quest->GetRewArenaPoints()); // bonus arena points - data << uint32(0); // review rep show mask + data << uint32(quest->GetRewardSkillId()); // reward skill id + data << uint32(quest->GetRewardSkillPoints()); // reward skill points + data << uint32(quest->GetRewardReputationMask()); // rep mask (unsure on what it does) + data << uint32(quest->GetQuestGiverPortrait()); // quest giver entry ? + data << uint32(quest->GetQuestTurnInPortrait()); // quest turnin entry ? if (quest->HasFlag(QUEST_FLAGS_HIDDEN_REWARDS)) { @@ -494,7 +509,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // columnid+1 QuestFactionReward.dbc? data << int32(quest->RewardFactionValueId[i]); - for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // unk (0) + for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // unknown usage data << int32(quest->RewardFactionValueIdOverride[i]); data << quest->GetPointMapId(); @@ -506,7 +521,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const data << questObjectives; data << questDetails; data << questEndText; - data << questCompletedText; // display in quest objectives window once all objectives are completed + data << questCompletedText; for (uint32 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) { @@ -516,8 +531,8 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const data << uint32(quest->RequiredNpcOrGo[i]); data << uint32(quest->RequiredNpcOrGoCount[i]); - data << uint32(quest->RequiredSourceItemid[i]); - data << uint32(0); // req source count? + data << uint32(quest->RequiredSourceItemId[i]); + data << uint32(quest->RequiredSourceItemCount[i]); } for (uint32 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) @@ -526,9 +541,30 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const data << uint32(quest->RequiredItemCount[i]); } + data << uint32(quest->GetRequiredSpell()); // Is it required to be cast, learned or what? + for (uint32 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) data << questObjectiveText[i]; + for (uint32 i = 0; i < QUEST_REWARD_CURRENCY_COUNT; ++i) + { + data << uint32(quest->RewardCurrencyId[i]); + data << uint32(quest->RewardCurrencyCount[i]); + } + + for (uint32 i = 0; i < QUEST_REQUIRED_CURRENCY_COUNT; ++i) + { + data << uint32(quest->RequiredCurrencyId[i]); + data << uint32(quest->RequiredCurrencyCount[i]); + } + + data << questGiverTextWindow; + data << questGiverTargetName; + data << questTurnTextWindow; + data << questTurnTargetName; + data << uint32(quest->GetSoundAccept()); + data << uint32(quest->GetSoundTurnIn()); + _session->SendPacket(&data); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUEST_QUERY_RESPONSE questid=%u", quest->GetQuestId()); } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 524a5943c7f..5565aacc0e1 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -14834,10 +14834,10 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver, for (uint8 i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i) { - if (quest->RequiredSourceItemid[i]) + if (quest->RequiredSourceItemId[i]) { - uint32 count = quest->RequiredSourceItemId[i]; - DestroyItemCount(quest->RequiredSourceItemid[i], count ? count : 9999, true); + uint32 count = quest->RequiredSourceItemCount[i]; + DestroyItemCount(quest->RequiredSourceItemId[i], count ? count : 9999, true); } } @@ -15031,9 +15031,9 @@ void Player::FailQuest(uint32 questId) // Destroy items recieved on starting the quest. DestroyItemCount(quest->RequiredItemId[i], quest->RequiredItemCount[i], true, true); for (uint8 i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i) - if (quest->RequiredSourceItemid[i] > 0 && quest->RequiredSourceItemId[i] > 0) + if (quest->RequiredSourceItemId[i] > 0 && quest->RequiredSourceItemCount[i] > 0) // Destroy items recieved during the quest. - DestroyItemCount(quest->RequiredSourceItemid[i], quest->RequiredSourceItemId[i], true, true); + DestroyItemCount(quest->RequiredSourceItemId[i], quest->RequiredSourceItemCount[i], true, true); } } @@ -16084,7 +16084,7 @@ bool Player::HasQuestForItem(uint32 itemid) const for (uint8 j = 0; j < QUEST_SOURCE_ITEM_IDS_COUNT; ++j) { // examined item is a source item - if (qinfo->RequiredSourceItemid[j] == itemid) + if (qinfo->RequiredSourceItemId[j] == itemid) { ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(itemid); @@ -16093,9 +16093,9 @@ bool Player::HasQuestForItem(uint32 itemid) const return true; // allows custom amount drop when not 0 - if (qinfo->RequiredSourceItemId[j]) + if (qinfo->RequiredSourceItemCount[j]) { - if (GetItemCount(itemid, true) < qinfo->RequiredSourceItemId[j]) + if (GetItemCount(itemid, true) < qinfo->RequiredSourceItemCount[j]) return true; } else if (GetItemCount(itemid, true) < pProto->GetMaxStackSize()) return true; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 2057180b81b..8a47e91b32b 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -3593,33 +3593,37 @@ void ObjectMgr::LoadQuests() "RequiredFactionId1, RequiredFactionId2, RequiredFactionValue1, RequiredFactionValue2, RequiredMinRepFaction, RequiredMaxRepFaction, RequiredMinRepValue, RequiredMaxRepValue, " // 21 22 23 24 25 26 27 28 29 30 31 "PrevQuestId, NextQuestId, ExclusiveGroup, NextQuestIdChain, RewardXPId, RewardOrRequiredMoney, RewardMoneyMaxLevel, RewardSpell, RewardSpellCast, RewardHonor, RewardHonorMultiplier, " - // 32 33 34 35 36 37 38 39 40 41 42 - "RewardMailTemplateId, RewardMailDelay, SourceItemId, SourceItemCount, SourceSpellId, Flags, SpecialFlags, RewardTitleId, RequiredPlayerKills, RewardTalents, RewardArenaPoints, " - // 43 44 45 46 47 48 49 50 - "RewardItemId1, RewardItemId2, RewardItemId3, RewardItemId4, RewardItemCount1, RewardItemCount2, RewardItemCount3, RewardItemCount4, " - // 51 52 53 54 55 56 57 58 59 60 61 62 + // 32 33 34 35 36 37 38 39 40 41 42 43 + "RewardMailTemplateId, RewardMailDelay, SourceItemId, SourceItemCount, SourceSpellId, Flags, SpecialFlags, MinimapTargetMark, RewardTitleId, RequiredPlayerKills, RewardTalents, RewardArenaPoints, " + // 44 45 46 47 48 49 50 51 52 53 54 55 56 + "RewardSkillId, RewardSkillPoints, RewardReputationMask, QuestGiverPortrait, QuestTurnInPortrait, RewardItemId1, RewardItemId2, RewardItemId3, RewardItemId4, RewardItemCount1, RewardItemCount2, RewardItemCount3, RewardItemCount4, " + // 57 58 59 60 61 62 63 64 65 66 67 68 "RewardChoiceItemId1, RewardChoiceItemId2, RewardChoiceItemId3, RewardChoiceItemId4, RewardChoiceItemId5, RewardChoiceItemId6, RewardChoiceItemCount1, RewardChoiceItemCount2, RewardChoiceItemCount3, RewardChoiceItemCount4, RewardChoiceItemCount5, RewardChoiceItemCount6, " - // 63 64 65 66 67 68 69 70 71 72 + // 69 70 71 72 73 74 75 76 77 78 "RewardFactionId1, RewardFactionId2, RewardFactionId3, RewardFactionId4, RewardFactionId5, RewardFactionValueId1, RewardFactionValueId2, RewardFactionValueId3, RewardFactionValueId4, RewardFactionValueId5, " - // 73 74 75 76 77 + // 79 80 81 82 83 "RewardFactionValueIdOverride1, RewardFactionValueIdOverride2, RewardFactionValueIdOverride3, RewardFactionValueIdOverride4, RewardFactionValueIdOverride5, " - // 78 79 80 81 - "PointMapId, PointX, PointY, PointOption, " - // 82 83 84 85 86 87 88 - "Title, Objectives, Details, EndText, OfferRewardText, RequestItemsText, CompletedText, " - // 89 90 91 92 93 94 95 96 + // 84 85 86 87 88 89 90 91 92 93 94 + "PointMapId, PointX, PointY, PointOption, Title, Objectives, Details, EndText, CompletedText, OfferRewardText, RequestItemsText, " + // 95 96 97 98 99 100 101 102 "RequiredNpcOrGo1, RequiredNpcOrGo2, RequiredNpcOrGo3, RequiredNpcOrGo4, RequiredNpcOrGoCount1, RequiredNpcOrGoCount2, RequiredNpcOrGoCount3, RequiredNpcOrGoCount4, " - // 97 98 99 100 101 102 103 104 + // 103 104 105 106 107 108 109 110 "RequiredSourceItemId1, RequiredSourceItemId2, RequiredSourceItemId3, RequiredSourceItemId4, RequiredSourceItemCount1, RequiredSourceItemCount2, RequiredSourceItemCount3, RequiredSourceItemCount4, " - // 105 106 107 108 109 110 111 112 113 114 115 116 + // 111 112 113 114 115 116 117 118 119 120 121 122 "RequiredItemId1, RequiredItemId2, RequiredItemId3, RequiredItemId4, RequiredItemId5, RequiredItemId6, RequiredItemCount1, RequiredItemCount2, RequiredItemCount3, RequiredItemCount4, RequiredItemCount5, RequiredItemCount6, " - // 117 118 119 120 121 122 123 124 125 - "RequiredSpellCast1, RequiredSpellCast2, RequiredSpellCast3, RequiredSpellCast4, Unknown0, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4, " - // 126 127 128 129 130 131 132 133 134 135 + // 123 124 125 126 127 128 129 130 131 + "RequiredSpell, RequiredSpellCast1, RequiredSpellCast2, RequiredSpellCast3, RequiredSpellCast4, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4, " + // 132 133 134 135 136 137 138 139 + "RewardCurrencyId1, RewardCurrencyId2, RewardCurrencyId3, RewardCurrencyId4, RewardCurrencyCount1, RewardCurrencyCount2, RewardCurrencyCount3, RewardCurrencyCount4, " + // 140 141 142 143 144 145 146 147 + "RequiredCurrencyId1, RequiredCurrencyId2, RequiredCurrencyId3, RequiredCurrencyId4, RequiredCurrencyCount1, RequiredCurrencyCount2, RequiredCurrencyCount3, RequiredCurrencyCount4, " + // 148 149 150 151 152 153 + "QuestGiverTextWindow, QuestGiverTargetName, QuestTurnTextWindow, QuestTurnTargetName, SoundAccept, SoundTurnIn, " + // 154 155 156 157 158 159 160 161 162 163 "DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4, DetailsEmoteDelay1, DetailsEmoteDelay2, DetailsEmoteDelay3, DetailsEmoteDelay4, EmoteOnIncomplete, EmoteOnComplete, " - // 136 137 138 139 140 141 142 143 + // 164 165 166 167 168 169 170 171 "OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4, OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4, " - // 144 145 146 + // 172 173 174 "StartScript, CompleteScript, WDBVerified" " FROM quest_template"); if (!result) @@ -3912,7 +3916,7 @@ void ObjectMgr::LoadQuests() qinfo->RequiredItemCount[j] = 0; // prevent incorrect work of quest } } - else if (qinfo->RequiredItemCount[j]>0) + else if (qinfo->RequiredItemCount[j] > 0) { sLog->outErrorDb("Quest %u has `RequiredItemId%d` = 0 but `RequiredItemCount%d` = %u, quest can't be done.", qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredItemCount[j]); @@ -3922,22 +3926,22 @@ void ObjectMgr::LoadQuests() for (uint8 j = 0; j < QUEST_SOURCE_ITEM_IDS_COUNT; ++j) { - uint32 id = qinfo->RequiredSourceItemid[j]; + uint32 id = qinfo->RequiredSourceItemId[j]; if (id) { if (!sObjectMgr->GetItemTemplate(id)) { - sLog->outErrorDb("Quest %u has `RequiredSourceItemid%d` = %u but item with entry %u does not exist, quest can't be done.", + sLog->outErrorDb("Quest %u has `RequiredSourceItemId%d` = %u but item with entry %u does not exist, quest can't be done.", qinfo->GetQuestId(), j+1, id, id); // no changes, quest can't be done for this requirement } } else { - if (qinfo->RequiredSourceItemId[j]>0) + if (qinfo->RequiredSourceItemCount[j] > 0) { - sLog->outErrorDb("Quest %u has `RequiredSourceItemid%d` = 0 but `RequiredSourceItemId%d` = %u.", - qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredSourceItemId[j]); + sLog->outErrorDb("Quest %u has `RequiredSourceItemId%d` = 0 but `RequiredSourceItemCount%d` = %u.", + qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredSourceItemCount[j]); // no changes, quest ignore this data } } @@ -4190,6 +4194,161 @@ void ObjectMgr::LoadQuests() qNextItr->second->prevChainQuests.push_back(qinfo->GetQuestId()); } + for (uint8 j = 0; j < QUEST_REWARD_CURRENCY_COUNT; ++j) + { + uint32 currency = qinfo->RewardCurrencyId[j]; + if (currency) + { + if (qinfo->RewardCurrencyCount[j] == 0) + { + sLog->outErrorDb("Quest %u has `RewardCurrencyId%d` = %u but `RewardCurrencyCount%d` = 0, quest can't be done.", + qinfo->GetQuestId(), j+1, currency, j+1); + // no changes, quest can't be done for this requirement + } + + /* TODO: Re-enable once currency dbc getters are implemented + if (!sObjectMgr->GetCurrency(currency)) + { + sLog->outErrorDb("Quest %u has `RewardCurrencyId%d` = %u but currency with entry %u does not exist, quest can't be done.", + qinfo->GetQuestId(), j+1, currency, currency); + qinfo->RewardCurrencyCount[j] = 0; // prevent incorrect work of quest + }*/ + } + else if (qinfo->RewardCurrencyCount[j] > 0) + { + sLog->outErrorDb("Quest %u has `RewardCurrencyId%d` = 0 but `RewardCurrencyCount%d` = %u, quest can't be done.", + qinfo->GetQuestId(), j+1, j+1, qinfo->RewardCurrencyCount[j]); + qinfo->RewardCurrencyCount[j] = 0; // prevent incorrect work of quest + } + } + + for (uint8 j = 0; j < QUEST_REQUIRED_CURRENCY_COUNT; ++j) + { + uint32 currency = qinfo->RequiredCurrencyId[j]; + if (currency) + { + if (qinfo->RequiredCurrencyCount[j] == 0) + { + sLog->outErrorDb("Quest %u has `RequiredCurrencyId%d` = %u but `RequiredCurrencyCount%d` = 0, quest can't be done.", + qinfo->GetQuestId(), j+1, currency, j+1); + // no changes, quest can't be done for this requirement + } + + /* TODO: Re-enable once currency dbc getters are implemented + if (!sObjectMgr->GetCurrency(currency)) + { + sLog->outErrorDb("Quest %u has `RequiredCurrencyId%d` = %u but currency with entry %u does not exist, quest can't be done.", + qinfo->GetQuestId(), j+1, currency, currency); + qinfo->RequiredCurrencyCount[j] = 0; // prevent incorrect work of quest + }*/ + } + else if (qinfo->RequiredCurrencyCount[j] > 0) + { + sLog->outErrorDb("Quest %u has `RequiredCurrencyId%d` = 0 but `RequiredCurrencyCount%d` = %u, quest can't be done.", + qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredCurrencyCount[j]); + qinfo->RequiredCurrencyCount[j] = 0; // prevent incorrect work of quest + } + } + + if (qinfo->SoundAccept) + { + if (!sSoundEntriesStore.LookupEntry(qinfo->SoundAccept)) + { + sLog->outErrorDb("Quest %u has `SoundAccept` = %u but sound %u does not exist, set to 0.", + qinfo->GetQuestId(), qinfo->SoundAccept, qinfo->SoundAccept); + qinfo->SoundAccept = 0; // no sound will be played + } + } + + if (qinfo->SoundTurnIn) + { + if (!sSoundEntriesStore.LookupEntry(qinfo->SoundTurnIn)) + { + sLog->outErrorDb("Quest %u has `SoundTurnIn` = %u but sound %u does not exist, set to 0.", + qinfo->GetQuestId(), qinfo->SoundTurnIn, qinfo->SoundTurnIn); + qinfo->SoundTurnIn = 0; // no sound will be played + } + } + + if (qinfo->RequiredSpell > 0) + { + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->RequiredSpell); + + if (!spellInfo) + { + sLog->outErrorDb("Quest %u has `RequiredSpell` = %u but spell %u does not exist, quest will not require a spell.", + qinfo->GetQuestId(), qinfo->RequiredSpell, qinfo->RequiredSpell); + qinfo->RequiredSpell = 0; // no spell will be required + } + + else if (!SpellMgr::IsSpellValid(spellInfo)) + { + sLog->outErrorDb("Quest %u has `RequiredSpell` = %u but spell %u is broken, quest will not require a spell.", + qinfo->GetQuestId(), qinfo->RequiredSpell, qinfo->RequiredSpell); + qinfo->RequiredSpell = 0; // no spell will be required + } + + /* Can we require talents? + else if (GetTalentSpellCost(qinfo->RewardSpellCast)) + { + sLog->outErrorDb("Quest %u has `RewardSpell` = %u but spell %u is talent, quest will not have a spell reward.", + qinfo->GetQuestId(), qinfo->RewardSpellCast, qinfo->RewardSpellCast); + qinfo->RewardSpellCast = 0; // no spell will be casted on player + } + }*/ + } + + if (qinfo->RewardSkillId) + { + if (!sSkillLineStore.LookupEntry(qinfo->RewardSkillId)) + { + sLog->outErrorDb("Quest %u has `RewardSkillId` = %u but this skill does not exist", + qinfo->GetQuestId(), qinfo->RewardSkillId); + } + if (!qinfo->RewardSkillPoints) + { + sLog->outErrorDb("Quest %u has `RewardSkillId` = %u but `RewardSkillPoints` is 0", + qinfo->GetQuestId(), qinfo->RewardSkillId); + } + } + + if (qinfo->RewardSkillPoints) + { + if (qinfo->RewardSkillPoints > sWorld->GetConfigMaxSkillValue()) + { + sLog->outErrorDb("Quest %u has `RewardSkillPoints` = %u but max possible skill is %u, quest can't be done.", + qinfo->GetQuestId(), qinfo->RewardSkillPoints, sWorld->GetConfigMaxSkillValue()); + // no changes, quest can't be done for this requirement + } + if (!qinfo->RewardSkillId) + { + sLog->outErrorDb("Quest %u has `RewardSkillPoints` = %u but `RewardSkillId` is 0", + qinfo->GetQuestId(), qinfo->RewardSkillPoints); + } + } + + if (qinfo->QuestGiverPortrait) + { + if (!sObjectMgr->GetCreatureTemplate(qinfo->QuestGiverPortrait)) + { + sLog->outErrorDb("Quest %u has `QuestGiverPortrait` = %u but creature with entry %u does not exist, quest can't be done.", + qinfo->GetQuestId(), qinfo->QuestGiverPortrait, qinfo->QuestGiverPortrait); + qinfo->QuestGiverPortrait = 0; + } + } + + if (qinfo->QuestTurnInPortrait) + { + if (!sObjectMgr->GetCreatureTemplate(qinfo->QuestTurnInPortrait)) + { + sLog->outErrorDb("Quest %u has `QuestTurnInPortrait` = %u but creature with entry %u does not exist, quest can't be done.", + qinfo->GetQuestId(), qinfo->QuestTurnInPortrait, qinfo->QuestTurnInPortrait); + qinfo->QuestTurnInPortrait = 0; + } + } + + + // fill additional data stores if (qinfo->PrevQuestId) { diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 873b6c29fea..f0c67e3ac4d 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -61,114 +61,150 @@ Quest::Quest(Field* questRecord) SourceSpellid = questRecord[36].GetUInt32(); Flags = questRecord[37].GetUInt32(); uint32 SpecialFlags = questRecord[38].GetUInt16(); - RewardTitleId = questRecord[39].GetUInt32(); - RequiredPlayerKills = questRecord[40].GetUInt32(); - RewardTalents = questRecord[41].GetUInt32(); - RewardArenaPoints = questRecord[42].GetInt32(); + MinimapTargetMark = questRecord[39].GetUInt32(); + RewardTitleId = questRecord[40].GetUInt32(); + RequiredPlayerKills = questRecord[41].GetUInt32(); + RewardTalents = questRecord[42].GetUInt32(); + RewardArenaPoints = questRecord[43].GetInt32(); + RewardSkillId = questRecord[44].GetUInt32(); + RewardSkillPoints = questRecord[45].GetUInt32(); + RewardReputationMask = questRecord[46].GetUInt32(); + QuestGiverPortrait = questRecord[47].GetUInt32(); + QuestTurnInPortrait = questRecord[48].GetUInt32(); for (int i = 0; i < QUEST_REWARDS_COUNT; ++i) - RewardItemId[i] = questRecord[43+i].GetUInt32(); + RewardItemId[i] = questRecord[49+i].GetUInt32(); for (int i = 0; i < QUEST_REWARDS_COUNT; ++i) - RewardItemIdCount[i] = questRecord[47+i].GetUInt32(); + RewardItemIdCount[i] = questRecord[53+i].GetUInt32(); for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) - RewardChoiceItemId[i] = questRecord[51+i].GetUInt32(); + RewardChoiceItemId[i] = questRecord[57+i].GetUInt32(); for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) - RewardChoiceItemCount[i] = questRecord[57+i].GetUInt32(); + RewardChoiceItemCount[i] = questRecord[63+i].GetUInt32(); for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - RewardFactionId[i] = questRecord[63+i].GetUInt32(); + RewardFactionId[i] = questRecord[69+i].GetUInt32(); for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - RewardFactionValueId[i] = questRecord[68+i].GetInt32(); + RewardFactionValueId[i] = questRecord[74+i].GetInt32(); for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - RewardFactionValueIdOverride[i] = questRecord[73+i].GetInt32(); + RewardFactionValueIdOverride[i] = questRecord[79+i].GetInt32(); - PointMapId = questRecord[78].GetUInt32(); - PointX = questRecord[79].GetFloat(); - PointY = questRecord[80].GetFloat(); - PointOption = questRecord[81].GetUInt32(); - Title = questRecord[82].GetString(); - Objectives = questRecord[83].GetString(); - Details = questRecord[84].GetString(); - EndText = questRecord[85].GetString(); - OfferRewardText = questRecord[86].GetString(); - RequestItemsText = questRecord[87].GetString(); - CompletedText = questRecord[88].GetString(); + PointMapId = questRecord[84].GetUInt32(); + PointX = questRecord[85].GetFloat(); + PointY = questRecord[86].GetFloat(); + PointOption = questRecord[87].GetUInt32(); + Title = questRecord[88].GetString(); + Objectives = questRecord[89].GetString(); + Details = questRecord[90].GetString(); + EndText = questRecord[91].GetString(); + CompletedText = questRecord[92].GetString(); + OfferRewardText = questRecord[93].GetString(); + RequestItemsText = questRecord[94].GetString(); for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - RequiredNpcOrGo[i] = questRecord[89+i].GetInt32(); + RequiredNpcOrGo[i] = questRecord[95+i].GetInt32(); for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - RequiredNpcOrGoCount[i] = questRecord[93+i].GetUInt32(); + RequiredNpcOrGoCount[i] = questRecord[99+i].GetUInt32(); for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i) - RequiredSourceItemid[i] = questRecord[97+i].GetUInt32(); + RequiredSourceItemId[i] = questRecord[103+i].GetUInt32(); for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i) - RequiredSourceItemId[i] = questRecord[101+i].GetUInt32(); + RequiredSourceItemCount[i] = questRecord[107+i].GetUInt32(); for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) - RequiredItemId[i] = questRecord[105+i].GetUInt32(); + RequiredItemId[i] = questRecord[111+i].GetUInt32(); for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) - RequiredItemCount[i] = questRecord[111+i].GetUInt32(); + RequiredItemCount[i] = questRecord[117+i].GetUInt32(); - for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - RequiredSpellCast[i] = questRecord[117+i].GetUInt32(); + RequiredSpell = questRecord[123].GetUInt32(); - // int8 Unknown0 = questRecord[121].GetUInt32(); + for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) // To be removed + RequiredSpellCast[i] = questRecord[124+i].GetUInt32(); for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - ObjectiveText[i] = questRecord[122+i].GetString(); + ObjectiveText[i] = questRecord[128+i].GetString(); + + for (int i = 0; i < QUEST_REWARD_CURRENCY_COUNT; ++i) + RewardCurrencyId[i] = questRecord[132].GetUInt32(); + + for (int i = 0; i < QUEST_REWARD_CURRENCY_COUNT; ++i) + RewardCurrencyCount[i] = questRecord[136].GetUInt32(); + + for (int i = 0; i < QUEST_REQUIRED_CURRENCY_COUNT; ++i) + RequiredCurrencyId[i] = questRecord[140].GetUInt32(); + + for (int i = 0; i < QUEST_REQUIRED_CURRENCY_COUNT; ++i) + RequiredCurrencyCount[i] = questRecord[144].GetUInt32(); + + QuestGiverTextWindow = questRecord[148].GetString(); + QuestGiverTargetName = questRecord[149].GetString(); + QuestTurnTextWindow = questRecord[150].GetString(); + QuestTurnTargetName = questRecord[151].GetString(); + SoundAccept = questRecord[152].GetUInt32(); + SoundTurnIn = questRecord[153].GetUInt32(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - DetailsEmote[i] = questRecord[126+i].GetUInt32(); + DetailsEmote[i] = questRecord[154+i].GetUInt32(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - DetailsEmoteDelay[i] = questRecord[130+i].GetUInt32(); + DetailsEmoteDelay[i] = questRecord[158+i].GetUInt32(); - EmoteOnIncomplete = questRecord[134].GetUInt32(); - EmoteOnComplete = questRecord[135].GetUInt32(); + EmoteOnIncomplete = questRecord[162].GetUInt32(); + EmoteOnComplete = questRecord[163].GetUInt32(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - OfferRewardEmote[i] = questRecord[136+i].GetInt32(); + OfferRewardEmote[i] = questRecord[164+i].GetInt32(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - OfferRewardEmoteDelay[i] = questRecord[140+i].GetInt32(); + OfferRewardEmoteDelay[i] = questRecord[168+i].GetInt32(); - StartScript = questRecord[144].GetUInt32(); - CompleteScript = questRecord[145].GetUInt32(); + StartScript = questRecord[172].GetUInt32(); + CompleteScript = questRecord[173].GetUInt32(); - // int32 WDBVerified = questRecord[146].GetInt32(); + // int32 WDBVerified = questRecord[174].GetInt32(); Flags |= SpecialFlags << 20; if (Flags & QUEST_TRINITY_FLAGS_AUTO_ACCEPT) Flags |= QUEST_FLAGS_AUTO_ACCEPT; - m_reqitemscount = 0; - m_reqCreatureOrGOcount = 0; - m_rewitemscount = 0; - m_rewchoiceitemscount = 0; + m_reqItemsCount = 0; + m_reqNpcOrGoCount = 0; + m_rewItemsCount = 0; + m_rewChoiceItemsCount = 0; + m_rewCurrencyCount = 0; + m_reqCurrencyCount = 0; for (int i=0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) if (RequiredItemId[i]) - ++m_reqitemscount; + ++m_reqItemsCount; for (int i=0; i < QUEST_OBJECTIVES_COUNT; ++i) if (RequiredNpcOrGo[i]) - ++m_reqCreatureOrGOcount; + ++m_reqNpcOrGoCount; for (int i=0; i < QUEST_REWARDS_COUNT; ++i) if (RewardItemId[i]) - ++m_rewitemscount; + ++m_rewItemsCount; for (int i=0; i < QUEST_REWARD_CHOICES_COUNT; ++i) if (RewardChoiceItemId[i]) - ++m_rewchoiceitemscount; + ++m_rewChoiceItemsCount; + + for (int i=0; i < QUEST_REWARD_CURRENCY_COUNT; ++i) + if (RewardCurrencyId[i]) + ++m_rewCurrencyCount; + + for (int i=0; i < QUEST_REQUIRED_CURRENCY_COUNT; ++i) + if (RequiredCurrencyId[i]) + ++m_reqCurrencyCount; + } uint32 Quest::XPValue(Player* player) const diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index fc9a432a11b..4601154feab 100755 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -41,6 +41,8 @@ class ObjectMgr; #define QUEST_REPUTATIONS_COUNT 5 #define QUEST_EMOTE_COUNT 4 #define QUEST_PVP_KILL_SLOT 0 +#define QUEST_REWARD_CURRENCY_COUNT 4 +#define QUEST_REQUIRED_CURRENCY_COUNT 4 enum QuestFailedReasons { @@ -173,6 +175,11 @@ struct QuestLocale StringVector EndText; StringVector CompletedText; std::vector< StringVector > ObjectiveText; + // new on 4.x + StringVector QuestGiverTextWindow; + StringVector QuestGiverTargetName; + StringVector QuestTurnTextWindow; + StringVector QuestTurnTargetName; }; // This Quest class provides a convenient way to access a few pretotaled (cached) quest details, @@ -229,11 +236,14 @@ class Quest std::string GetRequestItemsText() const { return RequestItemsText; } std::string GetEndText() const { return EndText; } std::string GetCompletedText() const { return CompletedText; } + std::string GetQuestGiverTextWindow() const { return QuestGiverTextWindow; } + std::string GetQuestGiverTargetName() const { return QuestGiverTargetName; } + std::string GetQuestTurnTextWindow() const { return QuestTurnTextWindow; } + std::string GetQuestTurnTargetName() const { return QuestTurnTargetName; } int32 GetRewOrReqMoney() const; uint32 GetRewHonorAddition() const { return RewardHonor; } float GetRewHonorMultiplier() const { return RewardHonorMultiplier; } - uint32 GetRewMoneyMaxLevel() const { return RewardMoneyMaxLevel; } - // use in XP calculation at client + uint32 GetRewMoneyMaxLevel() const { return RewardMoneyMaxLevel; } // use in XP calculation at client uint32 GetRewSpell() const { return RewardSpell; } int32 GetRewSpellCast() const { return RewardSpellCast; } uint32 GetRewMailTemplateId() const { return RewardMailTemplateId; } @@ -242,6 +252,9 @@ class Quest float GetPointX() const { return PointX; } float GetPointY() const { return PointY; } uint32 GetPointOpt() const { return PointOption; } + uint32 GetRequiredSpell() const { return RequiredSpell; } + uint32 GetSoundAccept() const { return SoundAccept; } + uint32 GetSoundTurnIn() const { return SoundTurnIn; } uint32 GetIncompleteEmote() const { return EmoteOnIncomplete; } uint32 GetCompleteEmote() const { return EmoteOnComplete; } uint32 GetQuestStartScript() const { return StartScript; } @@ -249,6 +262,12 @@ class Quest bool IsRepeatable() const { return Flags & QUEST_TRINITY_FLAGS_REPEATABLE; } bool IsAutoComplete() const; uint32 GetFlags() const { return Flags; } + uint32 GetMinimapTargetMark() const { return MinimapTargetMark; } + uint32 GetRewardSkillId() const { return RewardSkillId; } + uint32 GetRewardSkillPoints() const { return RewardSkillPoints; } + uint32 GetRewardReputationMask() const { return RewardReputationMask; } + uint32 GetQuestGiverPortrait() const { return QuestGiverPortrait; } + uint32 GetQuestTurnInPortrait() const { return QuestTurnInPortrait; } bool IsDaily() const { return Flags & QUEST_FLAGS_DAILY; } bool IsWeekly() const { return Flags & QUEST_FLAGS_WEEKLY; } bool IsDailyOrWeekly() const { return Flags & (QUEST_FLAGS_DAILY | QUEST_FLAGS_WEEKLY); } @@ -262,8 +281,8 @@ class Quest std::string ObjectiveText[QUEST_OBJECTIVES_COUNT]; uint32 RequiredItemId[QUEST_ITEM_OBJECTIVES_COUNT]; uint32 RequiredItemCount[QUEST_ITEM_OBJECTIVES_COUNT]; - uint32 RequiredSourceItemid[QUEST_SOURCE_ITEM_IDS_COUNT]; uint32 RequiredSourceItemId[QUEST_SOURCE_ITEM_IDS_COUNT]; + uint32 RequiredSourceItemCount[QUEST_SOURCE_ITEM_IDS_COUNT]; int32 RequiredNpcOrGo[QUEST_OBJECTIVES_COUNT]; // >0 Creature <0 Gameobject uint32 RequiredNpcOrGoCount[QUEST_OBJECTIVES_COUNT]; uint32 RequiredSpellCast[QUEST_OBJECTIVES_COUNT]; @@ -278,11 +297,16 @@ class Quest uint32 DetailsEmoteDelay[QUEST_EMOTE_COUNT]; uint32 OfferRewardEmote[QUEST_EMOTE_COUNT]; uint32 OfferRewardEmoteDelay[QUEST_EMOTE_COUNT]; + // 4.x + uint32 RewardCurrencyId[QUEST_REWARD_CURRENCY_COUNT]; + uint32 RewardCurrencyCount[QUEST_REWARD_CURRENCY_COUNT]; + uint32 RequiredCurrencyId[QUEST_REQUIRED_CURRENCY_COUNT]; + uint32 RequiredCurrencyCount[QUEST_REQUIRED_CURRENCY_COUNT]; - uint32 GetReqItemsCount() const { return m_reqitemscount; } - uint32 GetReqCreatureOrGOcount() const { return m_reqCreatureOrGOcount; } - uint32 GetRewChoiceItemsCount() const { return m_rewchoiceitemscount; } - uint32 GetRewItemsCount() const { return m_rewitemscount; } + uint32 GetReqItemsCount() const { return m_reqItemsCount; } + uint32 GetReqCreatureOrGOcount() const { return m_reqNpcOrGoCount; } + uint32 GetRewChoiceItemsCount() const { return m_rewChoiceItemsCount; } + uint32 GetRewItemsCount() const { return m_rewItemsCount; } typedef std::vector PrevQuests; PrevQuests prevQuests; @@ -291,10 +315,12 @@ class Quest // cached data private: - uint32 m_reqitemscount; - uint32 m_reqCreatureOrGOcount; - uint32 m_rewchoiceitemscount; - uint32 m_rewitemscount; + uint32 m_reqItemsCount; + uint32 m_reqNpcOrGoCount; + uint32 m_rewChoiceItemsCount; + uint32 m_rewItemsCount; + uint32 m_rewCurrencyCount; + uint32 m_reqCurrencyCount; // table data protected: @@ -355,6 +381,20 @@ class Quest uint32 EmoteOnComplete; uint32 StartScript; uint32 CompleteScript; + // new in 4.x + uint32 MinimapTargetMark; + uint32 RewardSkillId; + uint32 RewardSkillPoints; + uint32 RewardReputationMask; + uint32 QuestGiverPortrait; + uint32 QuestTurnInPortrait; + uint32 RequiredSpell; + std::string QuestGiverTextWindow; + std::string QuestGiverTargetName; + std::string QuestTurnTextWindow; + std::string QuestTurnTargetName; + uint32 SoundAccept; + uint32 SoundTurnIn; }; struct QuestStatusData -- cgit v1.2.3