TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
AchievementMgr.h File Reference
#include <map>
#include <string>
#include "Common.h"
#include "DatabaseEnv.h"
#include "DBCEnums.h"
#include "DBCStores.h"
#include "ObjectGuid.h"
+ Include dependency graph for AchievementMgr.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ModifierTreeNode
 
struct  AchievementCriteria
 
struct  AchievementCriteriaTree
 
struct  CriteriaProgress
 
struct  AchievementCriteriaData
 
struct  AchievementCriteriaDataSet
 
struct  AchievementReward
 
struct  AchievementRewardLocale
 
struct  CompletedAchievementData
 
struct  AchievementMgrDeleterBase< T >
 
struct  AchievementMgrDeleterBase< Player >
 
struct  AchievementMgrDeleterBase< Guild >
 
singleton  AchievementMgr< T >
 
class  AchievementGlobalMgr
 

Macros

#define sAchievementMgr   AchievementGlobalMgr::instance()
 

Typedefs

typedef std::unordered_map
< uint32, ModifierTreeNode * > 
ModifierTreeMap
 
typedef std::vector
< AchievementCriteria const * > 
AchievementCriteriaList
 
typedef std::unordered_map
< uint32, AchievementCriteria * > 
AchievementCriteriaMap
 
typedef std::unordered_map
< uint32,
AchievementCriteriaTree * > 
AchievementCriteriaTreeMap
 
typedef std::vector
< AchievementCriteriaTree
const * > 
AchievementCriteriaTreeList
 
typedef std::vector
< AchievementEntry const * > 
AchievementEntryList
 
typedef std::unordered_map
< uint32,
AchievementCriteriaTreeList
AchievementCriteriaTreeByCriteriaMap
 
typedef std::unordered_map
< uint32, AchievementEntryList
AchievementListByReferencedId
 
typedef std::map< uint32,
AchievementCriteriaDataSet
AchievementCriteriaDataMap
 
typedef std::unordered_map
< uint32, AchievementReward
AchievementRewards
 
typedef std::unordered_map
< uint32,
AchievementRewardLocale
AchievementRewardLocales
 
typedef std::unordered_map
< uint32, CriteriaProgress
CriteriaProgressMap
 
typedef std::unordered_map
< uint32,
CompletedAchievementData
CompletedAchievementMap
 

Enumerations

enum  AchievementCriteriaFlagsCu { ACHIEVEMENT_CRITERIA_FLAG_CU_PLAYER = 0x1, ACHIEVEMENT_CRITERIA_FLAG_CU_ACCOUNT = 0x2, ACHIEVEMENT_CRITERIA_FLAG_CU_GUILD = 0x4 }
 
enum  AchievementCriteriaDataType {
  ACHIEVEMENT_CRITERIA_DATA_TYPE_NONE = 0, ACHIEVEMENT_CRITERIA_DATA_TYPE_T_CREATURE = 1, ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE = 2, ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_LESS_HEALTH = 3,
  ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA = 5, ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA = 7, ACHIEVEMENT_CRITERIA_DATA_TYPE_VALUE = 8, ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL = 9,
  ACHIEVEMENT_CRITERIA_DATA_TYPE_T_GENDER = 10, ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT = 11, ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT = 13, ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM = 14,
  ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK = 15, ACHIEVEMENT_CRITERIA_DATA_TYPE_HOLIDAY = 16, ACHIEVEMENT_CRITERIA_DATA_TYPE_BG_LOSS_TEAM_SCORE = 17, ACHIEVEMENT_CRITERIA_DATA_TYPE_INSTANCE_SCRIPT = 18,
  ACHIEVEMENT_CRITERIA_DATA_TYPE_S_EQUIPED_ITEM = 19, ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_ID = 20, ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE = 21, ACHIEVEMENT_CRITERIA_DATA_TYPE_S_KNOWN_TITLE = 23,
  ACHIEVEMENT_CRITERIA_DATA_TYPE_GAME_EVENT = 24, MAX_ACHIEVEMENT_CRITERIA_DATA_TYPE
}
 
enum  ProgressType { PROGRESS_SET, PROGRESS_ACCUMULATE, PROGRESS_HIGHEST }
 

Functions

TC_GAME_API void DeletePlayerAchievementsFromDB (ObjectGuid guid)
 
TC_GAME_API void DeleteGuildAchievementsFromDB (ObjectGuid guid)
 

Macro Definition Documentation

#define sAchievementMgr   AchievementGlobalMgr::instance()

Typedef Documentation

typedef std::unordered_map<uint32, AchievementCriteria*> AchievementCriteriaMap
typedef std::unordered_map<uint32, AchievementReward> AchievementRewards
typedef std::unordered_map<uint32, CriteriaProgress> CriteriaProgressMap
typedef std::unordered_map<uint32, ModifierTreeNode*> ModifierTreeMap

Enumeration Type Documentation

