Added a mapflag to block BANK (#7773)

This commit is contained in:
Pokye 2023-05-22 13:23:46 -03:00 committed by GitHub
parent ccd7e5c14a
commit 9907721a69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 30 additions and 1 deletions

View File

@ -930,7 +930,10 @@
// @reloadbarterdb
830: Barter database has been reloaded.
//831-899 free
// NoBank Mapflag
831: You cannot use the Bank on this map.
//832-899 free
//------------------------------------
// More atcommands message

View File

@ -288,6 +288,12 @@ Disable the ability to capture pets on a map.
---------------------------------------
*nobank
Disable Bank on a map.
---------------------------------------
=====================
| 2. Battle-related |
=====================

View File

@ -4602,6 +4602,8 @@ ACMD_FUNC(mapinfo) {
strcat(atcmd_output, " NoTomb |");
if (map_getmapflag(m_id, MF_NOCOSTUME))
strcat(atcmd_output, " NoCostume |");
if (map_getmapflag(m_id, MF_NOBANK))
strcat(atcmd_output, " NoBank |");
clif_displaymessage(fd, atcmd_output);
switch (list) {

View File

@ -7487,6 +7487,10 @@ void clif_parse_BankOpen(int fd, map_session_data* sd) {
clif_messagecolor(&sd->bl,color_table[COLOR_RED],msg_txt(sd,1496),false,SELF); //Banking is disabled
return;
}
if( map_getmapflag( sd->bl.m, MF_NOBANK ) ){
clif_displaymessage( sd->fd, msg_txt( sd, 831 ) ); // You cannot use the Bank on this map.
return;
}
else {
struct s_packet_db* info = &packet_db[RFIFOW(fd,0)];
int aid = RFIFOL(fd,info->pos[0]); //unused should we check vs fd ?
@ -7558,6 +7562,10 @@ void clif_parse_BankCheck(int fd, map_session_data* sd) {
clif_messagecolor(&sd->bl,color_table[COLOR_RED],msg_txt(sd,1496),false,SELF); //Banking is disabled
return;
}
if( map_getmapflag( sd->bl.m, MF_NOBANK ) ){
clif_displaymessage( sd->fd, msg_txt( sd, 831 ) ); // You cannot use the Bank on this map.
return;
}
else {
struct s_packet_db* info = &packet_db[RFIFOW(fd,0)];
int aid = RFIFOL(fd,info->pos[0]); //unused should we check vs fd ?
@ -7594,6 +7602,10 @@ void clif_parse_BankDeposit(int fd, map_session_data* sd) {
clif_messagecolor(&sd->bl,color_table[COLOR_RED],msg_txt(sd,1496),false,SELF); //Banking is disabled
return;
}
if( map_getmapflag( sd->bl.m, MF_NOBANK ) ){
clif_displaymessage( sd->fd, msg_txt( sd, 831 ) ); // You cannot use the Bank on this map.
return;
}
else {
struct s_packet_db* info = &packet_db[RFIFOW(fd,0)];
int aid = RFIFOL(fd,info->pos[0]); //unused should we check vs fd ?
@ -7633,6 +7645,10 @@ void clif_parse_BankWithdraw(int fd, map_session_data* sd) {
clif_messagecolor(&sd->bl,color_table[COLOR_RED],msg_txt(sd,1496),false,SELF); //Banking is disabled
return;
}
if( map_getmapflag( sd->bl.m, MF_NOBANK ) ){
clif_displaymessage( sd->fd, msg_txt( sd, 831 ) ); // You cannot use the Bank on this map.
return;
}
else {
struct s_packet_db* info = &packet_db[RFIFOW(fd,0)];
int aid = RFIFOL(fd,info->pos[0]); //unused should we check vs fd ?

View File

@ -669,6 +669,7 @@ enum e_mapflag : int16 {
MF_NOPETCAPTURE,
MF_NOBUYINGSTORE,
MF_NODYNAMICNPC,
MF_NOBANK,
MF_MAX
};

View File

@ -537,6 +537,7 @@
export_constant(MF_NOPETCAPTURE);
export_constant(MF_NOBUYINGSTORE);
export_constant(MF_NODYNAMICNPC);
export_constant(MF_NOBANK);
/* setcell types */
export_constant(CELL_WALKABLE);