[10356] Drop unneeded groupFlag and rename it properly

(based on Schmoozerd's repo commit 1e8c842)

Also drop `achievement_criteria_requirement` data use at start timed achivement:
its will be checked at criteria update (and complete) case. So wrong criteria will
started maybe (timer set but always fail - progress not updated.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
Schmoozerd 2010-08-13 23:40:27 +04:00 committed by VladimirMangos
parent c7761a6db9
commit 3dd8c72a00
5 changed files with 11 additions and 18 deletions

View file

@ -725,9 +725,6 @@ void AchievementMgr::StartTimedAchievementCriteria(AchievementCriteriaTypes type
if (!achievementCriteria->IsExplicitlyStartedTimedCriteria()) if (!achievementCriteria->IsExplicitlyStartedTimedCriteria())
continue; continue;
if (achievementCriteria->groupFlag & ACHIEVEMENT_CRITERIA_GROUP_NOT_IN_GROUP && GetPlayer()->GetGroup())
continue;
AchievementEntry const *achievement = sAchievementStore.LookupEntry(achievementCriteria->referredAchievement); AchievementEntry const *achievement = sAchievementStore.LookupEntry(achievementCriteria->referredAchievement);
if (!achievement) if (!achievement)
continue; continue;
@ -740,9 +737,8 @@ void AchievementMgr::StartTimedAchievementCriteria(AchievementCriteriaTypes type
if (IsCompletedCriteria(achievementCriteria,achievement)) if (IsCompletedCriteria(achievementCriteria,achievement))
continue; continue;
// if we have additional DB criteria, they must be met to start the criteria // Only the Quest-Complete Timed Achievements need the groupcheck, so this check is only needed here
AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria); if (achievementCriteria->requiredType == ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST && GetPlayer()->GetGroup())
if (data && !data->Meets(GetPlayer(), NULL)) // TODO this might need more research, if this could be the player, or we also need to pass an unit
continue; continue;
// do not start already failed timers // do not start already failed timers
@ -782,9 +778,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
{ {
AchievementCriteriaEntry const *achievementCriteria = (*i); AchievementCriteriaEntry const *achievementCriteria = (*i);
if (achievementCriteria->groupFlag & ACHIEVEMENT_CRITERIA_GROUP_NOT_IN_GROUP && GetPlayer()->GetGroup())
continue;
AchievementEntry const *achievement = sAchievementStore.LookupEntry(achievementCriteria->referredAchievement); AchievementEntry const *achievement = sAchievementStore.LookupEntry(achievementCriteria->referredAchievement);
if (!achievement) if (!achievement)
continue; continue;
@ -1182,6 +1175,9 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
break; break;
} }
// As the groupFlag had wrong meaning, only the Quest-Complete Timed Achievements need the groupcheck, so this check is only needed here
if (achievementCriteria->timeLimit > 0 && GetPlayer()->GetGroup())
continue;
change = 1; change = 1;
progressType = PROGRESS_HIGHEST; progressType = PROGRESS_HIGHEST;

View file

@ -89,12 +89,6 @@ enum AchievementCriteriaCompletionFlags
ACHIEVEMENT_CRITERIA_FLAG_MONEY_COUNTER = 0x00000020, // Displays counter as money ACHIEVEMENT_CRITERIA_FLAG_MONEY_COUNTER = 0x00000020, // Displays counter as money
}; };
enum AchievementCriteriaGroupFlags
{
// you mustn't be in a group while fulfilling this achievement
ACHIEVEMENT_CRITERIA_GROUP_NOT_IN_GROUP = 2,
};
enum AchievementCriteriaTypes enum AchievementCriteriaTypes
{ {
ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE = 0, ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE = 0,

View file

@ -492,7 +492,10 @@ struct AchievementCriteriaEntry
char* name[16]; // 9-24 char* name[16]; // 9-24
//uint32 name_flags; // 25 //uint32 name_flags; // 25
uint32 completionFlag; // 26 uint32 completionFlag; // 26
uint32 groupFlag; // 27 //uint32 timedCriteriaStartType; // 27 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; // 28 Alway appears with timed events, used internally to start the achievement, store uint32 timedCriteriaMiscId; // 28 Alway appears with timed events, used internally to start the achievement, store
uint32 timeLimit; // 29 time limit in seconds uint32 timeLimit; // 29 time limit in seconds
uint32 showOrder; // 30 show order, also used in achievement shift-links as index in state bitmask uint32 showOrder; // 30 show order, also used in achievement shift-links as index in state bitmask

View file

@ -20,7 +20,7 @@
#define MANGOS_DBCSFRM_H #define MANGOS_DBCSFRM_H
const char Achievementfmt[]="niixssssssssssssssssxxxxxxxxxxxxxxxxxxiixixxxxxxxxxxxxxxxxxxii"; const char Achievementfmt[]="niixssssssssssssssssxxxxxxxxxxxxxxxxxxiixixxxxxxxxxxxxxxxxxxii";
const char AchievementCriteriafmt[]="niiiiiiiissssssssssssssssxiiiii"; const char AchievementCriteriafmt[]="niiiiiiiissssssssssssssssxixiii";
const char AreaTableEntryfmt[]="iiinixxxxxissssssssssssssssxixxxxxxx"; const char AreaTableEntryfmt[]="iiinixxxxxissssssssssssssssxixxxxxxx";
const char AreaGroupEntryfmt[]="niiiiiii"; const char AreaGroupEntryfmt[]="niiiiiii";
const char AreaTriggerEntryfmt[]="niffffffff"; const char AreaTriggerEntryfmt[]="niffffffff";

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "10355" #define REVISION_NR "10356"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__