mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[8720] Added missing ReqItem 5 and 6 to database.
(backported from commit 7a722b8)
This commit is contained in:
parent
e79aa4dee2
commit
3cc7f36006
12 changed files with 106 additions and 92 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue