diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 69fe95550c..76f2b2a0e3 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -11359,3 +11359,11 @@ Note: Only works with classes that use the ranking system. Returns true if the player is dead else false. --------------------------------------- + +*has_autoloot({}); + +This command checks whether a player configured autoloot. +Returns current autoloot value on success. + +--------------------------------------- + diff --git a/src/map/script.cpp b/src/map/script.cpp index 8cafe65c7b..954a33a3e8 100644 --- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -26939,6 +26939,24 @@ BUILDIN_FUNC(macro_detector) { return SCRIPT_CMD_SUCCESS; } +// =================================== +// *has_autoloot({}); +// This command checks whether a player configured autoloot. +// Returns current autoloot value on success. +// =================================== +BUILDIN_FUNC(has_autoloot) { + map_session_data *sd; + + if (!script_charid2sd(2, sd)) { + script_pushint(st, 0); + return SCRIPT_CMD_FAILURE; + } + + script_pushint(st, sd->state.autoloot); + + return SCRIPT_CMD_SUCCESS; +} + #include // declarations that were supposed to be exported from npc_chat.cpp @@ -27694,6 +27712,7 @@ struct script_function buildin_func[] = { BUILDIN_DEF(getfamerank, "?"), BUILDIN_DEF(isdead, "?"), BUILDIN_DEF(macro_detector, "?"), + BUILDIN_DEF(has_autoloot,"?"), #include