From 79a55bfd5c029ae833bed01a5a9b497b4dcf1ed7 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 3 Oct 2018 00:25:11 +0300 Subject: Add script command for remove special effect. New script command: removespecialeffect *removespecialeffect({, {, {, }}}) *removespecialeffect({, {, ""{, }}}) --- doc/script_commands.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'doc') diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 343eb02cb..d316a47ce 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -5992,6 +5992,17 @@ Example usage: --------------------------------------- +*removespecialeffect({, {, {, }}}) +*removespecialeffect({, {, ""{, }}}) + +Works for: + main client from version 2018-10-02 + re client from version 2018-10-02 +This command will remove special effect. All parameters same with specialeffect. +Examples and detailed explanation about parameters see in specialeffect. + +--------------------------------------- + *specialeffect2({, {, ""}}) @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -- cgit v1.2.3-70-g09d2 From e47b40be9b351ed05b69ba23e065cc26625f7c67 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 4 Oct 2018 19:12:37 +0300 Subject: Add script commands for show camera info window and change camera parameters. New script commands: camerainfo, changecamera --- doc/script_commands.txt | 16 ++++++++++++++++ src/map/clif.c | 4 ++-- src/map/clif.h | 2 +- src/map/script.c | 30 ++++++++++++++++++++++++++++++ 4 files changed, 49 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/script_commands.txt b/doc/script_commands.txt index d316a47ce..6cb7eb135 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -10183,3 +10183,19 @@ Show in client message by from msg string table. Optional can be used for set color for whole message. --------------------------------------- + +*camerainfo() + +Show or hide camera info window. +Works for 20160525 clients or newer. + +--------------------------------------- + +*changecamera(, , {, }) + +Change camera range, rotation, latitude. +The optional target parameter specifies who will get changed +camera. +Works for 20160525 clients or newer. + +--------------------------------------- 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 -- cgit v1.2.3-70-g09d2 From b0cb2898bfe7f8888a786612444cabc83e8ff0cb Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 5 Oct 2018 17:40:01 +0300 Subject: Add at command @camerainfo. --- conf/groups.conf | 1 + conf/messages.conf | 3 ++- doc/atcommands.txt | 6 ++++++ src/map/atcommand.c | 19 +++++++++++++++++++ 4 files changed, 28 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/conf/groups.conf b/conf/groups.conf index 3f0c34ffb..16eca6e96 100644 --- a/conf/groups.conf +++ b/conf/groups.conf @@ -126,6 +126,7 @@ groups: ( go: true breakguild: true channel: true + camerainfo: true } permissions: { } diff --git a/conf/messages.conf b/conf/messages.conf index f986e4649..9fc85cb55 100644 --- a/conf/messages.conf +++ b/conf/messages.conf @@ -448,7 +448,8 @@ // Return pet to egg message 451: You can't return your pet because your inventory is full. -//452-497 FREE +452: usage @camerainfo range rotation latitude +//453-497 FREE // Messages of others (not for GM commands) // ---------------------------------------- diff --git a/doc/atcommands.txt b/doc/atcommands.txt index fb3628e00..b455d9151 100644 --- a/doc/atcommands.txt +++ b/doc/atcommands.txt @@ -1498,3 +1498,9 @@ Reloads the 'conf/clans.conf' file. Obs: it will reload 'db/clans.conf' too since it's included inside 'conf/clans.conf' --------------------------------------- + +@camerainfo {, , } + +Allow show/hide or change client camera parameters + +--------------------------------------- diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 2538f797c..a7dc5dd95 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -9810,6 +9810,24 @@ ACMD(reloadclans) return true; } +// show camera window or change camera parameters +ACMD(camerainfo) +{ + if (*message == '\0') { + clif->camera_showWindow(sd); + return true; + } + float range = 0; + float rotation = 0; + float latitude = 0; + if (sscanf(message, "%15f %15f %15f", &range, &rotation, &latitude) < 3) { + clif->message(fd, msg_fd(fd, 452)); // usage @camerainfo range rotation latitude + return false; + } + clif->camera_change(sd, range, rotation, latitude, SELF); + return true; +} + /** * Fills the reference of available commands in atcommand DBMap **/ @@ -10092,6 +10110,7 @@ static void atcommand_basecommands(void) ACMD_DEF(leaveclan), ACMD_DEF(reloadclans), ACMD_DEF(setzone), + ACMD_DEF(camerainfo), }; int i; -- cgit v1.2.3-70-g09d2