diff options
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 50 |
1 files changed, 40 insertions, 10 deletions
diff --git a/src/map/script.c b/src/map/script.c index ed4f9e918..03f5b13a3 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -15476,8 +15476,35 @@ BUILDIN(compare) return true; } -// [zBuffer] List of mathematics commands ---> -BUILDIN(sqrt) +// List of mathematics commands ---> +BUILDIN(floor) +{ + double i, a; + i = script_getnum(st,2); + a = floor(i); + script_pushint(st,(int)a); + return true; +} + +BUILDIN(ceil) +{ + double i, a; + i = script_getnum(st,2); + a = ceil(i); + script_pushint(st,(int)a); + return true; +} + +BUILDIN(log) +{ + double i, a; + i = script_getnum(st,2); + a = log(i); + script_pushint(st,(int)a); + return true; +} + +BUILDIN(sqrt) //[zBuffer] { double i, a; i = script_getnum(st,2); @@ -15486,7 +15513,7 @@ BUILDIN(sqrt) return true; } -BUILDIN(pow) +BUILDIN(pow) //[zBuffer] { double i, a, b; a = script_getnum(st,2); @@ -15496,7 +15523,7 @@ BUILDIN(pow) return true; } -BUILDIN(distance) +BUILDIN(distance) //[zBuffer] { int x0, y0, x1, y1; @@ -15509,7 +15536,7 @@ BUILDIN(distance) return true; } -// <--- [zBuffer] List of mathematics commands +// <--- List of mathematics commands BUILDIN(min) { @@ -20052,11 +20079,14 @@ void script_parse_builtin(void) { BUILDIN_DEF(getiteminfo,"ii"), //[Lupus] returns Items Buy / sell Price, etc info BUILDIN_DEF(setiteminfo,"iii"), //[Lupus] set Items Buy / sell Price, etc info BUILDIN_DEF(getequipcardid,"ii"), //[Lupus] returns CARD ID or other info from CARD slot N of equipped item - // [zBuffer] List of mathematics commands ---> - BUILDIN_DEF(sqrt,"i"), - BUILDIN_DEF(pow,"ii"), - BUILDIN_DEF(distance,"iiii"), - // <--- [zBuffer] List of mathematics commands + // List of mathematics commands ---> + BUILDIN_DEF(floor,"i"), + BUILDIN_DEF(ceil,"i"), + BUILDIN_DEF(log,"i"), + BUILDIN_DEF(sqrt,"i"), //[zBuffer] + BUILDIN_DEF(pow,"ii"), //[zBuffer] + BUILDIN_DEF(distance,"iiii"), //[zBuffer] + // <--- List of mathematics commands BUILDIN_DEF(min, "i*"), BUILDIN_DEF(max, "i*"), BUILDIN_DEF(md5,"s"), |