viewing paste Unknown #58573 | Text

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
--- 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(<char_id>);
+ **/
+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 <custom/script.inc>
 
 // 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 <custom/script_def.inc>
 
    {nullptr,nullptr,nullptr},
 
Viewed 1000 times, submitted by Guest.