From a3dbbe21ceb3b9fe63bf7959f088110340837e60 Mon Sep 17 00:00:00 2001 From: Euphy Date: Sat, 11 Jan 2014 09:45:32 -0500 Subject: [PATCH] Added script command 'isbeginquest'. Aegis has been using this command instead of 'checkquest(id,HASQUEST)' for years, so we will no longer be writing workarounds for it. Signed-off-by: Euphy --- doc/script_commands.txt | 11 ++++++++++- src/map/script.c | 14 ++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 3ac3a26be9..3bd2f16138 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -3,7 +3,7 @@ //===== By: ================================================== //= rAthena Dev Team //===== Last Updated: ======================================== -//= 20131118 +//= 20140111 //===== Description: ========================================= //= A reference manual for the rAthena scripting language. //= Commands are sorted depending on their functionality. @@ -7532,6 +7532,15 @@ If parameter "HUNTING" is supplied: --------------------------------------- +*isbegin_quest() + +Return the state of the quest: + 0 = Quest not started (not in quest log) + 1 = Quest has been given (state is either "inactive" or "active") + 2 = Quest completed + +--------------------------------------- + *showevent , ; Show a colored mark in the mini-map like "viewpoint" and an emotion on top of a NPC. diff --git a/src/map/script.c b/src/map/script.c index ba04fcff8f..e343bf3754 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -16373,6 +16373,19 @@ BUILDIN_FUNC(checkquest) return SCRIPT_CMD_SUCCESS; } +BUILDIN_FUNC(isbegin_quest) +{ + struct map_session_data *sd = script_rid2sd(st); + int i; + + nullpo_ret(sd); + + i = quest_check(sd, script_getnum(st, 2), (quest_check_type) HAVEQUEST); + script_pushint(st, i + (i < 1)); + + return SCRIPT_CMD_SUCCESS; +} + BUILDIN_FUNC(showevent) { TBL_PC *sd = script_rid2sd(st); @@ -18759,6 +18772,7 @@ struct script_function buildin_func[] = { BUILDIN_DEF(erasequest, "i"), BUILDIN_DEF(completequest, "i"), BUILDIN_DEF(checkquest, "i?"), + BUILDIN_DEF(isbegin_quest,"i"), BUILDIN_DEF(changequest, "ii"), BUILDIN_DEF(showevent, "ii"),