diff --git a/conf/messages.conf b/conf/messages.conf index 51815c2..315105a 100644 --- a/conf/messages.conf +++ b/conf/messages.conf @@ -1510,5 +1510,9 @@ //src/map/pc.c::pc_isUseitem 1477: Item cannot be open when overweight by 90% +// No Cash Shop +1478: NoCashShop | +1479: You can't open a Cash Shop in this map. + //Custom translations import: conf/import/msg_conf.txt diff --git a/db/const.txt b/db/const.txt index 3b1aa64..2dbe9dc 100644 --- a/db/const.txt +++ b/db/const.txt @@ -363,6 +363,7 @@ mf_monster_noteleport 49 mf_pvp_nocalcrank 50 mf_battleground 51 mf_reset 52 +mf_nocashshop 53 cell_walkable 0 cell_shootable 1 diff --git a/npc/scripts_mapflags.conf b/npc/scripts_mapflags.conf index 2fe92eb..9215be5 100644 --- a/npc/scripts_mapflags.conf +++ b/npc/scripts_mapflags.conf @@ -6,6 +6,7 @@ npc: npc/mapflag/gvg.txt npc: npc/mapflag/jail.txt npc: npc/mapflag/nightmare.txt npc: npc/mapflag/nobranch.txt +npc: npc/mapflag/nocashshop.txt npc: npc/mapflag/noexp.txt npc: npc/mapflag/noicewall.txt npc: npc/mapflag/noloot.txt diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 29bd43d..0c52f20 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(1478)); // 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/clif.c b/src/map/clif.c index 951969a..554be21 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -17215,6 +17215,10 @@ 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[sd->bl.m].flag.nocashshop ) { // quesoph / Mysterious + clif->message(fd,"You can't open a Cash Shop in this map."); + return; + } WFIFOHEAD(fd, 10); WFIFOW(fd, 0) = 0x845; WFIFOL(fd, 2) = sd->cashPoints; //[Ryuuzaki] - switched positions to reflect proper values diff --git a/src/map/map.h b/src/map/map.h index 7826e00..3a70580 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 6aa1919..1ce1b38 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -3368,6 +3368,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 e14f9b8..a14c573 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -4839,12 +4839,17 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y bg_send_dot_remove(sd); if (sd->regen.state.gc) sd->regen.state.gc = 0; - // make sure vending is allowed here + // Let's make sure vending is allowed here if (sd->state.vending && map[m].flag.novending) { 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(1479)); // "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); } diff --git a/src/map/script.c b/src/map/script.c index 04d834f..c7ca564 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -239,7 +239,8 @@ enum { MF_PVP_NOCALCRANK, //50 MF_BATTLEGROUND, MF_RESET, - MF_NOTOMB + MF_NOTOMB, + MF_NOCASHSHOP }; const char* script_op2name(int op) @@ -10384,6 +10385,7 @@ void script_detach_rid(struct script_state* st) { case MF_BATTLEGROUND: script_pushint(st,map[m].flag.battleground); break; case MF_RESET: script_pushint(st,map[m].flag.reset); break; case MF_NOTOMB: script_pushint(st,map[m].flag.notomb); break; + case MF_NOCASHSHOP: script_pushint(st,map[m].flag.nocashshop); break; } } @@ -10501,6 +10503,7 @@ static int script_mapflag_pvp_sub(struct block_list *bl,va_list ap) { case MF_BATTLEGROUND: map[m].flag.battleground = (val <= 0 || val > 2) ? 1 : val; break; case MF_RESET: map[m].flag.reset = 1; break; case MF_NOTOMB: map[m].flag.notomb = 1; break; + case MF_NOCASHSHOP: map[m].flag.nocashshop = 1; break; } } @@ -10587,6 +10590,7 @@ static int script_mapflag_pvp_sub(struct block_list *bl,va_list ap) { case MF_BATTLEGROUND: map[m].flag.battleground = 0; break; case MF_RESET: map[m].flag.reset = 0; break; case MF_NOTOMB: map[m].flag.notomb = 0; break; + case MF_NOCASHSHOP: map[m].flag.nocashshop = 0; break; } }