summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/atcommand.c6
-rw-r--r--src/map/clif.c14
-rw-r--r--src/map/map.c10
-rw-r--r--src/map/map.h1
-rw-r--r--src/map/npc.c2
-rw-r--r--src/map/script.c3
-rw-r--r--src/map/script.h3
7 files changed, 34 insertions, 5 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 7d4008faf..c815967c2 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -7333,7 +7333,7 @@ ACMD(mapflag) {
CHECKFLAG(nojobexp); CHECKFLAG(nomobloot); CHECKFLAG(nomvploot); CHECKFLAG(nightenabled);
CHECKFLAG(nodrop); CHECKFLAG(novending); CHECKFLAG(loadevent);
CHECKFLAG(nochat); CHECKFLAG(partylock); CHECKFLAG(guildlock); CHECKFLAG(src4instance);
- CHECKFLAG(notomb);
+ CHECKFLAG(notomb); CHECKFLAG(nocashshop);
clif->message(sd->fd," ");
clif->message(sd->fd,msg_txt(1312)); // Usage: "@mapflag monster_noteleport 1" (0=Off | 1=On)
clif->message(sd->fd,msg_txt(1313)); // Type "@mapflag available" to list the available mapflags.
@@ -7370,7 +7370,7 @@ ACMD(mapflag) {
SETFLAG(nojobexp); SETFLAG(nomobloot); SETFLAG(nomvploot); SETFLAG(nightenabled);
SETFLAG(nodrop); SETFLAG(novending); SETFLAG(loadevent);
SETFLAG(nochat); SETFLAG(partylock); SETFLAG(guildlock); SETFLAG(src4instance);
- SETFLAG(notomb);
+ SETFLAG(notomb); SETFLAG(nocashshop);
clif->message(sd->fd,msg_txt(1314)); // Invalid flag name or flag.
clif->message(sd->fd,msg_txt(1312)); // Usage: "@mapflag monster_noteleport 1" (0=Off | 1=On)
@@ -7382,7 +7382,7 @@ ACMD(mapflag) {
clif->message(sd->fd,"nozenypenalty, notrade, noskill, nowarp, nowarpto, noicewall, snow, clouds, clouds2,");
clif->message(sd->fd,"fog, fireworks, sakura, leaves, nobaseexp, nojobexp, nomobloot,");
clif->message(sd->fd,"nomvploot, nightenabled, nodrop, novending, loadevent, nochat, partylock,");
- clif->message(sd->fd,"guildlock, src4instance, notomb");
+ clif->message(sd->fd,"guildlock, src4instance, notomb, nocashshop");
#undef CHECKFLAG
#undef SETFLAG
diff --git a/src/map/clif.c b/src/map/clif.c
index e47bd2bf4..decdfc2ce 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -9783,7 +9783,8 @@ void clif_parse_WalkToXY(int fd, struct map_session_data *sd)
RFIFOPOS(fd, packet_db[RFIFOW(fd,0)].pos[0], &x, &y, NULL);
//Set last idle time... [Skotlex]
- sd->idletime = last_tick;
+ if( battle_config.idletime_criteria & BCIDLE_WALK )
+ sd->idletime = last_tick;
unit->walktoxy(&sd->bl, x, y, 4);
}
@@ -17402,6 +17403,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 +17445,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));
diff --git a/src/map/script.c b/src/map/script.c
index c1281bf59..efc3e0264 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -10201,6 +10201,7 @@ BUILDIN(getmapflag)
case MF_BATTLEGROUND: script_pushint(st,map->list[m].flag.battleground); break;
case MF_RESET: script_pushint(st,map->list[m].flag.reset); break;
case MF_NOTOMB: script_pushint(st,map->list[m].flag.notomb); break;
+ case MF_NOCASHSHOP: script_pushint(st,map->list[m].flag.nocashshop); break;
}
}
@@ -10317,6 +10318,7 @@ BUILDIN(setmapflag) {
case MF_BATTLEGROUND: map->list[m].flag.battleground = (val <= 0 || val > 2) ? 1 : val; break;
case MF_RESET: map->list[m].flag.reset = 1; break;
case MF_NOTOMB: map->list[m].flag.notomb = 1; break;
+ case MF_NOCASHSHOP: map->list[m].flag.nocashshop = 1; break;
}
}
@@ -10402,6 +10404,7 @@ BUILDIN(removemapflag) {
case MF_BATTLEGROUND: map->list[m].flag.battleground = 0; break;
case MF_RESET: map->list[m].flag.reset = 0; break;
case MF_NOTOMB: map->list[m].flag.notomb = 0; break;
+ case MF_NOCASHSHOP: map->list[m].flag.nocashshop = 0; break;
}
}
diff --git a/src/map/script.h b/src/map/script.h
index c00086ef9..400916af8 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -287,7 +287,8 @@ enum {
MF_PVP_NOCALCRANK, //50
MF_BATTLEGROUND,
MF_RESET,
- MF_NOTOMB
+ MF_NOTOMB,
+ MF_NOCASHSHOP
};
/**