diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/atcommand.c | 2 | ||||
-rw-r--r-- | src/map/clif.c | 9 | ||||
-rw-r--r-- | src/map/map.h | 3 | ||||
-rw-r--r-- | src/map/npc.c | 5 | ||||
-rw-r--r-- | src/map/pc.c | 7 | ||||
-rw-r--r-- | src/map/script.c | 9 | ||||
-rw-r--r-- | src/map/skill.c | 4 |
7 files changed, 31 insertions, 8 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 606f63f8b..d0a222c12 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -4498,7 +4498,7 @@ int atcommand_night( if (night_flag != 1) { night_flag = 1; // 0=day, 1=night [Yor] for(i = 0; i < fd_max; i++) { - if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth) { + if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth && !map[sd->bl.m].flag.indoors) { pl_sd->opt2 |= STATE_BLIND; clif_changeoption(&pl_sd->bl); clif_displaymessage(pl_sd->fd, msg_table[59]); // Night has fallen. diff --git a/src/map/clif.c b/src/map/clif.c index 624e00d73..0622f6108 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -7298,6 +7298,15 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) if(battle_config.muting_players && sd->status.manner < 0) skill_status_change_start(&sd->bl,SC_NOCHAT,0,0,0,0,0,0); + if (night_flag) { + // night - when changing from indoors to outdoors - celest + if (!map[sd->bl.m].flag.indoors && sd->opt2 != STATE_BLIND) + sd->opt2 |= STATE_BLIND; + // changing from outdoors to indoors + else if (map[sd->bl.m].flag.indoors && sd->opt2 == STATE_BLIND) + sd->opt2 &= ~STATE_BLIND; + } + // option clif_changeoption(&sd->bl); if(sd->sc_data[SC_TRICKDEAD].timer != -1) diff --git a/src/map/map.h b/src/map/map.h index 0cc161fd8..da9ba3777 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -514,6 +514,7 @@ struct map_data { unsigned sakura : 1; // [Valaris] unsigned leaves : 1; // [Valaris] unsigned rain : 1; // [Valaris] + unsigned indoors : 1; // celest } flag; struct point save; struct npc_data *npc[MAX_NPC_PER_MAP]; @@ -552,6 +553,8 @@ enum { SP_UPPER,SP_PARTNER,SP_CART,SP_FAME,SP_UNBREAKABLE, //56-58 SP_CARTINFO=99, // 99 + SP_BASEJOB=119, // 100+19 - celest + // original 1000- SP_ATTACKRANGE=1000, SP_ATKELE,SP_DEFELE, // 1000-1002 SP_CASTRATE, SP_MAXHPRATE, SP_MAXSPRATE, SP_SPRATE, // 1003-1006 diff --git a/src/map/npc.c b/src/map/npc.c index d2fc58205..283b28e66 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -2099,7 +2099,10 @@ static int npc_parse_mapflag(char *w1,char *w2,char *w3,char *w4) } else if (strcmpi(w3,"rain")==0) { // rain [Valaris] map[m].flag.rain=1; - } + } + else if (strcmpi(w3,"indoors")==0) { // celest + map[m].flag.indoors=1; + } return 0; } diff --git a/src/map/pc.c b/src/map/pc.c index cd87455d0..64d10c1ce 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -797,7 +797,7 @@ int pc_authok(int id, int login_id2, time_t connect_until_time, struct mmo_chars //スパノビ用死にカウンターのスクリプト変数からの読み出しとsdへのセット sd->die_counter = pc_readglobalreg(sd,"PC_DIE_COUNTER"); - if (night_flag == 1) { + if (night_flag == 1 && !map[sd->bl.m].flag.indoors) { char tmpstr[1024]; strcpy(tmpstr, msg_txt(500)); // Actually, it's the night... clif_wis_message(sd->fd, wisp_server_name, tmpstr, strlen(tmpstr)+1); @@ -5208,6 +5208,9 @@ int pc_readparam(struct map_session_data *sd,int type) else val= sd->status.class; break; + case SP_BASEJOB: + val= s_class.job; + break; case SP_UPPER: val= s_class.upper; break; @@ -7184,7 +7187,7 @@ int map_night_timer(int tid, unsigned int tick, int id, int data) { // by [yor] strcpy(tmpstr, msg_txt(503)); // The night has fallen... night_flag = 1; // 0=day, 1=night [Yor] for(i = 0; i < fd_max; i++) { - if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth) { + if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth && !map[pl_sd->bl.m].flag.indoors) { pl_sd->opt2 |= STATE_BLIND; clif_changeoption(&pl_sd->bl); clif_wis_message(pl_sd->fd, wisp_server_name, tmpstr, strlen(tmpstr)+1); diff --git a/src/map/script.c b/src/map/script.c index 6e69bb5d0..73d52679c 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -4584,7 +4584,7 @@ int buildin_isloggedin(struct script_state *st) *------------------------------------------ */ enum { MF_NOMEMO,MF_NOTELEPORT,MF_NOSAVE,MF_NOBRANCH,MF_NOPENALTY,MF_NOZENYPENALTY,MF_PVP,MF_PVP_NOPARTY,MF_PVP_NOGUILD,MF_GVG,MF_GVG_NOPARTY,MF_NOTRADE,MF_NOSKILL, MF_NOWARP,MF_NOPVP,MF_NOICEWALL, - MF_SNOW, MF_FOG, MF_SAKURA, MF_LEAVES, MF_RAIN }; + MF_SNOW, MF_FOG, MF_SAKURA, MF_LEAVES, MF_RAIN, MF_INDOORS }; int buildin_setmapflagnosave(struct script_state *st) { @@ -4670,6 +4670,9 @@ int buildin_setmapflag(struct script_state *st) case MF_RAIN: // [Valaris] map[m].flag.rain=1; break; + case MF_INDOORS: // celest + map[m].flag.indoors=1; + break; } } @@ -4740,7 +4743,9 @@ int buildin_removemapflag(struct script_state *st) case MF_RAIN: // [Valaris] map[m].flag.rain=0; break; - + case MF_INDOORS: // celest + map[m].flag.indoors=0; + break; } } diff --git a/src/map/skill.c b/src/map/skill.c index 7eb992ed6..26aee1222 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -8009,7 +8009,7 @@ int skill_status_change_end(struct block_list* bl, int type, int tid) break; } - if (night_flag == 1 && (*opt2 & STATE_BLIND) == 0 && bl->type == BL_PC) { // by [Yor] + if (night_flag == 1 && (*opt2 & STATE_BLIND) == 0 && bl->type == BL_PC && !map[bl->m].flag.indoors) { // by [Yor] *opt2 |= STATE_BLIND; opt_flag = 1; } @@ -9230,7 +9230,7 @@ int skill_status_change_clear(struct block_list *bl, int type) *opt3 = 0; *option &= OPTION_MASK; - if (night_flag == 1 && type == BL_PC) // by [Yor] + if (night_flag == 1 && type == BL_PC && !map[bl->m].flag.indoors) // by [Yor] *opt2 |= STATE_BLIND; if(!type || type&2) |