diff options
author | Kevin <Kevin@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-04-26 23:11:15 +0000 |
---|---|---|
committer | Kevin <Kevin@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-04-26 23:11:15 +0000 |
commit | ab60cf06afb586b106991b4b9848dd9c107ddec2 (patch) | |
tree | b3f302475556f8e2a3fc6fb0b94a6796b982a272 | |
parent | a184ee1870554dc203de4d3b51f29a3324aaf746 (diff) | |
download | hercules-ab60cf06afb586b106991b4b9848dd9c107ddec2.tar.gz hercules-ab60cf06afb586b106991b4b9848dd9c107ddec2.tar.bz2 hercules-ab60cf06afb586b106991b4b9848dd9c107ddec2.tar.xz hercules-ab60cf06afb586b106991b4b9848dd9c107ddec2.zip |
Added script function hasquest.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12660 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | Changelog-Trunk.txt | 2 | ||||
-rw-r--r-- | src/map/quest.c | 9 | ||||
-rw-r--r-- | src/map/quest.h | 2 | ||||
-rw-r--r-- | src/map/script.c | 12 |
4 files changed, 25 insertions, 0 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index a8dfe0af2..2dfd49ea9 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,8 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. 2008/04/26 + * Added script function hasquest. [Kevin] + * Fixed OnGuildBreak. [Kevin] * Cleaned up auth system after change back to map server request. - Created function set_char_charselect to get rid of some of the "special case" variables. - Removed code that involved the char server sending auth data at char select. diff --git a/src/map/quest.c b/src/map/quest.c index b822b67ca..057c46d7c 100644 --- a/src/map/quest.c +++ b/src/map/quest.c @@ -185,6 +185,15 @@ int quest_update_objective(TBL_PC * sd, int quest_id, int objective_num, const c } +bool quest_has_quest(TBL_PC * sd, int quest_id) +{ + int i; + + ARR_FIND(0, MAX_QUEST, i, sd->quest_log[i].quest_id == quest_id); + + return (i != MAX_QUEST); +} + int quest_update_status(TBL_PC * sd, int quest_id, bool status) { diff --git a/src/map/quest.h b/src/map/quest.h index 269c58bee..c8fa98246 100644 --- a/src/map/quest.h +++ b/src/map/quest.h @@ -17,4 +17,6 @@ int quest_delete_ack(int char_id, int quest_id, int success); int quest_update_objective(TBL_PC * sd, int quest_id, int objective_num, const char * name, int count); int quest_update_status(TBL_PC * sd, int quest_id, bool status); +bool quest_has_quest(TBL_PC * sd, int quest_id); + #endif diff --git a/src/map/script.c b/src/map/script.c index 316bf113a..4f2bcd1b0 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -13161,6 +13161,17 @@ BUILDIN_FUNC(setquestobjective) return 0; } +BUILDIN_FUNC(hasquest) +{ + + TBL_PC * sd = script_rid2sd(st); + int qid = script_getnum(st, 2); + + script_pushint(st, quest_has_quest(sd, qid)?1:0); + + return 0; +} + BUILDIN_FUNC(setqueststatus) { @@ -13521,5 +13532,6 @@ struct script_function buildin_func[] = { BUILDIN_DEF(deletequest, "i"), BUILDIN_DEF(setquestobjective, "iisi"), BUILDIN_DEF(setqueststatus, "ii"), + BUILDIN_DEF(hasquest, "i"), {NULL,NULL,NULL}, }; |