summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c4
-rw-r--r--src/map/clif.h2
-rw-r--r--src/map/script.c30
3 files changed, 33 insertions, 3 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 152a72cee..1e9844f14 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -21935,7 +21935,7 @@ static void clif_camera_showWindow(struct map_session_data *sd)
#endif
}
-static void clif_camera_change(struct map_session_data *sd, float range, float rotation, float latitude)
+static void clif_camera_change(struct map_session_data *sd, float range, float rotation, float latitude, enum send_target target)
{
#if PACKETVER >= 20160525
struct PACKET_ZC_CAMERA_INFO p;
@@ -21944,7 +21944,7 @@ static void clif_camera_change(struct map_session_data *sd, float range, float r
p.range = range;
p.rotation = rotation;
p.latitude = latitude;
- clif->send(&p, sizeof(p), &sd->bl, SELF);
+ clif->send(&p, sizeof(p), &sd->bl, target);
#endif
}
diff --git a/src/map/clif.h b/src/map/clif.h
index c77dbcb94..13c34c77d 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -1553,7 +1553,7 @@ struct clif_interface {
void (*party_dead_notification) (struct map_session_data *sd);
void (*pMemorialDungeonCommand) (int fd, struct map_session_data *sd);
void (*camera_showWindow) (struct map_session_data *sd);
- void (*camera_change) (struct map_session_data *sd, float range, float rotation, float latitude);
+ void (*camera_change) (struct map_session_data *sd, float range, float rotation, float latitude, enum send_target target);
};
#ifdef HERCULES_CORE
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