From 89408e2401a3019c8cb1de0dab9f7e754c4dbfb4 Mon Sep 17 00:00:00 2001 From: Asheraf Date: Sun, 26 May 2019 08:19:59 +0100 Subject: Add new script commands cloakonnpc/cloakoffnpc --- doc/script_commands.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'doc/script_commands.txt') diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 244de4c0c..b8f856877 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -7041,6 +7041,18 @@ NPCs talking while hidden then revealing... you can wonder around =P). --------------------------------------- +*cloakonnpc(""{, }) +*cloakoffnpc(""{, }) + +These commands are used to apply the cloaking effect on npcs +this is a visual effect only and it does NOT stop the player +from interacting with the npc. + +If an account_id is specified then the effect will only display to the given id, +otherwise it's displayed to the entire npc area. + +--------------------------------------- + *doevent("::") This command will start a new execution thread in a specified NPC object -- cgit v1.2.3-70-g09d2 From 8695b790286586ae5e664bd1ef51fcb9debcc7c1 Mon Sep 17 00:00:00 2001 From: Asheraf Date: Wed, 15 Jan 2020 16:28:45 +0100 Subject: Add script command achievement_iscompleted to check for achievement status --- doc/script_commands.txt | 8 ++++++++ src/map/script.c | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+) (limited to 'doc/script_commands.txt') diff --git a/doc/script_commands.txt b/doc/script_commands.txt index b8f856877..6a97bae1d 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -10634,6 +10634,14 @@ returns progress on success and false on failure --------------------------------------- +*achievement_iscompleted({, }) + +Checks whether the attached player have completed all the given achievement objectives. + +returns true if yes and false if no. + +--------------------------------------- + *itempreview() Update already opened preview window with item from diff --git a/src/map/script.c b/src/map/script.c index 557550be2..3879d8efb 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -22269,6 +22269,23 @@ static BUILDIN(achievement_progress) return true; } +static BUILDIN(achievement_iscompleted) +{ + struct map_session_data *sd = script_hasdata(st, 3) ? map->id2sd(script_getnum(st, 3)) : script->rid2sd(st); + if (sd == NULL) + return false; + + int aid = script_getnum(st, 2); + const struct achievement_data *ad = achievement->get(aid); + if (ad == NULL) { + ShowError("buildin_achievement_iscompleted: Invalid Achievement %d provided.\n", aid); + return false; + } + + script_pushint(st, achievement->check_complete(sd, ad)); + return true; +} + /*========================================== * BattleGround System *------------------------------------------*/ @@ -27006,6 +27023,7 @@ static void script_parse_builtin(void) BUILDIN_DEF(agitcheck2,""), // Achievements [Smokexyz/Hercules] BUILDIN_DEF(achievement_progress, "iiii?"), + BUILDIN_DEF(achievement_iscompleted, "i?"), // BattleGround BUILDIN_DEF(waitingroom2bg,"siiss?"), BUILDIN_DEF(waitingroom2bg_single,"isiis"), -- cgit v1.2.3-70-g09d2