Adds MF_NOCASHSHOP (#6279)

* Fixes #5903.
* Adds a new mapflag to disable the Cash Shop on specified maps.
Thanks to @cahya1992's suggestion!
This commit is contained in:
Aleos 2021-10-02 16:36:07 -04:00 committed by GitHub
parent d04e03ee88
commit aa18fb0c2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 17 additions and 8 deletions

View File

@ -464,7 +464,7 @@
// Homunculus messages // Homunculus messages
450: You already have a homunculus 450: You already have a homunculus
//451 free 451: Cash Shop is disabled on this map.
// Message System // Message System
460: Please enter a valid language (usage: @langtype <language>). 460: Please enter a valid language (usage: @langtype <language>).

View File

@ -441,7 +441,7 @@
// Homunculus messages // Homunculus messages
450: 你已經擁有一個人工生命體了 450: 你已經擁有一個人工生命體了
//451 free 451: Cash Shop is disabled on this map.
// Message System // Message System
460: 請輸入合法的語言 (usage: @langtype <language>). 460: 請輸入合法的語言 (usage: @langtype <language>).

View File

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

View File

@ -407,6 +407,8 @@
// Homunculus messages // Homunculus messages
450: Du hast bereitz ein Homunculus 450: Du hast bereitz ein Homunculus
451: Cash Shop is disabled on this map.
// Messages of others (Nicht für GM commands) // Messages of others (Nicht für GM commands)
// ---------------------------------------- // ----------------------------------------

View File

@ -459,7 +459,7 @@
// Pesan-pesan untuk Homunculus // Pesan-pesan untuk Homunculus
450: Kamu sudah memiliki homunculus 450: Kamu sudah memiliki homunculus
//451 free 451: Cash Shop is disabled on this map.
// Sistem Pesan // Sistem Pesan
460: Harap masukkan tipe bahasa yang valid. (Penggunaan: @langtype <bahasa>). 460: Harap masukkan tipe bahasa yang valid. (Penggunaan: @langtype <bahasa>).

View File

@ -468,7 +468,7 @@
// Mensagens de homunculus // Mensagens de homunculus
450: Você já possui um homunculus 450: Você já possui um homunculus
//451 free 451: Cash Shop is disabled on this map.
// Sistema de Mensagens // Sistema de Mensagens
460: Digite um idioma válido (uso: @langtype <idioma>). 460: Digite um idioma válido (uso: @langtype <idioma>).

View File

@ -449,7 +449,7 @@
// Сообщения команды @makehomun // Сообщения команды @makehomun
450: У вас уже есть гомункулус 450: У вас уже есть гомункулус
//451 free 451: Cash Shop is disabled on this map.
// @langtype // @langtype
460: Введите существующий язык (Используйте: @langtype <язык>). 460: Введите существующий язык (Используйте: @langtype <язык>).

View File

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

View File

@ -447,7 +447,7 @@
// Homunculus messages // Homunculus messages
450: ¤Ø³ÁÕ Homunculus ÍÂÙèáÅéÇ. 450: ¤Ø³ÁÕ Homunculus ÍÂÙèáÅéÇ.
//451 free 451: Cash Shop is disabled on this map.
// Message System // Message System
460: â»Ã´àÅ×Í¡ÀÒÉÒ·Õèµéͧ¡Òà (ÇÔ¸Õãªé: @langtype <ÀÒÉÒ>). 460: â»Ã´àÅ×Í¡ÀÒÉÒ·Õèµéͧ¡Òà (ÇÔ¸Õãªé: @langtype <ÀÒÉÒ>).

View File

@ -16752,6 +16752,11 @@ void clif_parse_cashshop_open_request( int fd, struct map_session_data* sd ){
tab = p->tab; tab = p->tab;
#endif #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->state.cashshop_open = true;
sd->npc_shopid = -1; // Set npc_shopid when using cash shop from "cash shop" button [Aelys|Susu] bugreport:96 sd->npc_shopid = -1; // Set npc_shopid when using cash shop from "cash shop" button [Aelys|Susu] bugreport:96

View File

@ -609,6 +609,7 @@ enum e_mapflag : int16 {
MF_PRIVATEAIRSHIP_SOURCE, MF_PRIVATEAIRSHIP_SOURCE,
MF_PRIVATEAIRSHIP_DESTINATION, MF_PRIVATEAIRSHIP_DESTINATION,
MF_SKILL_DURATION, MF_SKILL_DURATION,
MF_NOCASHSHOP,
MF_MAX MF_MAX
}; };

View File

@ -478,6 +478,7 @@
export_constant(MF_PRIVATEAIRSHIP_SOURCE); export_constant(MF_PRIVATEAIRSHIP_SOURCE);
export_constant(MF_PRIVATEAIRSHIP_DESTINATION); export_constant(MF_PRIVATEAIRSHIP_DESTINATION);
export_constant(MF_SKILL_DURATION); export_constant(MF_SKILL_DURATION);
export_constant(MF_NOCASHSHOP);
/* setcell types */ /* setcell types */
export_constant(CELL_WALKABLE); export_constant(CELL_WALKABLE);