Core/Achievements: Fixed broken Achievement_Criteria.dbc structure

This commit is contained in:
Shauren
2013-06-01 12:25:02 +02:00
parent 812b6acbc3
commit 0712c31bb0
3 changed files with 22 additions and 13 deletions

View File

@@ -2702,8 +2702,15 @@ bool AchievementMgr<T>::AdditionalRequirementsSatisfied(AchievementCriteriaEntry
{
for (uint8 i = 0; i < MAX_ADDITIONAL_CRITERIA_CONDITIONS; ++i)
{
uint32 const reqType = criteria->additionalConditionType[i];
uint32 const reqValue = criteria->additionalConditionValue[i];
uint32 reqType = criteria->additionalConditionType[i];
///@TODO Extract additionalConditionValue[2] column from an older dbc and store it in database
/// This column is not present in 4.3.4 Achievement_Criteria.dbc
/// so for now, just return as failed condition to prevent invalid memory access
if (i == 2 && reqType)
return false;
uint32 reqValue = criteria->additionalConditionValue[i];
switch (AchievementCriteriaAdditionalCondition(reqType))
{

View File

@@ -511,25 +511,27 @@ struct AchievementCriteriaEntry
} raw;
};
//uint32 unk; // 5
struct
{
uint32 additionalRequirement_type;
uint32 additionalRequirement_value;
} additionalRequirements[MAX_CRITERIA_REQUIREMENTS];
char* name; // 9 m_description_lang
uint32 completionFlag; // 10 m_flags
uint32 timedCriteriaStartType; // 11 m_timer_start_event Only appears with timed achievements, seems to be the type of starting a timed Achievement, only type 1 and some of type 6 need manual starting
char* name; // 10 m_description_lang
uint32 completionFlag; // 11 m_flags
uint32 timedCriteriaStartType; // 12 m_timer_start_event Only appears with timed achievements, seems to be the type of starting a timed Achievement, only type 1 and some of type 6 need manual starting
// 1: ByEventId(?) (serverside IDs), 2: ByQuestId, 5: ByCastSpellId(?)
// 6: BySpellIdTarget(some of these are unknown spells, some not, some maybe spells)
// 7: ByKillNpcId, 9: ByUseItemId
uint32 timedCriteriaMiscId; // 12 m_timer_asset_id Alway appears with timed events, used internally to start the achievement, store
uint32 timeLimit; // 13 m_timer_time time limit in seconds
uint32 showOrder; // 14 m_ui_order also used in achievement shift-links as index in state bitmask
//uint32 unk1; // 15 only one value, still unknown
//uint32 unk2; // 16 all zeros
uint32 additionalConditionType[MAX_ADDITIONAL_CRITERIA_CONDITIONS]; // 17-19
uint32 additionalConditionValue[MAX_ADDITIONAL_CRITERIA_CONDITIONS]; // 20-22
uint32 timedCriteriaMiscId; // 13 m_timer_asset_id Alway appears with timed events, used internally to start the achievement, store
uint32 timeLimit; // 14 m_timer_time time limit in seconds
uint32 showOrder; // 15 m_ui_order also used in achievement shift-links as index in state bitmask
//uint32 unk1; // 16 only one value, still unknown
//uint32 unk2; // 17 all zeros
uint32 additionalConditionType[MAX_ADDITIONAL_CRITERIA_CONDITIONS]; // 18-20
uint32 additionalConditionValue[MAX_ADDITIONAL_CRITERIA_CONDITIONS - 1]; // 21-22 WTF one column was cut off here in 4.3.4
};
struct AreaTableEntry

View File

@@ -25,7 +25,7 @@
char const Achievementfmt[] = "niixsxiixixxii";
const std::string CustomAchievementfmt = "pppaaaapapaapp";
const std::string CustomAchievementIndex = "ID";
char const AchievementCriteriafmt[] = "niiiiiiiisiiiiixxiiiiii";
char const AchievementCriteriafmt[] = "niiiixiiiisiiiiixxiiiii";
char const AreaTableEntryfmt[] = "iiinixxxxxisiiiiiffixxxxxx";
char const AreaGroupEntryfmt[] = "niiiiiii";
char const AreaPOIEntryfmt[] = "niiiiiiiiiiiffixixxixx";