TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
AchievementMgr.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
3  * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the
7  * Free Software Foundation; either version 2 of the License, or (at your
8  * option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef __TRINITY_ACHIEVEMENTMGR_H
20 #define __TRINITY_ACHIEVEMENTMGR_H
21 
22 #include <map>
23 #include <string>
24 
25 #include "Common.h"
26 #include "DatabaseEnv.h"
27 #include "DBCEnums.h"
28 #include "DBCStores.h"
29 #include "ObjectGuid.h"
30 
31 class Unit;
32 class Player;
33 class Guild;
34 class WorldPacket;
35 
37 {
39  std::vector<ModifierTreeNode const*> Children;
40 };
41 
42 typedef std::unordered_map<uint32, ModifierTreeNode*> ModifierTreeMap;
43 
45 {
49 };
50 
52 {
53  uint32 ID = 0;
54  CriteriaEntry const* Entry = nullptr;
55  ModifierTreeNode const* Modifier = nullptr;
57 };
58 
59 typedef std::vector<AchievementCriteria const*> AchievementCriteriaList;
60 typedef std::unordered_map<uint32, AchievementCriteria*> AchievementCriteriaMap;
61 
63 {
64  uint32 ID = 0;
65  CriteriaTreeEntry const* Entry = nullptr;
66  AchievementEntry const* Achievement = nullptr;
67  AchievementCriteria const* Criteria = nullptr;
68  std::vector<AchievementCriteriaTree const*> Children;
69 };
70 
71 typedef std::unordered_map<uint32, AchievementCriteriaTree*> AchievementCriteriaTreeMap;
72 typedef std::vector<AchievementCriteriaTree const*> AchievementCriteriaTreeList;
73 typedef std::vector<AchievementEntry const*> AchievementEntryList;
74 typedef std::unordered_map<uint32, AchievementCriteriaTreeList> AchievementCriteriaTreeByCriteriaMap;
75 
76 typedef std::unordered_map<uint32, AchievementEntryList> AchievementListByReferencedId;
77 
79 {
81  time_t date = time_t(0); // latest update time.
82  ObjectGuid PlayerGUID; // GUID of the player that last updated the criteria
83  bool changed = false;
84 };
85 
87 { // value1 value2 comment
92  ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA = 5, // spell_id effect_idx
93  ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA = 7, // spell_id effect_idx
94  ACHIEVEMENT_CRITERIA_DATA_TYPE_VALUE = 8, // minvalue value provided with achievement update must be not less that limit
95  ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL = 9, // minlevel minlevel of target
96  ACHIEVEMENT_CRITERIA_DATA_TYPE_T_GENDER = 10, // gender 0=male; 1=female
97  ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT = 11, // scripted requirement
98  // REUSE
99  ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT = 13, // count "with less than %u people in the zone"
100  ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM = 14, // team HORDE(67), ALLIANCE(469)
101  ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK = 15, // drunken_state 0 (enum DrunkenState) of player
102  ACHIEVEMENT_CRITERIA_DATA_TYPE_HOLIDAY = 16, // holiday_id 0 event in holiday time
103  ACHIEVEMENT_CRITERIA_DATA_TYPE_BG_LOSS_TEAM_SCORE = 17, // min_score max_score player's team win bg and opposition team have team score in range
104  ACHIEVEMENT_CRITERIA_DATA_TYPE_INSTANCE_SCRIPT = 18, // 0 0 maker instance script call for check current criteria requirements fit
105  ACHIEVEMENT_CRITERIA_DATA_TYPE_S_EQUIPED_ITEM = 19, // item_level item_quality for equipped item in slot to check item level and quality
106  ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_ID = 20, // map_id 0 player must be on map with id in map_id
108  // REUSE
109  ACHIEVEMENT_CRITERIA_DATA_TYPE_S_KNOWN_TITLE = 23, // title_id known (pvp) title, values from dbc
111 
113 };
114 
116 {
118  union
119  {
120  // ACHIEVEMENT_CRITERIA_DATA_TYPE_NONE = 0 (no data)
121  // ACHIEVEMENT_CRITERIA_DATA_TYPE_T_CREATURE = 1
122  struct
123  {
125  } creature;
126  // ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE = 2
127  // ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE = 21
128  struct
129  {
132  } classRace;
133  // ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_LESS_HEALTH = 3
134  struct
135  {
137  } health;
138  // ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA = 5
139  // ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA = 7
140  struct
141  {
144  } aura;
145  // ACHIEVEMENT_CRITERIA_DATA_TYPE_VALUE = 8
146  struct
147  {
150  } value;
151  // ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL = 9
152  struct
153  {
155  } level;
156  // ACHIEVEMENT_CRITERIA_DATA_TYPE_T_GENDER = 10
157  struct
158  {
160  } gender;
161  // ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT = 11 (no data)
162  // ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT = 13
163  struct
164  {
166  } map_players;
167  // ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM = 14
168  struct
169  {
171  } team;
172  // ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK = 15
173  struct
174  {
176  } drunk;
177  // ACHIEVEMENT_CRITERIA_DATA_TYPE_HOLIDAY = 16
178  struct
179  {
180  uint32 id;
181  } holiday;
182  // ACHIEVEMENT_CRITERIA_DATA_TYPE_BG_LOSS_TEAM_SCORE= 17
183  struct
184  {
188  // ACHIEVEMENT_CRITERIA_DATA_TYPE_INSTANCE_SCRIPT = 18 (no data)
189  // ACHIEVEMENT_CRITERIA_DATA_TYPE_S_EQUIPED_ITEM = 19
190  struct
191  {
194  } equipped_item;
195  // ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_ID = 20
196  struct
197  {
199  } map_id;
200  // ACHIEVEMENT_CRITERIA_DATA_TYPE_KNOWN_TITLE = 22
201  struct
202  {
204  } known_title;
205  // ACHIEVEMENT_CRITERIA_DATA_TYPE_GAME_EVENT = 24
206  struct
207  {
208  uint32 id;
209  } game_event;
210  // raw
211  struct
212  {
215  } raw;
216  };
218 
220  {
221  raw.value1 = 0;
222  raw.value2 = 0;
223  ScriptId = 0;
224  }
225 
226  AchievementCriteriaData(uint32 _dataType, uint32 _value1, uint32 _value2, uint32 _scriptId) : dataType(AchievementCriteriaDataType(_dataType))
227  {
228  raw.value1 = _value1;
229  raw.value2 = _value2;
230  ScriptId = _scriptId;
231  }
232 
233  bool IsValid(AchievementCriteria const* criteria);
234  bool Meets(uint32 criteria_id, Player const* source, Unit const* target, uint32 miscValue1 = 0) const;
235 };
236 
238 {
239  AchievementCriteriaDataSet() : criteria_id(0) { }
240  typedef std::vector<AchievementCriteriaData> Storage;
241  void Add(AchievementCriteriaData const& data) { storage.push_back(data); }
242  bool Meets(Player const* source, Unit const* target, uint32 miscValue = 0) const;
243  void SetCriteriaId(uint32 id) {criteria_id = id;}
244  private:
246  Storage storage;
247 };
248 
249 typedef std::map<uint32, AchievementCriteriaDataSet> AchievementCriteriaDataMap;
250 
252 {
256  std::string subject;
257  std::string text;
259 };
260 
261 typedef std::unordered_map<uint32, AchievementReward> AchievementRewards;
262 
264 {
265  std::vector<std::string> subject;
266  std::vector<std::string> text;
267 };
268 
269 typedef std::unordered_map<uint32, AchievementRewardLocale> AchievementRewardLocales;
270 
272 {
273  time_t date;
275  bool changed;
276 };
277 
278 typedef std::unordered_map<uint32, CriteriaProgress> CriteriaProgressMap;
279 typedef std::unordered_map<uint32, CompletedAchievementData> CompletedAchievementMap;
280 
282 {
286 };
287 
288 // Hackfix to solve an unresolved issue in clang that the visibility
289 // flag is ignored in some explicit template specializations,
290 // which prevents clang from exporting the `DeleteFromDB` symbol.
291 // https://llvm.org/bugs/show_bug.cgi?id=24815
292 // https://llvm.org/bugs/show_bug.cgi?id=23667
295 
296 template<typename T>
298 
299 template<>
301 {
302  static void DeleteFromDB(ObjectGuid lowguid) { DeletePlayerAchievementsFromDB(lowguid); }
303 };
304 
305 template<>
307 {
308  static void DeleteFromDB(ObjectGuid lowguid) { DeleteGuildAchievementsFromDB(lowguid); }
309 };
310 
311 template<class T>
313  : public AchievementMgrDeleterBase<T>
314 {
315  public:
316  AchievementMgr(T* owner);
317  ~AchievementMgr();
318 
319  void Reset();
320 
322 
323  void LoadFromDB(PreparedQueryResult achievementResult, PreparedQueryResult criteriaResult);
324  void SaveToDB(SQLTransaction& trans);
325  void ResetAchievementCriteria(AchievementCriteriaTypes type, uint64 miscValue1 = 0, uint64 miscValue2 = 0, bool evenIfCriteriaComplete = false);
326  void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint64 miscValue1 = 0, uint64 miscValue2 = 0, uint64 miscValue3 = 0, Unit const* unit = NULL, Player* referencePlayer = NULL);
327  void CompletedAchievement(AchievementEntry const* entry, Player* referencePlayer);
328  void CheckAllAchievementCriteria(Player* referencePlayer);
329  void SendAllAchievementData(Player* receiver) const;
330  void SendAllTrackedCriterias(Player* receiver, std::set<uint32> const& trackedCriterias) const;
331  void SendAchievementInfo(Player* receiver, uint32 achievementId = 0) const;
332  bool HasAchieved(uint32 achievementId) const;
333  T* GetOwner() const { return _owner; }
334 
335  void UpdateTimedAchievements(uint32 timeDiff);
336  void StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry, uint32 timeLost = 0);
337  void RemoveTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry); // used for quest and scripted timed achievements
338 
339  uint32 GetAchievementPoints() const { return _achievementPoints; }
340  private:
341  void SendAchievementEarned(AchievementEntry const* achievement) const;
342  void SendCriteriaUpdate(AchievementCriteria const* entry, CriteriaProgress const* progress, uint32 timeElapsed, bool timedCompleted) const;
343  CriteriaProgress* GetCriteriaProgress(AchievementCriteria const* entry);
344  void SetCriteriaProgress(AchievementCriteria const* entry, uint64 changeValue, Player* referencePlayer, ProgressType ptype = PROGRESS_SET);
345  void RemoveCriteriaProgress(AchievementCriteria const* entry);
346  void CompletedCriteriaFor(AchievementEntry const* achievement, Player* referencePlayer);
347  bool IsCompletedCriteriaTree(AchievementCriteriaTree const* tree);
348  bool IsCompletedCriteria(AchievementCriteria const* achievementCriteria, uint64 requiredAmount);
349  bool IsCompletedAchievement(AchievementEntry const* entry);
350  bool CanUpdateCriteria(AchievementCriteria const* criteria, AchievementCriteriaTreeList const* trees, uint64 miscValue1, uint64 miscValue2, uint64 miscValue3, Unit const* unit, Player* referencePlayer);
351  void SendPacket(WorldPacket const* data) const;
352 
353  bool ConditionsSatisfied(AchievementCriteria const* criteria, Player* referencePlayer) const;
354  bool RequirementsSatisfied(AchievementCriteria const* criteria, uint64 miscValue1, uint64 miscValue2, uint64 miscValue3, Unit const* unit, Player* referencePlayer) const;
355  bool AdditionalRequirementsSatisfied(ModifierTreeNode const* parent, uint64 miscValue1, uint64 miscValue2, Unit const* unit, Player* referencePlayer) const;
356 
357  T* _owner;
360  typedef std::map<uint32, uint32> TimedAchievementMap;
361  TimedAchievementMap m_timedAchievements; // Criteria tree id/time left in MS
363 };
364 
366 {
369 
370  public:
371  static char const* GetCriteriaTypeString(AchievementCriteriaTypes type);
372  static char const* GetCriteriaTypeString(uint32 type);
373 
374  static AchievementGlobalMgr* instance();
375 
377  {
378  auto itr = _achievementCriteriaTreeByCriteria.find(criteriaId);
379  return itr != _achievementCriteriaTreeByCriteria.end() ? &itr->second : nullptr;
380  }
381 
383  {
384  return guild ? _guildAchievementCriteriasByType[type] : _achievementCriteriasByType[type];
385  }
386 
388  {
389  return _achievementCriteriasByTimedType[type];
390  }
391 
393  {
394  AchievementListByReferencedId::const_iterator itr = _achievementListByReferencedId.find(id);
395  return itr != _achievementListByReferencedId.end() ? &itr->second : NULL;
396  }
397 
398  AchievementReward const* GetAchievementReward(AchievementEntry const* achievement) const
399  {
400  AchievementRewards::const_iterator iter = _achievementRewards.find(achievement->ID);
401  return iter != _achievementRewards.end() ? &iter->second : NULL;
402  }
403 
405  {
406  AchievementRewardLocales::const_iterator iter = _achievementRewardLocales.find(achievement->ID);
407  return iter != _achievementRewardLocales.end() ? &iter->second : NULL;
408  }
409 
410  AchievementCriteriaDataSet const* GetCriteriaDataSet(AchievementCriteria const* achievementCriteria) const
411  {
412  AchievementCriteriaDataMap::const_iterator iter = _criteriaDataMap.find(achievementCriteria->ID);
413  return iter != _criteriaDataMap.end() ? &iter->second : NULL;
414  }
415 
416  bool IsRealmCompleted(AchievementEntry const* achievement, uint32 instanceId) const
417  {
418  AllCompletedAchievements::const_iterator itr = _allCompletedAchievements.find(achievement->ID);
419  if (itr == _allCompletedAchievements.end())
420  return false;
421 
422  if (achievement->Flags & ACHIEVEMENT_FLAG_REALM_FIRST_KILL)
423  return itr->second != instanceId;
424 
425  return true;
426  }
427 
428  void SetRealmCompleted(AchievementEntry const* achievement, uint32 instanceId)
429  {
430  if (IsRealmCompleted(achievement, instanceId))
431  return;
432 
433  _allCompletedAchievements[achievement->ID] = instanceId;
434  }
435 
437  {
438  switch (type)
439  {
446  return true;
447  default:
448  break;
449  }
450 
451  return false;
452  }
453 
454  template<typename Func>
455  void WalkCriteriaTree(AchievementCriteriaTree const* tree, Func const& func) const
456  {
457  for (AchievementCriteriaTree const* node : tree->Children)
458  WalkCriteriaTree(node, func);
459 
460  func(tree);
461  }
462 
463  // Removes instanceId as valid id to complete realm first kill achievements
464  void OnInstanceDestroyed(uint32 instanceId);
465 
466  void LoadAchievementCriteriaModifiersTree();
467  void LoadAchievementCriteriaList();
468  void LoadAchievementCriteriaData();
469  void LoadAchievementReferenceList();
470  void LoadCompletedAchievements();
471  void LoadRewards();
472  void LoadRewardLocales();
473  AchievementEntry const* GetAchievement(uint32 achievementId) const;
474  AchievementCriteriaTree const* GetAchievementCriteriaTree(uint32 criteriaTreeId) const;
475  AchievementCriteria const* GetAchievementCriteria(uint32 criteriaId) const;
476  private:
478 
482 
484 
485  // store achievement criterias by type to speed up lookup
487  AchievementCriteriaList _guildAchievementCriteriasByType[ACHIEVEMENT_CRITERIA_TYPE_TOTAL];
488 
489  AchievementCriteriaList _achievementCriteriasByTimedType[ACHIEVEMENT_TIMED_TYPE_MAX];
490 
491  // store achievements by referenced achievement id to speed up lookup
493 
494  typedef std::map<uint32 /*achievementId*/, uint32 /*instanceId*/> AllCompletedAchievements;
495  AllCompletedAchievements _allCompletedAchievements;
496 
499 };
500 
501 #define sAchievementMgr AchievementGlobalMgr::instance()
502 
503 #endif
TimedAchievementMap m_timedAchievements
Definition: AchievementMgr.h:361
AchievementEntryList const * GetAchievementByReferencedId(uint32 id) const
Definition: AchievementMgr.h:392
Definition: AchievementMgr.h:100
Definition: AchievementMgr.h:109
uint32 mapId
Definition: AchievementMgr.h:198
uint32 sender
Definition: AchievementMgr.h:255
std::shared_ptr< PreparedResultSet > PreparedQueryResult
Definition: QueryResult.h:107
Definition: AchievementMgr.h:36
AllCompletedAchievements _allCompletedAchievements
Definition: AchievementMgr.h:495
ModifierTreeEntry const * Entry
Definition: AchievementMgr.h:38
bool changed
Definition: AchievementMgr.h:83
std::vector< std::string > subject
Definition: AchievementMgr.h:265
std::vector< ModifierTreeNode const * > Children
Definition: AchievementMgr.h:39
#define ACHIEVEMENT_CRITERIA_TYPE_TOTAL
Definition: DBCEnums.h:360
CompletedAchievementMap m_completedAchievements
Definition: AchievementMgr.h:359
AchievementCriteriaData(uint32 _dataType, uint32 _value1, uint32 _value2, uint32 _scriptId)
Definition: AchievementMgr.h:226
bool changed
Definition: AchievementMgr.h:275
std::unordered_map< uint32, AchievementRewardLocale > AchievementRewardLocales
Definition: AchievementMgr.h:269
uint32 ID
Definition: AchievementMgr.h:53
Definition: AchievementMgr.h:365
struct AchievementCriteriaData::@58::@62 health
T * _owner
Definition: AchievementMgr.h:357
struct AchievementCriteriaData::@58::@61 classRace
uint32 ScriptId
Definition: AchievementMgr.h:217
uint32 mailTemplate
Definition: AchievementMgr.h:258
uint32 value1
Definition: AchievementMgr.h:213
AchievementCriteriaMap _achievementCriteria
Definition: AchievementMgr.h:480
Definition: AchievementMgr.h:97
void LoadFromDB()
Definition: AddonMgr.cpp:40
uint32 percent
Definition: AchievementMgr.h:136
uint32 Flags
Definition: DB2Structure.h:38
uint32 value2
Definition: AchievementMgr.h:214
AchievementCriteria const * Criteria
Definition: AchievementMgr.h:67
Definition: AchievementMgr.h:62
AchievementRewardLocale const * GetAchievementRewardLocale(AchievementEntry const *achievement) const
Definition: AchievementMgr.h:404
Definition: AchievementMgr.h:88
uint32 FlagsCu
Definition: AchievementMgr.h:56
std::string subject
Definition: AchievementMgr.h:256
AchievementCriteriaDataType dataType
Definition: AchievementMgr.h:117
Definition: DBCEnums.h:199
uint32 state
Definition: AchievementMgr.h:175
AchievementCriteriaTreeList const * GetAchievementCriteriaTreesByCriteria(uint32 criteriaId) const
Definition: AchievementMgr.h:376
Definition: AchievementMgr.h:95
uint32 value
Definition: AchievementMgr.h:148
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: AchievementMgr.h:297
std::unordered_map< uint32, AchievementCriteriaTreeList > AchievementCriteriaTreeByCriteriaMap
Definition: AchievementMgr.h:74
uint32 titleId[2]
Definition: AchievementMgr.h:253
Definition: DBCEnums.h:198
struct AchievementCriteriaData::@58::@60 creature
struct AchievementCriteriaData::@58::@75 game_event
uint32 item_quality
Definition: AchievementMgr.h:193
struct AchievementCriteriaData::@58::@65 level
void Add(AchievementCriteriaData const &data)
Definition: AchievementMgr.h:241
bool IsValid(AchievementCriteria const *criteria)
Definition: AchievementMgr.cpp:48
uint32 minlevel
Definition: AchievementMgr.h:154
Definition: AchievementMgr.h:96
Definition: DB2Structure.h:903
GuidSet guids
Definition: AchievementMgr.h:274
std::unordered_map< uint32, CompletedAchievementData > CompletedAchievementMap
Definition: AchievementMgr.h:279
uint32 _achievementPoints
Definition: AchievementMgr.h:362
std::vector< AchievementCriteriaData > Storage
Definition: AchievementMgr.h:240
uint32 title_id
Definition: AchievementMgr.h:203
std::unordered_map< uint32, AchievementEntryList > AchievementListByReferencedId
Definition: AchievementMgr.h:76
Definition: AchievementMgr.h:237
AchievementCriteriaDataMap _criteriaDataMap
Definition: AchievementMgr.h:477
bool IsRealmCompleted(AchievementEntry const *achievement, uint32 instanceId) const
Definition: AchievementMgr.h:416
AchievementCriteriaTreeMap _achievementCriteriaTrees
Definition: AchievementMgr.h:479
uint32 effect_idx
Definition: AchievementMgr.h:143
AchievementListByReferencedId _achievementListByReferencedId
Definition: AchievementMgr.h:492
uint32 ID
Definition: AchievementMgr.h:64
std::vector< AchievementCriteriaTree const * > Children
Definition: AchievementMgr.h:68
AchievementRewardLocales _achievementRewardLocales
Definition: AchievementMgr.h:498
Definition: AchievementMgr.h:92
Definition: AchievementMgr.h:106
CriteriaProgressMap m_criteriaProgress
Definition: AchievementMgr.h:358
std::unordered_map< uint32, ModifierTreeNode * > ModifierTreeMap
Definition: AchievementMgr.h:42
static void DeleteFromDB(ObjectGuid lowguid)
Definition: AchievementMgr.h:308
Definition: AchievementMgr.h:283
Definition: AchievementMgr.h:47
AchievementCriteriaDataType
Definition: AchievementMgr.h:86
uint32 item_level
Definition: AchievementMgr.h:192
Definition: AchievementMgr.h:263
Entry
Definition: boss_headless_horseman.cpp:50
uint32 max_score
Definition: AchievementMgr.h:186
struct AchievementCriteriaData::@58::@73 map_id
time_t date
Definition: AchievementMgr.h:273
std::vector< AchievementCriteriaTree const * > AchievementCriteriaTreeList
Definition: AchievementMgr.h:72
Definition: DB2Structure.h:27
uint32 ID
Definition: DB2Structure.h:29
static void DeleteFromDB(ObjectGuid lowguid)
Definition: AchievementMgr.h:302
uint32 race_id
Definition: AchievementMgr.h:131
AchievementCriteriaDataSet()
Definition: AchievementMgr.h:239
struct AchievementCriteriaData::@58::@70 holiday
AchievementCriteriaTimedTypes
Definition: DBCEnums.h:181
std::unordered_map< uint32, AchievementCriteria * > AchievementCriteriaMap
Definition: AchievementMgr.h:60
AchievementCriteriaTypes
Definition: DBCEnums.h:196
Storage storage
Definition: AchievementMgr.h:246
std::unordered_map< uint32, CriteriaProgress > CriteriaProgressMap
Definition: AchievementMgr.h:278
Definition: AchievementMgr.h:285
Achievement
Definition: boss_loatheb.cpp:52
uint32_t uint32
Definition: Define.h:150
std::unordered_map< uint32, AchievementReward > AchievementRewards
Definition: AchievementMgr.h:261
uint64_t uint64
Definition: Define.h:149
Definition: AchievementMgr.h:104
uint32 id
Definition: AchievementMgr.h:124
uint32 itemId
Definition: AchievementMgr.h:254
AchievementReward const * GetAchievementReward(AchievementEntry const *achievement) const
Definition: AchievementMgr.h:398
AchievementCriteriaData()
Definition: AchievementMgr.h:219
ModifierTreeMap _criteriaModifiers
Definition: AchievementMgr.h:481
AchievementCriteriaTreeByCriteriaMap _achievementCriteriaTreeByCriteria
Definition: AchievementMgr.h:483
struct AchievementCriteriaData::@58::@67 map_players
Definition: AchievementMgr.h:284
Definition: AchievementMgr.h:48
struct AchievementCriteriaData::@58::@76 raw
Definition: DBCEnums.h:193
std::string text
Definition: AchievementMgr.h:257
Definition: AchievementMgr.h:312
uint32 compType
Definition: AchievementMgr.h:149
Definition: DB2Structure.h:318
struct AchievementCriteriaData::@58::@63 aura
std::unordered_map< uint32, AchievementCriteriaTree * > AchievementCriteriaTreeMap
Definition: AchievementMgr.h:71
Definition: AchievementMgr.h:78
void SetRealmCompleted(AchievementEntry const *achievement, uint32 instanceId)
Definition: AchievementMgr.h:428
Definition: AchievementMgr.h:93
std::vector< std::string > text
Definition: AchievementMgr.h:266
uint32 maxcount
Definition: AchievementMgr.h:165
AchievementCriteriaFlagsCu
Definition: AchievementMgr.h:44
TC_GAME_API void DeletePlayerAchievementsFromDB(ObjectGuid guid)
Definition: AchievementMgr.cpp:491
uint32 GetAchievementPoints() const
Definition: AchievementMgr.h:339
uint32 spell_id
Definition: AchievementMgr.h:142
TC_GAME_API void DeleteGuildAchievementsFromDB(ObjectGuid guid)
Definition: AchievementMgr.cpp:506
ProgressType
Definition: AchievementMgr.h:281
void SetCriteriaId(uint32 id)
Definition: AchievementMgr.h:243
bool Meets(uint32 criteria_id, Player const *source, Unit const *target, uint32 miscValue1=0) const
Definition: AchievementMgr.cpp:277
Definition: DB2Structure.h:184
AchievementCriteriaList const & GetTimedAchievementCriteriaByType(AchievementCriteriaTimedTypes type) const
Definition: AchievementMgr.h:387
Definition: AchievementMgr.h:89
uint32 team
Definition: AchievementMgr.h:170
void WalkCriteriaTree(AchievementCriteriaTree const *tree, Func const &func) const
Definition: AchievementMgr.h:455
std::set< ObjectGuid > GuidSet
Definition: ObjectGuid.h:332
std::vector< AchievementEntry const * > AchievementEntryList
Definition: AchievementMgr.h:73
#define TC_GAME_API
Definition: Define.h:134
AchievementCriteriaList const & GetAchievementCriteriaByType(AchievementCriteriaTypes type, bool guild=false) const
Definition: AchievementMgr.h:382
Definition: AchievementMgr.h:115
std::vector< AchievementCriteria const * > AchievementCriteriaList
Definition: AchievementMgr.h:59
std::map< uint32, uint32 > TimedAchievementMap
Definition: AchievementMgr.h:360
uint32 min_score
Definition: AchievementMgr.h:185
AchievementGlobalMgr()
Definition: AchievementMgr.h:367
Definition: DBCEnums.h:92
Definition: AchievementMgr.h:105
uint32 gender
Definition: AchievementMgr.h:159
Definition: AchievementMgr.h:101
ModifierTreeNode const * Modifier
Definition: AchievementMgr.h:55
Definition: ObjectGuid.h:189
uint32 class_id
Definition: AchievementMgr.h:130
uint64 counter
Definition: AchievementMgr.h:80
AchievementRewards _achievementRewards
Definition: AchievementMgr.h:497
std::map< uint32, AchievementCriteriaDataSet > AchievementCriteriaDataMap
Definition: AchievementMgr.h:249
bool IsGroupCriteriaType(AchievementCriteriaTypes type) const
Definition: AchievementMgr.h:436
std::map< uint32, uint32 > AllCompletedAchievements
Definition: AchievementMgr.h:494
ObjectGuid PlayerGUID
Definition: AchievementMgr.h:82
Definition: AchievementMgr.h:46
Definition: Guild.h:320
T * GetOwner() const
Definition: AchievementMgr.h:333
Definition: AchievementMgr.h:271
Definition: Unit.h:1305
Definition: AchievementMgr.h:51
Definition: AchievementMgr.h:102
uint32 criteria_id
Definition: AchievementMgr.h:245
Definition: AchievementMgr.h:251
struct AchievementCriteriaData::@58::@72 equipped_item
Definition: WorldPacket.h:26
AchievementCriteriaDataSet const * GetCriteriaDataSet(AchievementCriteria const *achievementCriteria) const
Definition: AchievementMgr.h:410
struct AchievementCriteriaData::@58::@74 known_title
time_t date
Definition: AchievementMgr.h:81
Definition: AchievementMgr.h:110
struct AchievementCriteriaData::@58::@71 bg_loss_team_score
Definition: AchievementMgr.h:112
Definition: AchievementMgr.h:94
struct AchievementCriteriaData::@58::@69 drunk
std::shared_ptr< Transaction > SQLTransaction
Definition: Transaction.h:58