[8720] Added missing ReqItem 5 and 6 to database.

(backported from commit 7a722b8)
This commit is contained in:
tomrus88 2009-10-24 03:07:18 +04:00 committed by VladimirMangos
parent e79aa4dee2
commit 3cc7f36006
12 changed files with 106 additions and 92 deletions

View file

@ -24,7 +24,7 @@ CREATE TABLE `db_version` (
`version` varchar(120) default NULL, `version` varchar(120) default NULL,
`creature_ai_version` varchar(120) default NULL, `creature_ai_version` varchar(120) default NULL,
`cache_id` int(10) default '0', `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'; ) 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', `RewItemId2` mediumint(8) unsigned NOT NULL default '0',
`RewItemId3` mediumint(8) unsigned NOT NULL default '0', `RewItemId3` mediumint(8) unsigned NOT NULL default '0',
`RewItemId4` 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', `RewItemCount1` smallint(5) unsigned NOT NULL default '0',
`RewItemCount2` smallint(5) unsigned NOT NULL default '0', `RewItemCount2` smallint(5) unsigned NOT NULL default '0',
`RewItemCount3` smallint(5) unsigned NOT NULL default '0', `RewItemCount3` smallint(5) unsigned NOT NULL default '0',
`RewItemCount4` 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', `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', `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', `RewRepFaction3` smallint(5) unsigned NOT NULL default '0' COMMENT 'faction id from Faction.dbc in this case',

View file

@ -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`;

View file

@ -139,6 +139,7 @@ pkgdata_DATA = \
8688_01_mangos_creature_template.sql \ 8688_01_mangos_creature_template.sql \
8693_01_mangos_spell_proc_event.sql \ 8693_01_mangos_spell_proc_event.sql \
8702_01_characters_character_reputation.sql \ 8702_01_characters_character_reputation.sql \
8720_01_mangos_quest_template.sql \
README README
## Additional files to include when running 'make dist' ## Additional files to include when running 'make dist'
@ -258,4 +259,5 @@ EXTRA_DIST = \
8688_01_mangos_creature_template.sql \ 8688_01_mangos_creature_template.sql \
8693_01_mangos_spell_proc_event.sql \ 8693_01_mangos_spell_proc_event.sql \
8702_01_characters_character_reputation.sql \ 8702_01_characters_character_reputation.sql \
8720_01_mangos_quest_template.sql \
README README

View file

@ -519,8 +519,8 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest )
Details = pQuest->GetDetails(); Details = pQuest->GetDetails();
Objectives = pQuest->GetObjectives(); Objectives = pQuest->GetObjectives();
EndText = pQuest->GetEndText(); EndText = pQuest->GetEndText();
for (int i=0;i<QUEST_OBJECTIVES_COUNT;++i) for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
ObjectiveText[i]=pQuest->ObjectiveText[i]; ObjectiveText[i] = pQuest->ObjectiveText[i];
int loc_idx = pSession->GetSessionDbLocaleIndex(); int loc_idx = pSession->GetSessionDbLocaleIndex();
if (loc_idx >= 0) 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()) if (ql->EndText.size() > loc_idx && !ql->EndText[loc_idx].empty())
EndText=ql->EndText[loc_idx]; EndText=ql->EndText[loc_idx];
for (int i=0;i<QUEST_OBJECTIVES_COUNT;++i) for (int i = 0;i < QUEST_OBJECTIVES_COUNT; ++i)
if (ql->ObjectiveText[i].size() > loc_idx && !ql->ObjectiveText[i][loc_idx].empty()) if (ql->ObjectiveText[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]); 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->ReqItemId[iI]);
data << uint32(pQuest->ReqItemCount[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) for (iI = 0; iI < QUEST_OBJECTIVES_COUNT; ++iI)
data << ObjectiveText[iI]; data << ObjectiveText[iI];
@ -782,9 +777,10 @@ void PlayerMenu::SendQuestGiverRequestItems( Quest const *pQuest, uint64 npcGUID
data << uint32( pQuest->GetReqItemsCount() ); data << uint32( pQuest->GetReqItemsCount() );
ItemPrototype const *pItem; 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]); pItem = objmgr.GetItemPrototype(pQuest->ReqItemId[i]);
data << uint32(pQuest->ReqItemId[i]); data << uint32(pQuest->ReqItemId[i]);
data << uint32(pQuest->ReqItemCount[i]); data << uint32(pQuest->ReqItemCount[i]);

View file

@ -4794,7 +4794,7 @@ bool ChatHandler::HandleQuestComplete(const char* args)
} }
// Add quest items for quests that require items // 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 id = pQuest->ReqItemId[x];
uint32 count = pQuest->ReqItemCount[x]; uint32 count = pQuest->ReqItemCount[x];
@ -4804,11 +4804,11 @@ bool ChatHandler::HandleQuestComplete(const char* args)
uint32 curItemCount = player->GetItemCount(id,true); uint32 curItemCount = player->GetItemCount(id,true);
ItemPosCountVec dest; 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 ) if( msg == EQUIP_ERR_OK )
{ {
Item* item = player->StoreNewItem( dest, id, true); Item* item = player->StoreNewItem( dest, id, true);
player->SendNewItem(item,count-curItemCount,true,false); player->SendNewItem(item,count-curItemCount, true, false);
} }
} }

View file

@ -3224,31 +3224,31 @@ void ObjectMgr::LoadQuests()
"QuestFlags, SpecialFlags, CharTitleId, PlayersSlain, BonusTalents, PrevQuestId, NextQuestId, ExclusiveGroup, NextQuestInChain, SrcItemId, SrcItemCount, SrcSpell," "QuestFlags, SpecialFlags, CharTitleId, PlayersSlain, BonusTalents, PrevQuestId, NextQuestId, ExclusiveGroup, NextQuestInChain, SrcItemId, SrcItemCount, SrcSpell,"
// 29 30 31 32 33 34 35 36 37 38 // 29 30 31 32 33 34 35 36 37 38
"Title, Details, Objectives, OfferRewardText, RequestItemsText, EndText, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4," "Title, Details, Objectives, OfferRewardText, RequestItemsText, EndText, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4,"
// 39 40 41 42 43 44 45 46 // 39 40 41 42 43 44 45 46 47 48 49 50
"ReqItemId1, ReqItemId2, ReqItemId3, ReqItemId4, ReqItemCount1, ReqItemCount2, ReqItemCount3, ReqItemCount4," "ReqItemId1, ReqItemId2, ReqItemId3, ReqItemId4, ReqItemId5, ReqItemId6, ReqItemCount1, ReqItemCount2, ReqItemCount3, ReqItemCount4, ReqItemCount5, ReqItemCount6,"
// 47 48 49 50 51 52 53 54 // 51 52 53 54 55 56 57 58
"ReqSourceId1, ReqSourceId2, ReqSourceId3, ReqSourceId4, ReqSourceCount1, ReqSourceCount2, ReqSourceCount3, ReqSourceCount4," "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," "ReqCreatureOrGOId1, ReqCreatureOrGOId2, ReqCreatureOrGOId3, ReqCreatureOrGOId4, ReqCreatureOrGOCount1, ReqCreatureOrGOCount2, ReqCreatureOrGOCount3, ReqCreatureOrGOCount4,"
// 63 64 65 66 // 67 68 69 70
"ReqSpellCast1, ReqSpellCast2, ReqSpellCast3, ReqSpellCast4," "ReqSpellCast1, ReqSpellCast2, ReqSpellCast3, ReqSpellCast4,"
// 67 68 69 70 71 72 // 71 72 73 74 75 76
"RewChoiceItemId1, RewChoiceItemId2, RewChoiceItemId3, RewChoiceItemId4, RewChoiceItemId5, RewChoiceItemId6," "RewChoiceItemId1, RewChoiceItemId2, RewChoiceItemId3, RewChoiceItemId4, RewChoiceItemId5, RewChoiceItemId6,"
// 73 74 75 76 77 78 // 77 78 79 80 81 82
"RewChoiceItemCount1, RewChoiceItemCount2, RewChoiceItemCount3, RewChoiceItemCount4, RewChoiceItemCount5, RewChoiceItemCount6," "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," "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," "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," "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," "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," "IncompleteEmote, CompleteEmote, OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4,"
// 122 123 124 125 // 126 127 128 129
"OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4," "OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4,"
// 126 127 // 130 131
"StartScript, CompleteScript" "StartScript, CompleteScript"
" FROM quest_template"); " FROM quest_template");
if(result == NULL) 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]; uint32 id = qinfo->ReqItemId[j];
if(id) 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.", 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 // no changes, quest can't be done for this requirement
} }
@ -3519,14 +3519,14 @@ void ObjectMgr::LoadQuests()
if(!sItemStorage.LookupEntry<ItemPrototype>(id)) if(!sItemStorage.LookupEntry<ItemPrototype>(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 `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 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.", 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 qinfo->ReqItemCount[j] = 0; // prevent incorrect work of quest
} }
} }

