diff --git a/doc/script_commands.txt b/doc/script_commands.txt index f05a09e1e6..6079ad1381 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -8413,6 +8413,14 @@ error message instead. This command requires packet version 2021-11-03 or newer. +--------------------------------------- + +*opentips({,{}}); + +Opens the tip box UI for the attached player or the given character ID. + +This command requires packet version 2017-11-22 or newer. + --------------------------------------- \\ 6,1.- Unit-related commands diff --git a/src/map/clif.hpp b/src/map/clif.hpp index 94456558e5..b535e1ac78 100644 --- a/src/map/clif.hpp +++ b/src/map/clif.hpp @@ -1181,7 +1181,8 @@ enum out_ui_type : int8 { OUT_UI_STYLIST, OUT_UI_CAPTCHA, OUT_UI_MACRO, - OUT_UI_QUEST = 6, + OUT_UI_TIP = 5, + OUT_UI_QUEST, OUT_UI_ATTENDANCE, OUT_UI_ENCHANTGRADE, OUT_UI_ENCHANT = 10, diff --git a/src/map/script.cpp b/src/map/script.cpp index 954a33a3e8..7ea4cafd3a 100644 --- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -26957,6 +26957,22 @@ BUILDIN_FUNC(has_autoloot) { return SCRIPT_CMD_SUCCESS; } +BUILDIN_FUNC(opentips){ +#if PACKETVER < 20171122 + ShowError( "buildin_opentips: This command requires PACKETVER 20171122 or newer.\n" ); + return SCRIPT_CMD_FAILURE; +#else + map_session_data* sd; + + if (!script_charid2sd(3, sd)) { + return SCRIPT_CMD_FAILURE; + } + + clif_ui_open( *sd, OUT_UI_TIP, script_getnum(st, 2) ); + return SCRIPT_CMD_SUCCESS; +#endif +} + #include // declarations that were supposed to be exported from npc_chat.cpp @@ -27713,6 +27729,7 @@ struct script_function buildin_func[] = { BUILDIN_DEF(isdead, "?"), BUILDIN_DEF(macro_detector, "?"), BUILDIN_DEF(has_autoloot,"?"), + BUILDIN_DEF(opentips, "i?"), #include