diff --git a/conf/messages.conf b/conf/messages.conf index 21e24e9..465a1f1 100644 --- a/conf/messages.conf +++ b/conf/messages.conf @@ -1507,5 +1507,9 @@ 1476: You are already mounting something else +// No Cash Shop +1477: NoCashShop +1478: You can't open a Cash Shop in this map + //Custom translations import: conf/import/msg_conf.txt diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 950961b..4c6f61e 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -3913,6 +3913,8 @@ static void atcommand_raise_sub(struct map_session_data* sd) { strcat(atcmd_output, msg_txt(1083)); // NoTrade | if (map[m_id].flag.novending) strcat(atcmd_output, msg_txt(1084)); // NoVending | + if (map[m_id].flag.nocashshop) + strcat(atcmd_output, msg_txt(1477)); // NoCashShop | if (map[m_id].flag.nodrop) strcat(atcmd_output, msg_txt(1085)); // NoDrop | if (map[m_id].flag.noskill) @@ -7573,9 +7575,9 @@ static int atcommand_mutearea_sub(struct block_list *bl,va_list ap) checkflag(fog); checkflag(fireworks); checkflag(sakura); checkflag(leaves); checkflag(nobaseexp); checkflag(nojobexp); checkflag(nomobloot); checkflag(nomvploot); checkflag(nightenabled); - checkflag(nodrop); checkflag(novending); checkflag(loadevent); + 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. @@ -7612,7 +7614,7 @@ static int atcommand_mutearea_sub(struct block_list *bl,va_list ap) 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) @@ -7624,7 +7626,7 @@ static int atcommand_mutearea_sub(struct block_list *bl,va_list ap) 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/map.h b/src/map/map.h index ec59215..cb58927 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -606,6 +606,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 673c4f7..1c645c8 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -3357,6 +3357,8 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char map[m].flag.reset=state; else if (!strcmpi(w3,"notomb")) map[m].flag.notomb=state; + else if (!strcmpi(w3,"nocashshop")) + map[m].flag.nocashshop=state; else if (!strcmpi(w3,"adjust_unit_duration")) { int skill_id, k; char skill_name[MAP_ZONE_MAPFLAG_LENGTH], modifier[MAP_ZONE_MAPFLAG_LENGTH]; diff --git a/src/map/pc.c b/src/map/pc.c index 84cfe7e..62ec82a 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -4837,6 +4837,11 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y clif->message (sd->fd, msg_txt(276)); // "You can't open a shop on this map" vending->close(sd); } + // Make sure opening a Cash Shop is allowed here + if (sd->state.cashshop && map[m].flag.nocashshop) { + clif->message (sd->fd, msg_txt(1478)); // "You can't open a Cash Shop in this map" + cashshop->close(sd); + } if( hChSys.local && map[sd->bl.m].channel && idb_exists(map[sd->bl.m].channel->users, sd->status.char_id) ) { clif->chsys_left(map[sd->bl.m].channel,sd);