|
@@ -25736,6 +25736,25 @@ BUILDIN_FUNC( openstylist ){
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
+BUILDIN_FUNC(getitempos) {
|
|
|
+ struct map_session_data* sd;
|
|
|
+
|
|
|
+ if ( !script_rid2sd(sd) ){
|
|
|
+ script_pushint(st, 0);
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
+ }
|
|
|
+
|
|
|
+ if( current_equip_item_index == -1 ){
|
|
|
+ ShowError( "buildin_getitempos: Invalid usage detected. This command should only be used inside item scripts.\n" );
|
|
|
+ script_pushint(st, 0);
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
+ }
|
|
|
+
|
|
|
+ script_pushint(st, sd->inventory.u.items_inventory[current_equip_item_index].equip);
|
|
|
+
|
|
|
+ return SCRIPT_CMD_SUCCESS;
|
|
|
+}
|
|
|
+
|
|
|
#include "../custom/script.inc"
|
|
|
|
|
|
// declarations that were supposed to be exported from npc_chat.cpp
|
|
@@ -26443,6 +26462,8 @@ struct script_function buildin_func[] = {
|
|
|
|
|
|
BUILDIN_DEF(setinstancevar,"rvi"),
|
|
|
BUILDIN_DEF(openstylist, "?"),
|
|
|
+
|
|
|
+ BUILDIN_DEF(getitempos,""),
|
|
|
#include "../custom/script_def.inc"
|
|
|
|
|
|
{NULL,NULL,NULL},
|