Enumerator
ACHIEVEMENT_CRITERIA_DATA_TYPE_NONE 
ACHIEVEMENT_CRITERIA_DATA_TYPE_T_CREATURE 
ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE 
ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_LESS_HEALTH 
ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA 
ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA 
ACHIEVEMENT_CRITERIA_DATA_TYPE_VALUE 
ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL 
ACHIEVEMENT_CRITERIA_DATA_TYPE_T_GENDER 
ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT 
ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT 
ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM 
ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK 
ACHIEVEMENT_CRITERIA_DATA_TYPE_HOLIDAY 
ACHIEVEMENT_CRITERIA_DATA_TYPE_BG_LOSS_TEAM_SCORE 
ACHIEVEMENT_CRITERIA_DATA_TYPE_INSTANCE_SCRIPT 
ACHIEVEMENT_CRITERIA_DATA_TYPE_S_EQUIPED_ITEM 
ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_ID 
ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE 
ACHIEVEMENT_CRITERIA_DATA_TYPE_S_KNOWN_TITLE 
ACHIEVEMENT_CRITERIA_DATA_TYPE_GAME_EVENT 
MAX_ACHIEVEMENT_CRITERIA_DATA_TYPE 
87 { // value1 value2 comment
89  ACHIEVEMENT_CRITERIA_DATA_TYPE_T_CREATURE = 1, // creature_id 0
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
110  ACHIEVEMENT_CRITERIA_DATA_TYPE_GAME_EVENT = 24, // game_event_id 0
111 
113 };
Definition: AchievementMgr.h:100
Definition: AchievementMgr.h:109
Definition: AchievementMgr.h:97
Definition: AchievementMgr.h:88
Definition: AchievementMgr.h:95
Definition: AchievementMgr.h:96
Definition: AchievementMgr.h:92
Definition: AchievementMgr.h:106
Definition: AchievementMgr.h:104
Definition: AchievementMgr.h:93
Definition: AchievementMgr.h:89
Definition: AchievementMgr.h:105
Definition: AchievementMgr.h:101
Definition: AchievementMgr.h:102
Definition: AchievementMgr.h:110
Definition: AchievementMgr.h:112
Definition: AchievementMgr.h:94
Enumerator
ACHIEVEMENT_CRITERIA_FLAG_CU_PLAYER 
ACHIEVEMENT_CRITERIA_FLAG_CU_ACCOUNT 
ACHIEVEMENT_CRITERIA_FLAG_CU_GUILD 
45 {
49 };
Definition: AchievementMgr.h:47
Definition: AchievementMgr.h:48
Definition: AchievementMgr.h:46
Enumerator
PROGRESS_SET 
PROGRESS_ACCUMULATE 
PROGRESS_HIGHEST 
282 {
283  PROGRESS_SET,
286 };
Definition: AchievementMgr.h:283
Definition: AchievementMgr.h:285
Definition: AchievementMgr.h:284

Function Documentation

TC_GAME_API void DeleteGuildAchievementsFromDB ( ObjectGuid  guid)
507 {
509 
511  stmt->setUInt64(0, guid.GetCounter());
512  trans->Append(stmt);
513 
515  stmt->setUInt64(0, guid.GetCounter());
516  trans->Append(stmt);
517 
519 }
Definition: CharacterDatabase.h:204
SQLTransaction BeginTransaction()
Begins an automanaged transaction pointer that will automatically rollback if not commited...
Definition: DatabaseWorkerPool.h:221
Definition: PreparedStatement.h:74
void CommitTransaction(SQLTransaction transaction)
Definition: DatabaseWorkerPool.cpp:179
PreparedStatement * GetPreparedStatement(PreparedStatementIndex index)
Definition: DatabaseWorkerPool.h:263
void setUInt64(const uint8 index, const uint64 value)
Definition: PreparedStatement.cpp:124
CharacterDatabaseWorkerPool CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
Definition: CharacterDatabase.h:203
LowType GetCounter() const
Definition: ObjectGuid.h:221
std::shared_ptr< Transaction > SQLTransaction
Definition: Transaction.h:58

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TC_GAME_API void DeletePlayerAchievementsFromDB ( ObjectGuid  guid)
492 {
494 
496  stmt->setUInt64(0, guid.GetCounter());
497  trans->Append(stmt);
498 
500  stmt->setUInt64(0, guid.GetCounter());
501  trans->Append(stmt);
502 
504 }
SQLTransaction BeginTransaction()
Begins an automanaged transaction pointer that will automatically rollback if not commited...
Definition: DatabaseWorkerPool.h:221
Definition: PreparedStatement.h:74
void CommitTransaction(SQLTransaction transaction)
Definition: DatabaseWorkerPool.cpp:179
PreparedStatement * GetPreparedStatement(PreparedStatementIndex index)
Definition: DatabaseWorkerPool.h:263
Definition: CharacterDatabase.h:408
Definition: CharacterDatabase.h:407
void setUInt64(const uint8 index, const uint64 value)
Definition: PreparedStatement.cpp:124
CharacterDatabaseWorkerPool CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
LowType GetCounter() const
Definition: ObjectGuid.h:221
std::shared_ptr< Transaction > SQLTransaction
Definition: Transaction.h:58

+ Here is the call graph for this function:

+ Here is the caller graph for this function: