From 1e32aa5e41593bf05645e4412c86d8f4a00dac75 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 4 Oct 2018 18:50:37 +0300 Subject: Add packet ZC_CAMERA_INFO. This packet allow show camera info, or change camera parameters. --- src/map/clif.c | 29 +++++++++++++++++++++++++++++ src/map/clif.h | 2 ++ src/map/packets_struct.h | 9 +++++++++ 3 files changed, 40 insertions(+) diff --git a/src/map/clif.c b/src/map/clif.c index c8914d964..152a72cee 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -21922,6 +21922,32 @@ static void clif_parse_memorial_dungeon_command(int fd, struct map_session_data } } +static void clif_camera_showWindow(struct map_session_data *sd) +{ +#if PACKETVER >= 20160525 + struct PACKET_ZC_CAMERA_INFO p; + p.packetType = 0xa78; + p.action = 1; + p.range = 0; + p.rotation = 0; + p.latitude = 0; + clif->send(&p, sizeof(p), &sd->bl, SELF); +#endif +} + +static void clif_camera_change(struct map_session_data *sd, float range, float rotation, float latitude) +{ +#if PACKETVER >= 20160525 + struct PACKET_ZC_CAMERA_INFO p; + p.packetType = 0xa78; + p.action = 0; + p.range = range; + p.rotation = rotation; + p.latitude = latitude; + clif->send(&p, sizeof(p), &sd->bl, SELF); +#endif +} + /*========================================== * Main client packet processing function *------------------------------------------*/ @@ -23086,6 +23112,9 @@ void clif_defaults(void) clif->cz_req_style_change_sub = clif_cz_req_style_change_sub; clif->style_change_response = clif_style_change_response; + clif->camera_showWindow = clif_camera_showWindow; + clif->camera_change = clif_camera_change; + // -- Pet Evolution clif->pPetEvolution = clif_parse_pet_evolution; clif->petEvolutionResult = clif_pet_evolution_result; diff --git a/src/map/clif.h b/src/map/clif.h index e91f19f20..c77dbcb94 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -1552,6 +1552,8 @@ struct clif_interface { void (*petEvolutionResult) (int fd, enum pet_evolution_result result); 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); }; #ifdef HERCULES_CORE diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index c3886730b..29a3355f7 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -2842,6 +2842,15 @@ struct PACKET_ZC_REMOVE_EFFECT { uint32 effectId; } __attribute__((packed)); +struct PACKET_ZC_CAMERA_INFO { + int16 packetType; + int8 action; + float range; + float rotation; + float latitude; +} __attribute__((packed)); + + #if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute #pragma pack(pop) #endif // not NetBSD < 6 / Solaris -- cgit v1.2.3-70-g09d2