diff --git a/sql/mangos.sql b/sql/mangos.sql index 5e68dd49f..07f85514e 100644 --- a/sql/mangos.sql +++ b/sql/mangos.sql @@ -24,7 +24,7 @@ CREATE TABLE `db_version` ( `version` varchar(120) default NULL, `creature_ai_version` varchar(120) default NULL, `cache_id` int(10) default '0', - `required_8693_01_mangos_spell_proc_event` bit(1) default NULL + `required_8720_01_mangos_quest_template` bit(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; -- @@ -13677,10 +13677,14 @@ CREATE TABLE `quest_template` ( `RewItemId2` mediumint(8) unsigned NOT NULL default '0', `RewItemId3` mediumint(8) unsigned NOT NULL default '0', `RewItemId4` mediumint(8) unsigned NOT NULL default '0', + `ReqItemId5` mediumint(8) unsigned NOT NULL default '0', + `ReqItemId6` mediumint(8) unsigned NOT NULL default '0', `RewItemCount1` smallint(5) unsigned NOT NULL default '0', `RewItemCount2` smallint(5) unsigned NOT NULL default '0', `RewItemCount3` smallint(5) unsigned NOT NULL default '0', `RewItemCount4` smallint(5) unsigned NOT NULL default '0', + `ReqItemCount5` smallint(5) unsigned NOT NULL default '0', + `ReqItemCount6` smallint(5) unsigned NOT NULL default '0', `RewRepFaction1` smallint(5) unsigned NOT NULL default '0' COMMENT 'faction id from Faction.dbc in this case', `RewRepFaction2` smallint(5) unsigned NOT NULL default '0' COMMENT 'faction id from Faction.dbc in this case', `RewRepFaction3` smallint(5) unsigned NOT NULL default '0' COMMENT 'faction id from Faction.dbc in this case', diff --git a/sql/updates/8720_01_mangos_quest_template.sql b/sql/updates/8720_01_mangos_quest_template.sql new file mode 100644 index 000000000..9cc1c99e3 --- /dev/null +++ b/sql/updates/8720_01_mangos_quest_template.sql @@ -0,0 +1,7 @@ +ALTER TABLE db_version CHANGE COLUMN required_8693_01_mangos_spell_proc_event required_8720_01_mangos_quest_template bit; + +alter table `quest_template` + add column `ReqItemId5` mediumint(8) UNSIGNED DEFAULT '0' NOT NULL after `ReqItemId4`, + add column `ReqItemId6` mediumint(8) UNSIGNED DEFAULT '0' NOT NULL after `ReqItemId5`, + add column `ReqItemCount5` smallint(5) UNSIGNED DEFAULT '0' NOT NULL after `ReqItemCount4`, + add column `ReqItemCount6` smallint(5) UNSIGNED DEFAULT '0' NOT NULL after `ReqItemCount5`; diff --git a/sql/updates/Makefile.am b/sql/updates/Makefile.am index 800b9a85e..03c547e6d 100644 --- a/sql/updates/Makefile.am +++ b/sql/updates/Makefile.am @@ -139,6 +139,7 @@ pkgdata_DATA = \ 8688_01_mangos_creature_template.sql \ 8693_01_mangos_spell_proc_event.sql \ 8702_01_characters_character_reputation.sql \ + 8720_01_mangos_quest_template.sql \ README ## Additional files to include when running 'make dist' @@ -258,4 +259,5 @@ EXTRA_DIST = \ 8688_01_mangos_creature_template.sql \ 8693_01_mangos_spell_proc_event.sql \ 8702_01_characters_character_reputation.sql \ + 8720_01_mangos_quest_template.sql \ README diff --git a/src/game/GossipDef.cpp b/src/game/GossipDef.cpp index 7a221a59f..422ad6f5f 100644 --- a/src/game/GossipDef.cpp +++ b/src/game/GossipDef.cpp @@ -519,8 +519,8 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest ) Details = pQuest->GetDetails(); Objectives = pQuest->GetObjectives(); EndText = pQuest->GetEndText(); - for (int i=0;iObjectiveText[i]; + for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) + ObjectiveText[i] = pQuest->ObjectiveText[i]; int loc_idx = pSession->GetSessionDbLocaleIndex(); if (loc_idx >= 0) @@ -537,9 +537,9 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest ) if (ql->EndText.size() > loc_idx && !ql->EndText[loc_idx].empty()) EndText=ql->EndText[loc_idx]; - for (int i=0;iObjectiveText[i].size() > loc_idx && !ql->ObjectiveText[i][loc_idx].empty()) - ObjectiveText[i]=ql->ObjectiveText[i][loc_idx]; + ObjectiveText[i] = ql->ObjectiveText[i][loc_idx]; } } @@ -626,17 +626,12 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest ) data << uint32(pQuest->ReqSourceId[iI]); } - for (iI = 0; iI < QUEST_OBJECTIVES_COUNT; ++iI) + for (iI = 0; iI < QUEST_ITEM_OBJECTIVES_COUNT; ++iI) { data << uint32(pQuest->ReqItemId[iI]); data << uint32(pQuest->ReqItemCount[iI]); } - data << uint32(0); // TODO: 5 item objective - data << uint32(0); - data << uint32(0); // TODO: 6 item objective - data << uint32(0); - for (iI = 0; iI < QUEST_OBJECTIVES_COUNT; ++iI) data << ObjectiveText[iI]; @@ -782,9 +777,10 @@ void PlayerMenu::SendQuestGiverRequestItems( Quest const *pQuest, uint64 npcGUID data << uint32( pQuest->GetReqItemsCount() ); ItemPrototype const *pItem; - for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) + for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) { - if ( !pQuest->ReqItemId[i] ) continue; + if ( !pQuest->ReqItemId[i] ) + continue; pItem = objmgr.GetItemPrototype(pQuest->ReqItemId[i]); data << uint32(pQuest->ReqItemId[i]); data << uint32(pQuest->ReqItemCount[i]); diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index 2253ab34c..1e09d4b61 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -4794,7 +4794,7 @@ bool ChatHandler::HandleQuestComplete(const char* args) } // Add quest items for quests that require items - for(uint8 x = 0; x < QUEST_OBJECTIVES_COUNT; ++x) + for(uint8 x = 0; x < QUEST_ITEM_OBJECTIVES_COUNT; ++x) { uint32 id = pQuest->ReqItemId[x]; uint32 count = pQuest->ReqItemCount[x]; @@ -4804,11 +4804,11 @@ bool ChatHandler::HandleQuestComplete(const char* args) uint32 curItemCount = player->GetItemCount(id,true); ItemPosCountVec dest; - uint8 msg = player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, id, count-curItemCount ); + uint8 msg = player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, id, count - curItemCount ); if( msg == EQUIP_ERR_OK ) { Item* item = player->StoreNewItem( dest, id, true); - player->SendNewItem(item,count-curItemCount,true,false); + player->SendNewItem(item,count-curItemCount, true, false); } } diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 8dc836d4a..edfca2b95 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -3224,31 +3224,31 @@ void ObjectMgr::LoadQuests() "QuestFlags, SpecialFlags, CharTitleId, PlayersSlain, BonusTalents, PrevQuestId, NextQuestId, ExclusiveGroup, NextQuestInChain, SrcItemId, SrcItemCount, SrcSpell," // 29 30 31 32 33 34 35 36 37 38 "Title, Details, Objectives, OfferRewardText, RequestItemsText, EndText, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4," - // 39 40 41 42 43 44 45 46 - "ReqItemId1, ReqItemId2, ReqItemId3, ReqItemId4, ReqItemCount1, ReqItemCount2, ReqItemCount3, ReqItemCount4," - // 47 48 49 50 51 52 53 54 + // 39 40 41 42 43 44 45 46 47 48 49 50 + "ReqItemId1, ReqItemId2, ReqItemId3, ReqItemId4, ReqItemId5, ReqItemId6, ReqItemCount1, ReqItemCount2, ReqItemCount3, ReqItemCount4, ReqItemCount5, ReqItemCount6," + // 51 52 53 54 55 56 57 58 "ReqSourceId1, ReqSourceId2, ReqSourceId3, ReqSourceId4, ReqSourceCount1, ReqSourceCount2, ReqSourceCount3, ReqSourceCount4," - // 55 56 57 58 59 60 61 62 + // 59 60 61 62 63 64 65 66 "ReqCreatureOrGOId1, ReqCreatureOrGOId2, ReqCreatureOrGOId3, ReqCreatureOrGOId4, ReqCreatureOrGOCount1, ReqCreatureOrGOCount2, ReqCreatureOrGOCount3, ReqCreatureOrGOCount4," - // 63 64 65 66 + // 67 68 69 70 "ReqSpellCast1, ReqSpellCast2, ReqSpellCast3, ReqSpellCast4," - // 67 68 69 70 71 72 + // 71 72 73 74 75 76 "RewChoiceItemId1, RewChoiceItemId2, RewChoiceItemId3, RewChoiceItemId4, RewChoiceItemId5, RewChoiceItemId6," - // 73 74 75 76 77 78 + // 77 78 79 80 81 82 "RewChoiceItemCount1, RewChoiceItemCount2, RewChoiceItemCount3, RewChoiceItemCount4, RewChoiceItemCount5, RewChoiceItemCount6," - // 79 80 81 82 83 84 85 86 + // 83 84 85 86 87 88 89 90 "RewItemId1, RewItemId2, RewItemId3, RewItemId4, RewItemCount1, RewItemCount2, RewItemCount3, RewItemCount4," - // 87 88 89 90 91 92 93 94 95 96 + // 91 92 93 94 95 96 97 98 99 100 "RewRepFaction1, RewRepFaction2, RewRepFaction3, RewRepFaction4, RewRepFaction5, RewRepValue1, RewRepValue2, RewRepValue3, RewRepValue4, RewRepValue5," - // 97 98 99 100 101 102 103 104 105 106 107 + // 101 102 103 104 105 106 107 108 109 110 111 "RewHonorableKills, RewOrReqMoney, RewMoneyMaxLevel, RewSpell, RewSpellCast, RewMailTemplateId, RewMailDelaySecs, PointMapId, PointX, PointY, PointOpt," - // 108 109 110 111 112 113 114 115 + // 112 113 114 115 116 117 118 119 "DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4, DetailsEmoteDelay1, DetailsEmoteDelay2, DetailsEmoteDelay3, DetailsEmoteDelay4," - // 116 117 118 119 120 121 + // 120 121 122 123 124 125 "IncompleteEmote, CompleteEmote, OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4," - // 122 123 124 125 + // 126 127 128 129 "OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4," - // 126 127 + // 130 131 "StartScript, CompleteScript" " FROM quest_template"); if(result == NULL) @@ -3502,15 +3502,15 @@ void ObjectMgr::LoadQuests() } } - for(int j = 0; j < QUEST_OBJECTIVES_COUNT; ++j ) + for(int j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j ) { uint32 id = qinfo->ReqItemId[j]; if(id) { - if(qinfo->ReqItemCount[j]==0) + if(qinfo->ReqItemCount[j] == 0) { sLog.outErrorDb("Quest %u has `ReqItemId%d` = %u but `ReqItemCount%d` = 0, quest can't be done.", - qinfo->GetQuestId(),j+1,id,j+1); + qinfo->GetQuestId(), j+1, id, j+1); // no changes, quest can't be done for this requirement } @@ -3519,14 +3519,14 @@ void ObjectMgr::LoadQuests() if(!sItemStorage.LookupEntry(id)) { sLog.outErrorDb("Quest %u has `ReqItemId%d` = %u but item with entry %u does not exist, quest can't be done.", - qinfo->GetQuestId(),j+1,id,id); + qinfo->GetQuestId(), j+1, id, id); qinfo->ReqItemCount[j] = 0; // prevent incorrect work of quest } } - else if(qinfo->ReqItemCount[j]>0) + else if(qinfo->ReqItemCount[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->GetQuestId(), j+1, j+1, qinfo->ReqItemCount[j]); qinfo->ReqItemCount[j] = 0; // prevent incorrect work of quest } } diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 3d79f8ee3..5b3dd8f9f 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -12418,9 +12418,9 @@ bool Player::CanCompleteQuest( uint32 quest_id ) if ( qInfo->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) ) { - for(int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) + for(int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) { - if( qInfo->ReqItemCount[i]!= 0 && q_status.m_itemcount[i] < qInfo->ReqItemCount[i] ) + if( qInfo->ReqItemCount[i] != 0 && q_status.m_itemcount[i] < qInfo->ReqItemCount[i] ) return false; } } @@ -12468,8 +12468,8 @@ bool Player::CanCompleteRepeatableQuest( Quest const *pQuest ) return false; if (pQuest->HasFlag( QUEST_MANGOS_FLAGS_DELIVER) ) - for(int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - if( pQuest->ReqItemId[i] && pQuest->ReqItemCount[i] && !HasItemCount(pQuest->ReqItemId[i],pQuest->ReqItemCount[i]) ) + for(int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) + if( pQuest->ReqItemId[i] && pQuest->ReqItemCount[i] && !HasItemCount(pQuest->ReqItemId[i], pQuest->ReqItemCount[i]) ) return false; if( !CanRewardQuest(pQuest, false) ) @@ -12495,9 +12495,9 @@ bool Player::CanRewardQuest( Quest const *pQuest, bool msg ) // prevent receive reward with quest items in bank if ( pQuest->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) ) { - for(int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) + for(int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) { - if( pQuest->ReqItemCount[i]!= 0 && + if( pQuest->ReqItemCount[i] != 0 && GetItemCount(pQuest->ReqItemId[i]) < pQuest->ReqItemCount[i] ) { if(msg) @@ -12577,7 +12577,7 @@ void Player::AddQuest( Quest const *pQuest, Object *questGiver ) if ( pQuest->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) ) { - for(int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) + for(int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) questStatusData.m_itemcount[i] = 0; } @@ -12675,7 +12675,7 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver uint32 quest_id = pQuest->GetQuestId(); - for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i ) + for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i ) { if (pQuest->ReqItemId[i]) DestroyItemCount( pQuest->ReqItemId[i], pQuest->ReqItemCount[i], true); @@ -13381,12 +13381,12 @@ void Player::AdjustQuestReqItemCount( Quest const* pQuest, QuestStatusData& ques { if ( pQuest->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) ) { - for(int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) + for(int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) { uint32 reqitemcount = pQuest->ReqItemCount[i]; if( reqitemcount != 0 ) { - uint32 curitemcount = GetItemCount(pQuest->ReqItemId[i],true); + uint32 curitemcount = GetItemCount(pQuest->ReqItemId[i], true); questStatusData.m_itemcount[i] = std::min(curitemcount, reqitemcount); if (questStatusData.uState != QUEST_NEW) questStatusData.uState = QUEST_CHANGED; @@ -13460,7 +13460,7 @@ void Player::ItemAddedQuestCheck( uint32 entry, uint32 count ) if( !qInfo || !qInfo->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) ) continue; - for (int j = 0; j < QUEST_OBJECTIVES_COUNT; ++j) + for (int j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j) { uint32 reqitem = qInfo->ReqItemId[j]; if ( reqitem == entry ) @@ -13497,7 +13497,7 @@ void Player::ItemRemovedQuestCheck( uint32 entry, uint32 count ) if( !qInfo->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) ) continue; - for (int j = 0; j < QUEST_OBJECTIVES_COUNT; ++j) + for (int j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j) { uint32 reqitem = qInfo->ReqItemId[j]; if ( reqitem == entry ) @@ -13509,7 +13509,7 @@ void Player::ItemRemovedQuestCheck( uint32 entry, uint32 count ) if( q_status.m_status != QUEST_STATUS_COMPLETE ) curitemcount = q_status.m_itemcount[j]; else - curitemcount = GetItemCount(entry,true); + curitemcount = GetItemCount(entry, true); if ( curitemcount < reqitemcount + count ) { uint32 remitemcount = ( curitemcount <= reqitemcount ? count : count + reqitemcount - curitemcount); @@ -13799,7 +13799,7 @@ bool Player::HasQuestForItem( uint32 itemid ) const // There should be no mixed ReqItem/ReqSource drop // This part for ReqItem drop - for (int j = 0; j < QUEST_OBJECTIVES_COUNT; ++j) + for (int j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j) { if(itemid == qinfo->ReqItemId[j] && q_status.m_itemcount[j] < qinfo->ReqItemCount[j] ) return true; diff --git a/src/game/QuestDef.cpp b/src/game/QuestDef.cpp index 8c71d83ac..5a53e5252 100644 --- a/src/game/QuestDef.cpp +++ b/src/game/QuestDef.cpp @@ -61,74 +61,74 @@ Quest::Quest(Field * questRecord) for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) ObjectiveText[i] = questRecord[35+i].GetCppString(); - for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) + for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) ReqItemId[i] = questRecord[39+i].GetUInt32(); - for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - ReqItemCount[i] = questRecord[43+i].GetUInt32(); + for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) + ReqItemCount[i] = questRecord[45+i].GetUInt32(); for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i) - ReqSourceId[i] = questRecord[47+i].GetUInt32(); + ReqSourceId[i] = questRecord[51+i].GetUInt32(); for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i) - ReqSourceCount[i] = questRecord[51+i].GetUInt32(); + ReqSourceCount[i] = questRecord[55+i].GetUInt32(); for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - ReqCreatureOrGOId[i] = questRecord[55+i].GetInt32(); + ReqCreatureOrGOId[i] = questRecord[59+i].GetInt32(); for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - ReqCreatureOrGOCount[i] = questRecord[59+i].GetUInt32(); + ReqCreatureOrGOCount[i] = questRecord[63+i].GetUInt32(); for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - ReqSpell[i] = questRecord[63+i].GetUInt32(); + ReqSpell[i] = questRecord[67+i].GetUInt32(); for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) - RewChoiceItemId[i] = questRecord[67+i].GetUInt32(); + RewChoiceItemId[i] = questRecord[71+i].GetUInt32(); for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) - RewChoiceItemCount[i] = questRecord[73+i].GetUInt32(); + RewChoiceItemCount[i] = questRecord[77+i].GetUInt32(); for (int i = 0; i < QUEST_REWARDS_COUNT; ++i) - RewItemId[i] = questRecord[79+i].GetUInt32(); + RewItemId[i] = questRecord[83+i].GetUInt32(); for (int i = 0; i < QUEST_REWARDS_COUNT; ++i) - RewItemCount[i] = questRecord[83+i].GetUInt32(); + RewItemCount[i] = questRecord[87+i].GetUInt32(); for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - RewRepFaction[i] = questRecord[87+i].GetUInt32(); + RewRepFaction[i] = questRecord[91+i].GetUInt32(); for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - RewRepValue[i] = questRecord[92+i].GetInt32(); + RewRepValue[i] = questRecord[96+i].GetInt32(); - RewHonorableKills = questRecord[97].GetUInt32(); - RewOrReqMoney = questRecord[98].GetInt32(); - RewMoneyMaxLevel = questRecord[99].GetUInt32(); - RewSpell = questRecord[100].GetUInt32(); - RewSpellCast = questRecord[101].GetUInt32(); - RewMailTemplateId = questRecord[102].GetUInt32(); - RewMailDelaySecs = questRecord[103].GetUInt32(); - PointMapId = questRecord[104].GetUInt32(); - PointX = questRecord[105].GetFloat(); - PointY = questRecord[106].GetFloat(); - PointOpt = questRecord[107].GetUInt32(); + RewHonorableKills = questRecord[101].GetUInt32(); + RewOrReqMoney = questRecord[102].GetInt32(); + RewMoneyMaxLevel = questRecord[103].GetUInt32(); + RewSpell = questRecord[104].GetUInt32(); + RewSpellCast = questRecord[105].GetUInt32(); + RewMailTemplateId = questRecord[106].GetUInt32(); + RewMailDelaySecs = questRecord[107].GetUInt32(); + PointMapId = questRecord[108].GetUInt32(); + PointX = questRecord[109].GetFloat(); + PointY = questRecord[110].GetFloat(); + PointOpt = questRecord[111].GetUInt32(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - DetailsEmote[i] = questRecord[108+i].GetUInt32(); + DetailsEmote[i] = questRecord[112+i].GetUInt32(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - DetailsEmoteDelay[i] = questRecord[112+i].GetUInt32(); + DetailsEmoteDelay[i] = questRecord[116+i].GetUInt32(); - IncompleteEmote = questRecord[116].GetUInt32(); - CompleteEmote = questRecord[117].GetUInt32(); + IncompleteEmote = questRecord[120].GetUInt32(); + CompleteEmote = questRecord[121].GetUInt32(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - OfferRewardEmote[i] = questRecord[118+i].GetInt32(); + OfferRewardEmote[i] = questRecord[122+i].GetInt32(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - OfferRewardEmoteDelay[i] = questRecord[122+i].GetInt32(); + OfferRewardEmoteDelay[i] = questRecord[126+i].GetInt32(); - QuestStartScript = questRecord[126].GetUInt32(); - QuestCompleteScript = questRecord[127].GetUInt32(); + QuestStartScript = questRecord[130].GetUInt32(); + QuestCompleteScript = questRecord[131].GetUInt32(); QuestFlags |= SpecialFlags << 16; @@ -137,10 +137,14 @@ Quest::Quest(Field * questRecord) m_rewitemscount = 0; m_rewchoiceitemscount = 0; - for (int i=0; i < QUEST_OBJECTIVES_COUNT; ++i) + for (int i=0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) { if ( ReqItemId[i] ) ++m_reqitemscount; + } + + for (int i=0; i < QUEST_OBJECTIVES_COUNT; ++i) + { if ( ReqCreatureOrGOId[i] ) ++m_reqCreatureOrGOcount; } diff --git a/src/game/QuestDef.h b/src/game/QuestDef.h index d8dc4fabf..546a5dcc5 100644 --- a/src/game/QuestDef.h +++ b/src/game/QuestDef.h @@ -32,6 +32,7 @@ class ObjectMgr; #define MAX_QUEST_LOG_SIZE 25 #define QUEST_OBJECTIVES_COUNT 4 +#define QUEST_ITEM_OBJECTIVES_COUNT 6 #define QUEST_SOURCE_ITEM_IDS_COUNT 4 #define QUEST_REWARD_CHOICES_COUNT 6 #define QUEST_REWARDS_COUNT 4 @@ -231,8 +232,8 @@ class Quest // multiple values std::string ObjectiveText[QUEST_OBJECTIVES_COUNT]; - uint32 ReqItemId[QUEST_OBJECTIVES_COUNT]; - uint32 ReqItemCount[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 @@ -332,7 +333,7 @@ struct QuestStatusData : m_status(QUEST_STATUS_NONE),m_rewarded(false), m_explored(false), m_timer(0), uState(QUEST_NEW) { - memset(m_itemcount, 0, QUEST_OBJECTIVES_COUNT * sizeof(uint32)); + memset(m_itemcount, 0, QUEST_ITEM_OBJECTIVES_COUNT * sizeof(uint32)); memset(m_creatureOrGOcount, 0, QUEST_OBJECTIVES_COUNT * sizeof(uint32)); } @@ -342,7 +343,7 @@ struct QuestStatusData uint32 m_timer; QuestUpdateState uState; - uint32 m_itemcount[ QUEST_OBJECTIVES_COUNT ]; + uint32 m_itemcount[ QUEST_ITEM_OBJECTIVES_COUNT ]; uint32 m_creatureOrGOcount[ QUEST_OBJECTIVES_COUNT ]; }; #endif diff --git a/src/game/QuestHandler.cpp b/src/game/QuestHandler.cpp index ad42c75b7..a93b65880 100644 --- a/src/game/QuestHandler.cpp +++ b/src/game/QuestHandler.cpp @@ -193,7 +193,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode( WorldPacket & recv_data ) // destroy not required for quest finish quest starting item bool destroyItem = true; - for(int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) + for(int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) { if ((qInfo->ReqItemId[i] == ((Item*)pObject)->GetEntry()) && (((Item*)pObject)->GetProto()->MaxCount > 0)) { @@ -203,7 +203,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode( WorldPacket & recv_data ) } if(destroyItem) - _player->DestroyItem(((Item*)pObject)->GetBagSlot(),((Item*)pObject)->GetSlot(),true); + _player->DestroyItem(((Item*)pObject)->GetBagSlot(), ((Item*)pObject)->GetSlot(), true); break; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 32d09e3e0..7ebc4dd25 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8719" + #define REVISION_NR "8720" #endif // __REVISION_NR_H__ diff --git a/src/shared/revision_sql.h b/src/shared/revision_sql.h index 73a6bbfed..aa84bca80 100644 --- a/src/shared/revision_sql.h +++ b/src/shared/revision_sql.h @@ -1,6 +1,6 @@ #ifndef __REVISION_SQL_H__ #define __REVISION_SQL_H__ #define REVISION_DB_CHARACTERS "required_8702_01_characters_character_reputation" - #define REVISION_DB_MANGOS "required_8693_01_mangos_spell_proc_event" + #define REVISION_DB_MANGOS "required_8720_01_mangos_quest_template" #define REVISION_DB_REALMD "required_8332_01_realmd_realmcharacters" #endif // __REVISION_SQL_H__