Browse Source

Bug Fixes
* Follow up to 2fe8140 to fix quest_db.txt not being imported anymore. (bugreport:8891)
* Fixed Epiclesis to only run every 3 seconds and added animation display for healing HP and SP. (bugreport:8890)

aleos89 11 years ago
parent
commit
d3d34aa5d2
4 changed files with 72 additions and 64 deletions
  1. 1 1
      db/pre-re/skill_unit_db.txt
  2. 1 1
      db/re/skill_unit_db.txt
  3. 58 53
      src/map/quest.c
  4. 12 9
      src/map/skill.c

+ 1 - 1
db/pre-re/skill_unit_db.txt

@@ -101,7 +101,7 @@
 
 //706,0xfd,    ,  0, 0,1000,all, 0x000	//NPC_VENOMFOG
 
-2044,0xca,    ,  0, 2,1000,all,   0x018	//AB_EPICLESIS
+2044,0xca,    ,  0, 2,3000,all,   0x018	//AB_EPICLESIS
 
 2032,0xe1,    ,  2, 0,1000,enemy, 0x018	//GC_POISONSMOKE
 

+ 1 - 1
db/re/skill_unit_db.txt

@@ -103,7 +103,7 @@
 
 //706,0xfd,    ,  0, 0,1000,all, 0x000	//NPC_VENOMFOG
 
-2044,0xca,    ,  0, 2,1000,all,   0x018	//AB_EPICLESIS
+2044,0xca,    ,  0, 2,3000,all,   0x018	//AB_EPICLESIS
 
 2032,0xe1,    ,  2, 0,1000,enemy, 0x018	//GC_POISONSMOKE
 

+ 58 - 53
src/map/quest.c

