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!
This commit is contained in:
Aleos 2020-11-10 12:51:08 -05:00 committed by GitHub
parent 97bd759fde
commit 10703304da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 69 additions and 353 deletions

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -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

View File

@ -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)) {