View file

@ -12418,9 +12418,9 @@ bool Player::CanCompleteQuest( uint32 quest_id )
if ( qInfo->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) ) 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; return false;
} }
} }
@ -12468,8 +12468,8 @@ bool Player::CanCompleteRepeatableQuest( Quest const *pQuest )
return false; return false;
if (pQuest->HasFlag( QUEST_MANGOS_FLAGS_DELIVER) ) 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->ReqItemId[i] && pQuest->ReqItemCount[i] && !HasItemCount(pQuest->ReqItemId[i],pQuest->ReqItemCount[i]) ) if( pQuest->ReqItemId[i] && pQuest->ReqItemCount[i] && !HasItemCount(pQuest->ReqItemId[i], pQuest->ReqItemCount[i]) )
return false; return false;
if( !CanRewardQuest(pQuest, 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 // prevent receive reward with quest items in bank
if ( pQuest->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) ) 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] ) GetItemCount(pQuest->ReqItemId[i]) < pQuest->ReqItemCount[i] )
{ {
if(msg) if(msg)
@ -12577,7 +12577,7 @@ void Player::AddQuest( Quest const *pQuest, Object *questGiver )
if ( pQuest->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) ) 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; questStatusData.m_itemcount[i] = 0;
} }
@ -12675,7 +12675,7 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver
uint32 quest_id = pQuest->GetQuestId(); 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]) if (pQuest->ReqItemId[i])
DestroyItemCount( pQuest->ReqItemId[i], pQuest->ReqItemCount[i], true); 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 ) ) 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]; uint32 reqitemcount = pQuest->ReqItemCount[i];
if( reqitemcount != 0 ) 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); questStatusData.m_itemcount[i] = std::min(curitemcount, reqitemcount);
if (questStatusData.uState != QUEST_NEW) questStatusData.uState = QUEST_CHANGED; 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 ) ) if( !qInfo || !qInfo->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) )
continue; 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]; uint32 reqitem = qInfo->ReqItemId[j];
if ( reqitem == entry ) if ( reqitem == entry )
@ -13497,7 +13497,7 @@ void Player::ItemRemovedQuestCheck( uint32 entry, uint32 count )
if( !qInfo->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) ) if( !qInfo->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) )
continue; 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]; uint32 reqitem = qInfo->ReqItemId[j];
if ( reqitem == entry ) if ( reqitem == entry )
@ -13509,7 +13509,7 @@ void Player::ItemRemovedQuestCheck( uint32 entry, uint32 count )
if( q_status.m_status != QUEST_STATUS_COMPLETE ) if( q_status.m_status != QUEST_STATUS_COMPLETE )
curitemcount = q_status.m_itemcount[j]; curitemcount = q_status.m_itemcount[j];
else else
curitemcount = GetItemCount(entry,true); curitemcount = GetItemCount(entry, true);
if ( curitemcount < reqitemcount + count ) if ( curitemcount < reqitemcount + count )
{ {
uint32 remitemcount = ( curitemcount <= reqitemcount ? count : count + reqitemcount - curitemcount); 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 // There should be no mixed ReqItem/ReqSource drop
// This part for ReqItem 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] ) if(itemid == qinfo->ReqItemId[j] && q_status.m_itemcount[j] < qinfo->ReqItemCount[j] )
return true; return true;

View file

@ -61,74 +61,74 @@ Quest::Quest(Field * questRecord)
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
ObjectiveText[i] = questRecord[35+i].GetCppString(); 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(); ReqItemId[i] = questRecord[39+i].GetUInt32();
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
ReqItemCount[i] = questRecord[43+i].GetUInt32(); ReqItemCount[i] = questRecord[45+i].GetUInt32();
for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i) 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) 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) 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) 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) 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) 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) 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) 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) 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) 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) 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(); RewHonorableKills = questRecord[101].GetUInt32();
RewOrReqMoney = questRecord[98].GetInt32(); RewOrReqMoney = questRecord[102].GetInt32();
RewMoneyMaxLevel = questRecord[99].GetUInt32(); RewMoneyMaxLevel = questRecord[103].GetUInt32();
RewSpell = questRecord[100].GetUInt32(); RewSpell = questRecord[104].GetUInt32();
RewSpellCast = questRecord[101].GetUInt32(); RewSpellCast = questRecord[105].GetUInt32();
RewMailTemplateId = questRecord[102].GetUInt32(); RewMailTemplateId = questRecord[106].GetUInt32();
RewMailDelaySecs = questRecord[103].GetUInt32(); RewMailDelaySecs = questRecord[107].GetUInt32();
PointMapId = questRecord[104].GetUInt32(); PointMapId = questRecord[108].GetUInt32();
PointX = questRecord[105].GetFloat(); PointX = questRecord[109].GetFloat();
PointY = questRecord[106].GetFloat(); PointY = questRecord[110].GetFloat();
PointOpt = questRecord[107].GetUInt32(); PointOpt = questRecord[111].GetUInt32();
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) 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) 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(); IncompleteEmote = questRecord[120].GetUInt32();
CompleteEmote = questRecord[117].GetUInt32(); CompleteEmote = questRecord[121].GetUInt32();
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) 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) 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(); QuestStartScript = questRecord[130].GetUInt32();
QuestCompleteScript = questRecord[127].GetUInt32(); QuestCompleteScript = questRecord[131].GetUInt32();
QuestFlags |= SpecialFlags << 16; QuestFlags |= SpecialFlags << 16;
@ -137,10 +137,14 @@ Quest::Quest(Field * questRecord)
m_rewitemscount = 0; m_rewitemscount = 0;
m_rewchoiceitemscount = 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] ) if ( ReqItemId[i] )
++m_reqitemscount; ++m_reqitemscount;
}
for (int i=0; i < QUEST_OBJECTIVES_COUNT; ++i)
{
if ( ReqCreatureOrGOId[i] ) if ( ReqCreatureOrGOId[i] )
++m_reqCreatureOrGOcount; ++m_reqCreatureOrGOcount;
} }

