From e5f25d11eee43a31b2c41b357ac144d9e40ef37a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 29 Nov 2014 16:34:13 +0300 Subject: Add script command for move camera to absolute pixel position. New script command: setcam x,y --- src/map/init.c | 1 + src/map/script.c | 8 ++++++++ src/map/script.h | 1 + 3 files changed, 10 insertions(+) (limited to 'src') diff --git a/src/map/init.c b/src/map/init.c index 2034b4f..2448ffa 100644 --- a/src/map/init.c +++ b/src/map/init.c @@ -60,6 +60,7 @@ HPExport void plugin_init (void) // HPM_map_add_group_permission = GET_SYMBOL("addGroupPermission"); addScriptCommand("setcamnpc", "*", setCamNpc); + addScriptCommand("setcam", "ii", setCam); addScriptCommand("restorecam", "", restoreCam); addScriptCommand("npctalk3", "s", npcTalk3); addScriptCommand("closedialog", "", closeDialog); diff --git a/src/map/script.c b/src/map/script.c index 8b63dd4..d71cc82 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -74,6 +74,14 @@ BUILDIN(setCamNpc) return true; } +BUILDIN(setCam) +{ + send_npccommand2(script->rid2sd (st), st->oid, 2, 0, + script_getnum(st, 2), script_getnum(st, 3)); + + return true; +} + BUILDIN(restoreCam) { getSD(); diff --git a/src/map/script.h b/src/map/script.h index 3a92fcc..fb93c77 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -7,6 +7,7 @@ BUILDIN(l); BUILDIN(lg); BUILDIN(setCamNpc); +BUILDIN(setCam); BUILDIN(restoreCam); BUILDIN(npcTalk3); BUILDIN(closeDialog); -- cgit v1.2.3-70-g09d2