this function will be called whenever the user might have done a criteria relevant action
973 TC_LOG_DEBUG(
"achievement",
"UpdateAchievementCriteria: Wrong criteria type %u", type);
977 if (!referencePlayer)
979 TC_LOG_DEBUG(
"achievement",
"UpdateAchievementCriteria: Player is NULL! Cant update criteria");
984 if (referencePlayer->IsGameMaster())
991 TC_LOG_DEBUG(
"achievement",
"UpdateAchievementCriteria: %s, %s (%u), " UI64FMTD
", " UI64FMTD
", " UI64FMTD
1003 if (!
CanUpdateCriteria(achievementCriteria, trees, miscValue1, miscValue2, miscValue3, unit, referencePlayer))
1008 if (!data->Meets(referencePlayer, unit, miscValue1))
1096 if (
uint32 skillvalue = referencePlayer->GetBaseSkillValue(achievementCriteria->Entry->Asset.SkillID))
1100 if (
uint32 maxSkillvalue = referencePlayer->GetPureMaxSkillValue(achievementCriteria->Entry->Asset.SkillID))
1104 SetCriteriaProgress(achievementCriteria, referencePlayer->GetRewardedQuestCount(), referencePlayer);
1108 time_t nextDailyResetTime =
sWorld->GetNextDailyQuestsResetTime();
1114 if (progress && progress->
date < (nextDailyResetTime - 2 *
DAY))
1123 else if (progress->
date < (nextDailyResetTime - 2 *
DAY))
1126 else if (progress->
date < (nextDailyResetTime -
DAY))
1140 const RewardedQuestSet &rewQuests = referencePlayer->getRewardedQuests();
1141 for (RewardedQuestSet::const_iterator itr = rewQuests.begin(); itr != rewQuests.end(); ++itr)
1166 SetCriteriaProgress(achievementCriteria, referencePlayer->GetBankBagSlotCount(), referencePlayer);
1170 int32 reputation = referencePlayer->GetReputationMgr().GetReputation(achievementCriteria->Entry->Asset.FactionID);
1176 SetCriteriaProgress(achievementCriteria, referencePlayer->GetReputationMgr().GetExaltedFactionCount(), referencePlayer);
1182 for (PlayerSpellMap::const_iterator spellIter = referencePlayer->GetSpellMap().begin();
1183 spellIter != referencePlayer->GetSpellMap().end();
1187 for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter)
1189 if (skillIter->second->SkillLine == achievementCriteria->Entry->Asset.SkillID)
1197 SetCriteriaProgress(achievementCriteria, referencePlayer->GetReputationMgr().GetReveredFactionCount(), referencePlayer);
1200 SetCriteriaProgress(achievementCriteria, referencePlayer->GetReputationMgr().GetHonoredFactionCount(), referencePlayer);
1203 SetCriteriaProgress(achievementCriteria, referencePlayer->GetReputationMgr().GetVisibleFactionCount(), referencePlayer);
1219 uint32 reqTeamType = achievementCriteria->Entry->Asset.TeamType;
1223 if (miscValue2 != reqTeamType)
1232 uint32 teamId = referencePlayer->GetArenaTeamId(arena_slot);
1237 if (!team || team->
GetType() != reqTeamType)
Definition: DBCEnums.h:207
Definition: DBCEnums.h:265
Definition: DBCEnums.h:295
Definition: DBCEnums.h:339
Definition: DBCEnums.h:319
Definition: DBCEnums.h:303
Definition: DBCEnums.h:275
Definition: DBCEnums.h:242
Definition: DBCEnums.h:344
Definition: DBCEnums.h:343
Definition: DBCEnums.h:330
Definition: DBCEnums.h:204
Definition: DBCEnums.h:351
Definition: DBCEnums.h:264
Definition: DBCEnums.h:285
Definition: DBCEnums.h:253
Definition: DBCEnums.h:202
Definition: DBCEnums.h:213
Definition: DBCEnums.h:291
Definition: DBCEnums.h:217
Definition: DBCEnums.h:288
Definition: DBCEnums.h:356
Definition: DBCEnums.h:300
Definition: DBCEnums.h:222
Definition: DBCEnums.h:335
Definition: DBCEnums.h:229
Definition: DBCEnums.h:268
Definition: DBCEnums.h:250
Definition: DBCEnums.h:301
Definition: DBCEnums.h:236
Definition: DBCEnums.h:254
Definition: QuestDef.h:279
Definition: DBCEnums.h:234
#define ACHIEVEMENT_CRITERIA_TYPE_TOTAL
Definition: DBCEnums.h:360
Definition: DBCEnums.h:221
Definition: DBCEnums.h:208
Definition: DBCEnums.h:308
uint32 GetType() const
Definition: ArenaTeam.h:125
Definition: DBCEnums.h:292
Definition: DBCEnums.h:273
int32 GetZoneOrSort() const
Definition: QuestDef.h:307
Definition: DBCEnums.h:282
Definition: DBCEnums.h:260
Definition: DBCEnums.h:240
Definition: DBCEnums.h:315
Definition: DBCEnums.h:318
void SetCriteriaProgress(AchievementCriteria const *entry, uint64 changeValue, Player *referencePlayer, ProgressType ptype=PROGRESS_SET)
Definition: AchievementMgr.cpp:1552
void CompletedAchievement(AchievementEntry const *entry, Player *referencePlayer)
Definition: DBCEnums.h:263
Definition: AchievementMgr.h:62
Definition: DBCEnums.h:269
Definition: DBCEnums.h:205
Definition: DBCEnums.h:231
Definition: DBCEnums.h:199
Definition: DBCEnums.h:206
Definition: DBCEnums.h:271
Definition: DBCEnums.h:200
Definition: DBCEnums.h:198
Definition: DBCEnums.h:347
Definition: DBCEnums.h:258
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Definition: DBCEnums.h:326
Definition: DBCEnums.h:252
Definition: DBCEnums.h:210
#define sWorld
Definition: World.h:887
static char const * GetCriteriaTypeString(AchievementCriteriaTypes type)
Definition: AchievementMgr.cpp:2589
Definition: DBCEnums.h:340
Definition: DBCEnums.h:284
uint32 _achievementPoints
Definition: AchievementMgr.h:362
Definition: DBCEnums.h:259
#define sObjectMgr
Definition: ObjectMgr.h:1567
Definition: DBCEnums.h:249
Definition: DBCEnums.h:241
Definition: DBCEnums.h:255
Definition: AchievementMgr.h:237
Definition: DBCEnums.h:224
Definition: DBCEnums.h:256
Definition: DBCEnums.h:235
Definition: DBCEnums.h:212
Definition: DBCEnums.h:246
Definition: DBCEnums.h:215
Definition: DBCEnums.h:227
std::pair< SkillLineAbilityMap::const_iterator, SkillLineAbilityMap::const_iterator > SkillLineAbilityMapBounds
Definition: SpellMgr.h:549
Definition: DBCEnums.h:203
Definition: DBCEnums.h:352
void CompletedCriteriaFor(AchievementEntry const *achievement, Player *referencePlayer)
Definition: AchievementMgr.cpp:1498
Definition: DBCEnums.h:320
Definition: AchievementMgr.h:283
Definition: DBCEnums.h:321
Definition: DBCEnums.h:230
Definition: DBCEnums.h:237
Definition: DBCEnums.h:287
Definition: DBCEnums.h:274
Definition: DBCEnums.h:354
Definition: DBCEnums.h:267
string ToString(int i)
Definition: strutil.h:491
std::vector< AchievementCriteriaTree const * > AchievementCriteriaTreeList
Definition: AchievementMgr.h:72
Definition: DBCEnums.h:219
bool IsCompletedCriteriaTree(AchievementCriteriaTree const *tree)
Definition: AchievementMgr.cpp:1332
Definition: DB2Structure.h:27
Definition: DBCEnums.h:281
Definition: DBCEnums.h:238
bool CanUpdateCriteria(AchievementCriteria const *criteria, AchievementCriteriaTreeList const *trees, uint64 miscValue1, uint64 miscValue2, uint64 miscValue3, Unit const *unit, Player *referencePlayer)
Definition: AchievementMgr.cpp:2010
Definition: DBCEnums.h:244
Definition: DBCEnums.h:243
Definition: DBCEnums.h:299
Definition: DBCEnums.h:338
Definition: DBCEnums.h:218
Definition: DBCEnums.h:353
#define UI64FMTD
Definition: Define.h:137
Definition: DBCEnums.h:223
Definition: DBCEnums.h:357
Definition: AchievementMgr.h:285
#define sSpellMgr
Definition: SpellMgr.h:756
Definition: DBCEnums.h:279
CriteriaProgress * GetCriteriaProgress(AchievementCriteria const *entry)
Definition: AchievementMgr.cpp:1541
int32_t int32
Definition: Define.h:146
Definition: DBCEnums.h:276
uint32_t uint32
Definition: Define.h:150
Definition: DBCEnums.h:302
Definition: DBCEnums.h:283
Definition: DBCEnums.h:245
Definition: DBCEnums.h:266
Definition: DBCEnums.h:325
Definition: DBCEnums.h:305
Definition: AchievementMgr.h:284
Definition: DBCEnums.h:86
Definition: DBCEnums.h:261
Definition: DBCEnums.h:331
Definition: DBCEnums.h:337
Definition: DBCEnums.h:216
Definition: UpdateFields.h:273
Definition: DBCEnums.h:316
Definition: AchievementMgr.h:78
Definition: DBCEnums.h:309
Definition: DBCEnums.h:239
Definition: DBCEnums.h:233
ArenaTeamMember * GetMember(ObjectGuid guid)
Definition: ArenaTeam.cpp:800
Definition: DBCEnums.h:270
Definition: DBCEnums.h:272
Definition: DBCEnums.h:201
Definition: DBCEnums.h:247
Definition: DBCEnums.h:307
Definition: ArenaTeam.h:112
Definition: DBCEnums.h:304
ProgressType
Definition: AchievementMgr.h:281
Definition: DBCEnums.h:294
Definition: DBCEnums.h:251
Definition: DBCEnums.h:257
std::vector< AchievementEntry const * > AchievementEntryList
Definition: AchievementMgr.h:73
Definition: DBCEnums.h:277
Definition: DBCEnums.h:297
Definition: DBCEnums.h:355
std::vector< AchievementCriteria const * > AchievementCriteriaList
Definition: AchievementMgr.h:59
Definition: DBCEnums.h:336
Definition: DBCEnums.h:226
Definition: DBCEnums.h:332
Definition: DBCEnums.h:280
Definition: DBCEnums.h:290
Definition: DBCEnums.h:333
bool IsCompletedAchievement(AchievementEntry const *entry)
Definition: AchievementMgr.cpp:1513
Definition: DBCEnums.h:248
Definition: DBCEnums.h:342
#define sArenaTeamMgr
Definition: ArenaTeamMgr.h:53
Definition: DBCEnums.h:278
Definition: DBCEnums.h:289
uint32_t uint32
Definition: g3dmath.h:168
Definition: DBCEnums.h:296
Definition: DBCEnums.h:322
Definition: DBCEnums.h:232
Definition: DBCEnums.h:327
Definition: DBCEnums.h:228
Definition: DBCEnums.h:334
T * GetOwner() const
Definition: AchievementMgr.h:333
Definition: DBCEnums.h:317
Definition: AchievementMgr.h:51
Definition: DBCEnums.h:328
Definition: DBCEnums.h:209
Definition: DBCEnums.h:306
time_t date
Definition: AchievementMgr.h:81
#define sAchievementMgr
Definition: AchievementMgr.h:501
Definition: DBCEnums.h:293
Definition: DBCEnums.h:298
Definition: DBCEnums.h:211
Definition: DBCEnums.h:225
Definition: DBCEnums.h:214
#define MAX_ARENA_SLOT
Definition: ArenaTeam.h:110
Definition: ArenaTeam.h:84
Definition: DBCEnums.h:286
Definition: DBCEnums.h:220