From 59b77fd300765595d6fbf5333cc541f40c2f0cae Mon Sep 17 00:00:00 2001 From: Lupus Date: Thu, 25 May 2006 16:26:17 +0000 Subject: added noVending mapflag. Tested. + custom Market Place NPC, fixed MSG strings git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6755 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/atcommand.c | 12 +++++++----- src/map/map.h | 1 + src/map/npc.c | 3 +++ src/map/script.c | 8 +++++++- src/map/vending.c | 4 ++++ 5 files changed, 22 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 0fd9a0d7f..c5a9baf50 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -5759,18 +5759,20 @@ int atcommand_mapinfo( strcat(atcmd_output, "NoBranch | "); if (map[m_id].flag.notrade) strcat(atcmd_output, "NoTrade | "); + if (map[m_id].flag.novending) + strcat(atcmd_output, "NoVending | "); if (map[m_id].flag.nodrop) strcat(atcmd_output, "NoDrop | "); if (map[m_id].flag.noskill) strcat(atcmd_output, "NoSkill | "); if (map[m_id].flag.noicewall) strcat(atcmd_output, "NoIcewall | "); - if (map[m_id].flag.nocommand) - strcat(atcmd_output, "NoCommand | "); clif_displaymessage(fd, atcmd_output); strcpy(atcmd_output,"Other Flags: "); + if (map[m_id].flag.nocommand) + strcat(atcmd_output, "NoCommand | "); if (map[m_id].flag.nobaseexp) strcat(atcmd_output, "NoBaseEXP | "); if (map[m_id].flag.nojobexp) @@ -10285,14 +10287,14 @@ int atcommand_request( const char* command, const char* message) { if (!message || !*message) { - clif_displaymessage(sd->fd,msg_txt(275)); + clif_displaymessage(sd->fd,msg_txt(277)); return -1; } - sprintf(atcmd_output, msg_txt(276), message); + sprintf(atcmd_output, msg_txt(278), message); intif_wis_message_to_gm(sd->status.name, lowest_gm_level, atcmd_output); clif_disp_onlyself(sd, atcmd_output, strlen(atcmd_output)); - clif_displaymessage(sd->fd,msg_txt(277)); + clif_displaymessage(sd->fd,msg_txt(279)); return 0; } diff --git a/src/map/map.h b/src/map/map.h index 1035d014b..66315cadc 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -1079,6 +1079,7 @@ struct map_data { unsigned restricted : 1; // [Komurka] unsigned nocommand : 1; //Blocks @/# commands for non-gms. [Skotlex] unsigned nodrop : 1; + unsigned novending : 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 0d28b9699..37e47585c 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -2376,6 +2376,9 @@ static int npc_parse_mapflag (char *w1, char *w2, char *w3, char *w4) else if (strcmpi(w3,"notrade")==0) { map[m].flag.notrade=state; } + else if (strcmpi(w3,"novending")==0) { + map[m].flag.novending=state; + } else if (strcmpi(w3,"nodrop")==0) { map[m].flag.nodrop=state; } diff --git a/src/map/script.c b/src/map/script.c index ae509106d..d167f8230 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -6860,7 +6860,7 @@ enum { MF_NOMEMO,MF_NOTELEPORT,MF_NOSAVE,MF_NOBRANCH,MF_NOPENALTY,MF_NOZENYPENA MF_NOWARP,MF_FREE,MF_NOICEWALL,MF_SNOW,MF_FOG,MF_SAKURA,MF_LEAVES,MF_RAIN, MF_INDOORS,MF_NOGO,MF_CLOUDS,MF_CLOUDS2,MF_FIREWORKS,MF_GVG_CASTLE,MF_GVG_DUNGEON,MF_NIGHTENABLED, MF_NOBASEEXP, MF_NOJOBEXP, MF_NOMOBLOOT, MF_NOMVPLOOT, MF_NORETURN, MF_NOWARPTO, MF_NIGHTMAREDROP, - MF_RESTRICTED, MF_NOCOMMAND, MF_NODROP, MF_JEXP, MF_BEXP }; + MF_RESTRICTED, MF_NOCOMMAND, MF_NODROP, MF_JEXP, MF_BEXP, MF_NOVENDING }; int buildin_setmapflagnosave(struct script_state *st) { @@ -7016,6 +7016,9 @@ int buildin_setmapflag(struct script_state *st) case MF_BEXP: map[m].bexp = (!val || atoi(val) < 0) ? 100 : atoi(val); break; + case MF_NOVENDING: + map[m].flag.novending=1; + break; } } @@ -7152,6 +7155,9 @@ int buildin_removemapflag(struct script_state *st) case MF_BEXP: map[m].bexp=100; break; + case MF_NOVENDING: + map[m].flag.novending=0; + break; } } diff --git a/src/map/vending.c b/src/map/vending.c index d47fa8ece..607cdc890 100644 --- a/src/map/vending.c +++ b/src/map/vending.c @@ -205,6 +205,10 @@ void vending_openvending(struct map_session_data *sd,int len,char *message,int f int vending_skill_lvl; nullpo_retv(sd); + if (map[sd->bl.m].flag.novending) { + clif_displaymessage (sd->fd, msg_txt(276)); + return; //Can't vend in novending mapflag maps. + } //check shopname len if(message[0] == '\0') return; -- cgit v1.2.3-60-g2f50