summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog.txt5
-rw-r--r--conf-tmpl/mapflag/type/indoors.txt53
-rw-r--r--db/Changelog.txt1
-rw-r--r--db/const.txt1
-rw-r--r--src/map/atcommand.c2
-rw-r--r--src/map/clif.c9
-rw-r--r--src/map/map.h3
-rw-r--r--src/map/npc.c5
-rw-r--r--src/map/pc.c7
-rw-r--r--src/map/script.c9
-rw-r--r--src/map/skill.c4
11 files changed, 91 insertions, 8 deletions
diff --git a/Changelog.txt b/Changelog.txt
index bd0fc7404..1ca473251 100644
--- a/Changelog.txt
+++ b/Changelog.txt
@@ -6,6 +6,11 @@ Date Added
at first it'll delete common items then, if necessary, delete the rest items but upgraded/named/with cards. [Lupus]
* Added checks for Perfect hiding [celest]
* Modified level 0 skill check to allow auto blitz beat and steal. [celest]
+ * Added constant BaseJob. [celest] Usage: For example, instead of
+ If (Class==12) || (Class==4012) || (Class==4035)
+ you can use
+ If (BaseJob==12) or If (BaseJob==Job_Assassin)
+ * Added 'indoors' mapflag : When in-doors players will not be affected by Night [celest]
11/15
* Added a Database Changelog.txt File, use it for any changes inside the db folder. [shadowlady]
diff --git a/conf-tmpl/mapflag/type/indoors.txt b/conf-tmpl/mapflag/type/indoors.txt
new file mode 100644
index 000000000..c7312cd9b
--- /dev/null
+++ b/conf-tmpl/mapflag/type/indoors.txt
@@ -0,0 +1,53 @@
+//===== eAthena Script =======================================
+//= Map Flags for Indoors Buildings or Dungeons
+//===== By: ==================================================
+//= eAthena Dev Team
+//===== Current Version: =====================================
+//= 1.0
+//===== Compatible With: =====================================
+//=
+//===== Description: =========================================
+//= 'indoors' turns off all night effects.
+//============================================================
+
+alberta_in.gat mapflag indoors
+izlude_in.gat mapflag indoors
+gef_tower.gat mapflag indoors
+geffen_in.gat mapflag indoors
+moc_castle.gat mapflag indoors
+morocc_in.gat mapflag indoors
+payon_in01.gat mapflag indoors
+payon_in02.gat mapflag indoors
+payon_in03.gat mapflag indoors
+prt_in.gat mapflag indoors
+prt_castle.gat mapflag indoors
+prt_church.gat mapflag indoors
+in_orcs01.gat mapflag indoors
+aldeba_in.gat mapflag indoors
+monk_in.gat mapflag indoors
+prt_are_in.gat mapflag indoors
+arena_room.gat mapflag indoors
+sword_1-1.gat mapflag indoors
+sword_2-1.gat mapflag indoors
+sword_3-1.gat mapflag indoors
+xmas_in.gat mapflag indoors
+cmd_in01.gat mapflag indoors
+cmd_in02.gat mapflag indoors
+yuno_in01.gat mapflag indoors
+yuno_in03.gat mapflag indoors
+yuno_in04.gat mapflag indoors
+yuno_in05.gat mapflag indoors
+alde_alche.gat mapflag indoors
+sec_in01.gat mapflag indoors
+ama_in01.gat mapflag indoors
+ama_in02.gat mapflag indoors
+gon_in.gat mapflag indoors
+um_in.gat mapflag indoors
+nif_in.gat mapflag indoors
+lou_in01.gat mapflag indoors
+lou_in02.gat mapflag indoors
+jawaii_in.gat mapflag indoors
+que_god01.gat mapflag indoors
+que_god02.gat mapflag indoors
+ayo_in01.gat mapflag indoors
+ayo_in02.gat mapflag indoors \ No newline at end of file
diff --git a/db/Changelog.txt b/db/Changelog.txt
index 995a3625b..3cd36dec8 100644
--- a/db/Changelog.txt
+++ b/db/Changelog.txt
@@ -5,6 +5,7 @@
Ayothala items == Added but no effect ( all are "ect" itens)
Skill databases == celest working on them i believe.
+11/16 - Added BaseJob to const.txt [celest]
11/15
- Minor fix on wedding skills, to use 15% of SP/HP . [shadowlady]
diff --git a/db/const.txt b/db/const.txt
index acad5e67a..a99198c72 100644
--- a/db/const.txt
+++ b/db/const.txt
@@ -99,6 +99,7 @@ Hp 5 1
MaxHp 6 1
Sp 7 1
MaxSp 8 1
+BaseJob 119 1
bMaxHP 6
bMaxSP 8
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)