View file

@ -32,6 +32,7 @@ class ObjectMgr;
#define MAX_QUEST_LOG_SIZE 25 #define MAX_QUEST_LOG_SIZE 25
#define QUEST_OBJECTIVES_COUNT 4 #define QUEST_OBJECTIVES_COUNT 4
#define QUEST_ITEM_OBJECTIVES_COUNT 6
#define QUEST_SOURCE_ITEM_IDS_COUNT 4 #define QUEST_SOURCE_ITEM_IDS_COUNT 4
#define QUEST_REWARD_CHOICES_COUNT 6 #define QUEST_REWARD_CHOICES_COUNT 6
#define QUEST_REWARDS_COUNT 4 #define QUEST_REWARDS_COUNT 4
@ -231,8 +232,8 @@ class Quest
// multiple values // multiple values
std::string ObjectiveText[QUEST_OBJECTIVES_COUNT]; std::string ObjectiveText[QUEST_OBJECTIVES_COUNT];
uint32 ReqItemId[QUEST_OBJECTIVES_COUNT]; uint32 ReqItemId[QUEST_ITEM_OBJECTIVES_COUNT];
uint32 ReqItemCount[QUEST_OBJECTIVES_COUNT]; uint32 ReqItemCount[QUEST_ITEM_OBJECTIVES_COUNT];
uint32 ReqSourceId[QUEST_SOURCE_ITEM_IDS_COUNT]; uint32 ReqSourceId[QUEST_SOURCE_ITEM_IDS_COUNT];
uint32 ReqSourceCount[QUEST_SOURCE_ITEM_IDS_COUNT]; uint32 ReqSourceCount[QUEST_SOURCE_ITEM_IDS_COUNT];
int32 ReqCreatureOrGOId[QUEST_OBJECTIVES_COUNT]; // >0 Creature <0 Gameobject int32 ReqCreatureOrGOId[QUEST_OBJECTIVES_COUNT]; // >0 Creature <0 Gameobject
@ -332,7 +333,7 @@ struct QuestStatusData
: m_status(QUEST_STATUS_NONE),m_rewarded(false), : m_status(QUEST_STATUS_NONE),m_rewarded(false),
m_explored(false), m_timer(0), uState(QUEST_NEW) 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)); memset(m_creatureOrGOcount, 0, QUEST_OBJECTIVES_COUNT * sizeof(uint32));
} }
@ -342,7 +343,7 @@ struct QuestStatusData
uint32 m_timer; uint32 m_timer;
QuestUpdateState uState; QuestUpdateState uState;
uint32 m_itemcount[ QUEST_OBJECTIVES_COUNT ]; uint32 m_itemcount[ QUEST_ITEM_OBJECTIVES_COUNT ];
uint32 m_creatureOrGOcount[ QUEST_OBJECTIVES_COUNT ]; uint32 m_creatureOrGOcount[ QUEST_OBJECTIVES_COUNT ];
}; };
#endif #endif

View file

@ -193,7 +193,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode( WorldPacket & recv_data )
// destroy not required for quest finish quest starting item // destroy not required for quest finish quest starting item
bool destroyItem = true; 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)) if ((qInfo->ReqItemId[i] == ((Item*)pObject)->GetEntry()) && (((Item*)pObject)->GetProto()->MaxCount > 0))
{ {
@ -203,7 +203,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode( WorldPacket & recv_data )
} }
if(destroyItem) if(destroyItem)
_player->DestroyItem(((Item*)pObject)->GetBagSlot(),((Item*)pObject)->GetSlot(),true); _player->DestroyItem(((Item*)pObject)->GetBagSlot(), ((Item*)pObject)->GetSlot(), true);
break; break;
} }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "8719" #define REVISION_NR "8720"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__

View file

@ -1,6 +1,6 @@
#ifndef __REVISION_SQL_H__ #ifndef __REVISION_SQL_H__
#define __REVISION_SQL_H__ #define __REVISION_SQL_H__
#define REVISION_DB_CHARACTERS "required_8702_01_characters_character_reputation" #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" #define REVISION_DB_REALMD "required_8332_01_realmd_realmcharacters"
#endif // __REVISION_SQL_H__ #endif // __REVISION_SQL_H__