viewing paste rathena zenymap | Diff

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 40 41 42 43
 src/custom/script.inc     | 19 +++++++++++++++++++
 src/custom/script_def.inc |  1 +
 2 files changed, 20 insertions(+)
 
diff --git a/src/custom/script.inc b/src/custom/script.inc
index 1e01c88..a6e1481 100644
--- a/src/custom/script.inc
+++ b/src/custom/script.inc
@@ -17,3 +17,22 @@
 //     script_pushint(st,1);
 //     return 0;
 //}
+
+int buildin_zenymap( struct block_list *bl, va_list ap )
+{
+       TBL_PC *sd = BL_CAST( BL_PC, bl );
+       int value = va_arg( ap, int );
+       pc_getzeny( sd, value, LOG_TYPE_NONE, NULL );
+       return true;
+}
+
+BUILDIN_FUNC(zenymap)
+{
+       int16 m;
+       if ( ( m = map_mapname2mapid( script_getstr(st,2) ) ) < 0 ) {
+//             ShowError( "buildin_zenymap: Map not found !\n" ); // it seems the server already display an error
+               return SCRIPT_CMD_FAILURE;
+       }
+       map_foreachinmap( buildin_zenymap, m, BL_PC, script_getnum(st,3) );
+       return SCRIPT_CMD_SUCCESS;
+}
\ No newline at end of file
diff --git a/src/custom/script_def.inc b/src/custom/script_def.inc
index 3319eea..9750b86 100644
--- a/src/custom/script_def.inc
+++ b/src/custom/script_def.inc
@@ -9,3 +9,4 @@
  **/
 
 //BUILDIN_DEF(example,""),
+BUILDIN_DEF(zenymap,"si"),
\ No newline at end of file
 
Viewed 150 times, submitted by AnnieRuru.