summaryrefslogtreecommitdiff
path: root/src/map/quest.h
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-12-04 11:36:31 -0200
committershennetsind <ind@henn.et>2013-12-04 11:36:31 -0200
commit2350c7e6a28630c0157ebca7e41f96b7716e79ce (patch)
tree2114c6ed441588450b01473e3896d620e513eaac /src/map/quest.h
parent85023b1aad64d2b3b5d5ff53e1704abe0e689aa9 (diff)
parentfdd8d1556526abcfbc95263aa3b0a651e7f4cf0a (diff)
downloadhercules-2350c7e6a28630c0157ebca7e41f96b7716e79ce.tar.gz
hercules-2350c7e6a28630c0157ebca7e41f96b7716e79ce.tar.bz2
hercules-2350c7e6a28630c0157ebca7e41f96b7716e79ce.tar.xz
hercules-2350c7e6a28630c0157ebca7e41f96b7716e79ce.zip
Merge branch 'master' of https://github.com/HerculesWS/Hercules
Diffstat (limited to 'src/map/quest.h')
-rw-r--r--src/map/quest.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/map/quest.h b/src/map/quest.h
index 0725a8c46..28815a6c3 100644
--- a/src/map/quest.h
+++ b/src/map/quest.h
@@ -5,7 +5,9 @@
#ifndef _QUEST_H_
#define _QUEST_H_
-struct s_quest_db {
+#define MAX_QUEST_DB (60355+1) // Highest quest ID + 1
+
+struct quest_db {
int id;
unsigned int time;
int mob[MAX_QUEST_OBJECTIVES];
@@ -14,23 +16,31 @@ struct s_quest_db {
//char name[NAME_LENGTH];
};
-typedef enum quest_check_type { HAVEQUEST, PLAYTIME, HUNTING } quest_check_type;
+// Questlog check types
+enum quest_check_type {
+ HAVEQUEST, ///< Query the state of the given quest
+ PLAYTIME, ///< Check if the given quest has been completed or has yet to expire
+ HUNTING, ///< Check if the given hunting quest's requirements have been met
+};
struct quest_interface {
- struct s_quest_db db[MAX_QUEST_DB];
+ struct quest_db *db_data[MAX_QUEST_DB]; ///< Quest database
+ struct quest_db dummy; ///< Dummy entry for invalid quest lookups
/* */
void (*init) (bool minimal);
+ void (*final) (void);
void (*reload) (void);
/* */
- int (*search_db) (int quest_id);
+ struct quest_db *(*db) (int quest_id);
int (*pc_login) (TBL_PC *sd);
int (*add) (TBL_PC *sd, int quest_id);
int (*change) (TBL_PC *sd, int qid1, int qid2);
int (*delete) (TBL_PC *sd, int quest_id);
int (*update_objective_sub) (struct block_list *bl, va_list ap);
void (*update_objective) (TBL_PC *sd, int mob_id);
- int (*update_status) (TBL_PC *sd, int quest_id, quest_state qs);
- int (*check) (TBL_PC *sd, int quest_id, quest_check_type type);
+ int (*update_status) (TBL_PC *sd, int quest_id, enum quest_state qs);
+ int (*check) (TBL_PC *sd, int quest_id, enum quest_check_type type);
+ void (*clear) (void);
int (*read_db) (void);
};