Browse Source

Added 'BaseJob' const and 'indoors' mapflag

git-svn-id: https://svn.code.sf.net/p/rathena/svn/athena@209 54d463be-8e91-2dee-dedb-b68131a5f0ec
celest 20 years ago
parent
commit
1266aeb937
11 changed files with 91 additions and 8 deletions
  1. 5 0
      Changelog.txt
  2. 53 0
      conf-tmpl/mapflag/type/indoors.txt
  3. 1 0
      db/Changelog.txt
  4. 1 0
      db/const.txt
  5. 1 1
      src/map/atcommand.c
  6. 9 0
      src/map/clif.c
  7. 3 0
      src/map/map.h
  8. 4 1
      src/map/npc.c
  9. 5 2
      src/map/pc.c
  10. 7 2
      src/map/script.c
  11. 2 2
      src/map/skill.c

+ 5 - 0
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]

+ 53 - 0
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

+ 1 - 0
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]

+ 1 - 0
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

+ 1 - 1
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.

+ 9 - 0
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)

+ 3 - 0
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

+ 4 - 1
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;
 }

+ 5 - 2
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);

+ 7 - 2
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;
 		}
 	}
 

+ 2 - 2
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)