Skip to content

Commit

Permalink
[10356] Drop unneeded groupFlag and rename it properly
Browse files Browse the repository at this point in the history
(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>
  • Loading branch information
Schmoozerd authored and VladimirMangos committed Aug 13, 2010
1 parent 4fe568a commit ce3479e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 18 deletions.
14 changes: 5 additions & 9 deletions src/game/AchievementMgr.cpp
Expand Up @@ -725,9 +725,6 @@ void AchievementMgr::StartTimedAchievementCriteria(AchievementCriteriaTypes type
if (!achievementCriteria->IsExplicitlyStartedTimedCriteria())
continue;

if (achievementCriteria->groupFlag & ACHIEVEMENT_CRITERIA_GROUP_NOT_IN_GROUP && GetPlayer()->GetGroup())
continue;

AchievementEntry const *achievement = sAchievementStore.LookupEntry(achievementCriteria->referredAchievement);
if (!achievement)
continue;
Expand All @@ -740,9 +737,8 @@ void AchievementMgr::StartTimedAchievementCriteria(AchievementCriteriaTypes type
if (IsCompletedCriteria(achievementCriteria,achievement))
continue;

// if we have additional DB criteria, they must be met to start the criteria
AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria);
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
// Only the Quest-Complete Timed Achievements need the groupcheck, so this check is only needed here
if (achievementCriteria->requiredType == ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST && GetPlayer()->GetGroup())
continue;

// do not start already failed timers
Expand Down Expand Up @@ -782,9 +778,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
{
AchievementCriteriaEntry const *achievementCriteria = (*i);

if (achievementCriteria->groupFlag & ACHIEVEMENT_CRITERIA_GROUP_NOT_IN_GROUP && GetPlayer()->GetGroup())
continue;

AchievementEntry const *achievement = sAchievementStore.LookupEntry(achievementCriteria->referredAchievement);
if (!achievement)
continue;
Expand Down Expand Up @@ -1182,6 +1175,9 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
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;
progressType = PROGRESS_HIGHEST;
Expand Down
6 changes: 0 additions & 6 deletions src/game/DBCEnums.h
Expand Up @@ -89,12 +89,6 @@ enum AchievementCriteriaCompletionFlags
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
{
ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE = 0,
Expand Down
5 changes: 4 additions & 1 deletion src/game/DBCStructure.h
Expand Up @@ -492,7 +492,10 @@ struct AchievementCriteriaEntry
char* name[16]; // 9-24
//uint32 name_flags; // 25
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 timeLimit; // 29 time limit in seconds
uint32 showOrder; // 30 show order, also used in achievement shift-links as index in state bitmask
Expand Down
2 changes: 1 addition & 1 deletion src/game/DBCfmt.h
Expand Up @@ -20,7 +20,7 @@
#define MANGOS_DBCSFRM_H

const char Achievementfmt[]="niixssssssssssssssssxxxxxxxxxxxxxxxxxxiixixxxxxxxxxxxxxxxxxxii";
const char AchievementCriteriafmt[]="niiiiiiiissssssssssssssssxiiiii";
const char AchievementCriteriafmt[]="niiiiiiiissssssssssssssssxixiii";
const char AreaTableEntryfmt[]="iiinixxxxxissssssssssssssssxixxxxxxx";
const char AreaGroupEntryfmt[]="niiiiiii";
const char AreaTriggerEntryfmt[]="niffffffff";
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10355"
#define REVISION_NR "10356"
#endif // __REVISION_NR_H__

2 comments on commit ce3479e

@hegedenes
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a group flag at column additionalRequirement2_type...

@Schmoozerd
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is someting in these collumns for some timed criterias.
however if you look at the other criterias, most of them are 3 with some value, and this is BG related, a few are type = 1, and seem to be maxDeaths (usally 0), so I really think there is anything supporting that the 10 (only happening for the three timed quests) acutally does mean NoGroup

Please sign in to comment.