Jelajahi Sumber

Adds MF_NOCASHSHOP (#6279)

* Fixes #5903.
* Adds a new mapflag to disable the Cash Shop on specified maps.
Thanks to @cahya1992's suggestion!
Aleos 3 tahun lalu
induk
melakukan
aa18fb0c2d

+ 1 - 1
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 <language>).

+ 1 - 1
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 <language>).

+ 1 - 1
conf/msg_conf/map_msg_frn.conf

@@ -449,7 +449,7 @@
 // Homunculus messages
 450: Vous possédez déjà un homunculus
 
-//451 free
+451: Cash Shop is disabled on this map.
 
 // Message System
 460: Entrez une langue (usage: @langtype <langue>).

+ 2 - 0
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)
 // ----------------------------------------
 

+ 1 - 1
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 <bahasa>).

+ 1 - 1
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 válido (uso: @langtype <idioma>).

+ 1 - 1
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 <язык>).

+ 1 - 1
conf/msg_conf/map_msg_spn.conf

@@ -458,7 +458,7 @@
 // Mensajes de homúnculos
 450: Ya tienes un homúnculo.
 
-//451 free
+451: Cash Shop is disabled on this map.
 
 // Sistema de mensajería
 460: Introduce un idioma válido (instrucciones: @langtype <idioma>)

+ 1 - 1
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 <ŔŇÉŇ>).

+ 5 - 0
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
 

+ 1 - 0
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
 };
 

+ 1 - 0
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);