@@ -355,72 +355,77 @@ int quest_check(TBL_PC *sd, int quest_id, enum quest_check_type type) {
  * @return Number of loaded quests, or -1 if the file couldn't be read.
  */
 int quest_read_db(void) {
-	//@TODO[Haru]: This duplicates some sv_readdb functionalities, and it would be
-	//nice if it could be replaced by it. The reason why it wasn't is probably
-	//because we need to accept commas (which is also used as delimiter) in the
-	//last field (quest name), and sv_readdb isn't capable of doing so.
-	FILE *fp;
-	char line[1024];
-	int i, count = 0;
-	char *str[20], *p, *np;
-	struct quest_db entry;
-
-	sprintf(line, "%s/quest_db.txt", db_path);
-	if( (fp = fopen(line, "r")) == NULL ) {
-		ShowError("can't read %s\n", line);
-		return -1;
-	}
-
-	while( fgets(line, sizeof(line), fp) ) {
-		if( line[0] == '/' && line[1] == '/' )
-			continue;
-		memset(str, 0, sizeof(str));
-
-		for( i = 0, p = line; i < 8; i++ ) {
-			if( (np = strchr(p, ',')) != NULL ) {
-				str[i] = p;
-				*np = 0;
-				p = np + 1;
-			} else if( str[0] == NULL )
-				break;
-			else {
-				ShowError("quest_read_db: insufficient columns in line %s\n", line);
+	const char* dbsubpath[] = {
+		"",
+		DBIMPORT"/",
+	};
+	int f;
+
+	for (f = 0; f < ARRAYLENGTH(dbsubpath); f++) {
+		FILE *fp;
+		char line[1024];
+		int i, count = 0;
+		char *str[20], *p, *np;
+		char filename[256];
+		struct quest_db entry;
+
+		sprintf(filename, "%s/%s%s", db_path, dbsubpath[f], "quest_db.txt");
+		if( (fp = fopen(filename, "r")) == NULL ) {
+			if (f == 0)
+				ShowError("Can't read %s\n", filename);
+			return -1;
+		}
+		while( fgets(line, sizeof(line), fp) ) {
+			if( line[0] == '/' && line[1] == '/' )
 				continue;
+			memset(str, 0, sizeof(str));
+
+			for( i = 0, p = line; i < 8; i++ ) {
+				if( (np = strchr(p, ',')) != NULL ) {
+					str[i] = p;
+					*np = 0;
+					p = np + 1;
+				} else if( str[0] == NULL )
+					break;
+				else {
+					ShowError("quest_read_db: Insufficient columns in line %s\n", line);
+					continue;
+				}
 			}
-		}
-		if( str[0] == NULL )
-			continue;
+			if( str[0] == NULL )
+				continue;
 
-		memset(&entry, 0, sizeof(entry));
+			memset(&entry, 0, sizeof(entry));
 
-		entry.id = atoi(str[0]);
+			entry.id = atoi(str[0]);
 
-		if( entry.id < 0 || entry.id >= MAX_QUEST_DB ) {
-			ShowError("quest_read_db: Invalid quest ID '%d' in line '%s' (min: 0, max: %d.)\n", entry.id, line, MAX_QUEST_DB);
-			continue;
-		}
+			if( entry.id < 0 || entry.id >= MAX_QUEST_DB ) {
+				ShowError("quest_read_db: Invalid quest ID '%d' in line '%s' (min: 0, max: %d.)\n", entry.id, line, MAX_QUEST_DB);
+				continue;
+			}
 
-		entry.time = atoi(str[1]);
+			entry.time = atoi(str[1]);
 
-		for( i = 0; i < MAX_QUEST_OBJECTIVES; i++ ) {
-			entry.mob[i] = atoi(str[2 * i + 2]);
-			entry.count[i] = atoi(str[2 * i + 3]);
+			for( i = 0; i < MAX_QUEST_OBJECTIVES; i++ ) {
+				entry.mob[i] = atoi(str[2 * i + 2]);
+				entry.count[i] = atoi(str[2 * i + 3]);
 
-			if( !entry.mob[i] || !entry.count[i] )
-				break;
-		}
+				if( !entry.mob[i] || !entry.count[i] )
+					break;
+			}
 
-		entry.num_objectives = i;
+			entry.num_objectives = i;
 
-		if( quest_db_data[entry.id] == NULL )
-			quest_db_data[entry.id] = aMalloc(sizeof(struct quest_db));
+			if( quest_db_data[entry.id] == NULL )
+				quest_db_data[entry.id] = aMalloc(sizeof(struct quest_db));
 
-		memcpy(quest_db_data[entry.id], &entry, sizeof(struct quest_db));
-		count++;
+			memcpy(quest_db_data[entry.id], &entry, sizeof(struct quest_db));
+			count++;
+		}
+		fclose(fp);
+		ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, filename);
 	}
 
-	fclose(fp);
-	ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, "quest_db.txt");
 	return 0;
 }
 

+ 12 - 9
src/map/skill.c

@@ -12871,6 +12871,10 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
 				}
 				hp = tstatus->max_hp * hp / 100;
 				sp = tstatus->max_sp * sp / 100;
+				if (tstatus->hp < tstatus->max_hp)
+					clif_skill_nodamage(&src->bl, bl, AL_HEAL, hp, 1);
+				if (tstatus->sp < tstatus->max_sp)
+					clif_skill_nodamage(&src->bl, bl, MG_SRECOVERY, sp, 1);
 				if (tsc && tsc->data[SC_AKAITSUKI] && hp)
 					hp = ~hp + 1;
 				status_heal(bl, hp, sp, 3);
@@ -17572,7 +17576,7 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid,
 						make_per = 100000; // Star Crumbs are 100% success crafting rate? (made 1000% so it succeeds even after penalties) [Skotlex]
 						break;
 					default: // Enchanted Stones
-						make_per += 1000+i*500; // Enchantedstone Craft bonus: +15/+20/+25/+30/+35
+						make_per += 1000+i*500; // Enchanted stone Craft bonus: +15/+20/+25/+30/+35
 					break;
 				}
 				break;
@@ -17620,7 +17624,7 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid,
 					case ITEMID_COATING_BOTTLE:
 						make_per -= (1+rnd()%100)*10;
 						break;
