summaryrefslogtreecommitdiff
path: root/src/common/mmo.h
diff options
context:
space:
mode:
authorsmokexyz <sagunkho@hotmail.com>2018-06-30 04:20:03 +0100
committerAsheraf <acheraf1998@gmail.com>2018-07-24 21:41:20 +0100
commit19aa33a5f61f0996d76d19db7dbe9d81f5daa090 (patch)
treeb54e07d42a58e34820e3131f750b56b7130cb461 /src/common/mmo.h
parent78c75cade7f445231f11395a6faef9b0a55568dc (diff)
downloadhercules-19aa33a5f61f0996d76d19db7dbe9d81f5daa090.tar.gz
hercules-19aa33a5f61f0996d76d19db7dbe9d81f5daa090.tar.bz2
hercules-19aa33a5f61f0996d76d19db7dbe9d81f5daa090.tar.xz
hercules-19aa33a5f61f0996d76d19db7dbe9d81f5daa090.zip
Implementation of the official Achievement System.
Source: http://ro.gnjoy.com/news/update/View.asp?seq=163&curpage=1 Script Commands - ``` achievement_progress(<ach_id>,<obj_idx>,<progress>,<incremental?>{,<char_id>}); ``` Includes an achievement_db.conf generator that reads from the item_db, mob_db (server side) and achievement_list.lub files to determine valid achievement entries based on item/monster availability. Achievements containing unsupported entries are commented out. This feature, although renewal-only in official servers, is capable of being used in pre-renewal mode on Hercules. Does not include the title system yet. A big thanks to - @MishimaHaruna for constantly reviewing. @4144 for all the support. @Asheraf for a lot of official information. Co-authored-by: "Dastgir" <dastgirp@gmail.com>
Diffstat (limited to 'src/common/mmo.h')
-rw-r--r--src/common/mmo.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/common/mmo.h b/src/common/mmo.h
index 1b9562e9d..69717c972 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;