diff options
author | Haru <haru@dotalux.com> | 2018-05-07 00:13:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-07 00:13:15 +0200 |
commit | 614d7b66475f58dfb6354b57ca14999cc8c1b687 (patch) | |
tree | de881b6a6ad275c088e43b1388267e14d9e0cb52 | |
parent | 0903ea0b82614d127672b0c5ab3d8ca8049e0d87 (diff) | |
parent | 394e7f8752ae7c80786e202c8b859488db1af363 (diff) | |
download | hercules-614d7b66475f58dfb6354b57ca14999cc8c1b687.tar.gz hercules-614d7b66475f58dfb6354b57ca14999cc8c1b687.tar.bz2 hercules-614d7b66475f58dfb6354b57ca14999cc8c1b687.tar.xz hercules-614d7b66475f58dfb6354b57ca14999cc8c1b687.zip |
Merge pull request #1998 from Asheraf/private_airship
Implementation of Private AirShip
-rw-r--r-- | conf/messages.conf | 3 | ||||
-rw-r--r-- | db/constants.conf | 2 | ||||
-rw-r--r-- | doc/script_commands.txt | 13 | ||||
-rw-r--r-- | npc/mapflag/private_airship.txt | 436 | ||||
-rw-r--r-- | npc/other/private_airship.txt | 66 | ||||
-rw-r--r-- | npc/scripts.conf | 1 | ||||
-rw-r--r-- | npc/scripts_mapflags.conf | 1 | ||||
-rw-r--r-- | src/map/atcommand.c | 4 | ||||
-rw-r--r-- | src/map/clif.c | 45 | ||||
-rw-r--r-- | src/map/clif.h | 14 | ||||
-rw-r--r-- | src/map/map.h | 2 | ||||
-rw-r--r-- | src/map/npc.c | 4 | ||||
-rw-r--r-- | src/map/packets.h | 2 | ||||
-rw-r--r-- | src/map/packets_struct.h | 11 | ||||
-rw-r--r-- | src/map/script.c | 32 | ||||
-rw-r--r-- | src/map/script.h | 4 |
16 files changed, 636 insertions, 4 deletions
diff --git a/conf/messages.conf b/conf/messages.conf index 7adff9dff..0c238d0fe 100644 --- a/conf/messages.conf +++ b/conf/messages.conf @@ -1251,7 +1251,8 @@ // @mobinfo ... 1291: ATK:%d~%d MATK:%d~%d Range:%d~%d~%d Size:%s Race: %s Element: %s (Lv:%d) -//1292-1293 FREE +1292: PrivateAirshipStartable | +1293: PrivateAirshipEndable | //1294 used by hercules chat feature // @version diff --git a/db/constants.conf b/db/constants.conf index cc0fb3104..e51ccb9bd 100644 --- a/db/constants.conf +++ b/db/constants.conf @@ -428,6 +428,8 @@ constants_db: { mf_nocashshop: 54 mf_noautoloot: 55 mf_noviewid: 56 + mf_pairship_startable: 57 + mf_pairship_endable: 58 comment__: "Cell Properties" cell_walkable: 0 diff --git a/doc/script_commands.txt b/doc/script_commands.txt index d69322745..aa0fea31c 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -9994,4 +9994,17 @@ Enables the Emblem of the given Clan to the current NPC //===================================== 13 - End of Clan System Related Commands //===================================== +--------------------------------------- + +*airship_respond(<flag>) + +Send client respond to different private airship status. +the available flags are: + P_AIRSHIP_NONE + P_AIRSHIP_RETRY + P_AIRSHIP_INVALID_START_MAP + P_AIRSHIP_INVALID_END_MAP + P_AIRSHIP_ITEM_NOT_ENOUGH + P_AIRSHIP_ITEM_INVALID + ---------------------------------------
\ No newline at end of file diff --git a/npc/mapflag/private_airship.txt b/npc/mapflag/private_airship.txt new file mode 100644 index 000000000..dc5c7fd1c --- /dev/null +++ b/npc/mapflag/private_airship.txt @@ -0,0 +1,436 @@ +//================= Hercules Script ======================================= +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2018 Hercules Dev Team +//= Copyright (C) Asheraf +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= + +// Private Airship Startable Maps +// prt_cas mapflag pairship_startable +// prt_cas_q mapflag pairship_startable +prt_fild08d mapflag pairship_startable +prt_fild08c mapflag pairship_startable +prt_fild08b mapflag pairship_startable +prt_fild08a mapflag pairship_startable +iz_ac01_d mapflag pairship_startable +iz_ac02_d mapflag pairship_startable +iz_ac01_c mapflag pairship_startable +iz_ac02_c mapflag pairship_startable +iz_ac01_b mapflag pairship_startable +iz_ac02_b mapflag pairship_startable +iz_ac01_a mapflag pairship_startable +iz_ac02_a mapflag pairship_startable +izlude_d mapflag pairship_startable +izlude_c mapflag pairship_startable +izlude_b mapflag pairship_startable +izlude_a mapflag pairship_startable +iz_ac01 mapflag pairship_startable +iz_ac02 mapflag pairship_startable +iz_ng01 mapflag pairship_startable +treasure_n1 mapflag pairship_startable +treasure_n2 mapflag pairship_startable +moc_para01 mapflag pairship_startable +itemmall mapflag pairship_startable +um_dun01 mapflag pairship_startable +um_dun02 mapflag pairship_startable +um_in mapflag pairship_startable +um_fild01 mapflag pairship_startable +um_fild02 mapflag pairship_startable +um_fild03 mapflag pairship_startable +um_fild04 mapflag pairship_startable +umbala mapflag pairship_startable +alde_alche mapflag pairship_startable +job_duncer mapflag pairship_startable +job_sage mapflag pairship_startable +job_cru mapflag pairship_startable +job_monk mapflag pairship_startable +monk_test mapflag pairship_startable +in_rogue mapflag pairship_startable +job_wiz mapflag pairship_startable +job_prist mapflag pairship_startable +job_knt mapflag pairship_startable +job_hunte mapflag pairship_startable +cmd_in02 mapflag pairship_startable +cmd_in01 mapflag pairship_startable +comodo mapflag pairship_startable +beach_dun mapflag pairship_startable +beach_dun2 mapflag pairship_startable +beach_dun3 mapflag pairship_startable +cmd_fild01 mapflag pairship_startable +cmd_fild02 mapflag pairship_startable +cmd_fild03 mapflag pairship_startable +cmd_fild04 mapflag pairship_startable +cmd_fild06 mapflag pairship_startable +cmd_fild07 mapflag pairship_startable +cmd_fild08 mapflag pairship_startable +cmd_fild09 mapflag pairship_startable +mjolnir_01 mapflag pairship_startable +mjolnir_02 mapflag pairship_startable +mjolnir_03 mapflag pairship_startable +mjolnir_04 mapflag pairship_startable +mjolnir_05 mapflag pairship_startable +mjolnir_06 mapflag pairship_startable +mjolnir_07 mapflag pairship_startable +mjolnir_08 mapflag pairship_startable +mjolnir_09 mapflag pairship_startable +mjolnir_10 mapflag pairship_startable +mjolnir_11 mapflag pairship_startable +mjolnir_12 mapflag pairship_startable +prt_fild00 mapflag pairship_startable +prt_fild01 mapflag pairship_startable +prt_fild02 mapflag pairship_startable +prt_fild03 mapflag pairship_startable +prt_fild04 mapflag pairship_startable +prt_fild05 mapflag pairship_startable +prt_fild06 mapflag pairship_startable +prt_fild07 mapflag pairship_startable +prt_fild08 mapflag pairship_startable +prt_fild09 mapflag pairship_startable +prt_fild10 mapflag pairship_startable +prt_fild11 mapflag pairship_startable +prt_monk mapflag pairship_startable +gef_fild00 mapflag pairship_startable +gef_fild01 mapflag pairship_startable +gef_fild02 mapflag pairship_startable +gef_fild03 mapflag pairship_startable +gef_fild04 mapflag pairship_startable +gef_fild05 mapflag pairship_startable +gef_fild06 mapflag pairship_startable +gef_fild07 mapflag pairship_startable +gef_fild08 mapflag pairship_startable +gef_fild09 mapflag pairship_startable +gef_fild10 mapflag pairship_startable +in_orcs01 mapflag pairship_startable +gef_fild11 mapflag pairship_startable +moc_fild01 mapflag pairship_startable +moc_fild02 mapflag pairship_startable +moc_fild03 mapflag pairship_startable +moc_fild07 mapflag pairship_startable +moc_fild11 mapflag pairship_startable +moc_fild12 mapflag pairship_startable +moc_fild13 mapflag pairship_startable +moc_fild16 mapflag pairship_startable +in_moc_16 mapflag pairship_startable +moc_fild17 mapflag pairship_startable +moc_fild18 mapflag pairship_startable +moc_fild19 mapflag pairship_startable +pay_fild01 mapflag pairship_startable +pay_fild02 mapflag pairship_startable +pay_fild03 mapflag pairship_startable +pay_fild04 mapflag pairship_startable +pay_fild06 mapflag pairship_startable +pay_fild07 mapflag pairship_startable +pay_fild08 mapflag pairship_startable +pay_fild09 mapflag pairship_startable +pay_fild10 mapflag pairship_startable +anthell01 mapflag pairship_startable +anthell02 mapflag pairship_startable +gef_dun00 mapflag pairship_startable +gef_dun01 mapflag pairship_startable +gef_dun02 mapflag pairship_startable +iz_dun00 mapflag pairship_startable +iz_dun01 mapflag pairship_startable +iz_dun02 mapflag pairship_startable +iz_dun03 mapflag pairship_startable +iz_dun04 mapflag pairship_startable +iz_dun05 mapflag pairship_startable +in_sphinx1 mapflag pairship_startable +in_sphinx2 mapflag pairship_startable +in_sphinx3 mapflag pairship_startable +in_sphinx4 mapflag pairship_startable +in_sphinx5 mapflag pairship_startable +moc_pryd01 mapflag pairship_startable +moc_pryd02 mapflag pairship_startable +moc_pryd03 mapflag pairship_startable +moc_pryd04 mapflag pairship_startable +moc_pryd05 mapflag pairship_startable +moc_pryd06 mapflag pairship_startable +moc_prydb1 mapflag pairship_startable +mjo_dun01 mapflag pairship_startable +mjo_dun02 mapflag pairship_startable +mjo_dun03 mapflag pairship_startable +orcsdun01 mapflag pairship_startable +orcsdun02 mapflag pairship_startable +pay_dun00 mapflag pairship_startable +pay_dun01 mapflag pairship_startable +pay_dun02 mapflag pairship_startable +pay_dun03 mapflag pairship_startable +pay_dun04 mapflag pairship_startable +prt_maze01 mapflag pairship_startable +prt_maze02 mapflag pairship_startable +prt_maze03 mapflag pairship_startable +prt_sewb1 mapflag pairship_startable +prt_sewb2 mapflag pairship_startable +prt_sewb3 mapflag pairship_startable +prt_sewb4 mapflag pairship_startable +treasure01 mapflag pairship_startable +treasure02 mapflag pairship_startable +in_hunter mapflag pairship_startable +job_thief1 mapflag pairship_startable +alb_ship mapflag pairship_startable +alberta mapflag pairship_startable +alberta_in mapflag pairship_startable +alb2trea mapflag pairship_startable +aldebaran mapflag pairship_startable +aldeba_in mapflag pairship_startable +gef_tower mapflag pairship_startable +geffen mapflag pairship_startable +geffen_in mapflag pairship_startable +moc_ruins mapflag pairship_startable +morocc mapflag pairship_startable +morocc_in mapflag pairship_startable +pay_arche mapflag pairship_startable +payon mapflag pairship_startable +payon_in01 mapflag pairship_startable +payon_in02 mapflag pairship_startable +payon_in03 mapflag pairship_startable +prontera mapflag pairship_startable +prt_in mapflag pairship_startable +prt_castle mapflag pairship_startable +prt_church mapflag pairship_startable +izlude mapflag pairship_startable +izlude_in mapflag pairship_startable +izlu2dun mapflag pairship_startable +monk_in mapflag pairship_startable +xmas mapflag pairship_startable +xmas_fild01 mapflag pairship_startable +xmas_dun01 mapflag pairship_startable +xmas_dun02 mapflag pairship_startable +alde_dun01 mapflag pairship_startable +alde_dun02 mapflag pairship_startable +alde_dun03 mapflag pairship_startable +alde_dun04 mapflag pairship_startable +c_tower1 mapflag pairship_startable +c_tower2 mapflag pairship_startable +c_tower3 mapflag pairship_startable +c_tower4 mapflag pairship_startable +gl_cas01 mapflag pairship_startable +gl_cas02 mapflag pairship_startable +gl_church mapflag pairship_startable +gl_chyard mapflag pairship_startable +gl_dun01 mapflag pairship_startable +gl_dun02 mapflag pairship_startable +gl_in01 mapflag pairship_startable +gl_knt01 mapflag pairship_startable +gl_knt02 mapflag pairship_startable +gl_prison mapflag pairship_startable +gl_prison1 mapflag pairship_startable +gl_sew01 mapflag pairship_startable +gl_sew02 mapflag pairship_startable +gl_sew03 mapflag pairship_startable +gl_sew04 mapflag pairship_startable +gl_step mapflag pairship_startable +niflheim mapflag pairship_startable +nif_fild01 mapflag pairship_startable +nif_fild02 mapflag pairship_startable +tur_dun02 mapflag pairship_startable +tur_dun03 mapflag pairship_startable +tur_dun04 mapflag pairship_startable +tur_dun01 mapflag pairship_startable +glast_01 mapflag pairship_startable +lou_dun02 mapflag pairship_startable +lou_dun03 mapflag pairship_startable +louyang mapflag pairship_startable +lou_fild01 mapflag pairship_startable +lou_dun01 mapflag pairship_startable + +// Private Airship Endable Maps +prt_fild08d mapflag pairship_endable +prt_fild08c mapflag pairship_endable +prt_fild08b mapflag pairship_endable +prt_fild08a mapflag pairship_endable +izlude_d mapflag pairship_endable +izlude_c mapflag pairship_endable +izlude_b mapflag pairship_endable +izlude_a mapflag pairship_endable +um_dun01 mapflag pairship_endable +um_dun02 mapflag pairship_endable +um_fild01 mapflag pairship_endable +um_fild02 mapflag pairship_endable +um_fild03 mapflag pairship_endable +um_fild04 mapflag pairship_endable +umbala mapflag pairship_endable +comodo mapflag pairship_endable +beach_dun mapflag pairship_endable +beach_dun2 mapflag pairship_endable +beach_dun3 mapflag pairship_endable +cmd_fild01 mapflag pairship_endable +cmd_fild02 mapflag pairship_endable +cmd_fild03 mapflag pairship_endable +cmd_fild04 mapflag pairship_endable +cmd_fild06 mapflag pairship_endable +cmd_fild07 mapflag pairship_endable +cmd_fild08 mapflag pairship_endable +cmd_fild09 mapflag pairship_endable +mjolnir_01 mapflag pairship_endable +mjolnir_02 mapflag pairship_endable +mjolnir_03 mapflag pairship_endable +mjolnir_04 mapflag pairship_endable +mjolnir_05 mapflag pairship_endable +mjolnir_06 mapflag pairship_endable +mjolnir_07 mapflag pairship_endable +mjolnir_08 mapflag pairship_endable +mjolnir_09 mapflag pairship_endable +mjolnir_10 mapflag pairship_endable +mjolnir_11 mapflag pairship_endable +mjolnir_12 mapflag pairship_endable +prt_fild00 mapflag pairship_endable +prt_fild01 mapflag pairship_endable +prt_fild02 mapflag pairship_endable +prt_fild03 mapflag pairship_endable +prt_fild04 mapflag pairship_endable +prt_fild05 mapflag pairship_endable +prt_fild06 mapflag pairship_endable +prt_fild07 mapflag pairship_endable +prt_fild08 mapflag pairship_endable +prt_fild09 mapflag pairship_endable +prt_fild10 mapflag pairship_endable +prt_fild11 mapflag pairship_endable +prt_monk mapflag pairship_endable +gef_fild00 mapflag pairship_endable +gef_fild01 mapflag pairship_endable +gef_fild02 mapflag pairship_endable +gef_fild03 mapflag pairship_endable +gef_fild04 mapflag pairship_endable +gef_fild05 mapflag pairship_endable +gef_fild06 mapflag pairship_endable +gef_fild07 mapflag pairship_endable +gef_fild08 mapflag pairship_endable +gef_fild09 mapflag pairship_endable +gef_fild10 mapflag pairship_endable +gef_fild11 mapflag pairship_endable +moc_fild01 mapflag pairship_endable +moc_fild02 mapflag pairship_endable +moc_fild03 mapflag pairship_endable +moc_fild07 mapflag pairship_endable +moc_fild11 mapflag pairship_endable +moc_fild12 mapflag pairship_endable +moc_fild13 mapflag pairship_endable +moc_fild16 mapflag pairship_endable +moc_fild17 mapflag pairship_endable +moc_fild18 mapflag pairship_endable +moc_fild19 mapflag pairship_endable +pay_fild01 mapflag pairship_endable +pay_fild02 mapflag pairship_endable +pay_fild03 mapflag pairship_endable +pay_fild04 mapflag pairship_endable +pay_fild06 mapflag pairship_endable +pay_fild07 mapflag pairship_endable +pay_fild08 mapflag pairship_endable +pay_fild09 mapflag pairship_endable +pay_fild10 mapflag pairship_endable +anthell01 mapflag pairship_endable +anthell02 mapflag pairship_endable +gef_dun00 mapflag pairship_endable +gef_dun01 mapflag pairship_endable +gef_dun02 mapflag pairship_endable +iz_dun00 mapflag pairship_endable +iz_dun01 mapflag pairship_endable +iz_dun02 mapflag pairship_endable +iz_dun03 mapflag pairship_endable +iz_dun04 mapflag pairship_endable +iz_dun05 mapflag pairship_endable +in_sphinx1 mapflag pairship_endable +in_sphinx2 mapflag pairship_endable +in_sphinx3 mapflag pairship_endable +in_sphinx4 mapflag pairship_endable +in_sphinx5 mapflag pairship_endable +moc_pryd01 mapflag pairship_endable +moc_pryd02 mapflag pairship_endable +moc_pryd03 mapflag pairship_endable +moc_pryd04 mapflag pairship_endable +moc_pryd05 mapflag pairship_endable +moc_pryd06 mapflag pairship_endable +moc_prydb1 mapflag pairship_endable +mjo_dun01 mapflag pairship_endable +mjo_dun02 mapflag pairship_endable +mjo_dun03 mapflag pairship_endable +orcsdun01 mapflag pairship_endable +orcsdun02 mapflag pairship_endable +pay_dun00 mapflag pairship_endable +pay_dun01 mapflag pairship_endable +pay_dun02 mapflag pairship_endable +pay_dun03 mapflag pairship_endable +pay_dun04 mapflag pairship_endable +prt_maze01 mapflag pairship_endable +prt_maze02 mapflag pairship_endable +prt_maze03 mapflag pairship_endable +prt_sewb1 mapflag pairship_endable +prt_sewb2 mapflag pairship_endable +prt_sewb3 mapflag pairship_endable +prt_sewb4 mapflag pairship_endable +treasure01 mapflag pairship_endable +treasure02 mapflag pairship_endable +alberta mapflag pairship_endable +alb2trea mapflag pairship_endable +aldebaran mapflag pairship_endable +geffen mapflag pairship_endable +moc_ruins mapflag pairship_endable +morocc mapflag pairship_endable +pay_arche mapflag pairship_endable +payon mapflag pairship_endable +prontera mapflag pairship_endable +izlude mapflag pairship_endable +izlu2dun mapflag pairship_endable +xmas mapflag pairship_endable +xmas_fild01 mapflag pairship_endable +xmas_dun01 mapflag pairship_endable +xmas_dun02 mapflag pairship_endable +alde_dun01 mapflag pairship_endable +alde_dun02 mapflag pairship_endable +alde_dun03 mapflag pairship_endable +alde_dun04 mapflag pairship_endable +c_tower1 mapflag pairship_endable +c_tower2 mapflag pairship_endable +c_tower3 mapflag pairship_endable +c_tower4 mapflag pairship_endable +gl_cas01 mapflag pairship_endable +gl_cas02 mapflag pairship_endable +gl_church mapflag pairship_endable +gl_chyard mapflag pairship_endable +gl_dun01 mapflag pairship_endable +gl_dun02 mapflag pairship_endable +gl_in01 mapflag pairship_endable +gl_knt01 mapflag pairship_endable +gl_knt02 mapflag pairship_endable +gl_prison mapflag pairship_endable +gl_prison1 mapflag pairship_endable +gl_sew01 mapflag pairship_endable +gl_sew02 mapflag pairship_endable +gl_sew03 mapflag pairship_endable +gl_sew04 mapflag pairship_endable +gl_step mapflag pairship_endable +niflheim mapflag pairship_endable +nif_fild01 mapflag pairship_endable +nif_fild02 mapflag pairship_endable +tur_dun02 mapflag pairship_endable +tur_dun03 mapflag pairship_endable +tur_dun04 mapflag pairship_endable +tur_dun01 mapflag pairship_endable +glast_01 mapflag pairship_endable +lou_dun02 mapflag pairship_endable +lou_dun03 mapflag pairship_endable +louyang mapflag pairship_endable +lou_fild01 mapflag pairship_endable +lou_dun01 mapflag pairship_endable diff --git a/npc/other/private_airship.txt b/npc/other/private_airship.txt new file mode 100644 index 000000000..e650e4b96 --- /dev/null +++ b/npc/other/private_airship.txt @@ -0,0 +1,66 @@ +//================= Hercules Script ======================================= +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2018 Hercules Dev Team +//= Copyright (C) Asheraf +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Private AirShip +//========================================================================= + +- script private_airship FAKE_NPC,{ + end; + +S_AirShipIsNeedItem: + for (.@i = 0; .@i < getarraysize(.needitem); ++.@i) { + if (@itemid == .needitem[.@i]) + return true; + } + return false; + +OnAirShipRequest: + if (callsub(S_AirShipIsNeedItem) == false) { + airship_respond(P_AIRSHIP_ITEM_INVALID); + end; + } + if (countitem(@itemid) < 1) { + airship_respond(P_AIRSHIP_ITEM_NOT_ENOUGH); + end; + } + if (getmapflag(strcharinfo(PC_MAP), mf_pairship_startable) != true) { + airship_respond(P_AIRSHIP_INVALID_START_MAP); + end; + } + if (getmapflag(@mapname$, mf_pairship_endable) != true) { + airship_respond(P_AIRSHIP_INVALID_END_MAP); + end; + } + + delitem(@itemid, 1); + warp(@mapname$, 0, 0); + end; + +OnInit: + setarray(.needitem, 6909, 25464); + end; +} diff --git a/npc/scripts.conf b/npc/scripts.conf index d56d7cb73..f03ac50f0 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -225,6 +225,7 @@ // - Turbo Track Arena "npc/other/turbo_track.txt", "npc/other/item_merge.txt", +"npc/other/private_airship.txt", //================= Quests ================================================ // - Quests-Tutorials for basic classes (1st class quests) ------ diff --git a/npc/scripts_mapflags.conf b/npc/scripts_mapflags.conf index c662f7562..eed3c3d3d 100644 --- a/npc/scripts_mapflags.conf +++ b/npc/scripts_mapflags.conf @@ -57,3 +57,4 @@ "npc/mapflag/skillmodifier.txt", "npc/mapflag/skillduration.txt", "npc/mapflag/notomb.txt", +"npc/mapflag/private_airship.txt", diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 90ba73fa6..a130ecef3 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -3956,6 +3956,10 @@ ACMD(mapinfo) strcat(atcmd_output, msg_fd(fd, 1063)); // NoAutoloot | if (map->list[m_id].flag.noviewid != EQP_NONE) strcat(atcmd_output, msg_fd(fd,1079)); // NoViewID | + if (map->list[m_id].flag.pairship_startable) + strcat(atcmd_output, msg_fd(fd, 1292)); // PrivateAirshipStartable | + if (map->list[m_id].flag.pairship_endable) + strcat(atcmd_output, msg_fd(fd, 1293)); // PrivateAirshipEndable | clif->message(fd, atcmd_output); switch (list) { diff --git a/src/map/clif.c b/src/map/clif.c index 4e25a71ae..06f054ff2 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -20615,6 +20615,49 @@ void clif_ui_action(struct map_session_data *sd, int32 UIType, int32 data) clif->send(&p, sizeof(p), &sd->bl, SELF); } + +void clif_parse_private_airship_request(int fd, struct map_session_data *sd) __attribute__((nonnull(2))); +void clif_parse_private_airship_request(int fd, struct map_session_data *sd) +{ +#if defined(PACKETVER_RE) && PACKETVER >= 20180321 + char evname[EVENT_NAME_LENGTH]; + struct event_data *ev = NULL; + const struct PACKET_CZ_PRIVATE_AIRSHIP_REQUEST *p = RP2PTR(fd); + + safestrncpy(evname, "private_airship::OnAirShipRequest", EVENT_NAME_LENGTH); + if ((ev = strdb_get(npc->ev_db, evname))) { + pc->setregstr(sd, script->add_str("@mapname$"), p->mapName); + pc->setreg(sd, script->add_str("@itemid"), p->ItemID); + script->run_npc(ev->nd->u.scr.script, ev->pos, sd->bl.id, ev->nd->bl.id); + } else { + ShowError("clif_parse_private_airship_request: event '%s' not found, operation failed\n", evname); + } +#else + ShowWarning("clif_parse_private_airship_request: private airship is not supported in this client version, possible packet manipulation."); +#endif +} + +void clif_private_airship_response(struct map_session_data *sd, uint32 flag) +{ +#if defined(PACKETVER_RE) && PACKETVER >= 20180321 + struct PACKET_ZC_PRIVATE_AIRSHIP_RESPONSE p; + + nullpo_retv(sd); + + if (flag > P_AIRSHIP_ITEM_INVALID) { + ShowError("clif_private_airship_response: invalid flag given '%d', defaulting to 0.\n", flag); + flag = 0; + } + + p.PacketType = 0xA4A; + p.flag = flag; + + clif->send(&p, sizeof(p), &sd->bl, SELF); +#else + ShowWarning("clif_private_airship_response: private airship works only for clients >= 20180321."); +#endif +} + /*========================================== * Main client packet processing function *------------------------------------------*/ @@ -21721,4 +21764,6 @@ void clif_defaults(void) { clif->open_ui = clif_open_ui; clif->pAttendanceRewardRequest = clif_parse_attendance_reward_request; clif->ui_action = clif_ui_action; + clif->pPrivateAirshipRequest = clif_parse_private_airship_request; + clif->PrivateAirshipResponse = clif_private_airship_response; } diff --git a/src/map/clif.h b/src/map/clif.h index 8622d8729..58eb6b357 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -589,6 +589,18 @@ enum ui_types { ATTENDANCE_UI }; /** +* Private Airship Responds +**/ +enum private_airship { + P_AIRSHIP_NONE, + P_AIRSHIP_RETRY, + P_AIRSHIP_INVALID_START_MAP, + P_AIRSHIP_INVALID_END_MAP, + P_AIRSHIP_ITEM_NOT_ENOUGH, + P_AIRSHIP_ITEM_INVALID +}; + +/** * Structures **/ typedef void (*pFunc)(int, struct map_session_data *); //cant help but put it first @@ -1451,6 +1463,8 @@ struct clif_interface { void (*open_ui) (struct map_session_data *sd, int8 UIType); void (*pAttendanceRewardRequest) (int fd, struct map_session_data *sd); void (*ui_action) (struct map_session_data *sd, int32 UIType, int32 data); + void (*pPrivateAirshipRequest) (int fd, struct map_session_data *sd); + void (*PrivateAirshipResponse) (struct map_session_data *sd, uint32 flag); }; #ifdef HERCULES_CORE diff --git a/src/map/map.h b/src/map/map.h index 0618b0da8..b77b68813 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -857,6 +857,8 @@ struct map_data { unsigned notomb : 1; unsigned nocashshop : 1; unsigned noautoloot : 1; + unsigned pairship_startable : 1; + unsigned pairship_endable : 1; uint32 noviewid; ///< noviewid (bitmask - @see enum equip_pos) } flag; struct point save; diff --git a/src/map/npc.c b/src/map/npc.c index 94ab57bd9..d361f2e90 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -4517,6 +4517,10 @@ const char *npc_parse_mapflag(const char *w1, const char *w2, const char *w3, co map->list[m].flag.nocashshop = (state) ? 1 : 0; } else if (!strcmpi(w3,"noviewid")) { map->list[m].flag.noviewid = (state) ? atoi(w4) : 0; + } else if (!strcmpi(w3, "pairship_startable")) { + map->list[m].flag.pairship_startable = (state) ? 1 : 0; + } else if (!strcmpi(w3, "pairship_endable")) { + map->list[m].flag.pairship_endable = (state) ? 1 : 0; } else { npc->parse_unknown_mapflag(mapname, w3, w4, start, buffer, filepath, retval); } diff --git a/src/map/packets.h b/src/map/packets.h index a84a4ae09..29a0e0090 100644 --- a/src/map/packets.h +++ b/src/map/packets.h @@ -3827,7 +3827,7 @@ packet(0x96e,-1,clif->ackmergeitems); // changed packet sizes packet(0x006d,157); // HC_ACCEPT_MAKECHAR packet(0x08e3,157); // HC_UPDATE_CHARINFO - packet(0x0a49,20); + packet(0x0a49, 20, clif->pPrivateAirshipRequest); #endif // 2017-09-06cRagexeRE diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 5b9a4344a..cae794e92 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -1729,6 +1729,17 @@ struct PACKET_ZC_UI_ACTION { int32 data; } __attribute__((packed)); +struct PACKET_CZ_PRIVATE_AIRSHIP_REQUEST { + int16 PacketType; + char mapName[MAP_NAME_LENGTH_EXT]; + uint16 ItemID; +} __attribute__((packed)); + +struct PACKET_ZC_PRIVATE_AIRSHIP_RESPONSE { + int16 PacketType; + uint32 flag; +} __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 diff --git a/src/map/script.c b/src/map/script.c index 93c39f2bc..67dd4214c 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -12937,7 +12937,9 @@ BUILDIN(getmapflag) case MF_NOTOMB: script_pushint(st,map->list[m].flag.notomb); break; case MF_NOCASHSHOP: script_pushint(st,map->list[m].flag.nocashshop); break; case MF_NOAUTOLOOT: script_pushint(st, map->list[m].flag.noautoloot); break; - case MF_NOVIEWID: script_pushint(st,map->list[m].flag.noviewid); break; + case MF_NOVIEWID: script_pushint(st, map->list[m].flag.noviewid); break; + case MF_PAIRSHIP_STARTABLE: script_pushint(st, map->list[m].flag.pairship_startable); break; + case MF_PAIRSHIP_ENDABLE: script_pushint(st, map->list[m].flag.pairship_endable); break; } } @@ -13063,6 +13065,8 @@ BUILDIN(setmapflag) { case MF_NOCASHSHOP: map->list[m].flag.nocashshop = 1; break; case MF_NOAUTOLOOT: map->list[m].flag.noautoloot = 1; break; case MF_NOVIEWID: map->list[m].flag.noviewid = (val <= 0) ? EQP_NONE : val; break; + case MF_PAIRSHIP_STARTABLE: map->list[m].flag.pairship_startable = 1; break; + case MF_PAIRSHIP_ENDABLE: map->list[m].flag.pairship_endable = 1; break; } } @@ -23970,6 +23974,23 @@ BUILDIN(clan_master) return true; } +BUILDIN(airship_respond) +{ + struct map_session_data *sd = map->id2sd(st->rid); + int32 flag = script_getnum(st, 2); + + if (sd == NULL) + return false; + + if (flag < P_AIRSHIP_NONE || flag > P_AIRSHIP_ITEM_INVALID) { + ShowWarning("buildin_airship_respond: invalid flag %d has been given.", flag); + return false; + } + + clif->PrivateAirshipResponse(sd, flag); + return true; +} + /** * hateffect(EffectID, Enable_State) */ @@ -24719,6 +24740,7 @@ void script_parse_builtin(void) { BUILDIN_DEF2(rodex_sendmail, "rodex_sendmail_acc", "isss???????????"), BUILDIN_DEF(rodex_sendmail2, "isss?????????????????????????????????????????"), BUILDIN_DEF2(rodex_sendmail2, "rodex_sendmail_acc2", "isss?????????????????????????????????????????"), + BUILDIN_DEF(airship_respond, "i"), BUILDIN_DEF(_,"s"), BUILDIN_DEF2(_, "_$", "s"), @@ -25094,6 +25116,14 @@ void script_hardcoded_constants(void) script->set_constant("MST_AROUND4", MST_AROUND4, false, false); script->set_constant("MST_AROUND", MST_AROUND , false, false); + script->constdb_comment("private airship responds"); + script->set_constant("P_AIRSHIP_NONE", P_AIRSHIP_NONE, false, false); + script->set_constant("P_AIRSHIP_RETRY", P_AIRSHIP_RETRY, false, false); + script->set_constant("P_AIRSHIP_INVALID_START_MAP", P_AIRSHIP_INVALID_START_MAP, false, false); + script->set_constant("P_AIRSHIP_INVALID_END_MAP", P_AIRSHIP_INVALID_END_MAP, false, false); + script->set_constant("P_AIRSHIP_ITEM_NOT_ENOUGH", P_AIRSHIP_ITEM_NOT_ENOUGH, false, false); + script->set_constant("P_AIRSHIP_ITEM_INVALID", P_AIRSHIP_ITEM_INVALID, false, false); + script->constdb_comment("Renewal"); #ifdef RENEWAL script->set_constant("RENEWAL", 1, false, false); diff --git a/src/map/script.h b/src/map/script.h index ede786481..0eaf5c539 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -337,7 +337,9 @@ enum { MF_NOTOMB, MF_NOCASHSHOP, MF_NOAUTOLOOT, - MF_NOVIEWID + MF_NOVIEWID, + MF_PAIRSHIP_STARTABLE, + MF_PAIRSHIP_ENDABLE }; enum navigation_service { |