-					//Common items, recieve no bonus or penalty, listed just because they are commonly produced
+					//Common items, receive no bonus or penalty, listed just because they are commonly produced
 					case ITEMID_BLUE_POTION:
 					case ITEMID_RED_SLIM_POTION:
 					case ITEMID_ANODYNE:
@@ -17668,7 +17672,7 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid,
 				break;
 			    }
 			/**
-			 * Guilotine Cross
+			 * Guillotine Cross
 			 **/
 			case GC_CREATENEWPOISON:
 				make_per = 3000 + 500 * pc_checkskill(sd,GC_RESEARCHNEWPOISON);
@@ -19773,11 +19777,10 @@ static void skill_readdb(void) {
 		char* dbsubpath1 = (char*)aMalloc(n1+1);
 		char* dbsubpath2 = (char*)aMalloc(n2+1);
 
-		if(i==0) {
+		if (i == 0) {
 			safesnprintf(dbsubpath1,n1,"%s%s",db_path,dbsubpath[i]);
 			safesnprintf(dbsubpath2,n2,"%s/%s%s",db_path,DBPATH,dbsubpath[i]);
-		}
-		else {
+		} else {
 			safesnprintf(dbsubpath1,n1,"%s%s",db_path,dbsubpath[i]);
 			safesnprintf(dbsubpath2,n1,"%s%s",db_path,dbsubpath[i]);
 		}
@@ -19792,9 +19795,9 @@ static void skill_readdb(void) {
 		sv_readdb(dbsubpath1, "produce_db.txt"        , ',',   4,  4+2*MAX_PRODUCE_RESOURCE, MAX_SKILL_PRODUCE_DB, skill_parse_row_producedb, i);
 		sv_readdb(dbsubpath1, "create_arrow_db.txt"   , ',', 1+2,  1+2*MAX_ARROW_RESOURCE, MAX_SKILL_ARROW_DB, skill_parse_row_createarrowdb, i);
 		sv_readdb(dbsubpath1, "abra_db.txt"           , ',',   3,  3, MAX_SKILL_ABRA_DB, skill_parse_row_abradb, i);
-		sv_readdb(dbsubpath1, "spellbook_db.txt"      , ',',   3,  3, MAX_SKILL_SPELLBOOK_DB, skill_parse_row_spellbookdb, i); //Warlock
-		sv_readdb(dbsubpath1, "magicmushroom_db.txt"  , ',',   1,  1, MAX_SKILL_MAGICMUSHROOM_DB, skill_parse_row_magicmushroomdb, i); //Guillotine Cross
-		sv_readdb(dbsubpath1, "skill_copyable_db.txt"       , ',',    2,  4, MAX_SKILL_DB, skill_parse_row_copyabledb, i);
+		sv_readdb(dbsubpath1, "spellbook_db.txt"      , ',',   3,  3, MAX_SKILL_SPELLBOOK_DB, skill_parse_row_spellbookdb, i);
+		sv_readdb(dbsubpath1, "magicmushroom_db.txt"  , ',',   1,  1, MAX_SKILL_MAGICMUSHROOM_DB, skill_parse_row_magicmushroomdb, i);
+		sv_readdb(dbsubpath1, "skill_copyable_db.txt"       , ',',   2,  4, MAX_SKILL_DB, skill_parse_row_copyabledb, i);
 		sv_readdb(dbsubpath1, "skill_improvise_db.txt"      , ',',   2,  2, MAX_SKILL_IMPROVISE_DB, skill_parse_row_improvisedb, i);
 		sv_readdb(dbsubpath1, "skill_changematerial_db.txt" , ',',   4,  4+2*5, MAX_SKILL_PRODUCE_DB, skill_parse_row_changematerialdb, i);
 		sv_readdb(dbsubpath1, "skill_nonearnpc_db.txt"      , ',',   2,  3, MAX_SKILL_DB, skill_parse_row_nonearnpcrangedb, i);