فهرست منبع

Added HP_SP_TABLES option in core.h which allows you to bypass the job HP and SP tables - http://rathena.org/board/tracker/issue-8015-hp-sp-bugs-exp/
The long range attack rate bonus now effects damage, rather than ATK - http://rathena.org/board/tracker/issue-8109-long-range-attack-rate/
Fixed SP cost on Invisibility and removed time limit - http://rathena.org/board/tracker/issue-8102-invisibility/
Fixed some warnings that popped up recently - http://rathena.org/board/tracker/issue-8145-warning-in-skillc
Some small changes for the double casted skills - http://rathena.org/board/tracker/issue-7382-aoe-bug-sometimes-it-hits-more-than-one/
Cleaned up some Masquerade Unlucky unused code

Akinari1087 11 سال پیش
والد
کامیت
af108b20c4
8فایلهای تغییر یافته به همراه41 افزوده شده و 25 حذف شده
  1. 1 1
      db/re/skill_cast_db.txt
  2. 2 2
      db/re/skill_unit_db.txt
  3. 3 0
      src/config/core.h
  4. 1 1
      src/map/atcommand.c
  5. 3 3
      src/map/battle.c
  6. 24 3
      src/map/pc.c
  7. 3 1
      src/map/skill.c
  8. 4 14
      src/map/status.c

+ 1 - 1
db/re/skill_cast_db.txt

@@ -1353,7 +1353,7 @@
 //-- SC_BODYPAINT
 2289,0,1000,0,5000:7000:9000:11000:13000,0,2000,-1
 //-- SC_INVISIBILITY
-2290,1000,1000,0,20000,0,20000:30000:40000:50000:60000,-1
+2290,1000,1000,0,0,0,20000:30000:40000:50000:60000,-1
 //-- SC_DEADLYINFECT
 2291,0,1000,0,10000:15000:20000:25000:30000,0,2000,-1
 //-- SC_ENERVATION

+ 2 - 2
db/re/skill_unit_db.txt

@@ -157,8 +157,8 @@
 
 3006,0x86,    ,  0, 2,1000,enemy, 0x018	//KO_BAKURETSU
 3008,0x86,    ,  0, 2,1000,enemy, 0x018	//KO_MUCHANAGE
-3009,0x86,    ,  0, 3, 500,enemy, 0x018	//KO_HUUMARANKA
-3020,0xf8,    ,  0, 3,1000,all,   0x018	//KO_ZENKAI
+3009,0x86,    ,  0, 3,1000,enemy, 0x018	//KO_HUUMARANKA
+3020,0xf8,    ,  0, 3, 100,all,   0x018	//KO_ZENKAI
 3010,0xfc,    ,  0, 1,1000,enemy, 0x020	//KO_MAKIBISHI
 5006,0x101,   ,  0, 3,2000,enemy, 0x018	//NC_MAGMA_ERUPTION
 5010,0xfe,    ,  0, 2,  -1,enemy, 0x000	//SC_ESCAPE

+ 3 - 0
src/config/core.h

@@ -69,6 +69,9 @@
 #define MAX_SKILL_DAMAGE_RATE 100000
 #endif
 
+/// Comment to disable the job HP/SP tables and use formulas instead
+#define HP_SP_TABLES
+
 /**
  * No settings past this point
  **/

+ 1 - 1
src/map/atcommand.c

@@ -5955,7 +5955,7 @@ ACMD_FUNC(autolootitem)
 ACMD_FUNC(autoloottype)
 {
 	uint8 i = 0, action = 3; // 1=add, 2=remove, 3=help+list (default), 4=reset
-	enum item_types type;
+	enum item_types type = -1;
 	int ITEM_NONE = 0, ITEM_MAX = 1533;
 
 	nullpo_retr(-1, sd);

+ 3 - 3
src/map/battle.c

@@ -637,9 +637,6 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li
 					}
 				}
 
