Implements autoloot support for Mercenary (#5594)

* Fixed #5570.
* Adds the ability for mercenary to trigger autoloot.
* Adds idle sharing and idle option configs for granular settings.
Thanks to @saya9200's suggestion and @Lemongrass3110!
Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
This commit is contained in:
Aleos
2021-02-27 17:14:10 -05:00
committed by GitHub
parent 0e9308cba6
commit 2b94f0aeff
9 changed files with 97 additions and 9 deletions

View File

@@ -17643,6 +17643,17 @@ BUILDIN_FUNC(checkidlehom)
return SCRIPT_CMD_SUCCESS;
}
BUILDIN_FUNC(checkidlemer)
{
TBL_PC *sd;
if( script_nick2sd(2,sd) )
script_pushint(st, DIFF_TICK(last_tick, sd->idletime_mer));
else
script_pushint(st, 0);
return SCRIPT_CMD_SUCCESS;
}
BUILDIN_FUNC(searchitem)
{
struct script_data* data = script_getdata(st, 2);
@@ -25476,6 +25487,7 @@ struct script_function buildin_func[] = {
BUILDIN_DEF(checkchatting,"?"),
BUILDIN_DEF(checkidle,"?"),
BUILDIN_DEF(checkidlehom,"?"),
BUILDIN_DEF(checkidlemer,"?"),
BUILDIN_DEF(openmail,"?"),
BUILDIN_DEF(openauction,"?"),
BUILDIN_DEF(checkcell,"siii"),