Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a mapflag to block BANK #7773

Merged
merged 5 commits into from
May 22, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 Bank on this map.
Pokye marked this conversation as resolved.
Show resolved Hide resolved

//832-899 free

//------------------------------------
// More atcommands message
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 Bank on this map.
Pokye marked this conversation as resolved.
Show resolved Hide resolved
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 Bank on this map.
Pokye marked this conversation as resolved.
Show resolved Hide resolved
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 Bank on this map.
Pokye marked this conversation as resolved.
Show resolved Hide resolved
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 Bank on this map.
Pokye marked this conversation as resolved.
Show resolved Hide resolved
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