diff options
author | Happy <markaizer@gmail.com> | 2014-08-21 04:50:46 +0800 |
---|---|---|
committer | Happy <markaizer@gmail.com> | 2014-08-21 04:50:46 +0800 |
commit | f52e1007fe08c67003c0bc4c78231904dd3fd5cc (patch) | |
tree | 99907d827264e501774e58ab4630e41fa7103c02 /src/map/quest.h | |
parent | 2410110dece79b4598c12f1c953219f1d0d1904a (diff) | |
parent | 769b1d05aa5cfa8cddfe7d21b35d5c5e4da3bbd6 (diff) | |
download | hercules-f52e1007fe08c67003c0bc4c78231904dd3fd5cc.tar.gz hercules-f52e1007fe08c67003c0bc4c78231904dd3fd5cc.tar.bz2 hercules-f52e1007fe08c67003c0bc4c78231904dd3fd5cc.tar.xz hercules-f52e1007fe08c67003c0bc4c78231904dd3fd5cc.zip |
Merge pull request #1 from HerculesWS/master
Update from original
Diffstat (limited to 'src/map/quest.h')
-rw-r--r-- | src/map/quest.h | 61 |
1 files changed, 41 insertions, 20 deletions
diff --git a/src/map/quest.h b/src/map/quest.h index 7f638a54c..9d617e369 100644 --- a/src/map/quest.h +++ b/src/map/quest.h @@ -1,10 +1,17 @@ -// Copyright (c) Athena Dev Teams - Licensed under GNU GPL -// For more information, see LICENCE in the main folder +// Copyright (c) Hercules Dev Team, licensed under GNU GPL. +// See the LICENSE file +// Portions Copyright (c) Athena Dev Teams -#ifndef _QUEST_H_ -#define _QUEST_H_ +#ifndef MAP_QUEST_H +#define MAP_QUEST_H -struct s_quest_db { +#include "map.h" // TBL_PC +#include "../common/cbasetypes.h" +#include "../common/mmo.h" // MAX_QUEST_OBJECTIVES + +#define MAX_QUEST_DB (60355+1) // Highest quest ID + 1 + +struct quest_db { int id; unsigned int time; int mob[MAX_QUEST_OBJECTIVES]; @@ -12,23 +19,37 @@ struct s_quest_db { int num_objectives; //char name[NAME_LENGTH]; }; -extern struct s_quest_db quest_db[MAX_QUEST_DB]; - -typedef enum quest_check_type { HAVEQUEST, PLAYTIME, HUNTING } quest_check_type; -int quest_pc_login(TBL_PC * sd); +// 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 +}; -int quest_add(TBL_PC * sd, int quest_id); -int quest_delete(TBL_PC * sd, int quest_id); -int quest_change(TBL_PC * sd, int qid1, int qid2); -int quest_update_objective_sub(struct block_list *bl, va_list ap); -void quest_update_objective(TBL_PC * sd, int mob); -int quest_update_status(TBL_PC * sd, int quest_id, quest_state status); -int quest_check(TBL_PC * sd, int quest_id, quest_check_type type); +struct quest_interface { + 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); + /* */ + 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, enum quest_state qs); + int (*check) (TBL_PC *sd, int quest_id, enum quest_check_type type); + void (*clear) (void); + int (*read_db) (void); +}; -int quest_search_db(int quest_id); +struct quest_interface *quest; -void do_init_quest(); -void do_reload_quest(void); +void quest_defaults(void); -#endif +#endif /* MAP_QUEST_H */ |