Core/Quests: Fix some variable renaming fails in quest related code
Closes #4183
This commit is contained in:
@@ -516,7 +516,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const
|
|||||||
data << uint32(quest->RequiredNpcOrGo[i]);
|
data << uint32(quest->RequiredNpcOrGo[i]);
|
||||||
|
|
||||||
data << uint32(quest->RequiredNpcOrGoCount[i]);
|
data << uint32(quest->RequiredNpcOrGoCount[i]);
|
||||||
data << uint32(quest->RequiredSourceItemid[i]);
|
data << uint32(quest->RequiredSourceItemId[i]);
|
||||||
data << uint32(0); // req source count?
|
data << uint32(0); // req source count?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14855,10 +14855,10 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
|
|||||||
|
|
||||||
for (uint8 i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
|
for (uint8 i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
|
||||||
{
|
{
|
||||||
if (quest->RequiredSourceItemid[i])
|
if (quest->RequiredSourceItemId[i])
|
||||||
{
|
{
|
||||||
uint32 count = quest->RequiredSourceItemId[i];
|
uint32 count = quest->RequiredSourceItemIdCount[i];
|
||||||
DestroyItemCount(quest->RequiredSourceItemid[i], count ? count : 9999, true);
|
DestroyItemCount(quest->RequiredSourceItemId[i], count ? count : 9999, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15055,9 +15055,9 @@ void Player::FailQuest(uint32 questId)
|
|||||||
// Destroy items recieved on starting the quest.
|
// Destroy items recieved on starting the quest.
|
||||||
DestroyItemCount(quest->RequiredItemId[i], quest->RequiredItemCount[i], true, true);
|
DestroyItemCount(quest->RequiredItemId[i], quest->RequiredItemCount[i], true, true);
|
||||||
for (uint8 i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
|
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->RequiredSourceItemIdCount[i] > 0)
|
||||||
// Destroy items recieved during the quest.
|
// Destroy items recieved during the quest.
|
||||||
DestroyItemCount(quest->RequiredSourceItemid[i], quest->RequiredSourceItemId[i], true, true);
|
DestroyItemCount(quest->RequiredSourceItemId[i], quest->RequiredSourceItemIdCount[i], true, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -16108,7 +16108,7 @@ bool Player::HasQuestForItem(uint32 itemid) const
|
|||||||
for (uint8 j = 0; j < QUEST_SOURCE_ITEM_IDS_COUNT; ++j)
|
for (uint8 j = 0; j < QUEST_SOURCE_ITEM_IDS_COUNT; ++j)
|
||||||
{
|
{
|
||||||
// examined item is a source item
|
// examined item is a source item
|
||||||
if (qinfo->RequiredSourceItemid[j] == itemid)
|
if (qinfo->RequiredSourceItemId[j] == itemid)
|
||||||
{
|
{
|
||||||
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(itemid);
|
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(itemid);
|
||||||
|
|
||||||
@@ -16117,9 +16117,9 @@ bool Player::HasQuestForItem(uint32 itemid) const
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
// allows custom amount drop when not 0
|
// allows custom amount drop when not 0
|
||||||
if (qinfo->RequiredSourceItemId[j])
|
if (qinfo->RequiredSourceItemIdCount[j])
|
||||||
{
|
{
|
||||||
if (GetItemCount(itemid, true) < qinfo->RequiredSourceItemId[j])
|
if (GetItemCount(itemid, true) < qinfo->RequiredSourceItemIdCount[j])
|
||||||
return true;
|
return true;
|
||||||
} else if (GetItemCount(itemid, true) < pProto->GetMaxStackSize())
|
} else if (GetItemCount(itemid, true) < pProto->GetMaxStackSize())
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -4024,22 +4024,22 @@ void ObjectMgr::LoadQuests()
|
|||||||
|
|
||||||
for (uint8 j = 0; j < QUEST_SOURCE_ITEM_IDS_COUNT; ++j)
|
for (uint8 j = 0; j < QUEST_SOURCE_ITEM_IDS_COUNT; ++j)
|
||||||
{
|
{
|
||||||
uint32 id = qinfo->RequiredSourceItemid[j];
|
uint32 id = qinfo->RequiredSourceItemId[j];
|
||||||
if (id)
|
if (id)
|
||||||
{
|
{
|
||||||
if (!sObjectMgr->GetItemTemplate(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);
|
qinfo->GetQuestId(), j+1, id, id);
|
||||||
// no changes, quest can't be done for this requirement
|
// no changes, quest can't be done for this requirement
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (qinfo->RequiredSourceItemId[j]>0)
|
if (qinfo->RequiredSourceItemIdCount[j]>0)
|
||||||
{
|
{
|
||||||
sLog->outErrorDb("Quest %u has `RequiredSourceItemid%d` = 0 but `RequiredSourceItemId%d` = %u.",
|
sLog->outErrorDb("Quest %u has `RequiredSourceItemId%d` = 0 but `RequiredSourceItemIdCount%d` = %u.",
|
||||||
qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredSourceItemId[j]);
|
qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredSourceItemIdCount[j]);
|
||||||
// no changes, quest ignore this data
|
// no changes, quest ignore this data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,10 +106,10 @@ Quest::Quest(Field* questRecord)
|
|||||||
RequiredNpcOrGoCount[i] = questRecord[93+i].GetUInt32();
|
RequiredNpcOrGoCount[i] = questRecord[93+i].GetUInt32();
|
||||||
|
|
||||||
for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
|
for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
|
||||||
RequiredSourceItemid[i] = questRecord[97+i].GetUInt32();
|
RequiredSourceItemId[i] = questRecord[97+i].GetUInt32();
|
||||||
|
|
||||||
for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
|
for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
|
||||||
RequiredSourceItemId[i] = questRecord[101+i].GetUInt32();
|
RequiredSourceItemIdCount[i] = questRecord[101+i].GetUInt32();
|
||||||
|
|
||||||
for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
|
for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
|
||||||
RequiredItemId[i] = questRecord[105+i].GetUInt32();
|
RequiredItemId[i] = questRecord[105+i].GetUInt32();
|
||||||
|
|||||||
@@ -262,8 +262,8 @@ class Quest
|
|||||||
std::string ObjectiveText[QUEST_OBJECTIVES_COUNT];
|
std::string ObjectiveText[QUEST_OBJECTIVES_COUNT];
|
||||||
uint32 RequiredItemId[QUEST_ITEM_OBJECTIVES_COUNT];
|
uint32 RequiredItemId[QUEST_ITEM_OBJECTIVES_COUNT];
|
||||||
uint32 RequiredItemCount[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 RequiredSourceItemId[QUEST_SOURCE_ITEM_IDS_COUNT];
|
||||||
|
uint32 RequiredSourceItemIdCount[QUEST_SOURCE_ITEM_IDS_COUNT];
|
||||||
int32 RequiredNpcOrGo[QUEST_OBJECTIVES_COUNT]; // >0 Creature <0 Gameobject
|
int32 RequiredNpcOrGo[QUEST_OBJECTIVES_COUNT]; // >0 Creature <0 Gameobject
|
||||||
uint32 RequiredNpcOrGoCount[QUEST_OBJECTIVES_COUNT];
|
uint32 RequiredNpcOrGoCount[QUEST_OBJECTIVES_COUNT];
|
||||||
uint32 RequiredSpellCast[QUEST_OBJECTIVES_COUNT];
|
uint32 RequiredSpellCast[QUEST_OBJECTIVES_COUNT];
|
||||||
|
|||||||
Reference in New Issue
Block a user