--- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -27559,6 +27559,23 @@ BUILDIN_FUNC(monster_immunity) { return SCRIPT_CMD_SUCCESS; } +/** + * KafraShop Addon + * charid2rid(); + **/ +BUILDIN_FUNC(charid2rid) { + int char_id = script_getnum(st, 2); + map_session_data* sd = map_charid2sd(char_id); + + if (sd == nullptr) { + script_pushint(st, 0); + return SCRIPT_CMD_SUCCESS; + } + + script_pushint(st, sd->status.account_id); + return SCRIPT_CMD_SUCCESS; +} + #include // declarations that were supposed to be exported from npc_chat.cpp @@ -28336,6 +28353,11 @@ struct script_function buildin_func[] = { BUILDIN_DEF(setprofession_count, "isi"), BUILDIN_DEF(monster_immunity, "ii"), + /** + * KafraShop: Sabong Event + **/ + BUILDIN_DEF(charid2rid, "i"), + #include {nullptr,nullptr,nullptr},