mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-20 06:59:46 -04:00
Core|DB/Quests: Rename and re-order fields in quest_template table, for the sake of consistency
Order should match SMSG_QUEST_QUERY_RESPONSE
This commit is contained in:
@@ -337,13 +337,13 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID,
|
||||
data << uint32(quest->GetRewChoiceItemsCount());
|
||||
for (uint32 i=0; i < QUEST_REWARD_CHOICES_COUNT; ++i)
|
||||
{
|
||||
if (!quest->RewChoiceItemId[i])
|
||||
if (!quest->RewardChoiceItemId[i])
|
||||
continue;
|
||||
|
||||
data << uint32(quest->RewChoiceItemId[i]);
|
||||
data << uint32(quest->RewChoiceItemCount[i]);
|
||||
data << uint32(quest->RewardChoiceItemId[i]);
|
||||
data << uint32(quest->RewardChoiceItemCount[i]);
|
||||
|
||||
if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RewChoiceItemId[i]))
|
||||
if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RewardChoiceItemId[i]))
|
||||
data << uint32(itemTemplate->DisplayInfoID);
|
||||
else
|
||||
data << uint32(0x00);
|
||||
@@ -353,13 +353,13 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID,
|
||||
|
||||
for (uint32 i=0; i < QUEST_REWARDS_COUNT; ++i)
|
||||
{
|
||||
if (!quest->RewItemId[i])
|
||||
if (!quest->RewardItemId[i])
|
||||
continue;
|
||||
|
||||
data << uint32(quest->RewItemId[i]);
|
||||
data << uint32(quest->RewItemCount[i]);
|
||||
data << uint32(quest->RewardItemId[i]);
|
||||
data << uint32(quest->RewardItemIdCount[i]);
|
||||
|
||||
if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RewItemId[i]))
|
||||
if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RewardItemId[i]))
|
||||
data << uint32(itemTemplate->DisplayInfoID);
|
||||
else
|
||||
data << uint32(0);
|
||||
@@ -380,13 +380,13 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID,
|
||||
data << uint32(0); // unk
|
||||
|
||||
for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)
|
||||
data << uint32(quest->RewRepFaction[i]);
|
||||
data << uint32(quest->RewardFactionId[i]);
|
||||
|
||||
for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)
|
||||
data << int32(quest->RewRepValueId[i]);
|
||||
data << int32(quest->RewardFactionValueId[i]);
|
||||
|
||||
for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)
|
||||
data << int32(quest->RewRepValue[i]);
|
||||
data << int32(quest->RewardFactionValueIdOverride[i]);
|
||||
|
||||
data << uint32(QUEST_EMOTE_COUNT);
|
||||
for (uint32 i = 0; i < QUEST_EMOTE_COUNT; ++i)
|
||||
@@ -478,24 +478,24 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const
|
||||
{
|
||||
for (uint32 i = 0; i < QUEST_REWARDS_COUNT; ++i)
|
||||
{
|
||||
data << uint32(quest->RewItemId[i]);
|
||||
data << uint32(quest->RewItemCount[i]);
|
||||
data << uint32(quest->RewardItemId[i]);
|
||||
data << uint32(quest->RewardItemIdCount[i]);
|
||||
}
|
||||
for (uint32 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i)
|
||||
{
|
||||
data << uint32(quest->RewChoiceItemId[i]);
|
||||
data << uint32(quest->RewChoiceItemCount[i]);
|
||||
data << uint32(quest->RewardChoiceItemId[i]);
|
||||
data << uint32(quest->RewardChoiceItemCount[i]);
|
||||
}
|
||||
}
|
||||
|
||||
for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // reward factions ids
|
||||
data << uint32(quest->RewRepFaction[i]);
|
||||
data << uint32(quest->RewardFactionId[i]);
|
||||
|
||||
for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // columnid+1 QuestFactionReward.dbc?
|
||||
data << int32(quest->RewRepValueId[i]);
|
||||
data << int32(quest->RewardFactionValueId[i]);
|
||||
|
||||
for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // unk (0)
|
||||
data << int32(quest->RewRepValue[i]);
|
||||
data << int32(quest->RewardFactionValueIdOverride[i]);
|
||||
|
||||
data << quest->GetPointMapId();
|
||||
data << quest->GetPointX();
|
||||
@@ -510,20 +510,20 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const
|
||||
|
||||
for (uint32 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
||||
{
|
||||
if (quest->ReqCreatureOrGOId[i] < 0)
|
||||
data << uint32((quest->ReqCreatureOrGOId[i] * (-1)) | 0x80000000); // client expects gameobject template id in form (id|0x80000000)
|
||||
if (quest->RequiredNpcOrGo[i] < 0)
|
||||
data << uint32((quest->RequiredNpcOrGo[i] * (-1)) | 0x80000000); // client expects gameobject template id in form (id|0x80000000)
|
||||
else
|
||||
data << uint32(quest->ReqCreatureOrGOId[i]);
|
||||
data << uint32(quest->RequiredNpcOrGo[i]);
|
||||
|
||||
data << uint32(quest->ReqCreatureOrGOCount[i]);
|
||||
data << uint32(quest->ReqSourceId[i]);
|
||||
data << uint32(quest->RequiredNpcOrGoCount[i]);
|
||||
data << uint32(quest->RequiredSourceItemid[i]);
|
||||
data << uint32(0); // req source count?
|
||||
}
|
||||
|
||||
for (uint32 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
|
||||
{
|
||||
data << uint32(quest->ReqItemId[i]);
|
||||
data << uint32(quest->ReqItemCount[i]);
|
||||
data << uint32(quest->RequiredItemId[i]);
|
||||
data << uint32(quest->RequiredItemCount[i]);
|
||||
}
|
||||
|
||||
for (uint32 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
||||
@@ -576,10 +576,10 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, uint64 npcGUID, b
|
||||
data << uint32(quest->GetRewChoiceItemsCount());
|
||||
for (uint32 i=0; i < quest->GetRewChoiceItemsCount(); ++i)
|
||||
{
|
||||
data << uint32(quest->RewChoiceItemId[i]);
|
||||
data << uint32(quest->RewChoiceItemCount[i]);
|
||||
data << uint32(quest->RewardChoiceItemId[i]);
|
||||
data << uint32(quest->RewardChoiceItemCount[i]);
|
||||
|
||||
if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RewChoiceItemId[i]))
|
||||
if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RewardChoiceItemId[i]))
|
||||
data << uint32(itemTemplate->DisplayInfoID);
|
||||
else
|
||||
data << uint32(0);
|
||||
@@ -588,10 +588,10 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, uint64 npcGUID, b
|
||||
data << uint32(quest->GetRewItemsCount());
|
||||
for (uint32 i = 0; i < quest->GetRewItemsCount(); ++i)
|
||||
{
|
||||
data << uint32(quest->RewItemId[i]);
|
||||
data << uint32(quest->RewItemCount[i]);
|
||||
data << uint32(quest->RewardItemId[i]);
|
||||
data << uint32(quest->RewardItemIdCount[i]);
|
||||
|
||||
if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RewItemId[i]))
|
||||
if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RewardItemId[i]))
|
||||
data << uint32(itemTemplate->DisplayInfoID);
|
||||
else
|
||||
data << uint32(0);
|
||||
@@ -612,13 +612,13 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, uint64 npcGUID, b
|
||||
data << uint32(0);
|
||||
|
||||
for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // reward factions ids
|
||||
data << uint32(quest->RewRepFaction[i]);
|
||||
data << uint32(quest->RewardFactionId[i]);
|
||||
|
||||
for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // columnid in QuestFactionReward.dbc (zero based)?
|
||||
data << int32(quest->RewRepValueId[i]);
|
||||
data << int32(quest->RewardFactionValueId[i]);
|
||||
|
||||
for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // reward reputation override?
|
||||
data << uint32(quest->RewRepValue[i]);
|
||||
data << uint32(quest->RewardFactionValueIdOverride[i]);
|
||||
|
||||
_session->SendPacket(&data);
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_OFFER_REWARD NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), quest->GetQuestId());
|
||||
@@ -676,13 +676,13 @@ void PlayerMenu::SendQuestGiverRequestItems(Quest const* quest, uint64 npcGUID,
|
||||
data << uint32(quest->GetReqItemsCount());
|
||||
for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
|
||||
{
|
||||
if (!quest->ReqItemId[i])
|
||||
if (!quest->RequiredItemId[i])
|
||||
continue;
|
||||
|
||||
data << uint32(quest->ReqItemId[i]);
|
||||
data << uint32(quest->ReqItemCount[i]);
|
||||
data << uint32(quest->RequiredItemId[i]);
|
||||
data << uint32(quest->RequiredItemCount[i]);
|
||||
|
||||
if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->ReqItemId[i]))
|
||||
if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RequiredItemId[i]))
|
||||
data << uint32(itemTemplate->DisplayInfoID);
|
||||
else
|
||||
data << uint32(0);
|
||||
|
||||
@@ -7016,22 +7016,22 @@ void Player::RewardReputation(Quest const* quest)
|
||||
// quest reputation reward/loss
|
||||
for (uint8 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)
|
||||
{
|
||||
if (!quest->RewRepFaction[i])
|
||||
if (!quest->RewardFactionId[i])
|
||||
continue;
|
||||
if (quest->RewRepValue[i])
|
||||
if (quest->RewardFactionValueIdOverride[i])
|
||||
{
|
||||
int32 rep = CalculateReputationGain(GetQuestLevel(quest), quest->RewRepValue[i]/100, quest->RewRepFaction[i], true, true);
|
||||
int32 rep = CalculateReputationGain(GetQuestLevel(quest), quest->RewardFactionValueIdOverride[i]/100, quest->RewardFactionId[i], true, true);
|
||||
|
||||
if (recruitAFriend)
|
||||
rep = int32(rep * (1 + sWorld->getRate(RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS)));
|
||||
|
||||
if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(quest->RewRepFaction[i]))
|
||||
if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(quest->RewardFactionId[i]))
|
||||
GetReputationMgr().ModifyReputation(factionEntry, rep);
|
||||
}
|
||||
else
|
||||
{
|
||||
uint32 row = ((quest->RewRepValueId[i] < 0) ? 1 : 0) + 1;
|
||||
uint32 field = abs(quest->RewRepValueId[i]);
|
||||
uint32 row = ((quest->RewardFactionValueId[i] < 0) ? 1 : 0) + 1;
|
||||
uint32 field = abs(quest->RewardFactionValueId[i]);
|
||||
|
||||
if (const QuestFactionRewEntry* pRow = sQuestFactionRewardStore.LookupEntry(row))
|
||||
{
|
||||
@@ -7040,12 +7040,12 @@ void Player::RewardReputation(Quest const* quest)
|
||||
if (!repPoints)
|
||||
continue;
|
||||
|
||||
repPoints = CalculateReputationGain(GetQuestLevel(quest), repPoints, quest->RewRepFaction[i], true);
|
||||
repPoints = CalculateReputationGain(GetQuestLevel(quest), repPoints, quest->RewardFactionId[i], true);
|
||||
|
||||
if (recruitAFriend)
|
||||
repPoints = int32(repPoints * (1 + sWorld->getRate(RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS)));
|
||||
|
||||
if (const FactionEntry* factionEntry = sFactionStore.LookupEntry(quest->RewRepFaction[i]))
|
||||
if (const FactionEntry* factionEntry = sFactionStore.LookupEntry(quest->RewardFactionId[i]))
|
||||
GetReputationMgr().ModifyReputation(factionEntry, repPoints);
|
||||
}
|
||||
}
|
||||
@@ -14589,7 +14589,7 @@ bool Player::CanCompleteQuest(uint32 quest_id)
|
||||
{
|
||||
for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++)
|
||||
{
|
||||
if (qInfo->ReqItemCount[i]!= 0 && q_status.m_itemcount[i] < qInfo->ReqItemCount[i])
|
||||
if (qInfo->RequiredItemCount[i]!= 0 && q_status.m_itemcount[i] < qInfo->RequiredItemCount[i])
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -14598,10 +14598,10 @@ bool Player::CanCompleteQuest(uint32 quest_id)
|
||||
{
|
||||
for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; i++)
|
||||
{
|
||||
if (qInfo->ReqCreatureOrGOId[i] == 0)
|
||||
if (qInfo->RequiredNpcOrGo[i] == 0)
|
||||
continue;
|
||||
|
||||
if (qInfo->ReqCreatureOrGOCount[i] != 0 && q_status.m_creatureOrGOcount[i] < qInfo->ReqCreatureOrGOCount[i])
|
||||
if (qInfo->RequiredNpcOrGoCount[i] != 0 && q_status.m_creatureOrGOcount[i] < qInfo->RequiredNpcOrGoCount[i])
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -14642,7 +14642,7 @@ bool Player::CanCompleteRepeatableQuest(Quest const* quest)
|
||||
|
||||
if (quest->HasFlag(QUEST_TRINITY_FLAGS_DELIVER))
|
||||
for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++)
|
||||
if (quest->ReqItemId[i] && quest->ReqItemCount[i] && !HasItemCount(quest->ReqItemId[i], quest->ReqItemCount[i]))
|
||||
if (quest->RequiredItemId[i] && quest->RequiredItemCount[i] && !HasItemCount(quest->RequiredItemId[i], quest->RequiredItemCount[i]))
|
||||
return false;
|
||||
|
||||
if (!CanRewardQuest(quest, false))
|
||||
@@ -14670,11 +14670,11 @@ bool Player::CanRewardQuest(Quest const* quest, bool msg)
|
||||
{
|
||||
for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++)
|
||||
{
|
||||
if (quest->ReqItemCount[i]!= 0 &&
|
||||
GetItemCount(quest->ReqItemId[i]) < quest->ReqItemCount[i])
|
||||
if (quest->RequiredItemCount[i]!= 0 &&
|
||||
GetItemCount(quest->RequiredItemId[i]) < quest->RequiredItemCount[i])
|
||||
{
|
||||
if (msg)
|
||||
SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL, quest->ReqItemId[i]);
|
||||
SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL, quest->RequiredItemId[i]);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -14695,13 +14695,13 @@ bool Player::CanRewardQuest(Quest const* quest, uint32 reward, bool msg)
|
||||
|
||||
if (quest->GetRewChoiceItemsCount() > 0)
|
||||
{
|
||||
if (quest->RewChoiceItemId[reward])
|
||||
if (quest->RewardChoiceItemId[reward])
|
||||
{
|
||||
ItemPosCountVec dest;
|
||||
InventoryResult res = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, quest->RewChoiceItemId[reward], quest->RewChoiceItemCount[reward]);
|
||||
InventoryResult res = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, quest->RewardChoiceItemId[reward], quest->RewardChoiceItemCount[reward]);
|
||||
if (res != EQUIP_ERR_OK)
|
||||
{
|
||||
SendEquipError(res, NULL, NULL, quest->RewChoiceItemId[reward]);
|
||||
SendEquipError(res, NULL, NULL, quest->RewardChoiceItemId[reward]);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -14711,13 +14711,13 @@ bool Player::CanRewardQuest(Quest const* quest, uint32 reward, bool msg)
|
||||
{
|
||||
for (uint32 i = 0; i < quest->GetRewItemsCount(); ++i)
|
||||
{
|
||||
if (quest->RewItemId[i])
|
||||
if (quest->RewardItemId[i])
|
||||
{
|
||||
ItemPosCountVec dest;
|
||||
InventoryResult res = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, quest->RewItemId[i], quest->RewItemCount[i]);
|
||||
InventoryResult res = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, quest->RewardItemId[i], quest->RewardItemIdCount[i]);
|
||||
if (res != EQUIP_ERR_OK)
|
||||
{
|
||||
SendEquipError(res, NULL, NULL, quest->RewItemId[i]);
|
||||
SendEquipError(res, NULL, NULL, quest->RewardItemId[i]);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -14850,15 +14850,15 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
|
||||
uint32 quest_id = quest->GetQuestId();
|
||||
|
||||
for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
|
||||
if (quest->ReqItemId[i])
|
||||
DestroyItemCount(quest->ReqItemId[i], quest->ReqItemCount[i], true);
|
||||
if (quest->RequiredItemId[i])
|
||||
DestroyItemCount(quest->RequiredItemId[i], quest->RequiredItemCount[i], true);
|
||||
|
||||
for (uint8 i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
|
||||
{
|
||||
if (quest->ReqSourceId[i])
|
||||
if (quest->RequiredSourceItemid[i])
|
||||
{
|
||||
uint32 count = quest->ReqSourceCount[i];
|
||||
DestroyItemCount(quest->ReqSourceId[i], count ? count : 9999, true);
|
||||
uint32 count = quest->RequiredSourceItemId[i];
|
||||
DestroyItemCount(quest->RequiredSourceItemid[i], count ? count : 9999, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14866,13 +14866,13 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
|
||||
|
||||
if (quest->GetRewChoiceItemsCount() > 0)
|
||||
{
|
||||
if (uint32 itemId = quest->RewChoiceItemId[reward])
|
||||
if (uint32 itemId = quest->RewardChoiceItemId[reward])
|
||||
{
|
||||
ItemPosCountVec dest;
|
||||
if (CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, quest->RewChoiceItemCount[reward]) == EQUIP_ERR_OK)
|
||||
if (CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, quest->RewardChoiceItemCount[reward]) == EQUIP_ERR_OK)
|
||||
{
|
||||
Item* item = StoreNewItem(dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId));
|
||||
SendNewItem(item, quest->RewChoiceItemCount[reward], true, false);
|
||||
SendNewItem(item, quest->RewardChoiceItemCount[reward], true, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14881,13 +14881,13 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
|
||||
{
|
||||
for (uint32 i = 0; i < quest->GetRewItemsCount(); ++i)
|
||||
{
|
||||
if (uint32 itemId = quest->RewItemId[i])
|
||||
if (uint32 itemId = quest->RewardItemId[i])
|
||||
{
|
||||
ItemPosCountVec dest;
|
||||
if (CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, quest->RewItemCount[i]) == EQUIP_ERR_OK)
|
||||
if (CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, quest->RewardItemIdCount[i]) == EQUIP_ERR_OK)
|
||||
{
|
||||
Item* item = StoreNewItem(dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId));
|
||||
SendNewItem(item, quest->RewItemCount[i], true, false);
|
||||
SendNewItem(item, quest->RewardItemIdCount[i], true, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15051,13 +15051,13 @@ void Player::FailQuest(uint32 questId)
|
||||
|
||||
// Destroy quest items on quest failure.
|
||||
for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
||||
if (quest->ReqItemId[i] > 0 && quest->ReqItemCount[i] > 0)
|
||||
if (quest->RequiredItemId[i] > 0 && quest->RequiredItemCount[i] > 0)
|
||||
// Destroy items recieved on starting the quest.
|
||||
DestroyItemCount(quest->ReqItemId[i], quest->ReqItemCount[i], true, true);
|
||||
DestroyItemCount(quest->RequiredItemId[i], quest->RequiredItemCount[i], true, true);
|
||||
for (uint8 i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
|
||||
if (quest->ReqSourceId[i] > 0 && quest->ReqSourceCount[i] > 0)
|
||||
if (quest->RequiredSourceItemid[i] > 0 && quest->RequiredSourceItemId[i] > 0)
|
||||
// Destroy items recieved during the quest.
|
||||
DestroyItemCount(quest->ReqSourceId[i], quest->ReqSourceCount[i], true, true);
|
||||
DestroyItemCount(quest->RequiredSourceItemid[i], quest->RequiredSourceItemId[i], true, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15478,7 +15478,7 @@ bool Player::TakeQuestSourceItem(uint32 questId, bool msg)
|
||||
// exist two cases when destroy source quest item not possible:
|
||||
// a) non un-equippable item (equipped non-empty bag, for example)
|
||||
// b) when quest is started from an item and item also is needed in
|
||||
// the end as ReqItemId
|
||||
// the end as RequiredItemId
|
||||
InventoryResult res = CanUnequipItems(srcItemId, count);
|
||||
if (res != EQUIP_ERR_OK)
|
||||
{
|
||||
@@ -15488,7 +15488,7 @@ bool Player::TakeQuestSourceItem(uint32 questId, bool msg)
|
||||
}
|
||||
|
||||
for (uint8 n = 0; n < QUEST_ITEM_OBJECTIVES_COUNT; ++n)
|
||||
if (item->StartQuest == questId && srcItemId == quest->ReqItemId[n])
|
||||
if (item->StartQuest == questId && srcItemId == quest->RequiredItemId[n])
|
||||
destroyItem = false;
|
||||
|
||||
if (destroyItem)
|
||||
@@ -15580,7 +15580,7 @@ uint16 Player::GetReqKillOrCastCurrentCount(uint32 quest_id, int32 entry)
|
||||
return 0;
|
||||
|
||||
for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j)
|
||||
if (qInfo->ReqCreatureOrGOId[j] == entry)
|
||||
if (qInfo->RequiredNpcOrGo[j] == entry)
|
||||
return m_QuestStatus[quest_id].m_creatureOrGOcount[j];
|
||||
|
||||
return 0;
|
||||
@@ -15592,10 +15592,10 @@ void Player::AdjustQuestReqItemCount(Quest const* quest, QuestStatusData& questS
|
||||
{
|
||||
for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
|
||||
{
|
||||
uint32 reqitemcount = quest->ReqItemCount[i];
|
||||
uint32 reqitemcount = quest->RequiredItemCount[i];
|
||||
if (reqitemcount != 0)
|
||||
{
|
||||
uint32 curitemcount = GetItemCount(quest->ReqItemId[i], true);
|
||||
uint32 curitemcount = GetItemCount(quest->RequiredItemId[i], true);
|
||||
|
||||
questStatusData.m_itemcount[i] = std::min(curitemcount, reqitemcount);
|
||||
m_QuestStatusSave[quest->GetQuestId()] = true;
|
||||
@@ -15670,10 +15670,10 @@ void Player::ItemAddedQuestCheck(uint32 entry, uint32 count)
|
||||
|
||||
for (uint8 j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j)
|
||||
{
|
||||
uint32 reqitem = qInfo->ReqItemId[j];
|
||||
uint32 reqitem = qInfo->RequiredItemId[j];
|
||||
if (reqitem == entry)
|
||||
{
|
||||
uint32 reqitemcount = qInfo->ReqItemCount[j];
|
||||
uint32 reqitemcount = qInfo->RequiredItemCount[j];
|
||||
uint16 curitemcount = q_status.m_itemcount[j];
|
||||
if (curitemcount < reqitemcount)
|
||||
{
|
||||
@@ -15708,12 +15708,12 @@ void Player::ItemRemovedQuestCheck(uint32 entry, uint32 count)
|
||||
|
||||
for (uint8 j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j)
|
||||
{
|
||||
uint32 reqitem = qInfo->ReqItemId[j];
|
||||
uint32 reqitem = qInfo->RequiredItemId[j];
|
||||
if (reqitem == entry)
|
||||
{
|
||||
QuestStatusData& q_status = m_QuestStatus[questid];
|
||||
|
||||
uint32 reqitemcount = qInfo->ReqItemCount[j];
|
||||
uint32 reqitemcount = qInfo->RequiredItemCount[j];
|
||||
uint16 curitemcount;
|
||||
if (q_status.m_status != QUEST_STATUS_COMPLETE)
|
||||
curitemcount = q_status.m_itemcount[j];
|
||||
@@ -15777,18 +15777,18 @@ void Player::KilledMonsterCredit(uint32 entry, uint64 guid)
|
||||
for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j)
|
||||
{
|
||||
// skip GO activate objective or none
|
||||
if (qInfo->ReqCreatureOrGOId[j] <= 0)
|
||||
if (qInfo->RequiredNpcOrGo[j] <= 0)
|
||||
continue;
|
||||
|
||||
// skip Cast at creature objective
|
||||
if (qInfo->ReqSpell[j] != 0)
|
||||
if (qInfo->RequiredSpellCast[j] != 0)
|
||||
continue;
|
||||
|
||||
uint32 reqkill = qInfo->ReqCreatureOrGOId[j];
|
||||
uint32 reqkill = qInfo->RequiredNpcOrGo[j];
|
||||
|
||||
if (reqkill == real_entry)
|
||||
{
|
||||
uint32 reqkillcount = qInfo->ReqCreatureOrGOCount[j];
|
||||
uint32 reqkillcount = qInfo->RequiredNpcOrGoCount[j];
|
||||
uint16 curkillcount = q_status.m_creatureOrGOcount[j];
|
||||
if (curkillcount < reqkillcount)
|
||||
{
|
||||
@@ -15874,7 +15874,7 @@ void Player::CastedCreatureOrGO(uint32 entry, uint64 guid, uint32 spell_id)
|
||||
for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j)
|
||||
{
|
||||
// skip kill creature objective (0) or wrong spell casts
|
||||
if (qInfo->ReqSpell[j] != spell_id)
|
||||
if (qInfo->RequiredSpellCast[j] != spell_id)
|
||||
continue;
|
||||
|
||||
uint32 reqTarget = 0;
|
||||
@@ -15882,10 +15882,10 @@ void Player::CastedCreatureOrGO(uint32 entry, uint64 guid, uint32 spell_id)
|
||||
if (isCreature)
|
||||
{
|
||||
// creature activate objectives
|
||||
if (qInfo->ReqCreatureOrGOId[j] > 0)
|
||||
if (qInfo->RequiredNpcOrGo[j] > 0)
|
||||
{
|
||||
// checked at quest_template loading
|
||||
reqTarget = qInfo->ReqCreatureOrGOId[j];
|
||||
reqTarget = qInfo->RequiredNpcOrGo[j];
|
||||
if (reqTarget != entry) // if entry doesn't match, check for killcredits referenced in template
|
||||
{
|
||||
CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(entry);
|
||||
@@ -15898,16 +15898,16 @@ void Player::CastedCreatureOrGO(uint32 entry, uint64 guid, uint32 spell_id)
|
||||
else
|
||||
{
|
||||
// GO activate objective
|
||||
if (qInfo->ReqCreatureOrGOId[j] < 0)
|
||||
if (qInfo->RequiredNpcOrGo[j] < 0)
|
||||
// checked at quest_template loading
|
||||
reqTarget = - qInfo->ReqCreatureOrGOId[j];
|
||||
reqTarget = - qInfo->RequiredNpcOrGo[j];
|
||||
}
|
||||
|
||||
// other not this creature/GO related objectives
|
||||
if (reqTarget != entry)
|
||||
continue;
|
||||
|
||||
uint32 reqCastCount = qInfo->ReqCreatureOrGOCount[j];
|
||||
uint32 reqCastCount = qInfo->RequiredNpcOrGoCount[j];
|
||||
uint16 curCastCount = q_status.m_creatureOrGOcount[j];
|
||||
if (curCastCount < reqCastCount)
|
||||
{
|
||||
@@ -15951,20 +15951,20 @@ void Player::TalkedToCreature(uint32 entry, uint64 guid)
|
||||
for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j)
|
||||
{
|
||||
// skip spell casts and Gameobject objectives
|
||||
if (qInfo->ReqSpell[j] > 0 || qInfo->ReqCreatureOrGOId[j] < 0)
|
||||
if (qInfo->RequiredSpellCast[j] > 0 || qInfo->RequiredNpcOrGo[j] < 0)
|
||||
continue;
|
||||
|
||||
uint32 reqTarget = 0;
|
||||
|
||||
if (qInfo->ReqCreatureOrGOId[j] > 0) // creature activate objectives
|
||||
if (qInfo->RequiredNpcOrGo[j] > 0) // creature activate objectives
|
||||
// checked at quest_template loading
|
||||
reqTarget = qInfo->ReqCreatureOrGOId[j];
|
||||
reqTarget = qInfo->RequiredNpcOrGo[j];
|
||||
else
|
||||
continue;
|
||||
|
||||
if (reqTarget == entry)
|
||||
{
|
||||
uint32 reqTalkCount = qInfo->ReqCreatureOrGOCount[j];
|
||||
uint32 reqTalkCount = qInfo->RequiredNpcOrGoCount[j];
|
||||
uint16 curTalkCount = q_status.m_creatureOrGOcount[j];
|
||||
if (curTalkCount < reqTalkCount)
|
||||
{
|
||||
@@ -16101,14 +16101,14 @@ bool Player::HasQuestForItem(uint32 itemid) const
|
||||
// This part for ReqItem drop
|
||||
for (uint8 j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j)
|
||||
{
|
||||
if (itemid == qinfo->ReqItemId[j] && q_status.m_itemcount[j] < qinfo->ReqItemCount[j])
|
||||
if (itemid == qinfo->RequiredItemId[j] && q_status.m_itemcount[j] < qinfo->RequiredItemCount[j])
|
||||
return true;
|
||||
}
|
||||
// This part - for ReqSource
|
||||
for (uint8 j = 0; j < QUEST_SOURCE_ITEM_IDS_COUNT; ++j)
|
||||
{
|
||||
// examined item is a source item
|
||||
if (qinfo->ReqSourceId[j] == itemid)
|
||||
if (qinfo->RequiredSourceItemid[j] == itemid)
|
||||
{
|
||||
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(itemid);
|
||||
|
||||
@@ -16117,9 +16117,9 @@ bool Player::HasQuestForItem(uint32 itemid) const
|
||||
return true;
|
||||
|
||||
// allows custom amount drop when not 0
|
||||
if (qinfo->ReqSourceCount[j])
|
||||
if (qinfo->RequiredSourceItemId[j])
|
||||
{
|
||||
if (GetItemCount(itemid, true) < qinfo->ReqSourceCount[j])
|
||||
if (GetItemCount(itemid, true) < qinfo->RequiredSourceItemId[j])
|
||||
return true;
|
||||
} else if (GetItemCount(itemid, true) < pProto->GetMaxStackSize())
|
||||
return true;
|
||||
@@ -16237,7 +16237,7 @@ void Player::SendQuestUpdateAddItem(Quest const* /*quest*/, uint32 /*item_idx*/,
|
||||
{
|
||||
WorldPacket data(SMSG_QUESTUPDATE_ADD_ITEM, 0);
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_ADD_ITEM");
|
||||
//data << quest->ReqItemId[item_idx];
|
||||
//data << quest->RequiredItemId[item_idx];
|
||||
//data << count;
|
||||
GetSession()->SendPacket(&data);
|
||||
}
|
||||
@@ -16246,7 +16246,7 @@ void Player::SendQuestUpdateAddCreatureOrGo(Quest const* quest, uint64 guid, uin
|
||||
{
|
||||
ASSERT(old_count + add_count < 65536 && "mob/GO count store in 16 bits 2^16 = 65536 (0..65536)");
|
||||
|
||||
int32 entry = quest->ReqCreatureOrGOId[ creatureOrGO_idx ];
|
||||
int32 entry = quest->RequiredNpcOrGo[ creatureOrGO_idx ];
|
||||
if (entry < 0)
|
||||
// client expected gameobject template id in form (id|0x80000000)
|
||||
entry = (-entry) | 0x80000000;
|
||||
@@ -16256,7 +16256,7 @@ void Player::SendQuestUpdateAddCreatureOrGo(Quest const* quest, uint64 guid, uin
|
||||
data << uint32(quest->GetQuestId());
|
||||
data << uint32(entry);
|
||||
data << uint32(old_count + add_count);
|
||||
data << uint32(quest->ReqCreatureOrGOCount[ creatureOrGO_idx ]);
|
||||
data << uint32(quest->RequiredNpcOrGoCount[ creatureOrGO_idx ]);
|
||||
data << uint64(guid);
|
||||
GetSession()->SendPacket(&data);
|
||||
|
||||
@@ -22064,10 +22064,10 @@ bool Player::HasQuestForGO(int32 GOId) const
|
||||
|
||||
for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j)
|
||||
{
|
||||
if (qinfo->ReqCreatureOrGOId[j] >= 0) //skip non GO case
|
||||
if (qinfo->RequiredNpcOrGo[j] >= 0) //skip non GO case
|
||||
continue;
|
||||
|
||||
if ((-1)*GOId == qinfo->ReqCreatureOrGOId[j] && qs.m_creatureOrGOcount[j] < qinfo->ReqCreatureOrGOCount[j])
|
||||
if ((-1)*GOId == qinfo->RequiredNpcOrGo[j] && qs.m_creatureOrGOcount[j] < qinfo->RequiredNpcOrGoCount[j])
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3691,42 +3691,41 @@ void ObjectMgr::LoadQuests()
|
||||
|
||||
mExclusiveQuestGroups.clear();
|
||||
|
||||
// 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, "
|
||||
// 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, "
|
||||
// 35 36 37 38 39 40 41 42 43 44 45
|
||||
"Title, Details, Objectives, OfferRewardText, RequestItemsText, EndText, CompletedText, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4, "
|
||||
// 46 47 48 49 50 51 52 53 54 55 56 57
|
||||
"ReqItemId1, ReqItemId2, ReqItemId3, ReqItemId4, ReqItemId5, ReqItemId6, ReqItemCount1, ReqItemCount2, ReqItemCount3, ReqItemCount4, ReqItemCount5, ReqItemCount6, "
|
||||
// 58 59 60 61 62 63 64 65
|
||||
"ReqSourceId1, ReqSourceId2, ReqSourceId3, ReqSourceId4, ReqSourceCount1, ReqSourceCount2, ReqSourceCount3, ReqSourceCount4, "
|
||||
// 66 67 68 69 70 71 72 73
|
||||
"ReqCreatureOrGOId1, ReqCreatureOrGOId2, ReqCreatureOrGOId3, ReqCreatureOrGOId4, ReqCreatureOrGOCount1, ReqCreatureOrGOCount2, ReqCreatureOrGOCount3, ReqCreatureOrGOCount4, "
|
||||
// 74 75 76 77
|
||||
"ReqSpellCast1, ReqSpellCast2, ReqSpellCast3, ReqSpellCast4, "
|
||||
// 78 79 80 81 82 83
|
||||
"RewChoiceItemId1, RewChoiceItemId2, RewChoiceItemId3, RewChoiceItemId4, RewChoiceItemId5, RewChoiceItemId6, "
|
||||
// 84 85 86 87 88 89
|
||||
"RewChoiceItemCount1, RewChoiceItemCount2, RewChoiceItemCount3, RewChoiceItemCount4, RewChoiceItemCount5, RewChoiceItemCount6, "
|
||||
// 90 91 92 93 94 95 96 97
|
||||
"RewItemId1, RewItemId2, RewItemId3, RewItemId4, RewItemCount1, RewItemCount2, RewItemCount3, RewItemCount4, "
|
||||
// 98 99 100 101 102 103 104 105 106 107
|
||||
"RewRepFaction1, RewRepFaction2, RewRepFaction3, RewRepFaction4, RewRepFaction5, RewRepValueId1, RewRepValueId2, RewRepValueId3, RewRepValueId4, RewRepValueId5, "
|
||||
// 108 109 110 111 112
|
||||
"RewRepValue1, RewRepValue2, RewRepValue3, RewRepValue4, RewRepValue5, "
|
||||
// 113 114 115 116 117 118 119 120 121 122 123 124
|
||||
"RewHonorAddition, RewHonorMultiplier, RewOrReqMoney, RewMoneyMaxLevel, RewSpell, RewSpellCast, RewMailTemplateId, RewMailDelaySecs, PointMapId, PointX, PointY, PointOpt, "
|
||||
// 125 126 127 128 129 130 131 132
|
||||
"DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4, DetailsEmoteDelay1, DetailsEmoteDelay2, DetailsEmoteDelay3, DetailsEmoteDelay4, "
|
||||
// 133 134 135 136 137 138
|
||||
"IncompleteEmote, CompleteEmote, OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4, "
|
||||
// 139 140 141 142
|
||||
"OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4, "
|
||||
// 143 144
|
||||
"StartScript, CompleteScript"
|
||||
QueryResult result = WorldDatabase.Query("SELECT "
|
||||
//0 1 2 3 4 5 6 7 8 9 10 11 12
|
||||
"Id, Method, Level, MinLevel, MaxLevel, ZoneOrSort, Type, SuggestedPlayers, LimitTime, RequiredClasses, RequiredRaces, RequiredSkillId, RequiredSkillPoints, "
|
||||
// 13 14 15 16 17 18 19 20
|
||||
"RequiredFactionId1, RequiredFactionId2, RequiredFactionValue1, RequiredFactionValue2, RequiredMinRepFaction, RequiredMaxRepFaction, RequiredMinRepValue, RequiredMaxRepValue, "
|
||||
// 21 22 23 24 25 26 27 28 29 30 31
|
||||
"PrevQuestId, NextQuestId, ExclusiveGroup, NextQuestIdChain, RewardXPId, RewardOrRequiredMoney, RewardMoneyMaxLevel, RewardSpell, RewardSpellCast, RewardHonor, RewardHonorMultiplier, "
|
||||
// 32 33 34 35 36 37 38 39 40 41 42
|
||||
"RewardMailTemplateId, RewardMailDelay, SourceItemId, SourceItemCount, SourceSpellId, Flags, SpecialFlags, RewardTitleId, RequiredPlayerKills, RewardTalents, RewardArenaPoints, "
|
||||
// 43 44 45 46 47 48 49 50
|
||||
"RewardItemId1, RewardItemId2, RewardItemId3, RewardItemId4, RewardItemCount1, RewardItemCount2, RewardItemCount3, RewardItemCount4, "
|
||||
// 51 52 53 54 55 56 57 58 59 60 61 62
|
||||
"RewardChoiceItemId1, RewardChoiceItemId2, RewardChoiceItemId3, RewardChoiceItemId4, RewardChoiceItemId5, RewardChoiceItemId6, RewardChoiceItemCount1, RewardChoiceItemCount2, RewardChoiceItemCount3, RewardChoiceItemCount4, RewardChoiceItemCount5, RewardChoiceItemCount6, "
|
||||
// 63 64 65 66 67 68 69 70 71 72
|
||||
"RewardFactionId1, RewardFactionId2, RewardFactionId3, RewardFactionId4, RewardFactionId5, RewardFactionValueId1, RewardFactionValueId2, RewardFactionValueId3, RewardFactionValueId4, RewardFactionValueId5, "
|
||||
// 73 74 75 76 77
|
||||
"RewardFactionValueIdOverride1, RewardFactionValueIdOverride2, RewardFactionValueIdOverride3, RewardFactionValueIdOverride4, RewardFactionValueIdOverride5, "
|
||||
// 78 79 80 81
|
||||
"PointMapId, PointX, PointY, PointOption, "
|
||||
// 82 83 84 85 86 87 88
|
||||
"Title, Objectives, Details, EndText, OfferRewardText, RequestItemsText, CompletedText, "
|
||||
// 89 90 91 92 93 94 95 96
|
||||
"RequiredNpcOrGo1, RequiredNpcOrGo2, RequiredNpcOrGo3, RequiredNpcOrGo4, RequiredNpcOrGoCount1, RequiredNpcOrGoCount2, RequiredNpcOrGoCount3, RequiredNpcOrGoCount4, "
|
||||
// 97 98 99 100 101 102 103 104
|
||||
"RequiredSourceItemId1, RequiredSourceItemId2, RequiredSourceItemId3, RequiredSourceItemId4, RequiredSourceItemCount1, RequiredSourceItemCount2, RequiredSourceItemCount3, RequiredSourceItemCount4, "
|
||||
// 105 106 107 108 109 110 111 112 113 114 115 116
|
||||
"RequiredItemId1, RequiredItemId2, RequiredItemId3, RequiredItemId4, RequiredItemId5, RequiredItemId6, RequiredItemCount1, RequiredItemCount2, RequiredItemCount3, RequiredItemCount4, RequiredItemCount5, RequiredItemCount6, "
|
||||
// 117 118 119 120 121 122 123 124 125
|
||||
"RequiredSpellCast1, RequiredSpellCast2, RequiredSpellCast3, RequiredSpellCast4, Unknown0, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4, "
|
||||
// 126 127 128 129 130 131 132 133 134 135
|
||||
"DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4, DetailsEmoteDelay1, DetailsEmoteDelay2, DetailsEmoteDelay3, DetailsEmoteDelay4, EmoteOnIncomplete, EmoteOnComplete, "
|
||||
// 136 137 138 139 140 141 142 143
|
||||
"OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4, OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4, "
|
||||
// 144 145 146
|
||||
"StartScript, CompleteScript, WDBVerified"
|
||||
" FROM quest_template");
|
||||
if (!result)
|
||||
{
|
||||
@@ -3764,45 +3763,45 @@ void ObjectMgr::LoadQuests()
|
||||
sLog->outErrorDb("Quest %u has `Method` = %u, expected values are 0, 1 or 2.", qinfo->GetQuestId(), qinfo->GetQuestMethod());
|
||||
}
|
||||
|
||||
if (qinfo->QuestFlags & ~QUEST_TRINITY_FLAGS_DB_ALLOWED)
|
||||
if (qinfo->Flags & ~QUEST_TRINITY_FLAGS_DB_ALLOWED)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `SpecialFlags` = %u > max allowed value. Correct `SpecialFlags` to value <= %u",
|
||||
qinfo->GetQuestId(), qinfo->QuestFlags >> 20, QUEST_TRINITY_FLAGS_DB_ALLOWED >> 20);
|
||||
qinfo->QuestFlags &= QUEST_TRINITY_FLAGS_DB_ALLOWED;
|
||||
qinfo->GetQuestId(), qinfo->Flags >> 20, QUEST_TRINITY_FLAGS_DB_ALLOWED >> 20);
|
||||
qinfo->Flags &= QUEST_TRINITY_FLAGS_DB_ALLOWED;
|
||||
}
|
||||
|
||||
if (qinfo->QuestFlags & QUEST_FLAGS_DAILY && qinfo->QuestFlags & QUEST_FLAGS_WEEKLY)
|
||||
if (qinfo->Flags & QUEST_FLAGS_DAILY && qinfo->Flags & QUEST_FLAGS_WEEKLY)
|
||||
{
|
||||
sLog->outErrorDb("Weekly Quest %u is marked as daily quest in `QuestFlags`, removed daily flag.", qinfo->GetQuestId());
|
||||
qinfo->QuestFlags &= ~QUEST_FLAGS_DAILY;
|
||||
sLog->outErrorDb("Weekly Quest %u is marked as daily quest in `Flags`, removed daily flag.", qinfo->GetQuestId());
|
||||
qinfo->Flags &= ~QUEST_FLAGS_DAILY;
|
||||
}
|
||||
|
||||
if (qinfo->QuestFlags & QUEST_FLAGS_DAILY)
|
||||
if (qinfo->Flags & QUEST_FLAGS_DAILY)
|
||||
{
|
||||
if (!(qinfo->QuestFlags & QUEST_TRINITY_FLAGS_REPEATABLE))
|
||||
if (!(qinfo->Flags & QUEST_TRINITY_FLAGS_REPEATABLE))
|
||||
{
|
||||
sLog->outErrorDb("Daily Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId());
|
||||
qinfo->QuestFlags |= QUEST_TRINITY_FLAGS_REPEATABLE;
|
||||
qinfo->Flags |= QUEST_TRINITY_FLAGS_REPEATABLE;
|
||||
}
|
||||
}
|
||||
|
||||
if (qinfo->QuestFlags & QUEST_FLAGS_WEEKLY)
|
||||
if (qinfo->Flags & QUEST_FLAGS_WEEKLY)
|
||||
{
|
||||
if (!(qinfo->QuestFlags & QUEST_TRINITY_FLAGS_REPEATABLE))
|
||||
if (!(qinfo->Flags & QUEST_TRINITY_FLAGS_REPEATABLE))
|
||||
{
|
||||
sLog->outErrorDb("Weekly Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId());
|
||||
qinfo->QuestFlags |= QUEST_TRINITY_FLAGS_REPEATABLE;
|
||||
qinfo->Flags |= QUEST_TRINITY_FLAGS_REPEATABLE;
|
||||
}
|
||||
}
|
||||
|
||||
if (qinfo->QuestFlags & QUEST_FLAGS_AUTO_REWARDED)
|
||||
if (qinfo->Flags & QUEST_FLAGS_AUTO_REWARDED)
|
||||
{
|
||||
// at auto-reward can be rewarded only RewChoiceItemId[0]
|
||||
// at auto-reward can be rewarded only RewardChoiceItemId[0]
|
||||
for (int j = 1; j < QUEST_REWARD_CHOICES_COUNT; ++j )
|
||||
{
|
||||
if (uint32 id = qinfo->RewChoiceItemId[j])
|
||||
if (uint32 id = qinfo->RewardChoiceItemId[j])
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewChoiceItemId%d` = %u but item from `RewChoiceItemId%d` can't be rewarded with quest flag QUEST_FLAGS_AUTO_REWARDED.",
|
||||
sLog->outErrorDb("Quest %u has `RewardChoiceItemId%d` = %u but item from `RewardChoiceItemId%d` can't be rewarded with quest flag QUEST_FLAGS_AUTO_REWARDED.",
|
||||
qinfo->GetQuestId(), j+1, id, j+1);
|
||||
// no changes, quest ignore this data
|
||||
}
|
||||
@@ -3829,12 +3828,12 @@ 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 for proper RequiredSkill value (skill case)
|
||||
//check for proper RequiredSkillId value (skill case)
|
||||
if (int32 skill_id = SkillByQuestSort(-int32(qinfo->ZoneOrSort)))
|
||||
{
|
||||
if (qinfo->RequiredSkill != skill_id)
|
||||
if (qinfo->RequiredSkillId != skill_id)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `ZoneOrSort` = %i but `RequiredSkill` does not have a corresponding value (%i).",
|
||||
sLog->outErrorDb("Quest %u has `ZoneOrSort` = %i but `RequiredSkillId` does not have a corresponding value (%i).",
|
||||
qinfo->GetQuestId(), qinfo->ZoneOrSort, skill_id);
|
||||
//override, and force proper value here?
|
||||
}
|
||||
@@ -3859,38 +3858,38 @@ void ObjectMgr::LoadQuests()
|
||||
qinfo->RequiredRaces = 0;
|
||||
}
|
||||
}
|
||||
// RequiredSkill, can be 0
|
||||
if (qinfo->RequiredSkill)
|
||||
// RequiredSkillId, can be 0
|
||||
if (qinfo->RequiredSkillId)
|
||||
{
|
||||
if (!sSkillLineStore.LookupEntry(qinfo->RequiredSkill))
|
||||
if (!sSkillLineStore.LookupEntry(qinfo->RequiredSkillId))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RequiredSkill` = %u but this skill does not exist",
|
||||
qinfo->GetQuestId(), qinfo->RequiredSkill);
|
||||
sLog->outErrorDb("Quest %u has `RequiredSkillId` = %u but this skill does not exist",
|
||||
qinfo->GetQuestId(), qinfo->RequiredSkillId);
|
||||
}
|
||||
}
|
||||
|
||||
if (qinfo->RequiredSkillValue)
|
||||
if (qinfo->RequiredSkillPoints)
|
||||
{
|
||||
if (qinfo->RequiredSkillValue > sWorld->GetConfigMaxSkillValue())
|
||||
if (qinfo->RequiredSkillPoints > sWorld->GetConfigMaxSkillValue())
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RequiredSkillValue` = %u but max possible skill is %u, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->RequiredSkillValue, sWorld->GetConfigMaxSkillValue());
|
||||
sLog->outErrorDb("Quest %u has `RequiredSkillPoints` = %u but max possible skill is %u, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->RequiredSkillPoints, sWorld->GetConfigMaxSkillValue());
|
||||
// no changes, quest can't be done for this requirement
|
||||
}
|
||||
}
|
||||
// else Skill quests can have 0 skill level, this is ok
|
||||
|
||||
if (qinfo->RepObjectiveFaction2 && !sFactionStore.LookupEntry(qinfo->RepObjectiveFaction2))
|
||||
if (qinfo->RequiredFactionId2 && !sFactionStore.LookupEntry(qinfo->RequiredFactionId2))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RepObjectiveFaction2` = %u but faction template %u does not exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->RepObjectiveFaction2, qinfo->RepObjectiveFaction2);
|
||||
sLog->outErrorDb("Quest %u has `RequiredFactionId2` = %u but faction template %u does not exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->RequiredFactionId2, qinfo->RequiredFactionId2);
|
||||
// no changes, quest can't be done for this requirement
|
||||
}
|
||||
|
||||
if (qinfo->RepObjectiveFaction && !sFactionStore.LookupEntry(qinfo->RepObjectiveFaction))
|
||||
if (qinfo->RequiredFactionId1 && !sFactionStore.LookupEntry(qinfo->RequiredFactionId1))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RepObjectiveFaction` = %u but faction template %u does not exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->RepObjectiveFaction, qinfo->RepObjectiveFaction);
|
||||
sLog->outErrorDb("Quest %u has `RequiredFactionId1` = %u but faction template %u does not exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->RequiredFactionId1, qinfo->RequiredFactionId1);
|
||||
// no changes, quest can't be done for this requirement
|
||||
}
|
||||
|
||||
@@ -3922,17 +3921,17 @@ void ObjectMgr::LoadQuests()
|
||||
// no changes, quest can't be done for this requirement
|
||||
}
|
||||
|
||||
if (!qinfo->RepObjectiveFaction && qinfo->RepObjectiveValue != 0)
|
||||
if (!qinfo->RequiredFactionId1 && qinfo->RequiredFactionValue1 != 0)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RepObjectiveValue` = %d but `RepObjectiveFaction` is 0, value has no effect",
|
||||
qinfo->GetQuestId(), qinfo->RepObjectiveValue);
|
||||
sLog->outErrorDb("Quest %u has `RequiredFactionValue1` = %d but `RequiredFactionId1` is 0, value has no effect",
|
||||
qinfo->GetQuestId(), qinfo->RequiredFactionValue1);
|
||||
// warning
|
||||
}
|
||||
|
||||
if (!qinfo->RepObjectiveFaction2 && qinfo->RepObjectiveValue2 != 0)
|
||||
if (!qinfo->RequiredFactionId2 && qinfo->RequiredFactionValue2 != 0)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RepObjectiveValue2` = %d but `RepObjectiveFaction2` is 0, value has no effect",
|
||||
qinfo->GetQuestId(), qinfo->RepObjectiveValue2);
|
||||
sLog->outErrorDb("Quest %u has `RequiredFactionValue2` = %d but `RequiredFactionId2` is 0, value has no effect",
|
||||
qinfo->GetQuestId(), qinfo->RequiredFactionValue2);
|
||||
// warning
|
||||
}
|
||||
|
||||
@@ -3950,61 +3949,61 @@ void ObjectMgr::LoadQuests()
|
||||
// warning
|
||||
}
|
||||
|
||||
if (qinfo->CharTitleId && !sCharTitlesStore.LookupEntry(qinfo->CharTitleId))
|
||||
if (qinfo->RewardTitleId && !sCharTitlesStore.LookupEntry(qinfo->RewardTitleId))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `CharTitleId` = %u but CharTitle Id %u does not exist, quest can't be rewarded with title.",
|
||||
sLog->outErrorDb("Quest %u has `RewardTitleId` = %u but CharTitle Id %u does not exist, quest can't be rewarded with title.",
|
||||
qinfo->GetQuestId(), qinfo->GetCharTitleId(), qinfo->GetCharTitleId());
|
||||
qinfo->CharTitleId = 0;
|
||||
qinfo->RewardTitleId = 0;
|
||||
// quest can't reward this title
|
||||
}
|
||||
|
||||
if (qinfo->SrcItemId)
|
||||
if (qinfo->SourceItemId)
|
||||
{
|
||||
if (!sObjectMgr->GetItemTemplate(qinfo->SrcItemId))
|
||||
if (!sObjectMgr->GetItemTemplate(qinfo->SourceItemId))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `SrcItemId` = %u but item with entry %u does not exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->SrcItemId, qinfo->SrcItemId);
|
||||
qinfo->SrcItemId = 0; // quest can't be done for this requirement
|
||||
sLog->outErrorDb("Quest %u has `SourceItemId` = %u but item with entry %u does not exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->SourceItemId, qinfo->SourceItemId);
|
||||
qinfo->SourceItemId = 0; // quest can't be done for this requirement
|
||||
}
|
||||
else if (qinfo->SrcItemCount == 0)
|
||||
else if (qinfo->SourceItemIdCount == 0)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `SrcItemId` = %u but `SrcItemCount` = 0, set to 1 but need fix in DB.",
|
||||
qinfo->GetQuestId(), qinfo->SrcItemId);
|
||||
qinfo->SrcItemCount = 1; // update to 1 for allow quest work for backward compatibility with DB
|
||||
sLog->outErrorDb("Quest %u has `SourceItemId` = %u but `SourceItemIdCount` = 0, set to 1 but need fix in DB.",
|
||||
qinfo->GetQuestId(), qinfo->SourceItemId);
|
||||
qinfo->SourceItemIdCount = 1; // update to 1 for allow quest work for backward compatibility with DB
|
||||
}
|
||||
}
|
||||
else if (qinfo->SrcItemCount>0)
|
||||
else if (qinfo->SourceItemIdCount>0)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `SrcItemId` = 0 but `SrcItemCount` = %u, useless value.",
|
||||
qinfo->GetQuestId(), qinfo->SrcItemCount);
|
||||
qinfo->SrcItemCount=0; // no quest work changes in fact
|
||||
sLog->outErrorDb("Quest %u has `SourceItemId` = 0 but `SourceItemIdCount` = %u, useless value.",
|
||||
qinfo->GetQuestId(), qinfo->SourceItemIdCount);
|
||||
qinfo->SourceItemIdCount=0; // no quest work changes in fact
|
||||
}
|
||||
|
||||
if (qinfo->SrcSpell)
|
||||
if (qinfo->SourceSpellid)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->SrcSpell);
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->SourceSpellid);
|
||||
if (!spellInfo)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `SrcSpell` = %u but spell %u doesn't exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->SrcSpell, qinfo->SrcSpell);
|
||||
qinfo->SrcSpell = 0; // quest can't be done for this requirement
|
||||
sLog->outErrorDb("Quest %u has `SourceSpellid` = %u but spell %u doesn't exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->SourceSpellid, qinfo->SourceSpellid);
|
||||
qinfo->SourceSpellid = 0; // quest can't be done for this requirement
|
||||
}
|
||||
else if (!SpellMgr::IsSpellValid(spellInfo))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `SrcSpell` = %u but spell %u is broken, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->SrcSpell, qinfo->SrcSpell);
|
||||
qinfo->SrcSpell = 0; // quest can't be done for this requirement
|
||||
sLog->outErrorDb("Quest %u has `SourceSpellid` = %u but spell %u is broken, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->SourceSpellid, qinfo->SourceSpellid);
|
||||
qinfo->SourceSpellid = 0; // quest can't be done for this requirement
|
||||
}
|
||||
}
|
||||
|
||||
for (uint8 j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j)
|
||||
{
|
||||
uint32 id = qinfo->ReqItemId[j];
|
||||
uint32 id = qinfo->RequiredItemId[j];
|
||||
if (id)
|
||||
{
|
||||
if (qinfo->ReqItemCount[j] == 0)
|
||||
if (qinfo->RequiredItemCount[j] == 0)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `ReqItemId%d` = %u but `ReqItemCount%d` = 0, quest can't be done.",
|
||||
sLog->outErrorDb("Quest %u has `RequiredItemId%d` = %u but `RequiredItemCount%d` = 0, quest can't be done.",
|
||||
qinfo->GetQuestId(), j+1, id, j+1);
|
||||
// no changes, quest can't be done for this requirement
|
||||
}
|
||||
@@ -4013,37 +4012,37 @@ void ObjectMgr::LoadQuests()
|
||||
|
||||
if (!sObjectMgr->GetItemTemplate(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 `RequiredItemId%d` = %u but item with entry %u does not exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), j+1, id, id);
|
||||
qinfo->ReqItemCount[j] = 0; // prevent incorrect work of quest
|
||||
qinfo->RequiredItemCount[j] = 0; // prevent incorrect work of quest
|
||||
}
|
||||
}
|
||||
else if (qinfo->ReqItemCount[j]>0)
|
||||
else if (qinfo->RequiredItemCount[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->ReqItemCount[j] = 0; // prevent incorrect work of quest
|
||||
sLog->outErrorDb("Quest %u has `RequiredItemId%d` = 0 but `RequiredItemCount%d` = %u, quest can't be done.",
|
||||
qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredItemCount[j]);
|
||||
qinfo->RequiredItemCount[j] = 0; // prevent incorrect work of quest
|
||||
}
|
||||
}
|
||||
|
||||
for (uint8 j = 0; j < QUEST_SOURCE_ITEM_IDS_COUNT; ++j)
|
||||
{
|
||||
uint32 id = qinfo->ReqSourceId[j];
|
||||
uint32 id = qinfo->RequiredSourceItemid[j];
|
||||
if (id)
|
||||
{
|
||||
if (!sObjectMgr->GetItemTemplate(id))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `ReqSourceId%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);
|
||||
// no changes, quest can't be done for this requirement
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (qinfo->ReqSourceCount[j]>0)
|
||||
if (qinfo->RequiredSourceItemId[j]>0)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `ReqSourceId%d` = 0 but `ReqSourceCount%d` = %u.",
|
||||
qinfo->GetQuestId(), j+1, j+1, qinfo->ReqSourceCount[j]);
|
||||
sLog->outErrorDb("Quest %u has `RequiredSourceItemid%d` = 0 but `RequiredSourceItemId%d` = %u.",
|
||||
qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredSourceItemId[j]);
|
||||
// no changes, quest ignore this data
|
||||
}
|
||||
}
|
||||
@@ -4051,7 +4050,7 @@ void ObjectMgr::LoadQuests()
|
||||
|
||||
for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j)
|
||||
{
|
||||
uint32 id = qinfo->ReqSpell[j];
|
||||
uint32 id = qinfo->RequiredSpellCast[j];
|
||||
if (id)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(id);
|
||||
@@ -4062,12 +4061,12 @@ void ObjectMgr::LoadQuests()
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!qinfo->ReqCreatureOrGOId[j])
|
||||
if (!qinfo->RequiredNpcOrGo[j])
|
||||
{
|
||||
bool found = false;
|
||||
for (uint8 k = 0; k < MAX_SPELL_EFFECTS; ++k)
|
||||
{
|
||||
if ((spellInfo->Effects[k].Effect == SPELL_EFFECT_QUEST_COMPLETE && uint32(spellInfo->Effects[k].MiscValue) == qinfo->QuestId) ||
|
||||
if ((spellInfo->Effects[k].Effect == SPELL_EFFECT_QUEST_COMPLETE && uint32(spellInfo->Effects[k].MiscValue) == qinfo->Id) ||
|
||||
spellInfo->Effects[k].Effect == SPELL_EFFECT_SEND_EVENT)
|
||||
{
|
||||
found = true;
|
||||
@@ -4079,7 +4078,7 @@ void ObjectMgr::LoadQuests()
|
||||
{
|
||||
if (!qinfo->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
|
||||
{
|
||||
sLog->outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT for quest %u and ReqCreatureOrGOId%d = 0, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags or ReqCreatureOrGOId%d must be fixed, quest modified to enable objective.", spellInfo->Id, qinfo->QuestId, j+1, j+1);
|
||||
sLog->outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT for quest %u and RequiredNpcOrGo%d = 0, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags or RequiredNpcOrGo%d must be fixed, quest modified to enable objective.", spellInfo->Id, qinfo->Id, j+1, j+1);
|
||||
|
||||
// this will prevent quest completing without objective
|
||||
const_cast<Quest*>(qinfo)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT);
|
||||
@@ -4087,7 +4086,7 @@ void ObjectMgr::LoadQuests()
|
||||
}
|
||||
else
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `ReqSpellCast%d` = %u and ReqCreatureOrGOId%d = 0 but spell %u does not have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT effect for this quest, quest can't be done.",
|
||||
sLog->outErrorDb("Quest %u has `ReqSpellCast%d` = %u and RequiredNpcOrGo%d = 0 but spell %u does not have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT effect for this quest, quest can't be done.",
|
||||
qinfo->GetQuestId(), j+1, id, j+1, id);
|
||||
// no changes, quest can't be done for this requirement
|
||||
}
|
||||
@@ -4097,19 +4096,19 @@ void ObjectMgr::LoadQuests()
|
||||
|
||||
for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j)
|
||||
{
|
||||
int32 id = qinfo->ReqCreatureOrGOId[j];
|
||||
int32 id = qinfo->RequiredNpcOrGo[j];
|
||||
if (id < 0 && !sObjectMgr->GetGameObjectTemplate(-id))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `ReqCreatureOrGOId%d` = %i but gameobject %u does not exist, quest can't be done.",
|
||||
sLog->outErrorDb("Quest %u has `RequiredNpcOrGo%d` = %i but gameobject %u does not exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), j+1, id, uint32(-id));
|
||||
qinfo->ReqCreatureOrGOId[j] = 0; // quest can't be done for this requirement
|
||||
qinfo->RequiredNpcOrGo[j] = 0; // quest can't be done for this requirement
|
||||
}
|
||||
|
||||
if (id > 0 && !sObjectMgr->GetCreatureTemplate(id))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `ReqCreatureOrGOId%d` = %i but creature with entry %u does not exist, quest can't be done.",
|
||||
sLog->outErrorDb("Quest %u has `RequiredNpcOrGo%d` = %i but creature with entry %u does not exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), j+1, id, uint32(id));
|
||||
qinfo->ReqCreatureOrGOId[j] = 0; // quest can't be done for this requirement
|
||||
qinfo->RequiredNpcOrGo[j] = 0; // quest can't be done for this requirement
|
||||
}
|
||||
|
||||
if (id)
|
||||
@@ -4118,179 +4117,179 @@ void ObjectMgr::LoadQuests()
|
||||
|
||||
qinfo->SetFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST | QUEST_TRINITY_FLAGS_SPEAKTO);
|
||||
|
||||
if (!qinfo->ReqCreatureOrGOCount[j])
|
||||
if (!qinfo->RequiredNpcOrGoCount[j])
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `ReqCreatureOrGOId%d` = %u but `ReqCreatureOrGOCount%d` = 0, quest can't be done.",
|
||||
sLog->outErrorDb("Quest %u has `RequiredNpcOrGo%d` = %u but `RequiredNpcOrGoCount%d` = 0, quest can't be done.",
|
||||
qinfo->GetQuestId(), j+1, id, j+1);
|
||||
// no changes, quest can be incorrectly done, but we already report this
|
||||
}
|
||||
}
|
||||
else if (qinfo->ReqCreatureOrGOCount[j]>0)
|
||||
else if (qinfo->RequiredNpcOrGoCount[j]>0)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `ReqCreatureOrGOId%d` = 0 but `ReqCreatureOrGOCount%d` = %u.",
|
||||
qinfo->GetQuestId(), j+1, j+1, qinfo->ReqCreatureOrGOCount[j]);
|
||||
sLog->outErrorDb("Quest %u has `RequiredNpcOrGo%d` = 0 but `RequiredNpcOrGoCount%d` = %u.",
|
||||
qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredNpcOrGoCount[j]);
|
||||
// no changes, quest ignore this data
|
||||
}
|
||||
}
|
||||
|
||||
for (uint8 j = 0; j < QUEST_REWARD_CHOICES_COUNT; ++j)
|
||||
{
|
||||
uint32 id = qinfo->RewChoiceItemId[j];
|
||||
uint32 id = qinfo->RewardChoiceItemId[j];
|
||||
if (id)
|
||||
{
|
||||
if (!sObjectMgr->GetItemTemplate(id))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewChoiceItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.",
|
||||
sLog->outErrorDb("Quest %u has `RewardChoiceItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.",
|
||||
qinfo->GetQuestId(), j+1, id, id);
|
||||
qinfo->RewChoiceItemId[j] = 0; // no changes, quest will not reward this
|
||||
qinfo->RewardChoiceItemId[j] = 0; // no changes, quest will not reward this
|
||||
}
|
||||
|
||||
if (!qinfo->RewChoiceItemCount[j])
|
||||
if (!qinfo->RewardChoiceItemCount[j])
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewChoiceItemId%d` = %u but `RewChoiceItemCount%d` = 0, quest can't be done.",
|
||||
sLog->outErrorDb("Quest %u has `RewardChoiceItemId%d` = %u but `RewardChoiceItemCount%d` = 0, quest can't be done.",
|
||||
qinfo->GetQuestId(), j+1, id, j+1);
|
||||
// no changes, quest can't be done
|
||||
}
|
||||
}
|
||||
else if (qinfo->RewChoiceItemCount[j]>0)
|
||||
else if (qinfo->RewardChoiceItemCount[j]>0)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewChoiceItemId%d` = 0 but `RewChoiceItemCount%d` = %u.",
|
||||
qinfo->GetQuestId(), j+1, j+1, qinfo->RewChoiceItemCount[j]);
|
||||
sLog->outErrorDb("Quest %u has `RewardChoiceItemId%d` = 0 but `RewardChoiceItemCount%d` = %u.",
|
||||
qinfo->GetQuestId(), j+1, j+1, qinfo->RewardChoiceItemCount[j]);
|
||||
// no changes, quest ignore this data
|
||||
}
|
||||
}
|
||||
|
||||
for (uint8 j = 0; j < QUEST_REWARDS_COUNT; ++j)
|
||||
{
|
||||
uint32 id = qinfo->RewItemId[j];
|
||||
uint32 id = qinfo->RewardItemId[j];
|
||||
if (id)
|
||||
{
|
||||
if (!sObjectMgr->GetItemTemplate(id))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.",
|
||||
sLog->outErrorDb("Quest %u has `RewardItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.",
|
||||
qinfo->GetQuestId(), j+1, id, id);
|
||||
qinfo->RewItemId[j] = 0; // no changes, quest will not reward this item
|
||||
qinfo->RewardItemId[j] = 0; // no changes, quest will not reward this item
|
||||
}
|
||||
|
||||
if (!qinfo->RewItemCount[j])
|
||||
if (!qinfo->RewardItemIdCount[j])
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewItemId%d` = %u but `RewItemCount%d` = 0, quest will not reward this item.",
|
||||
sLog->outErrorDb("Quest %u has `RewardItemId%d` = %u but `RewardItemIdCount%d` = 0, quest will not reward this item.",
|
||||
qinfo->GetQuestId(), j+1, id, j+1);
|
||||
// no changes
|
||||
}
|
||||
}
|
||||
else if (qinfo->RewItemCount[j]>0)
|
||||
else if (qinfo->RewardItemIdCount[j]>0)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewItemId%d` = 0 but `RewItemCount%d` = %u.",
|
||||
qinfo->GetQuestId(), j+1, j+1, qinfo->RewItemCount[j]);
|
||||
sLog->outErrorDb("Quest %u has `RewardItemId%d` = 0 but `RewardItemIdCount%d` = %u.",
|
||||
qinfo->GetQuestId(), j+1, j+1, qinfo->RewardItemIdCount[j]);
|
||||
// no changes, quest ignore this data
|
||||
}
|
||||
}
|
||||
|
||||
for (uint8 j = 0; j < QUEST_REPUTATIONS_COUNT; ++j)
|
||||
{
|
||||
if (qinfo->RewRepFaction[j])
|
||||
if (qinfo->RewardFactionId[j])
|
||||
{
|
||||
if (abs(qinfo->RewRepValueId[j]) > 9)
|
||||
if (abs(qinfo->RewardFactionValueId[j]) > 9)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has RewRepValueId%d = %i. That is outside the range of valid values (-9 to 9).", qinfo->GetQuestId(), j+1, qinfo->RewRepValueId[j]);
|
||||
sLog->outErrorDb("Quest %u has RewardFactionValueId%d = %i. That is outside the range of valid values (-9 to 9).", qinfo->GetQuestId(), j+1, qinfo->RewardFactionValueId[j]);
|
||||
}
|
||||
if (!sFactionStore.LookupEntry(qinfo->RewRepFaction[j]))
|
||||
if (!sFactionStore.LookupEntry(qinfo->RewardFactionId[j]))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewRepFaction%d` = %u but raw faction (faction.dbc) %u does not exist, quest will not reward reputation for this faction.", qinfo->GetQuestId(), j+1, qinfo->RewRepFaction[j], qinfo->RewRepFaction[j]);
|
||||
qinfo->RewRepFaction[j] = 0; // quest will not reward this
|
||||
sLog->outErrorDb("Quest %u has `RewardFactionId%d` = %u but raw faction (faction.dbc) %u does not exist, quest will not reward reputation for this faction.", qinfo->GetQuestId(), j+1, qinfo->RewardFactionId[j], qinfo->RewardFactionId[j]);
|
||||
qinfo->RewardFactionId[j] = 0; // quest will not reward this
|
||||
}
|
||||
}
|
||||
|
||||
else if (qinfo->RewRepValue[j] != 0)
|
||||
else if (qinfo->RewardFactionValueIdOverride[j] != 0)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewRepFaction%d` = 0 but `RewRepValue%d` = %i.",
|
||||
qinfo->GetQuestId(), j+1, j+1, qinfo->RewRepValue[j]);
|
||||
sLog->outErrorDb("Quest %u has `RewardFactionId%d` = 0 but `RewardFactionValueIdOverride%d` = %i.",
|
||||
qinfo->GetQuestId(), j+1, j+1, qinfo->RewardFactionValueIdOverride[j]);
|
||||
// no changes, quest ignore this data
|
||||
}
|
||||
}
|
||||
|
||||
if (qinfo->RewSpell)
|
||||
if (qinfo->RewardSpell)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->RewSpell);
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->RewardSpell);
|
||||
|
||||
if (!spellInfo)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewSpell` = %u but spell %u does not exist, spell removed as display reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewSpell, qinfo->RewSpell);
|
||||
qinfo->RewSpell = 0; // no spell reward will display for this quest
|
||||
sLog->outErrorDb("Quest %u has `RewardSpell` = %u but spell %u does not exist, spell removed as display reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewardSpell, qinfo->RewardSpell);
|
||||
qinfo->RewardSpell = 0; // no spell reward will display for this quest
|
||||
}
|
||||
|
||||
else if (!SpellMgr::IsSpellValid(spellInfo))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewSpell` = %u but spell %u is broken, quest will not have a spell reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewSpell, qinfo->RewSpell);
|
||||
qinfo->RewSpell = 0; // no spell reward will display for this quest
|
||||
sLog->outErrorDb("Quest %u has `RewardSpell` = %u but spell %u is broken, quest will not have a spell reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewardSpell, qinfo->RewardSpell);
|
||||
qinfo->RewardSpell = 0; // no spell reward will display for this quest
|
||||
}
|
||||
|
||||
else if (GetTalentSpellCost(qinfo->RewSpell))
|
||||
else if (GetTalentSpellCost(qinfo->RewardSpell))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewSpell` = %u but spell %u is talent, quest will not have a spell reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewSpell, qinfo->RewSpell);
|
||||
qinfo->RewSpell = 0; // no spell reward will display for this quest
|
||||
sLog->outErrorDb("Quest %u has `RewardSpell` = %u but spell %u is talent, quest will not have a spell reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewardSpell, qinfo->RewardSpell);
|
||||
qinfo->RewardSpell = 0; // no spell reward will display for this quest
|
||||
}
|
||||
}
|
||||
|
||||
if (qinfo->RewSpellCast > 0)
|
||||
if (qinfo->RewardSpellCast > 0)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->RewSpellCast);
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->RewardSpellCast);
|
||||
|
||||
if (!spellInfo)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewSpellCast` = %u but spell %u does not exist, quest will not have a spell reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewSpellCast, qinfo->RewSpellCast);
|
||||
qinfo->RewSpellCast = 0; // no spell will be casted on player
|
||||
sLog->outErrorDb("Quest %u has `RewardSpellCast` = %u but spell %u does not exist, quest will not have a spell reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewardSpellCast, qinfo->RewardSpellCast);
|
||||
qinfo->RewardSpellCast = 0; // no spell will be casted on player
|
||||
}
|
||||
|
||||
else if (!SpellMgr::IsSpellValid(spellInfo))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewSpellCast` = %u but spell %u is broken, quest will not have a spell reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewSpellCast, qinfo->RewSpellCast);
|
||||
qinfo->RewSpellCast = 0; // no spell will be casted on player
|
||||
sLog->outErrorDb("Quest %u has `RewardSpellCast` = %u but spell %u is broken, quest will not have a spell reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewardSpellCast, qinfo->RewardSpellCast);
|
||||
qinfo->RewardSpellCast = 0; // no spell will be casted on player
|
||||
}
|
||||
|
||||
else if (GetTalentSpellCost(qinfo->RewSpellCast))
|
||||
else if (GetTalentSpellCost(qinfo->RewardSpellCast))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewSpell` = %u but spell %u is talent, quest will not have a spell reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewSpellCast, qinfo->RewSpellCast);
|
||||
qinfo->RewSpellCast = 0; // no spell will be casted on player
|
||||
sLog->outErrorDb("Quest %u has `RewardSpell` = %u but spell %u is talent, quest will not have a spell reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewardSpellCast, qinfo->RewardSpellCast);
|
||||
qinfo->RewardSpellCast = 0; // no spell will be casted on player
|
||||
}
|
||||
}
|
||||
|
||||
if (qinfo->RewMailTemplateId)
|
||||
if (qinfo->RewardMailTemplateId)
|
||||
{
|
||||
if (!sMailTemplateStore.LookupEntry(qinfo->RewMailTemplateId))
|
||||
if (!sMailTemplateStore.LookupEntry(qinfo->RewardMailTemplateId))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewMailTemplateId` = %u but mail template %u does not exist, quest will not have a mail reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewMailTemplateId, qinfo->RewMailTemplateId);
|
||||
qinfo->RewMailTemplateId = 0; // no mail will send to player
|
||||
qinfo->RewMailDelaySecs = 0; // no mail will send to player
|
||||
sLog->outErrorDb("Quest %u has `RewardMailTemplateId` = %u but mail template %u does not exist, quest will not have a mail reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewardMailTemplateId, qinfo->RewardMailTemplateId);
|
||||
qinfo->RewardMailTemplateId = 0; // no mail will send to player
|
||||
qinfo->RewardMailDelay = 0; // no mail will send to player
|
||||
}
|
||||
else if (usedMailTemplates.find(qinfo->RewMailTemplateId) != usedMailTemplates.end())
|
||||
else if (usedMailTemplates.find(qinfo->RewardMailTemplateId) != usedMailTemplates.end())
|
||||
{
|
||||
std::map<uint32, uint32>::const_iterator used_mt_itr = usedMailTemplates.find(qinfo->RewMailTemplateId);
|
||||
sLog->outErrorDb("Quest %u has `RewMailTemplateId` = %u but mail template %u already used for quest %u, quest will not have a mail reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewMailTemplateId, qinfo->RewMailTemplateId, used_mt_itr->second);
|
||||
qinfo->RewMailTemplateId = 0; // no mail will send to player
|
||||
qinfo->RewMailDelaySecs = 0; // no mail will send to player
|
||||
std::map<uint32, uint32>::const_iterator used_mt_itr = usedMailTemplates.find(qinfo->RewardMailTemplateId);
|
||||
sLog->outErrorDb("Quest %u has `RewardMailTemplateId` = %u but mail template %u already used for quest %u, quest will not have a mail reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewardMailTemplateId, qinfo->RewardMailTemplateId, used_mt_itr->second);
|
||||
qinfo->RewardMailTemplateId = 0; // no mail will send to player
|
||||
qinfo->RewardMailDelay = 0; // no mail will send to player
|
||||
}
|
||||
else
|
||||
usedMailTemplates[qinfo->RewMailTemplateId] = qinfo->GetQuestId();
|
||||
usedMailTemplates[qinfo->RewardMailTemplateId] = qinfo->GetQuestId();
|
||||
}
|
||||
|
||||
if (qinfo->NextQuestInChain)
|
||||
if (qinfo->NextQuestIdChain)
|
||||
{
|
||||
QuestMap::iterator qNextItr = mQuestTemplates.find(qinfo->NextQuestInChain);
|
||||
QuestMap::iterator qNextItr = mQuestTemplates.find(qinfo->NextQuestIdChain);
|
||||
if (qNextItr == mQuestTemplates.end())
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `NextQuestInChain` = %u but quest %u does not exist, quest chain will not work.",
|
||||
qinfo->GetQuestId(), qinfo->NextQuestInChain, qinfo->NextQuestInChain);
|
||||
qinfo->NextQuestInChain = 0;
|
||||
sLog->outErrorDb("Quest %u has `NextQuestIdChain` = %u but quest %u does not exist, quest chain will not work.",
|
||||
qinfo->GetQuestId(), qinfo->NextQuestIdChain, qinfo->NextQuestIdChain);
|
||||
qinfo->NextQuestIdChain = 0;
|
||||
}
|
||||
else
|
||||
qNextItr->second->prevChainQuests.push_back(qinfo->GetQuestId());
|
||||
@@ -4327,7 +4326,7 @@ void ObjectMgr::LoadQuests()
|
||||
mExclusiveQuestGroups.insert(std::pair<int32, uint32>(qinfo->ExclusiveGroup, qinfo->GetQuestId()));
|
||||
if (qinfo->LimitTime)
|
||||
qinfo->SetFlag(QUEST_TRINITY_FLAGS_TIMED);
|
||||
if (qinfo->PlayersSlain)
|
||||
if (qinfo->RequiredPlayerKills)
|
||||
qinfo->SetFlag(QUEST_TRINITY_FLAGS_PLAYER_KILL);
|
||||
}
|
||||
|
||||
|
||||
+112
-108
@@ -22,128 +22,132 @@
|
||||
|
||||
Quest::Quest(Field* questRecord)
|
||||
{
|
||||
QuestId = questRecord[0].GetUInt32();
|
||||
QuestMethod = questRecord[1].GetUInt32();
|
||||
ZoneOrSort = questRecord[2].GetInt32();
|
||||
Id = questRecord[0].GetUInt32();
|
||||
Method = questRecord[1].GetUInt32();
|
||||
Level = questRecord[2].GetInt32();
|
||||
MinLevel = questRecord[3].GetUInt32();
|
||||
MaxLevel = questRecord[4].GetUInt32();
|
||||
QuestLevel = questRecord[5].GetInt32();
|
||||
ZoneOrSort = questRecord[5].GetInt32();
|
||||
Type = questRecord[6].GetUInt32();
|
||||
RequiredClasses = questRecord[7].GetUInt32();
|
||||
RequiredRaces = questRecord[8].GetUInt32();
|
||||
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[42+i].GetString();
|
||||
|
||||
for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
|
||||
ReqItemId[i] = questRecord[46+i].GetUInt32();
|
||||
|
||||
for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
|
||||
ReqItemCount[i] = questRecord[52+i].GetUInt32();
|
||||
|
||||
for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
|
||||
ReqSourceId[i] = questRecord[58+i].GetUInt32();
|
||||
|
||||
for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
|
||||
ReqSourceCount[i] = questRecord[62+i].GetUInt32();
|
||||
|
||||
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
||||
ReqCreatureOrGOId[i] = questRecord[66+i].GetInt32();
|
||||
|
||||
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
||||
ReqCreatureOrGOCount[i] = questRecord[70+i].GetUInt32();
|
||||
|
||||
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
||||
ReqSpell[i] = questRecord[74+i].GetUInt32();
|
||||
|
||||
for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i)
|
||||
RewChoiceItemId[i] = questRecord[78+i].GetUInt32();
|
||||
|
||||
for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i)
|
||||
RewChoiceItemCount[i] = questRecord[84+i].GetUInt32();
|
||||
SuggestedPlayers = questRecord[7].GetUInt32();
|
||||
LimitTime = questRecord[8].GetUInt32();
|
||||
RequiredClasses = questRecord[9].GetUInt32();
|
||||
RequiredRaces = questRecord[10].GetUInt32();
|
||||
RequiredSkillId = questRecord[11].GetUInt32();
|
||||
RequiredSkillPoints = questRecord[12].GetUInt32();
|
||||
RequiredFactionId1 = questRecord[13].GetUInt32();
|
||||
RequiredFactionId2 = questRecord[14].GetUInt32();
|
||||
RequiredFactionValue1 = questRecord[15].GetInt32();
|
||||
RequiredFactionValue2 = questRecord[16].GetInt32();
|
||||
RequiredMinRepFaction = questRecord[17].GetUInt32();
|
||||
RequiredMaxRepFaction = questRecord[18].GetUInt32();
|
||||
RequiredMinRepValue = questRecord[19].GetInt32();
|
||||
RequiredMaxRepValue = questRecord[20].GetInt32();
|
||||
PrevQuestId = questRecord[21].GetInt32();
|
||||
NextQuestId = questRecord[22].GetInt32();
|
||||
ExclusiveGroup = questRecord[23].GetInt32();
|
||||
NextQuestIdChain = questRecord[24].GetUInt32();
|
||||
RewardXPId = questRecord[25].GetUInt32();
|
||||
RewardOrRequiredMoney = questRecord[26].GetInt32();
|
||||
RewardMoneyMaxLevel = questRecord[27].GetUInt32();
|
||||
RewardSpell = questRecord[28].GetUInt32();
|
||||
RewardSpellCast = questRecord[29].GetInt32();
|
||||
RewardHonor = questRecord[30].GetUInt32();
|
||||
RewardHonorMultiplier = questRecord[31].GetFloat();
|
||||
RewardMailTemplateId = questRecord[32].GetUInt32();
|
||||
RewardMailDelay = questRecord[33].GetUInt32();
|
||||
SourceItemId = questRecord[34].GetUInt32();
|
||||
SourceItemIdCount = questRecord[35].GetUInt32();
|
||||
SourceSpellid = questRecord[36].GetUInt32();
|
||||
Flags = questRecord[37].GetUInt32();
|
||||
uint32 SpecialFlags = questRecord[38].GetUInt16();
|
||||
RewardTitleId = questRecord[39].GetUInt32();
|
||||
RequiredPlayerKills = questRecord[40].GetUInt32();
|
||||
RewardTalents = questRecord[41].GetUInt32();
|
||||
RewardArenaPoints = questRecord[42].GetInt32();
|
||||
|
||||
for (int i = 0; i < QUEST_REWARDS_COUNT; ++i)
|
||||
RewItemId[i] = questRecord[90+i].GetUInt32();
|
||||
RewardItemId[i] = questRecord[43+i].GetUInt32();
|
||||
|
||||
for (int i = 0; i < QUEST_REWARDS_COUNT; ++i)
|
||||
RewItemCount[i] = questRecord[94+i].GetUInt32();
|
||||
RewardItemIdCount[i] = questRecord[47+i].GetUInt32();
|
||||
|
||||
for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i)
|
||||
RewardChoiceItemId[i] = questRecord[51+i].GetUInt32();
|
||||
|
||||
for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i)
|
||||
RewardChoiceItemCount[i] = questRecord[57+i].GetUInt32();
|
||||
|
||||
for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)
|
||||
RewardFactionId[i] = questRecord[63+i].GetUInt32();
|
||||
|
||||
for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)
|
||||
RewRepFaction[i] = questRecord[98+i].GetUInt32();
|
||||
RewardFactionValueId[i] = questRecord[68+i].GetInt32();
|
||||
|
||||
for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)
|
||||
RewRepValueId[i] = questRecord[103+i].GetInt32();
|
||||
RewardFactionValueIdOverride[i] = questRecord[73+i].GetInt32();
|
||||
|
||||
PointMapId = questRecord[78].GetUInt32();
|
||||
PointX = questRecord[79].GetFloat();
|
||||
PointY = questRecord[80].GetFloat();
|
||||
PointOption = questRecord[81].GetUInt32();
|
||||
Title = questRecord[82].GetString();
|
||||
Objectives = questRecord[83].GetString();
|
||||
Details = questRecord[84].GetString();
|
||||
EndText = questRecord[85].GetString();
|
||||
OfferRewardText = questRecord[86].GetString();
|
||||
RequestItemsText = questRecord[87].GetString();
|
||||
CompletedText = questRecord[88].GetString();
|
||||
|
||||
for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)
|
||||
RewRepValue[i] = questRecord[108+i].GetInt32();
|
||||
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
||||
RequiredNpcOrGo[i] = questRecord[89+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_OBJECTIVES_COUNT; ++i)
|
||||
RequiredNpcOrGoCount[i] = questRecord[93+i].GetUInt32();
|
||||
|
||||
for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
|
||||
RequiredSourceItemid[i] = questRecord[97+i].GetUInt32();
|
||||
|
||||
for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
|
||||
RequiredSourceItemId[i] = questRecord[101+i].GetUInt32();
|
||||
|
||||
for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
|
||||
RequiredItemId[i] = questRecord[105+i].GetUInt32();
|
||||
|
||||
for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
|
||||
RequiredItemCount[i] = questRecord[111+i].GetUInt32();
|
||||
|
||||
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
||||
RequiredSpellCast[i] = questRecord[117+i].GetUInt32();
|
||||
|
||||
// int8 Unknown0 = questRecord[121].GetUInt32();
|
||||
|
||||
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
||||
ObjectiveText[i] = questRecord[122+i].GetString();
|
||||
|
||||
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
|
||||
DetailsEmote[i] = questRecord[125+i].GetUInt32();
|
||||
DetailsEmote[i] = questRecord[126+i].GetUInt32();
|
||||
|
||||
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
|
||||
DetailsEmoteDelay[i] = questRecord[129+i].GetUInt32();
|
||||
DetailsEmoteDelay[i] = questRecord[130+i].GetUInt32();
|
||||
|
||||
IncompleteEmote = questRecord[133].GetUInt32();
|
||||
CompleteEmote = questRecord[134].GetUInt32();
|
||||
EmoteOnIncomplete = questRecord[134].GetUInt32();
|
||||
EmoteOnComplete = questRecord[135].GetUInt32();
|
||||
|
||||
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
|
||||
OfferRewardEmote[i] = questRecord[135+i].GetInt32();
|
||||
OfferRewardEmote[i] = questRecord[136+i].GetInt32();
|
||||
|
||||
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
|
||||
OfferRewardEmoteDelay[i] = questRecord[139+i].GetInt32();
|
||||
OfferRewardEmoteDelay[i] = questRecord[140+i].GetInt32();
|
||||
|
||||
QuestStartScript = questRecord[143].GetUInt32();
|
||||
QuestCompleteScript = questRecord[144].GetUInt32();
|
||||
StartScript = questRecord[144].GetUInt32();
|
||||
CompleteScript = questRecord[145].GetUInt32();
|
||||
|
||||
QuestFlags |= SpecialFlags << 20;
|
||||
if (QuestFlags & QUEST_TRINITY_FLAGS_AUTO_ACCEPT)
|
||||
QuestFlags |= QUEST_FLAGS_AUTO_ACCEPT;
|
||||
// int32 WDBVerified = questRecord[146].GetInt32();
|
||||
|
||||
Flags |= SpecialFlags << 20;
|
||||
if (Flags & QUEST_TRINITY_FLAGS_AUTO_ACCEPT)
|
||||
Flags |= QUEST_FLAGS_AUTO_ACCEPT;
|
||||
|
||||
m_reqitemscount = 0;
|
||||
m_reqCreatureOrGOcount = 0;
|
||||
@@ -151,19 +155,19 @@ Quest::Quest(Field* questRecord)
|
||||
m_rewchoiceitemscount = 0;
|
||||
|
||||
for (int i=0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
|
||||
if (ReqItemId[i])
|
||||
if (RequiredItemId[i])
|
||||
++m_reqitemscount;
|
||||
|
||||
for (int i=0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
||||
if (ReqCreatureOrGOId[i])
|
||||
if (RequiredNpcOrGo[i])
|
||||
++m_reqCreatureOrGOcount;
|
||||
|
||||
for (int i=0; i < QUEST_REWARDS_COUNT; ++i)
|
||||
if (RewItemId[i])
|
||||
if (RewardItemId[i])
|
||||
++m_rewitemscount;
|
||||
|
||||
for (int i=0; i < QUEST_REWARD_CHOICES_COUNT; ++i)
|
||||
if (RewChoiceItemId[i])
|
||||
if (RewardChoiceItemId[i])
|
||||
++m_rewchoiceitemscount;
|
||||
}
|
||||
|
||||
@@ -171,7 +175,7 @@ uint32 Quest::XPValue(Player* player) const
|
||||
{
|
||||
if (player)
|
||||
{
|
||||
int32 quest_level = (QuestLevel == -1 ? player->getLevel() : QuestLevel);
|
||||
int32 quest_level = (Level == -1 ? player->getLevel() : Level);
|
||||
const QuestXPEntry* xpentry = sQuestXPStore.LookupEntry(quest_level);
|
||||
if (!xpentry)
|
||||
return 0;
|
||||
@@ -182,7 +186,7 @@ uint32 Quest::XPValue(Player* player) const
|
||||
else if (diffFactor > 10)
|
||||
diffFactor = 10;
|
||||
|
||||
uint32 xp = diffFactor * xpentry->Exp[XPId] / 10;
|
||||
uint32 xp = diffFactor * xpentry->Exp[RewardXPId] / 10;
|
||||
if (xp <= 100)
|
||||
xp = 5 * ((xp + 2) / 5);
|
||||
else if (xp <= 500)
|
||||
@@ -200,15 +204,15 @@ uint32 Quest::XPValue(Player* player) const
|
||||
|
||||
int32 Quest::GetRewOrReqMoney() const
|
||||
{
|
||||
if (RewOrReqMoney <= 0)
|
||||
return RewOrReqMoney;
|
||||
if (RewardOrRequiredMoney <= 0)
|
||||
return RewardOrRequiredMoney;
|
||||
|
||||
return int32(RewOrReqMoney * sWorld->getRate(RATE_DROP_MONEY));
|
||||
return int32(RewardOrRequiredMoney * sWorld->getRate(RATE_DROP_MONEY));
|
||||
}
|
||||
|
||||
bool Quest::IsAutoComplete() const
|
||||
{
|
||||
return QuestMethod == 0 || HasFlag(QUEST_FLAGS_AUTOCOMPLETE);
|
||||
return Method == 0 || HasFlag(QUEST_FLAGS_AUTOCOMPLETE);
|
||||
}
|
||||
|
||||
bool Quest::IsAllowedInRaid() const
|
||||
|
||||
@@ -141,7 +141,7 @@ enum __QuestFlags
|
||||
QUEST_FLAGS_UNAVAILABLE = 0x00004000, // Used on quests that are not generically available
|
||||
QUEST_FLAGS_WEEKLY = 0x00008000,
|
||||
QUEST_FLAGS_AUTOCOMPLETE = 0x00010000, // auto complete
|
||||
QUEST_FLAGS_SPECIAL_ITEM = 0x00020000, // has something to do with ReqItemId and SrcItemId
|
||||
QUEST_FLAGS_SPECIAL_ITEM = 0x00020000, // has something to do with RequiredItemId and SourceItemId
|
||||
QUEST_FLAGS_OBJ_TEXT = 0x00040000, // use Objective text as Complete text
|
||||
QUEST_FLAGS_AUTO_ACCEPT = 0x00080000, // The client recognizes this flag as auto-accept. However, NONE of the current quests (3.3.5a) have this flag. Maybe blizz used to use it, or will use it in the future.
|
||||
|
||||
@@ -185,25 +185,25 @@ class Quest
|
||||
Quest(Field* questRecord);
|
||||
uint32 XPValue(Player* player) const;
|
||||
|
||||
bool HasFlag(uint32 flag) const { return (QuestFlags & flag) != 0; }
|
||||
void SetFlag(uint32 flag) { QuestFlags |= flag; }
|
||||
bool HasFlag(uint32 flag) const { return (Flags & flag) != 0; }
|
||||
void SetFlag(uint32 flag) { Flags |= flag; }
|
||||
|
||||
// table data accessors:
|
||||
uint32 GetQuestId() const { return QuestId; }
|
||||
uint32 GetQuestMethod() const { return QuestMethod; }
|
||||
uint32 GetQuestId() const { return Id; }
|
||||
uint32 GetQuestMethod() const { return Method; }
|
||||
int32 GetZoneOrSort() const { return ZoneOrSort; }
|
||||
uint32 GetMinLevel() const { return MinLevel; }
|
||||
uint32 GetMaxLevel() const { return MaxLevel; }
|
||||
uint32 GetQuestLevel() const { return QuestLevel; }
|
||||
uint32 GetQuestLevel() const { return Level; }
|
||||
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; }
|
||||
uint32 GetRepObjectiveFaction2() const { return RepObjectiveFaction2; }
|
||||
int32 GetRepObjectiveValue2() const { return RepObjectiveValue2; }
|
||||
uint32 GetRequiredSkill() const { return RequiredSkillId; }
|
||||
uint32 GetRequiredSkillValue() const { return RequiredSkillPoints; }
|
||||
uint32 GetRepObjectiveFaction() const { return RequiredFactionId1; }
|
||||
int32 GetRepObjectiveValue() const { return RequiredFactionValue1; }
|
||||
uint32 GetRepObjectiveFaction2() const { return RequiredFactionId2; }
|
||||
int32 GetRepObjectiveValue2() const { return RequiredFactionValue2; }
|
||||
uint32 GetRequiredMinRepFaction() const { return RequiredMinRepFaction; }
|
||||
int32 GetRequiredMinRepValue() const { return RequiredMinRepValue; }
|
||||
uint32 GetRequiredMaxRepFaction() const { return RequiredMaxRepFaction; }
|
||||
@@ -213,15 +213,15 @@ class Quest
|
||||
int32 GetPrevQuestId() const { return PrevQuestId; }
|
||||
int32 GetNextQuestId() const { return NextQuestId; }
|
||||
int32 GetExclusiveGroup() const { return ExclusiveGroup; }
|
||||
uint32 GetNextQuestInChain() const { return NextQuestInChain; }
|
||||
uint32 GetCharTitleId() const { return CharTitleId; }
|
||||
uint32 GetPlayersSlain() const { return PlayersSlain; }
|
||||
uint32 GetBonusTalents() const { return BonusTalents; }
|
||||
int32 GetRewArenaPoints() const {return RewArenaPoints; }
|
||||
uint32 GetXPId() const { return XPId; }
|
||||
uint32 GetSrcItemId() const { return SrcItemId; }
|
||||
uint32 GetSrcItemCount() const { return SrcItemCount; }
|
||||
uint32 GetSrcSpell() const { return SrcSpell; }
|
||||
uint32 GetNextQuestInChain() const { return NextQuestIdChain; }
|
||||
uint32 GetCharTitleId() const { return RewardTitleId; }
|
||||
uint32 GetPlayersSlain() const { return RequiredPlayerKills; }
|
||||
uint32 GetBonusTalents() const { return RewardTalents; }
|
||||
int32 GetRewArenaPoints() const {return RewardArenaPoints; }
|
||||
uint32 GetXPId() const { return RewardXPId; }
|
||||
uint32 GetSrcItemId() const { return SourceItemId; }
|
||||
uint32 GetSrcItemCount() const { return SourceItemIdCount; }
|
||||
uint32 GetSrcSpell() const { return SourceSpellid; }
|
||||
std::string GetTitle() const { return Title; }
|
||||
std::string GetDetails() const { return Details; }
|
||||
std::string GetObjectives() const { return Objectives; }
|
||||
@@ -230,50 +230,50 @@ class Quest
|
||||
std::string GetEndText() const { return EndText; }
|
||||
std::string GetCompletedText() const { return CompletedText; }
|
||||
int32 GetRewOrReqMoney() const;
|
||||
uint32 GetRewHonorAddition() const { return RewHonorAddition; }
|
||||
float GetRewHonorMultiplier() const { return RewHonorMultiplier; }
|
||||
uint32 GetRewMoneyMaxLevel() const { return RewMoneyMaxLevel; }
|
||||
uint32 GetRewHonorAddition() const { return RewardHonor; }
|
||||
float GetRewHonorMultiplier() const { return RewardHonorMultiplier; }
|
||||
uint32 GetRewMoneyMaxLevel() const { return RewardMoneyMaxLevel; }
|
||||
// use in XP calculation at client
|
||||
uint32 GetRewSpell() const { return RewSpell; }
|
||||
int32 GetRewSpellCast() const { return RewSpellCast; }
|
||||
uint32 GetRewMailTemplateId() const { return RewMailTemplateId; }
|
||||
uint32 GetRewMailDelaySecs() const { return RewMailDelaySecs; }
|
||||
uint32 GetRewSpell() const { return RewardSpell; }
|
||||
int32 GetRewSpellCast() const { return RewardSpellCast; }
|
||||
uint32 GetRewMailTemplateId() const { return RewardMailTemplateId; }
|
||||
uint32 GetRewMailDelaySecs() const { return RewardMailDelay; }
|
||||
uint32 GetPointMapId() const { return PointMapId; }
|
||||
float GetPointX() const { return PointX; }
|
||||
float GetPointY() const { return PointY; }
|
||||
uint32 GetPointOpt() const { return PointOpt; }
|
||||
uint32 GetIncompleteEmote() const { return IncompleteEmote; }
|
||||
uint32 GetCompleteEmote() const { return CompleteEmote; }
|
||||
uint32 GetQuestStartScript() const { return QuestStartScript; }
|
||||
uint32 GetQuestCompleteScript() const { return QuestCompleteScript; }
|
||||
bool IsRepeatable() const { return QuestFlags & QUEST_TRINITY_FLAGS_REPEATABLE; }
|
||||
uint32 GetPointOpt() const { return PointOption; }
|
||||
uint32 GetIncompleteEmote() const { return EmoteOnIncomplete; }
|
||||
uint32 GetCompleteEmote() const { return EmoteOnComplete; }
|
||||
uint32 GetQuestStartScript() const { return StartScript; }
|
||||
uint32 GetQuestCompleteScript() const { return CompleteScript; }
|
||||
bool IsRepeatable() const { return Flags & QUEST_TRINITY_FLAGS_REPEATABLE; }
|
||||
bool IsAutoComplete() const;
|
||||
uint32 GetFlags() const { return QuestFlags; }
|
||||
bool IsDaily() const { return QuestFlags & QUEST_FLAGS_DAILY; }
|
||||
bool IsWeekly() const { return QuestFlags & QUEST_FLAGS_WEEKLY; }
|
||||
bool IsDailyOrWeekly() const { return QuestFlags & (QUEST_FLAGS_DAILY | QUEST_FLAGS_WEEKLY); }
|
||||
bool IsAutoAccept() const { return QuestFlags & QUEST_FLAGS_AUTO_ACCEPT; }
|
||||
uint32 GetFlags() const { return Flags; }
|
||||
bool IsDaily() const { return Flags & QUEST_FLAGS_DAILY; }
|
||||
bool IsWeekly() const { return Flags & QUEST_FLAGS_WEEKLY; }
|
||||
bool IsDailyOrWeekly() const { return Flags & (QUEST_FLAGS_DAILY | QUEST_FLAGS_WEEKLY); }
|
||||
bool IsAutoAccept() const { return Flags & QUEST_FLAGS_AUTO_ACCEPT; }
|
||||
bool IsRaidQuest() const { return Type == QUEST_TYPE_RAID || Type == QUEST_TYPE_RAID_10 || Type == QUEST_TYPE_RAID_25; }
|
||||
bool IsAllowedInRaid() const;
|
||||
bool IsDFQuest() const { return QuestFlags & QUEST_TRINITY_FLAGS_DF_QUEST; }
|
||||
bool IsDFQuest() const { return Flags & QUEST_TRINITY_FLAGS_DF_QUEST; }
|
||||
uint32 CalculateHonorGain(uint8 level) const;
|
||||
|
||||
// multiple values
|
||||
std::string ObjectiveText[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
|
||||
uint32 ReqCreatureOrGOCount[QUEST_OBJECTIVES_COUNT];
|
||||
uint32 ReqSpell[QUEST_OBJECTIVES_COUNT];
|
||||
uint32 RewChoiceItemId[QUEST_REWARD_CHOICES_COUNT];
|
||||
uint32 RewChoiceItemCount[QUEST_REWARD_CHOICES_COUNT];
|
||||
uint32 RewItemId[QUEST_REWARDS_COUNT];
|
||||
uint32 RewItemCount[QUEST_REWARDS_COUNT];
|
||||
uint32 RewRepFaction[QUEST_REPUTATIONS_COUNT];
|
||||
int32 RewRepValueId[QUEST_REPUTATIONS_COUNT];
|
||||
int32 RewRepValue[QUEST_REPUTATIONS_COUNT];
|
||||
uint32 RequiredItemId[QUEST_ITEM_OBJECTIVES_COUNT];
|
||||
uint32 RequiredItemCount[QUEST_ITEM_OBJECTIVES_COUNT];
|
||||
uint32 RequiredSourceItemid[QUEST_SOURCE_ITEM_IDS_COUNT];
|
||||
uint32 RequiredSourceItemId[QUEST_SOURCE_ITEM_IDS_COUNT];
|
||||
int32 RequiredNpcOrGo[QUEST_OBJECTIVES_COUNT]; // >0 Creature <0 Gameobject
|
||||
uint32 RequiredNpcOrGoCount[QUEST_OBJECTIVES_COUNT];
|
||||
uint32 RequiredSpellCast[QUEST_OBJECTIVES_COUNT];
|
||||
uint32 RewardChoiceItemId[QUEST_REWARD_CHOICES_COUNT];
|
||||
uint32 RewardChoiceItemCount[QUEST_REWARD_CHOICES_COUNT];
|
||||
uint32 RewardItemId[QUEST_REWARDS_COUNT];
|
||||
uint32 RewardItemIdCount[QUEST_REWARDS_COUNT];
|
||||
uint32 RewardFactionId[QUEST_REPUTATIONS_COUNT];
|
||||
int32 RewardFactionValueId[QUEST_REPUTATIONS_COUNT];
|
||||
int32 RewardFactionValueIdOverride[QUEST_REPUTATIONS_COUNT];
|
||||
uint32 DetailsEmote[QUEST_EMOTE_COUNT];
|
||||
uint32 DetailsEmoteDelay[QUEST_EMOTE_COUNT];
|
||||
uint32 OfferRewardEmote[QUEST_EMOTE_COUNT];
|
||||
@@ -298,40 +298,40 @@ class Quest
|
||||
|
||||
// table data
|
||||
protected:
|
||||
uint32 QuestId;
|
||||
uint32 QuestMethod;
|
||||
uint32 Id;
|
||||
uint32 Method;
|
||||
int32 ZoneOrSort;
|
||||
uint32 MinLevel;
|
||||
uint32 MaxLevel;
|
||||
int32 QuestLevel;
|
||||
int32 Level;
|
||||
uint32 Type;
|
||||
uint32 RequiredClasses;
|
||||
uint32 RequiredRaces;
|
||||
uint32 RequiredSkill;
|
||||
uint32 RequiredSkillValue;
|
||||
uint32 RepObjectiveFaction;
|
||||
int32 RepObjectiveValue;
|
||||
uint32 RepObjectiveFaction2;
|
||||
int32 RepObjectiveValue2;
|
||||
uint32 RequiredSkillId;
|
||||
uint32 RequiredSkillPoints;
|
||||
uint32 RequiredFactionId1;
|
||||
int32 RequiredFactionValue1;
|
||||
uint32 RequiredFactionId2;
|
||||
int32 RequiredFactionValue2;
|
||||
uint32 RequiredMinRepFaction;
|
||||
int32 RequiredMinRepValue;
|
||||
uint32 RequiredMaxRepFaction;
|
||||
int32 RequiredMaxRepValue;
|
||||
uint32 SuggestedPlayers;
|
||||
uint32 LimitTime;
|
||||
uint32 QuestFlags;
|
||||
uint32 CharTitleId;
|
||||
uint32 PlayersSlain;
|
||||
uint32 BonusTalents;
|
||||
int32 RewArenaPoints;
|
||||
uint32 Flags;
|
||||
uint32 RewardTitleId;
|
||||
uint32 RequiredPlayerKills;
|
||||
uint32 RewardTalents;
|
||||
int32 RewardArenaPoints;
|
||||
int32 PrevQuestId;
|
||||
int32 NextQuestId;
|
||||
int32 ExclusiveGroup;
|
||||
uint32 NextQuestInChain;
|
||||
uint32 XPId;
|
||||
uint32 SrcItemId;
|
||||
uint32 SrcItemCount;
|
||||
uint32 SrcSpell;
|
||||
uint32 NextQuestIdChain;
|
||||
uint32 RewardXPId;
|
||||
uint32 SourceItemId;
|
||||
uint32 SourceItemIdCount;
|
||||
uint32 SourceSpellid;
|
||||
std::string Title;
|
||||
std::string Details;
|
||||
std::string Objectives;
|
||||
@@ -339,22 +339,22 @@ class Quest
|
||||
std::string RequestItemsText;
|
||||
std::string EndText;
|
||||
std::string CompletedText;
|
||||
uint32 RewHonorAddition;
|
||||
float RewHonorMultiplier;
|
||||
int32 RewOrReqMoney;
|
||||
uint32 RewMoneyMaxLevel;
|
||||
uint32 RewSpell;
|
||||
int32 RewSpellCast;
|
||||
uint32 RewMailTemplateId;
|
||||
uint32 RewMailDelaySecs;
|
||||
uint32 RewardHonor;
|
||||
float RewardHonorMultiplier;
|
||||
int32 RewardOrRequiredMoney;
|
||||
uint32 RewardMoneyMaxLevel;
|
||||
uint32 RewardSpell;
|
||||
int32 RewardSpellCast;
|
||||
uint32 RewardMailTemplateId;
|
||||
uint32 RewardMailDelay;
|
||||
uint32 PointMapId;
|
||||
float PointX;
|
||||
float PointY;
|
||||
uint32 PointOpt;
|
||||
uint32 IncompleteEmote;
|
||||
uint32 CompleteEmote;
|
||||
uint32 QuestStartScript;
|
||||
uint32 QuestCompleteScript;
|
||||
uint32 PointOption;
|
||||
uint32 EmoteOnIncomplete;
|
||||
uint32 EmoteOnComplete;
|
||||
uint32 StartScript;
|
||||
uint32 CompleteScript;
|
||||
};
|
||||
|
||||
struct QuestStatusData
|
||||
|
||||
@@ -205,14 +205,14 @@ void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recv_data
|
||||
ItemTemplate const* iProto = NULL;
|
||||
for (uint8 i = 0; i < QUEST_REWARDS_COUNT; ++i)
|
||||
{
|
||||
if (!qRew->RewItemId[i])
|
||||
if (!qRew->RewardItemId[i])
|
||||
continue;
|
||||
|
||||
iProto = sObjectMgr->GetItemTemplate(qRew->RewItemId[i]);
|
||||
iProto = sObjectMgr->GetItemTemplate(qRew->RewardItemId[i]);
|
||||
|
||||
data << uint32(qRew->RewItemId[i]);
|
||||
data << uint32(qRew->RewardItemId[i]);
|
||||
data << uint32(iProto ? iProto->DisplayInfoID : 0);
|
||||
data << uint32(qRew->RewItemCount[i]);
|
||||
data << uint32(qRew->RewardItemIdCount[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -495,14 +495,14 @@ void WorldSession::SendLfgPlayerReward(uint32 rdungeonEntry, uint32 sdungeonEntr
|
||||
ItemTemplate const* iProto = NULL;
|
||||
for (uint8 i = 0; i < QUEST_REWARDS_COUNT; ++i)
|
||||
{
|
||||
if (!qRew->RewItemId[i])
|
||||
if (!qRew->RewardItemId[i])
|
||||
continue;
|
||||
|
||||
iProto = sObjectMgr->GetItemTemplate(qRew->RewItemId[i]);
|
||||
iProto = sObjectMgr->GetItemTemplate(qRew->RewardItemId[i]);
|
||||
|
||||
data << uint32(qRew->RewItemId[i]);
|
||||
data << uint32(qRew->RewardItemId[i]);
|
||||
data << uint32(iProto ? iProto->DisplayInfoID : 0);
|
||||
data << uint32(qRew->RewItemCount[i]);
|
||||
data << uint32(qRew->RewardItemIdCount[i]);
|
||||
}
|
||||
}
|
||||
SendPacket(&data);
|
||||
|
||||
@@ -200,7 +200,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data)
|
||||
bool destroyItem = true;
|
||||
for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
|
||||
{
|
||||
if ((qInfo->ReqItemId[i] == ((Item*)pObject)->GetEntry()) && (((Item*)pObject)->GetTemplate()->MaxCount > 0))
|
||||
if ((qInfo->RequiredItemId[i] == ((Item*)pObject)->GetEntry()) && (((Item*)pObject)->GetTemplate()->MaxCount > 0))
|
||||
{
|
||||
destroyItem = false;
|
||||
break;
|
||||
|
||||
@@ -176,8 +176,8 @@ public:
|
||||
// Add quest items for quests that require items
|
||||
for (uint8 x = 0; x < QUEST_ITEM_OBJECTIVES_COUNT; ++x)
|
||||
{
|
||||
uint32 id = quest->ReqItemId[x];
|
||||
uint32 count = quest->ReqItemCount[x];
|
||||
uint32 id = quest->RequiredItemId[x];
|
||||
uint32 count = quest->RequiredItemCount[x];
|
||||
if (!id || !count)
|
||||
continue;
|
||||
|
||||
@@ -195,10 +195,10 @@ public:
|
||||
// All creature/GO slain/casted (not required, but otherwise it will display "Creature slain 0/10")
|
||||
for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
||||
{
|
||||
int32 creature = quest->ReqCreatureOrGOId[i];
|
||||
uint32 creaturecount = quest->ReqCreatureOrGOCount[i];
|
||||
int32 creature = quest->RequiredNpcOrGo[i];
|
||||
uint32 creaturecount = quest->RequiredNpcOrGoCount[i];
|
||||
|
||||
if (uint32 spell_id = quest->ReqSpell[i])
|
||||
if (uint32 spell_id = quest->RequiredSpellCast[i])
|
||||
{
|
||||
for (uint16 z = 0; z < creaturecount; ++z)
|
||||
player->CastedCreatureOrGO(creature, 0, spell_id);
|
||||
|
||||
@@ -2125,7 +2125,7 @@ public:
|
||||
{
|
||||
Quest const* qInfo = sObjectMgr->GetQuestTemplate(QUEST_YOU_RE_NOT_SO_BIG_NOW);
|
||||
if (qInfo)
|
||||
CAST_PLR(killer)->KilledMonsterCredit(qInfo->ReqCreatureOrGOId[0], 0);
|
||||
CAST_PLR(killer)->KilledMonsterCredit(qInfo->RequiredNpcOrGo[0], 0);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1009,7 +1009,7 @@ public:
|
||||
if (qInfo)
|
||||
{
|
||||
//TODO: prisoner should help player for a short period of time
|
||||
player->KilledMonsterCredit(qInfo->ReqCreatureOrGOId[0], 0);
|
||||
player->KilledMonsterCredit(qInfo->RequiredNpcOrGo[0], 0);
|
||||
pPrisoner->DisappearAndDie();
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user