diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-10-04 19:12:37 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-10-04 19:12:37 +0300 |
commit | e47b40be9b351ed05b69ba23e065cc26625f7c67 (patch) | |
tree | ffe28a40a27f0e9051fbc904dded085bf61883fa /src/map/script.c | |
parent | 1e32aa5e41593bf05645e4412c86d8f4a00dac75 (diff) | |
download | hercules-e47b40be9b351ed05b69ba23e065cc26625f7c67.tar.gz hercules-e47b40be9b351ed05b69ba23e065cc26625f7c67.tar.bz2 hercules-e47b40be9b351ed05b69ba23e065cc26625f7c67.tar.xz hercules-e47b40be9b351ed05b69ba23e065cc26625f7c67.zip |
Add script commands for show camera info window and change camera parameters.
New script commands: camerainfo, changecamera
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c index 1973c5629..7eb713211 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -24847,6 +24847,32 @@ static BUILDIN(msgtable2) return true; } +// show/hide camera info +static BUILDIN(camerainfo) +{ + struct map_session_data *sd = script_rid2sd(st); + if (sd == NULL) + return false; + + clif->camera_showWindow(sd); + return true; +} + +// allow change some camera parameters +static BUILDIN(changecamera) +{ + struct map_session_data *sd = script_rid2sd(st); + if (sd == NULL) + return false; + + enum send_target target = SELF; + if (script_hasdata(st, 5)) { + target = script_getnum(st, 5); + } + clif->camera_change(sd, (float)script_getnum(st, 2), (float)script_getnum(st, 3), (float)script_getnum(st, 4), target); + return true; +} + /** * Adds a built-in script function. * @@ -25577,6 +25603,10 @@ static void script_parse_builtin(void) // -- HatEffect BUILDIN_DEF(hateffect, "ii"), + + // camera + BUILDIN_DEF(camerainfo, ""), + BUILDIN_DEF(changecamera, "iii?"), }; int i, len = ARRAYLENGTH(BUILDIN); RECREATE(script->buildin, char *, script->buildin_count + len); // Pre-alloc to speed up |