diff options
author | Stalker_Riddick <nenad_kuza@hotmail.com> | 2011-11-25 13:11:53 +0000 |
---|---|---|
committer | Nay <dnpd.dd@gmail.com> | 2011-11-25 13:11:53 +0000 |
commit | d8ffeed4767a42071ca075b23e3989069f91e4ab (patch) | |
tree | ec3f0c4b39ba5957ebb2014dfd7b42cc5ec225c0 /src | |
parent | d2b4f331128e10748ad31d3dbc83b36eba5904ca (diff) |
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 <nofantasy@nf.no>
Signed-off-by: Stalker_Riddick <nenad_kuza@hotmail.com>
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/Entities/Player/Player.cpp | 66 | ||||
-rwxr-xr-x | src/server/game/Entities/Player/Player.h | 5 | ||||
-rwxr-xr-x | src/server/game/Globals/ObjectMgr.cpp | 91 | ||||
-rwxr-xr-x | src/server/game/Quests/QuestDef.cpp | 147 | ||||
-rwxr-xr-x | src/server/game/Quests/QuestDef.h | 6 |
5 files changed, 151 insertions, 164 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 24e83da78d5..fce50bc37d2 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -14515,7 +14515,7 @@ Quest const* Player::GetNextQuest(uint64 guid, Quest const* quest) bool Player::CanSeeStartQuest(Quest const* quest) { - if (SatisfyQuestRace(quest, false) && SatisfyQuestSkillOrClass(quest, false) && + if (SatisfyQuestClass(quest, false) && SatisfyQuestRace(quest, false) && SatisfyQuestSkill(quest, false) && SatisfyQuestExclusiveGroup(quest, false) && SatisfyQuestReputation(quest, false) && SatisfyQuestPreviousQuest(quest, false) && SatisfyQuestNextChain(quest, false) && SatisfyQuestPrevChain(quest, false) && SatisfyQuestDay(quest, false) && SatisfyQuestWeek(quest, false) && @@ -14530,8 +14530,8 @@ bool Player::CanSeeStartQuest(Quest const* quest) bool Player::CanTakeQuest(Quest const* quest, bool msg) { return SatisfyQuestStatus(quest, msg) && SatisfyQuestExclusiveGroup(quest, msg) - && SatisfyQuestRace(quest, msg) && SatisfyQuestLevel(quest, msg) - && SatisfyQuestSkillOrClass(quest, msg) && SatisfyQuestReputation(quest, msg) + && SatisfyQuestClass(quest, msg) && SatisfyQuestRace(quest, msg) && SatisfyQuestLevel(quest, msg) + && SatisfyQuestSkill(quest, msg) && SatisfyQuestReputation(quest, msg) && SatisfyQuestPreviousQuest(quest, msg) && SatisfyQuestTimed(quest, msg) && SatisfyQuestNextChain(quest, msg) && SatisfyQuestPrevChain(quest, msg) && SatisfyQuestDay(quest, msg) && SatisfyQuestWeek(quest, msg) @@ -15062,47 +15062,21 @@ void Player::FailQuest(uint32 questId) } } -bool Player::SatisfyQuestSkillOrClass(Quest const* qInfo, bool msg) +bool Player::SatisfyQuestSkill(Quest const* qInfo, bool msg) const { - int32 zoneOrSort = qInfo->GetZoneOrSort(); - int32 skillOrClassMask = qInfo->GetSkillOrClassMask(); + uint32 skill = qInfo->GetRequiredSkill(); - // skip zone zoneOrSort and 0 case skillOrClass - if (zoneOrSort >= 0 && skillOrClassMask == 0) + // skip 0 case RequiredSkill + if (skill == 0) return true; - int32 questSort = -zoneOrSort; - uint8 reqSortClass = ClassByQuestSort(questSort); - - // check class sort cases in zoneOrSort - if (reqSortClass != 0 && getClass() != reqSortClass) + // check skill value + if (GetSkillValue(skill) < qInfo->GetRequiredSkillValue()) { if (msg) SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ); - return false; - } - // check class - if (skillOrClassMask < 0) - { - uint32 reqClassMask = -int32(skillOrClassMask); - if (!(reqClassMask & getClassMask())) - { - if (msg) - SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ); - return false; - } - } - // check skill - else if (skillOrClassMask > 0) - { - uint32 reqSkill = skillOrClassMask; - if (GetSkillValue(reqSkill) < qInfo->GetRequiredSkillValue()) - { - if (msg) - SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ); - return false; - } + return false; } return true; @@ -15230,6 +15204,24 @@ bool Player::SatisfyQuestPreviousQuest(Quest const* qInfo, bool msg) return false; } +bool Player::SatisfyQuestClass(Quest const* qInfo, bool msg) const +{ + uint32 reqClass = qInfo->GetRequiredClasses(); + + if (reqClass == 0) + return true; + + if ((reqClass & getClassMask()) == 0) + { + if (msg) + SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ); + + return false; + } + + return true; +} + bool Player::SatisfyQuestRace(Quest const* qInfo, bool msg) { uint32 reqraces = qInfo->GetRequiredRaces(); @@ -16201,7 +16193,7 @@ void Player::SendQuestTimerFailed(uint32 quest_id) } } -void Player::SendCanTakeQuestResponse(uint32 msg) +void Player::SendCanTakeQuestResponse(uint32 msg) const { WorldPacket data(SMSG_QUESTGIVER_QUEST_INVALID, 4); data << uint32(msg); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 9aad63ccb1b..da58a7dadbf 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1410,10 +1410,11 @@ class Player : public Unit, public GridObject<Player> void IncompleteQuest(uint32 quest_id); void RewardQuest(Quest const* quest, uint32 reward, Object* questGiver, bool announce = true); void FailQuest(uint32 quest_id); - bool SatisfyQuestSkillOrClass(Quest const* qInfo, bool msg); + bool SatisfyQuestSkill(Quest const* qInfo, bool msg) const; bool SatisfyQuestLevel(Quest const* qInfo, bool msg); bool SatisfyQuestLog(bool msg); bool SatisfyQuestPreviousQuest(Quest const* qInfo, bool msg); + bool SatisfyQuestClass(Quest const* qInfo, bool msg) const; bool SatisfyQuestRace(Quest const* qInfo, bool msg); bool SatisfyQuestReputation(Quest const* qInfo, bool msg); bool SatisfyQuestStatus(Quest const* qInfo, bool msg); @@ -1493,7 +1494,7 @@ class Player : public Unit, public GridObject<Player> void SendQuestReward(Quest const* quest, uint32 XP, Object* questGiver); void SendQuestFailed(uint32 questId, InventoryResult reason = EQUIP_ERR_OK); void SendQuestTimerFailed(uint32 quest_id); - void SendCanTakeQuestResponse(uint32 msg); + void SendCanTakeQuestResponse(uint32 msg) const; void SendQuestConfirmAccept(Quest const* quest, Player* pReceiver); void SendPushToPartyResponse(Player* player, uint32 msg); void SendQuestUpdateAddItem(Quest const* quest, uint32 item_idx, uint16 count); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 1047ff90174..c1af7bcfed4 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -3691,41 +3691,41 @@ void ObjectMgr::LoadQuests() mExclusiveQuestGroups.clear(); - // 0 1 2 3 4 5 6 7 8 9 - QueryResult result = WorldDatabase.Query("SELECT entry, Method, ZoneOrSort, SkillOrClassMask, MinLevel, MaxLevel, QuestLevel, Type, RequiredRaces, RequiredSkillValue, " - // 10 11 12 13 14 15 16 17 18 19 + // 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, " - // 20 21 22 23 24 25 26 27 28 29 30 31 32 33 + // 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, " - // 34 35 36 37 38 39 40 41 42 43 44 + // 35 36 37 38 39 40 41 42 43 44 45 "Title, Details, Objectives, OfferRewardText, RequestItemsText, EndText, CompletedText, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4, " - // 45 46 47 48 49 50 51 52 53 54 55 56 + // 46 47 48 49 50 51 52 53 54 55 56 57 "ReqItemId1, ReqItemId2, ReqItemId3, ReqItemId4, ReqItemId5, ReqItemId6, ReqItemCount1, ReqItemCount2, ReqItemCount3, ReqItemCount4, ReqItemCount5, ReqItemCount6, " - // 57 58 59 60 61 62 63 64 + // 58 59 60 61 62 63 64 65 "ReqSourceId1, ReqSourceId2, ReqSourceId3, ReqSourceId4, ReqSourceCount1, ReqSourceCount2, ReqSourceCount3, ReqSourceCount4, " - // 65 66 67 68 69 70 71 72 + // 66 67 68 69 70 71 72 73 "ReqCreatureOrGOId1, ReqCreatureOrGOId2, ReqCreatureOrGOId3, ReqCreatureOrGOId4, ReqCreatureOrGOCount1, ReqCreatureOrGOCount2, ReqCreatureOrGOCount3, ReqCreatureOrGOCount4, " - // 73 74 75 76 + // 74 75 76 77 "ReqSpellCast1, ReqSpellCast2, ReqSpellCast3, ReqSpellCast4, " - // 77 78 79 80 81 82 + // 78 79 80 81 82 83 "RewChoiceItemId1, RewChoiceItemId2, RewChoiceItemId3, RewChoiceItemId4, RewChoiceItemId5, RewChoiceItemId6, " - // 83 84 85 86 87 88 + // 84 85 86 87 88 89 "RewChoiceItemCount1, RewChoiceItemCount2, RewChoiceItemCount3, RewChoiceItemCount4, RewChoiceItemCount5, RewChoiceItemCount6, " - // 89 90 91 92 93 94 95 96 + // 90 91 92 93 94 95 96 97 "RewItemId1, RewItemId2, RewItemId3, RewItemId4, RewItemCount1, RewItemCount2, RewItemCount3, RewItemCount4, " - // 97 98 99 100 101 102 103 104 105 106 + // 98 99 100 101 102 103 104 105 106 107 "RewRepFaction1, RewRepFaction2, RewRepFaction3, RewRepFaction4, RewRepFaction5, RewRepValueId1, RewRepValueId2, RewRepValueId3, RewRepValueId4, RewRepValueId5, " - // 107 108 109 110 111 + // 108 109 110 111 112 "RewRepValue1, RewRepValue2, RewRepValue3, RewRepValue4, RewRepValue5, " - // 112 113 114 115 116 117 118 119 120 121 122 123 + // 113 114 115 116 117 118 119 120 121 122 123 124 "RewHonorAddition, RewHonorMultiplier, RewOrReqMoney, RewMoneyMaxLevel, RewSpell, RewSpellCast, RewMailTemplateId, RewMailDelaySecs, PointMapId, PointX, PointY, PointOpt, " - // 124 125 126 127 128 129 130 131 + // 125 126 127 128 129 130 131 132 "DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4, DetailsEmoteDelay1, DetailsEmoteDelay2, DetailsEmoteDelay3, DetailsEmoteDelay4, " - // 132 133 134 135 136 137 + // 133 134 135 136 137 138 "IncompleteEmote, CompleteEmote, OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4, " - // 138 139 140 141 + // 139 140 141 142 "OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4, " - // 142 143 + // 143 144 "StartScript, CompleteScript" " FROM quest_template"); if (!result) @@ -3829,45 +3829,43 @@ 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 SkillOrClass value (class case). - if (ClassByQuestSort(-int32(qinfo->ZoneOrSort))) - { - // SkillOrClass should not have class case when class case already set in ZoneOrSort. - if (qinfo->SkillOrClassMask < 0) - { - sLog->outErrorDb("Quest %u has `ZoneOrSort` = %i (class sort case) and `SkillOrClassMask` = %i (class case), redundant.", - qinfo->GetQuestId(), qinfo->ZoneOrSort, qinfo->SkillOrClassMask); - } - } - //check for proper SkillOrClass value (skill case) + //check for proper RequiredSkill value (skill case) if (int32 skill_id = SkillByQuestSort(-int32(qinfo->ZoneOrSort))) { - // skill is positive value in SkillOrClass - if (qinfo->SkillOrClassMask != skill_id) + if (qinfo->RequiredSkill != skill_id) { - sLog->outErrorDb("Quest %u has `ZoneOrSort` = %i (skill sort case) but `SkillOrClassMask` does not have a corresponding value (%i).", + sLog->outErrorDb("Quest %u has `ZoneOrSort` = %i but `RequiredSkill` does not have a corresponding value (%i).", qinfo->GetQuestId(), qinfo->ZoneOrSort, skill_id); //override, and force proper value here? } } } - // SkillOrClassMask (class case) - if (qinfo->SkillOrClassMask < 0) + // RequiredClasses, can be 0/CLASSMASK_ALL_PLAYABLE to allow any class + if (qinfo->RequiredClasses) { - if (!(-int32(qinfo->SkillOrClassMask) & CLASSMASK_ALL_PLAYABLE)) + if (!(qinfo->RequiredClasses & CLASSMASK_ALL_PLAYABLE)) { - sLog->outErrorDb("Quest %u has `SkillOrClassMask` = %i (class case) but classmask does not have valid class", - qinfo->GetQuestId(), qinfo->SkillOrClassMask); + sLog->outErrorDb("Quest %u does not contain any playable classes in `RequiredClasses` (%u), value set to 0 (all classes).", qinfo->GetQuestId(), qinfo->RequiredClasses); + qinfo->RequiredClasses = 0; } } - // SkillOrClassMask (skill case) - if (qinfo->SkillOrClassMask > 0) + // RequiredRaces, can be 0/RACEMASK_ALL_PLAYABLE to allow any race + if (qinfo->RequiredRaces) + { + if (!(qinfo->RequiredRaces & RACEMASK_ALL_PLAYABLE)) + { + sLog->outErrorDb("Quest %u does not contain any playable races in `RequiredRaces` (%u), value set to 0 (all races).", qinfo->GetQuestId(), qinfo->RequiredRaces); + qinfo->RequiredRaces = 0; + } + } + // RequiredSkill, can be 0 + if (qinfo->RequiredSkill) { - if (!sSkillLineStore.LookupEntry(qinfo->SkillOrClassMask)) + if (!sSkillLineStore.LookupEntry(qinfo->RequiredSkill)) { - sLog->outErrorDb("Quest %u has `SkillOrClass` = %u (skill case) but skill (%i) does not exist", - qinfo->GetQuestId(), qinfo->SkillOrClassMask, qinfo->SkillOrClassMask); + sLog->outErrorDb("Quest %u has `RequiredSkill` = %u but this skill does not exist", + qinfo->GetQuestId(), qinfo->RequiredSkill); } } @@ -3879,13 +3877,6 @@ void ObjectMgr::LoadQuests() qinfo->GetQuestId(), qinfo->RequiredSkillValue, sWorld->GetConfigMaxSkillValue()); // no changes, quest can't be done for this requirement } - - if (qinfo->SkillOrClassMask <= 0) - { - sLog->outErrorDb("Quest %u has `RequiredSkillValue` = %u but `SkillOrClass` = %i (class case), value ignored.", - qinfo->GetQuestId(), qinfo->RequiredSkillValue, qinfo->SkillOrClassMask); - // no changes, quest can't be done for this requirement (fail at wrong skill id) - } } // else Skill quests can have 0 skill level, this is ok 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) diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index 90e52660160..895b87f4465 100755 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -192,12 +192,13 @@ class Quest uint32 GetQuestId() const { return QuestId; } uint32 GetQuestMethod() const { return QuestMethod; } int32 GetZoneOrSort() const { return ZoneOrSort; } - int32 GetSkillOrClassMask() const { return SkillOrClassMask; } uint32 GetMinLevel() const { return MinLevel; } uint32 GetMaxLevel() const { return MaxLevel; } uint32 GetQuestLevel() const { return QuestLevel; } 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; } @@ -300,12 +301,13 @@ class Quest uint32 QuestId; uint32 QuestMethod; int32 ZoneOrSort; - int32 SkillOrClassMask; uint32 MinLevel; uint32 MaxLevel; int32 QuestLevel; uint32 Type; + uint32 RequiredClasses; uint32 RequiredRaces; + uint32 RequiredSkill; uint32 RequiredSkillValue; uint32 RepObjectiveFaction; int32 RepObjectiveValue; |