From ca27c6d89de4f74ddac372fcfbd37fbf9da40fc9 Mon Sep 17 00:00:00 2001 From: Aleos Date: Fri, 21 Aug 2020 13:10:55 -0400 Subject: [PATCH] Parry delay should be based on adelay (#5325) * Removes hard coded 1 second delay. * The delay should scale based on the player's ASPD. Thanks to @mrjnumber1 and @Daegaladh! --- db/pre-re/skill_db.yml | 1 - db/re/skill_db.yml | 1 - src/map/battle.cpp | 8 +++++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/db/pre-re/skill_db.yml b/db/pre-re/skill_db.yml index 30cf778478..d72540de50 100644 --- a/db/pre-re/skill_db.yml +++ b/db/pre-re/skill_db.yml @@ -9404,7 +9404,6 @@ Body: Time: 55000 - Level: 10 Time: 60000 - Duration2: 1000 Requires: SpCost: 50 Weapon: diff --git a/db/re/skill_db.yml b/db/re/skill_db.yml index e1d488aa57..ae7aaf315e 100644 --- a/db/re/skill_db.yml +++ b/db/re/skill_db.yml @@ -9711,7 +9711,6 @@ Body: Time: 55000 - Level: 10 Time: 60000 - Duration2: 1000 Requires: SpCost: 50 Weapon: diff --git a/src/map/battle.cpp b/src/map/battle.cpp index 841d1bd9d2..d81ac68b63 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -1283,10 +1283,12 @@ bool battle_status_block_damage(struct block_list *src, struct block_list *targe if ((sce = sc->data[SC_PARRYING]) && flag&BF_WEAPON && skill_id != WS_CARTTERMINATION && rnd() % 100 < sce->val2) { clif_skill_nodamage(target, target, LK_PARRYING, sce->val1, 1); - unit_data *ud = unit_bl2ud(target); + if (skill_id == LK_PARRYING) { + unit_data *ud = unit_bl2ud(target); - if (ud) // Delay the next attack - ud->attackabletime = gettick() + skill_get_time2(LK_PARRYING, sce->val1); + if (ud != nullptr) // Delay the next attack + ud->attackabletime = gettick() + status_get_adelay(target); + } return false; }