Skip to content

Commit

Permalink
Added a mapflag to block BANK (#7773)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pokye committed May 22, 2023
1 parent ccd7e5c commit 9907721
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 1 deletion.
5 changes: 4 additions & 1 deletion conf/msg_conf/map_msg.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions doc/mapflags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,12 @@ Disable the ability to capture pets on a map.

---------------------------------------

*nobank

Disable Bank on a map.

---------------------------------------

=====================
| 2. Battle-related |
=====================
Expand Down
2 changes: 2 additions & 0 deletions src/map/atcommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
16 changes: 16 additions & 0 deletions src/map/clif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?
Expand Down Expand Up @@ -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 ?
Expand Down Expand Up @@ -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 ?
Expand Down Expand Up @@ -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 ?
Expand Down
1 change: 1 addition & 0 deletions src/map/map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,7 @@ enum e_mapflag : int16 {
MF_NOPETCAPTURE,
MF_NOBUYINGSTORE,
MF_NODYNAMICNPC,
MF_NOBANK,
MF_MAX
};

Expand Down
1 change: 1 addition & 0 deletions src/map/script_constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9907721

Please sign in to comment.