Added script command openbank (#6821)

This commit is contained in:
Pokye 2022-04-10 20:56:17 -03:00 committed by GitHub
parent 2cde45e569
commit f4410fba6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 1 deletions

View File

@ -8099,6 +8099,14 @@ This feature requires packet version 2017-07-26 or newer.
This function is intended for use in item scripts.
---------------------------------------
*openbank({<char id>})
Opens the Bank UI for the attached player or the given character ID.
This command requires packet version 2015-01-28 or newer.
---------------------------------------
\\
6,1.- Unit-related commands

View File

@ -1159,7 +1159,8 @@ enum in_ui_type : int8 {
};
enum out_ui_type : int8 {
OUT_UI_STYLIST = 1,
OUT_UI_BANK = 0,
OUT_UI_STYLIST,
OUT_UI_QUEST = 6,
OUT_UI_ATTENDANCE = 7
};

View File

@ -25840,6 +25840,27 @@ BUILDIN_FUNC( open_quest_ui ){
return SCRIPT_CMD_SUCCESS;
}
BUILDIN_FUNC(openbank){
#if PACKETVER < 20150128
ShowError( "buildin_openbank: This command requires PACKETVER 20150128 or newer.\n" );
return SCRIPT_CMD_FAILURE;
#else
struct map_session_data* sd = nullptr;
if (!script_charid2sd(2, sd)) {
return SCRIPT_CMD_FAILURE;
}
if( !battle_config.feature_banking ){
ShowError( "buildin_openbank: banking is disabled.\n" );
return SCRIPT_CMD_FAILURE;
}
clif_ui_open( sd, OUT_UI_BANK, 0 );
return SCRIPT_CMD_SUCCESS;
#endif
}
#include "../custom/script.inc"
// declarations that were supposed to be exported from npc_chat.cpp
@ -26553,6 +26574,7 @@ struct script_function buildin_func[] = {
BUILDIN_DEF(laphine_upgrade, ""),
BUILDIN_DEF(randomoptgroup,"i"),
BUILDIN_DEF(open_quest_ui, "??"),
BUILDIN_DEF(openbank,"?"),
#include "../custom/script_def.inc"
{NULL,NULL,NULL},