-				if( flag&BF_LONG )
-					cardfix = cardfix * ( 100 + sd->bonus.long_attack_atk_rate ) / 100;
-
 				if( (left&1) && cardfix_ != 1000 )
 					bccDAMAGE_RATE(cardfix_)
 				else if( cardfix != 1000 )
@@ -4529,6 +4526,9 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src, struct bl
 		if (sd) { //monsters, homuns and pets have their damage computed directly
 			wd.damage = wd.statusAtk + wd.weaponAtk + wd.equipAtk + wd.masteryAtk;
 			wd.damage2 = wd.statusAtk2 + wd.weaponAtk2 + wd.equipAtk2 + wd.masteryAtk2;
+
+			if( wd.flag&BF_LONG ) // Long damage rate addition doesn't use weapon + equip attack, what about others?
+				wd.damage = wd.damage * ( 100 + sd->bonus.long_attack_atk_rate ) / 100;
 		}
 #else
 		// final attack bonuses that aren't affected by cards

+ 24 - 3
src/map/pc.c

@@ -9464,7 +9464,7 @@ void pc_overheat(struct map_session_data *sd, int val) {
  */
 bool pc_isautolooting(struct map_session_data *sd, int nameid)
 {
-	uint8 i;
+	uint8 i = 0;
 	bool j = false;
 
 	if (!sd->state.autolooting && !sd->state.autolootingtype)
@@ -9776,6 +9776,9 @@ static bool pc_readdb_levelpenalty(char* fields[], int columns, int current)
 static bool pc_readdb_job1(char* fields[], int columns, int current){
 	int idx, class_;
 	unsigned int i;
+#ifndef HP_SP_TABLES
+	unsigned int k = 0, val;
+#endif
 
 	class_ = atoi(fields[0]);
 
@@ -9798,6 +9801,20 @@ static bool pc_readdb_job1(char* fields[], int columns, int current){
 	{
 		job_info[idx].aspd_base[i] = atoi(fields[i+5]);
 	}
+
+#ifndef HP_SP_TABLES
+	for(i = 0; i <= MAX_LEVEL; i++) {
+		k += (job_info[idx].hp_factor*(i+1) + 50) / 100;
+		val = 35 + ((i+1)*job_info[idx].hp_multiplicator)/100 + k;
+		val = min(INT_MAX,val);
+		job_info[idx].hp_table[i] = val;
+	}
+	for(i = 0; i <= MAX_LEVEL; i++) {
+		val = 10 + ((i+1)*job_info[idx].sp_factor)/100;
+		val = min(INT_MAX,val);
+		job_info[idx].sp_table[i] = val;
+	}
+#endif
 	return true;
 }
 
@@ -9824,6 +9841,7 @@ static bool pc_readdb_job2(char* fields[], int columns, int current)
 
 //Reading job_maxhpsp.txt line
 //startlvl,maxlvl,class,type,values...
+#ifdef HP_SP_TABLES
 static bool pc_readdb_job_maxhpsp(char* fields[], int columns, int current)
 {
 	int idx, i,j, maxlvl, startlvl;
@@ -9849,6 +9867,7 @@ static bool pc_readdb_job_maxhpsp(char* fields[], int columns, int current)
 		ShowError("pc_readdb_job_maxhpsp: Invalid type %d specified.\n", type);
 		return false;
 	}
+
 	job_count = pc_split_atoi(fields[2],jobs,':',CLASS_COUNT);
 	if (job_count < 1)
 		return false;
@@ -9860,8 +9879,7 @@ static bool pc_readdb_job_maxhpsp(char* fields[], int columns, int current)
 		}
 		idx = pc_class2idx(job_id);
 		if(type == 0) {	//hp type
-			unsigned int k = 0;
-			unsigned int val, oldval=0;
+			unsigned int k = 0, val, oldval=0;
 			short level = 0;
 			for(i = 0; i <= MAX_LEVEL; i++) {
 				val = 0;
@@ -9908,6 +9926,7 @@ static bool pc_readdb_job_maxhpsp(char* fields[], int columns, int current)
 	}
 	return true;
 }
+#endif
 
 //Reading job_exp.txt line
 //Max Level,Class list,Type (0 - Base Exp; 1 - Job Exp),Exp/lvl...
@@ -10057,7 +10076,9 @@ int pc_readdb(void)
 	sv_readdb(db_path, "pre-re/job_db1.txt",',',5+MAX_WEAPON_TYPE,5+MAX_WEAPON_TYPE,CLASS_COUNT,&pc_readdb_job1);
 #endif
 	sv_readdb(db_path, "job_db2.txt",',',1,1+MAX_LEVEL,CLASS_COUNT,&pc_readdb_job2);
+#ifdef HP_SP_TABLES
 	sv_readdb(db_path, DBPATH"job_maxhpsp_db.txt", ',', 4, 4+MAX_LEVEL, CLASS_COUNT*2, &pc_readdb_job_maxhpsp);
+#endif
 	sv_readdb(db_path, DBPATH"job_exp.txt",',',4,1000+3,CLASS_COUNT*2,&pc_readdb_job_exp); //support till 1000lvl
 	
 	//Checking if all class have their data

+ 3 - 1
src/map/skill.c

@@ -18524,7 +18524,9 @@ static bool skill_parse_row_copyabledb(char* split[], int column, int current) {
 
 /// Reads additional range [Cydh]
 static bool skill_parse_row_nonearnpcrangedb(char* split[], int column, int current) {
-	uint16 skill_id = skill_name2id(split[0]), idx;
+	int idx;
+	uint16 skill_id = skill_name2id(split[0]);
+
 	if ((idx = skill_get_index(skill_id)) < 0) { // invalid skill id
 		ShowError("skill_parse_row_nonearnpcrangedb: Invalid skill '%s'\n",split[0]);
 		return false;

+ 4 - 14
src/map/status.c

@@ -6378,8 +6378,6 @@ int status_get_sc_def(struct block_list *src, struct block_list *bl, enum sc_typ
 		sc = NULL;
 	switch (type) {
 		case SC_POISON:
-			if( sc && sc->data[SC__UNLUCKY] )
-				return tick;
 		case SC_DPOISON:
 			sc_def = status->vit*100;
 			sc_def2 = status->luk*10 + status_get_lv(bl)*10 - status_get_lv(src)*10;
@@ -6394,8 +6392,6 @@ int status_get_sc_def(struct block_list *src, struct block_list *bl, enum sc_typ
 			}
 			break;
 		case SC_STUN:
-			if( sc && sc->data[SC__UNLUCKY] )
-				return tick;
 		case SC_SILENCE:
 		case SC_BLEEDING:
 			sc_def = status->vit*100;
@@ -6427,8 +6423,6 @@ int status_get_sc_def(struct block_list *src, struct block_list *bl, enum sc_typ
 			tick_def2 = status->luk*10;
 			break;
 		case SC_BLIND:
-			if( sc && sc->data[SC__UNLUCKY] )
-				return tick;
 			sc_def = (status->vit + status->int_)*50;
 			sc_def2 = status->luk*10 + status_get_lv(bl)*10 - status_get_lv(src)*10;
 			tick_def2 = status->luk*10;
@@ -10666,14 +10660,10 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data)
 		break;
 
 	case SC__INVISIBILITY:
-		if( --(sce->val4) >= 0 )
-		{
-			if( !status_charge(bl, 0, (status->sp * 6 - sce->val1) / 100) )// 6% - skill_lv.
-				break;
-			sc_timer_next(1000 + tick, status_change_timer, bl->id, data);
-			return 0;
-		}
-		break;
+		if( !status_charge(bl, 0, (12 - 2 * sce->val1) * status->max_sp / 100) )// 6% - skill_lv.
+			break;
+		sc_timer_next(1000 + tick, status_change_timer, bl->id, data);
+		return 0;
 
 	case SC_STRIKING:
 		if( --(sce->val4) >= 0 )