浏览代码

Adjusts behavior of skill fixed cast time (#5136)

* Fixes #1061.
* Skills no longer assign 20% of the variable cast to fixed cast.
* Inverts the skill database behavior so that 0 actually means 0 cast time and -1 represents 20% behavior for backwards support.
* Updates documentation.
Thanks to @Tokeiburu!
Aleos 4 年之前
父节点
当前提交
10703304da
共有 4 个文件被更改,包括 64 次插入139 次删除
  1. 2 2
      conf/battle/skill.conf
  2. 50 125
      db/re/skill_db.yml
  3. 1 1
      doc/skill_db.txt
  4. 11 11
      src/map/skill.cpp

+ 2 - 2
conf/battle/skill.conf

@@ -341,9 +341,9 @@ arrow_shower_knockback: yes
 stormgust_knockback: yes
 
 // For RENEWAL_CAST (Note 2)
-// By default skill that has '0' value for Fixed Casting Time will use 20% of cast time
+// By default skill that has '-1' value for Fixed Casting Time will use 20% of cast time
 // as Fixed Casting Time, and the rest (80%) as Variable Casting Time.
-// Put it 0 to disable default Fixed Casting Time (just like -1 in the skill_db.yml).
+// Put it 0 to disable default Fixed Casting Time (just like 0 in the skill_db.yml).
 default_fixed_castrate: 20
 
 // On official servers, skills that hit all targets on a path (e.g. Focused Arrow Strike and First Wind) first

文件差异内容过多而无法显示
+ 50 - 125
db/re/skill_db.yml


+ 1 - 1
doc/skill_db.txt

@@ -442,7 +442,7 @@ Sequence Map Form
 
 ---------------------------------------
 
-FixedCastTime: Time that is fixed during cast of the skill in milliseconds.
+FixedCastTime: Time that is fixed during cast of the skill in milliseconds. A value of -1 will use 20% of CastTime as FixedCastTime. See battle_config::default_fixed_castrate to adjust the rate.
 
 Can be defined in scalar form or sequence map form:
 Scalar Form

+ 11 - 11
src/map/skill.cpp

@@ -17275,11 +17275,6 @@ int skill_castfix_sc(struct block_list *bl, double time, uint8 flag)
  */
 int skill_vfcastfix(struct block_list *bl, double time, uint16 skill_id, uint16 skill_lv)
 {
-	struct status_change *sc = status_get_sc(bl);
-	struct map_session_data *sd = BL_CAST(BL_PC,bl);
-	int fixed = skill_get_fixed_cast(skill_id, skill_lv), fixcast_r = 0, varcast_r = 0, reduce_cast_rate = 0;
-	uint8 flag = skill_get_castnodex(skill_id);
-
 	nullpo_ret(bl);
 
 	if (time < 0)
@@ -17288,13 +17283,18 @@ int skill_vfcastfix(struct block_list *bl, double time, uint16 skill_id, uint16
 	if (bl->type == BL_MOB || bl->type == BL_NPC)
 		return (int)time;
 
-	if (fixed < 0) // no fixed cast time
-		fixed = 0;
-	else if (fixed == 0) {
-		fixed = (int)time * battle_config.default_fixed_castrate / 100; // fixed time
-		time = time * (100 - battle_config.default_fixed_castrate) / 100; // variable time
+	status_change *sc = status_get_sc(bl);
+	map_session_data *sd = BL_CAST(BL_PC, bl);
+	int fixed = skill_get_fixed_cast(skill_id, skill_lv), fixcast_r = 0, varcast_r = 0, reduce_cast_rate = 0;
+	uint8 flag = skill_get_castnodex(skill_id);
+
+	if (fixed < 0) {
+		if (battle_config.default_fixed_castrate > 0) {
+			fixed = (int)time * battle_config.default_fixed_castrate / 100; // fixed time
+			time = time * (100 - battle_config.default_fixed_castrate) / 100; // variable time
+		} else
+			fixed = 0;
 	}
-	// Else, use fixed cast time from database (when default_fixed_castrate is set to 0)
 
 	// Additive Variable Cast bonus adjustments by items
 	if (sd && !(flag&4)) {

部分文件因为文件数量过多而无法显示