From aa18fb0c2d60716a5784cb4a15f527e91e0503ab Mon Sep 17 00:00:00 2001 From: Aleos Date: Sat, 2 Oct 2021 16:36:07 -0400 Subject: [PATCH] Adds MF_NOCASHSHOP (#6279) * Fixes #5903. * Adds a new mapflag to disable the Cash Shop on specified maps. Thanks to @cahya1992's suggestion! --- conf/msg_conf/map_msg.conf | 2 +- conf/msg_conf/map_msg_chn.conf | 2 +- conf/msg_conf/map_msg_frn.conf | 2 +- conf/msg_conf/map_msg_grm.conf | 2 ++ conf/msg_conf/map_msg_idn.conf | 2 +- conf/msg_conf/map_msg_por.conf | 2 +- conf/msg_conf/map_msg_rus.conf | 2 +- conf/msg_conf/map_msg_spn.conf | 2 +- conf/msg_conf/map_msg_tha.conf | 2 +- src/map/clif.cpp | 5 +++++ src/map/map.hpp | 1 + src/map/script_constants.hpp | 1 + 12 files changed, 17 insertions(+), 8 deletions(-) diff --git a/conf/msg_conf/map_msg.conf b/conf/msg_conf/map_msg.conf index b9e0ce730c..4b10ebfba4 100644 --- a/conf/msg_conf/map_msg.conf +++ b/conf/msg_conf/map_msg.conf @@ -464,7 +464,7 @@ // Homunculus messages 450: You already have a homunculus -//451 free +451: Cash Shop is disabled on this map. // Message System 460: Please enter a valid language (usage: @langtype ). diff --git a/conf/msg_conf/map_msg_chn.conf b/conf/msg_conf/map_msg_chn.conf index e1fc85d262..2b55b049c1 100644 --- a/conf/msg_conf/map_msg_chn.conf +++ b/conf/msg_conf/map_msg_chn.conf @@ -441,7 +441,7 @@ // Homunculus messages 450: 你已經擁有一個人工生命體了 -//451 free +451: Cash Shop is disabled on this map. // Message System 460: 請輸入合法的語言 (usage: @langtype ). diff --git a/conf/msg_conf/map_msg_frn.conf b/conf/msg_conf/map_msg_frn.conf index 3f428a6985..5a4148e21f 100644 --- a/conf/msg_conf/map_msg_frn.conf +++ b/conf/msg_conf/map_msg_frn.conf @@ -449,7 +449,7 @@ // Homunculus messages 450: Vous possdez dj un homunculus -//451 free +451: Cash Shop is disabled on this map. // Message System 460: Entrez une langue (usage: @langtype ). diff --git a/conf/msg_conf/map_msg_grm.conf b/conf/msg_conf/map_msg_grm.conf index 5def0b53a7..a4ba0ae3ab 100644 --- a/conf/msg_conf/map_msg_grm.conf +++ b/conf/msg_conf/map_msg_grm.conf @@ -407,6 +407,8 @@ // Homunculus messages 450: Du hast bereitz ein Homunculus +451: Cash Shop is disabled on this map. + // Messages of others (Nicht für GM commands) // ---------------------------------------- diff --git a/conf/msg_conf/map_msg_idn.conf b/conf/msg_conf/map_msg_idn.conf index 8d8395873e..01bbf48e28 100644 --- a/conf/msg_conf/map_msg_idn.conf +++ b/conf/msg_conf/map_msg_idn.conf @@ -459,7 +459,7 @@ // Pesan-pesan untuk Homunculus 450: Kamu sudah memiliki homunculus -//451 free +451: Cash Shop is disabled on this map. // Sistem Pesan 460: Harap masukkan tipe bahasa yang valid. (Penggunaan: @langtype ). diff --git a/conf/msg_conf/map_msg_por.conf b/conf/msg_conf/map_msg_por.conf index 4adc9c165a..f747198032 100644 --- a/conf/msg_conf/map_msg_por.conf +++ b/conf/msg_conf/map_msg_por.conf @@ -468,7 +468,7 @@ // Mensagens de homunculus 450: Voc j possui um homunculus -//451 free +451: Cash Shop is disabled on this map. // Sistema de Mensagens 460: Digite um idioma vlido (uso: @langtype ). diff --git a/conf/msg_conf/map_msg_rus.conf b/conf/msg_conf/map_msg_rus.conf index 7f0d1e01b8..e048a5488d 100644 --- a/conf/msg_conf/map_msg_rus.conf +++ b/conf/msg_conf/map_msg_rus.conf @@ -449,7 +449,7 @@ // @makehomun 450: -//451 free +451: Cash Shop is disabled on this map. // @langtype 460: (: @langtype <>). diff --git a/conf/msg_conf/map_msg_spn.conf b/conf/msg_conf/map_msg_spn.conf index 901df9f63d..53f63f029a 100644 --- a/conf/msg_conf/map_msg_spn.conf +++ b/conf/msg_conf/map_msg_spn.conf @@ -458,7 +458,7 @@ // Mensajes de homnculos 450: Ya tienes un homnculo. -//451 free +451: Cash Shop is disabled on this map. // Sistema de mensajera 460: Introduce un idioma vlido (instrucciones: @langtype ) diff --git a/conf/msg_conf/map_msg_tha.conf b/conf/msg_conf/map_msg_tha.conf index 64bf940eac..09a3894df0 100644 --- a/conf/msg_conf/map_msg_tha.conf +++ b/conf/msg_conf/map_msg_tha.conf @@ -447,7 +447,7 @@ // Homunculus messages 450: س Homunculus . -//451 free +451: Cash Shop is disabled on this map. // Message System 460: ô͡ҷͧ (Ը: @langtype <>). diff --git a/src/map/clif.cpp b/src/map/clif.cpp index 1407f317fc..d812c12c16 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -16752,6 +16752,11 @@ void clif_parse_cashshop_open_request( int fd, struct map_session_data* sd ){ tab = p->tab; #endif + if (map_getmapflag(sd->bl.m, MF_NOCASHSHOP)) { + clif_displaymessage(fd, msg_txt(sd, 451)); // Cash Shop is disabled on this map. + return; + } + sd->state.cashshop_open = true; sd->npc_shopid = -1; // Set npc_shopid when using cash shop from "cash shop" button [Aelys|Susu] bugreport:96 diff --git a/src/map/map.hpp b/src/map/map.hpp index 80165ab20c..62ce03dac2 100644 --- a/src/map/map.hpp +++ b/src/map/map.hpp @@ -609,6 +609,7 @@ enum e_mapflag : int16 { MF_PRIVATEAIRSHIP_SOURCE, MF_PRIVATEAIRSHIP_DESTINATION, MF_SKILL_DURATION, + MF_NOCASHSHOP, MF_MAX }; diff --git a/src/map/script_constants.hpp b/src/map/script_constants.hpp index c60b5ec27b..9e80a7ee4c 100644 --- a/src/map/script_constants.hpp +++ b/src/map/script_constants.hpp @@ -478,6 +478,7 @@ export_constant(MF_PRIVATEAIRSHIP_SOURCE); export_constant(MF_PRIVATEAIRSHIP_DESTINATION); export_constant(MF_SKILL_DURATION); + export_constant(MF_NOCASHSHOP); /* setcell types */ export_constant(CELL_WALKABLE);