summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/map/clif.c11
-rw-r--r--src/map/map.c10
-rw-r--r--src/map/map.h1
-rw-r--r--src/map/npc.c2
4 files changed, 24 insertions, 0 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index e47bd2bf4..4b8baf401 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -17402,6 +17402,12 @@ void __attribute__ ((unused)) clif_parse_dull(int fd,struct map_session_data *sd
return;
}
void clif_parse_CashShopOpen(int fd, struct map_session_data *sd) {
+
+ if( map->list[sd->bl.m].flag.nocashshop ) {
+ clif->colormes(fd,COLOR_RED,msg_txt(1489)); //Cash Shop is disabled in this map
+ return;
+ }
+
WFIFOHEAD(fd, 10);
WFIFOW(fd, 0) = 0x845;
WFIFOL(fd, 2) = sd->cashPoints; //[Ryuuzaki] - switched positions to reflect proper values
@@ -17438,6 +17444,11 @@ void clif_parse_CashShopBuy(int fd, struct map_session_data *sd) {
unsigned short limit = RFIFOW(fd, 4), i, j;
unsigned int kafra_pay = RFIFOL(fd, 6);// [Ryuuzaki] - These are free cash points (strangely #CASH = main cash curreny for us, confusing)
+ if( map->list[sd->bl.m].flag.nocashshop ) {
+ clif->colormes(fd,COLOR_RED,msg_txt(1489)); //Cash Shop is disabled in this map
+ return;
+ }
+
for(i = 0; i < limit; i++) {
int qty = RFIFOL(fd, 14 + ( i * 10 ));
int id = RFIFOL(fd, 10 + ( i * 10 ));
diff --git a/src/map/map.c b/src/map/map.c
index 412a266fc..81bd732df 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -4398,7 +4398,17 @@ bool map_zone_mf_cache(int m, char *flag, char *params) {
map_zone_mf_cache_add(m,rflag);
}
}
+ } else if (!strcmpi(flag,"nocashshop")) {
+ if( state && map->list[m].flag.nocashshop )
+ ;/* nothing to do */
+ else {
+ if( state )
+ map_zone_mf_cache_add(m,"nocashshop\toff");
+ else if( map->list[m].flag.nocashshop )
+ map_zone_mf_cache_add(m,"nocashshop");
+ }
}
+
return false;
}
void map_zone_apply(int m, struct map_zone_data *zone, const char* start, const char* buffer, const char* filepath) {
diff --git a/src/map/map.h b/src/map/map.h
index 053d7ff2e..6e4878dfd 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -643,6 +643,7 @@ struct map_data {
unsigned chsysnolocalaj : 1;
unsigned noknockback : 1;
unsigned notomb : 1;
+ unsigned nocashshop : 1;
} flag;
struct point save;
struct npc_data *npc[MAX_NPC_PER_MAP];
diff --git a/src/map/npc.c b/src/map/npc.c
index 79e976bb3..e4416c19f 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -3444,6 +3444,8 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char
map->list[m].long_damage_rate = (state) ? atoi(w4) : 100;
} else if ( !strcmpi(w3,"src4instance") ) {
map->list[m].flag.src4instance = (state) ? 1 : 0;
+ } else if ( !strcmpi(w3,"nocashshop") ) {
+ map->list[m].flag.nocashshop = (state) ? 1 : 0;
} else
ShowError("npc_parse_mapflag: unrecognized mapflag '%s' (file '%s', line '%d').\n", w3, filepath, strline(buffer,start-buffer));