瀏覽代碼

Added the missing Fixed Casting Time support.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@15780 54d463be-8e91-2dee-dedb-b68131a5f0ec
shennetsind 13 年之前
父節點
當前提交
4ce86275af
共有 4 個文件被更改,包括 375 次插入362 次删除
  1. 354 353
      db/re/skill_cast_db.txt
  2. 5 0
      src/map/config/Data/Const.h
  3. 13 9
      src/map/skill.c
  4. 3 0
      src/map/skill.h

File diff suppressed because it is too large
+ 354 - 353
db/re/skill_cast_db.txt


+ 5 - 0
src/map/config/Data/Const.h

@@ -13,6 +13,11 @@
  * "Constants"
  **/
 #if RECASTING
+
+	#if REMODE == 0
+		#error RECASTING requires REMODE enabled
+	#endif
+
 	#define CONST_CASTRATE_SCALE RECASTING_VMIN
 	/**
 	 * Cast Rate Formula: (DEX x 2)+INT

+ 13 - 9
src/map/skill.c

@@ -217,7 +217,9 @@ int	skill_get_unit_bl_target( int id )    { skill_get (skill_db[id].unit_target&
 int	skill_get_unit_flag( int id )         { skill_get (skill_db[id].unit_flag, id, 1); }
 int	skill_get_unit_layout_type( int id ,int lv ){ skill_get (skill_db[id].unit_layout_type[lv-1], id, lv); }
 int	skill_get_cooldown( int id ,int lv )     { skill_get (skill_db[id].cooldown[lv-1], id, lv); }
-
+#if RECASTING
+int	skill_get_fixed_cast( int id ,int lv ){ skill_get (skill_db[id].fixed_cast[lv-1], id, lv); }
+#endif
 int skill_tree_get_max(int id, int b_class)
 {
 	int i;
@@ -12132,15 +12134,14 @@ int skill_castfix (struct block_list *bl, int skill_id, int skill_lv)
 /*==========================================
  * Does cast-time reductions based on sc data.
  *------------------------------------------*/
-int skill_castfix_sc (struct block_list *bl, int time, int skill_id, int skill_lv)
-{
+int skill_castfix_sc (struct block_list *bl, int time, int skill_id, int skill_lv) {
 	struct status_change *sc = status_get_sc(bl);
 #if RECASTING
-	int fixed = skill_get_cast(skill_id, skill_lv);
-	if( fixed > 1 )
-		fixed = fixed * 20 / 100;
-	else
-		fixed = 0;
+	int fixed = skill_get_fixed_cast(skill_id, skill_lv);
+	if( !fixed ) {
+		fixed = skill_get_cast(skill_id, skill_lv);
+		fixed = ( fixed > 1 ? ( fixed * 20 / 100 ) : 0 );
+	}
 #endif
 	if (sc && sc->count) {
 		if (sc->data[SC_SLOWCAST])
@@ -15552,6 +15553,9 @@ static bool skill_parse_row_castdb(char* split[], int columns, int current)
 	skill_split_atoi(split[4],skill_db[i].upkeep_time);
 	skill_split_atoi(split[5],skill_db[i].upkeep_time2);
 	skill_split_atoi(split[6],skill_db[i].cooldown);
+#if RECASTING
+	skill_split_atoi(split[7],skill_db[i].fixed_cast);
+#endif
 	return true;
 }
 
@@ -15783,7 +15787,7 @@ static void skill_readdb(void)
 
 	sv_readdb(db_path, DBPATH"skill_db.txt"          , ',',  17, 17, MAX_SKILL_DB, skill_parse_row_skilldb);
 	sv_readdb(db_path, DBPATH"skill_require_db.txt"  , ',',  32, 32, MAX_SKILL_DB, skill_parse_row_requiredb);
-	sv_readdb(db_path, DBPATH"skill_cast_db.txt"     , ',',   7,  7, MAX_SKILL_DB, skill_parse_row_castdb);
+	sv_readdb(db_path, DBPATH"skill_cast_db.txt"     , ',',   7,  8, MAX_SKILL_DB, skill_parse_row_castdb);
 	sv_readdb(db_path, DBPATH"skill_castnodex_db.txt", ',',   2,  3, MAX_SKILL_DB, skill_parse_row_castnodexdb);
 	sv_readdb(db_path, DBPATH"skill_unit_db.txt"     , ',',   8,  8, MAX_SKILL_DB, skill_parse_row_unitdb);
 

+ 3 - 0
src/map/skill.h

@@ -94,6 +94,9 @@ struct s_skill_db {
 	int range[MAX_SKILL_LEVEL],hit,inf,element[MAX_SKILL_LEVEL],nk,splash[MAX_SKILL_LEVEL],max;
 	int num[MAX_SKILL_LEVEL];
 	int cast[MAX_SKILL_LEVEL],walkdelay[MAX_SKILL_LEVEL],delay[MAX_SKILL_LEVEL];
+#if RECASTING
+	int fixed_cast[MAX_SKILL_LEVEL];
+#endif
 	int upkeep_time[MAX_SKILL_LEVEL],upkeep_time2[MAX_SKILL_LEVEL],cooldown[MAX_SKILL_LEVEL];
 	int castcancel,cast_def_rate;
 	int inf2,maxcount[MAX_SKILL_LEVEL],skill_type;

Some files were not shown because too many files changed in this diff