summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-07-28 03:21:42 +0200
committerGitHub <noreply@github.com>2018-07-28 03:21:42 +0200
commit621611e6e90af0c5551b4daca75ba1267d8e8478 (patch)
tree92ca087267778474df4c3589e22ec801f4c34622 /src/common
parent164e79976b926da35612ce28cf84ebd9c2ac3d3e (diff)
parent7f5b041efd88bae052c98e1bd1c5e28676c73272 (diff)
downloadhercules-621611e6e90af0c5551b4daca75ba1267d8e8478.tar.gz
hercules-621611e6e90af0c5551b4daca75ba1267d8e8478.tar.bz2
hercules-621611e6e90af0c5551b4daca75ba1267d8e8478.tar.xz
hercules-621611e6e90af0c5551b4daca75ba1267d8e8478.zip
Merge pull request #2067 from dastgirp/1-achievement
Implemented Achievement System and Title System
Diffstat (limited to 'src/common')
-rw-r--r--src/common/mmo.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/common/mmo.h b/src/common/mmo.h
index 1b9562e9d..7e0d915eb 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -218,6 +218,16 @@
#define MAX_QUEST_OBJECTIVES 3 // Max quest objectives for a quest
#endif
+// Achievements [Smokexyz/Hercules]
+#ifndef MAX_ACHIEVEMENT_DB
+#define MAX_ACHIEVEMENT_DB 360 // Maximum number of achievements
+#define MAX_ACHIEVEMENT_OBJECTIVES 10 // Maximum number of achievement objectives
+STATIC_ASSERT(MAX_ACHIEVEMENT_OBJECTIVES <= 10, "This value is limited by the client and database layout and should only be increased if you know the consequences.");
+#define MAX_ACHIEVEMENT_RANKS 20 // Achievement Ranks
+STATIC_ASSERT(MAX_ACHIEVEMENT_RANKS <= 255, "This value is limited by the client and database layout and should only be increased if you know the consequences.");
+#define MAX_ACHIEVEMENT_ITEM_REWARDS 10 // Achievement Rewards
+#endif
+
// for produce
#define MIN_ATTRIBUTE 0
#define MAX_ATTRIBUTE 4
@@ -616,6 +626,14 @@ struct hotkey {
#endif
};
+struct achievement { // Achievements [Smokexyz/Hercules]
+ int id;
+ int objective[MAX_ACHIEVEMENT_OBJECTIVES];
+ time_t completed_at, rewarded_at;
+};
+
+VECTOR_STRUCT_DECL(char_achievements, struct achievement);
+
struct mmo_charstatus {
int char_id;
int account_id;
@@ -687,6 +705,8 @@ struct mmo_charstatus {
short attendance_count;
unsigned char hotkey_rowshift;
+
+ int32 title_id; // Achievement Title[Dastgir/Hercules]
};
typedef enum mail_status {