From d3a88ad35d2de83d370dedb2482d64f942ede9ba Mon Sep 17 00:00:00 2001 From: csnv Date: Sat, 28 Oct 2023 05:12:24 +0200 Subject: [PATCH] Fixed MO_TRIPLEATTACK animation being suddenly resetted Fixed MO_TRIPLEATTACK not applying delay Fixed Monk combo's delay formula --- src/map/battle.c | 6 +++--- src/map/skill.c | 9 +++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/map/battle.c b/src/map/battle.c index cdf3dee4938..e836d292883 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -6582,11 +6582,11 @@ static enum damage_lv battle_weapon_attack(struct block_list *src, struct block_ if(sd && (skillv = pc->checkskill(sd,MO_TRIPLEATTACK)) > 0) { int triple_rate= 30 - skillv; //Base Rate if (sc && sc->data[SC_SKILLRATE_UP] && sc->data[SC_SKILLRATE_UP]->val1 == MO_TRIPLEATTACK) { - triple_rate+= triple_rate*(sc->data[SC_SKILLRATE_UP]->val2)/100; + triple_rate += triple_rate * (sc->data[SC_SKILLRATE_UP]->val2) /100; status_change_end(src, SC_SKILLRATE_UP, INVALID_TIMER); } - if (rnd()%100 < triple_rate) { - if( skill->attack(BF_WEAPON,src,src,target,MO_TRIPLEATTACK,skillv,tick,0) ) + if (rnd() % 100 < triple_rate) { + if (skill->attack(BF_WEAPON, src, src, target, MO_TRIPLEATTACK, skillv, tick, 0)) return ATK_DEF; return ATK_MISS; } diff --git a/src/map/skill.c b/src/map/skill.c index 83f362ef1fa..286b8c59075 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -3392,6 +3392,11 @@ static int skill_attack(int attack_type, struct block_list *src, struct block_li case MO_TRIPLEATTACK: if (pc->checkskill(sd, MO_CHAINCOMBO) > 0 || pc->checkskill(sd, SR_DRAGONCOMBO) > 0) combo=1; + // Contrary to other MO combos, triple doesn't get delayed through skill_castend_id + // A little delay (amotion) is required for the animation to display properly + // even if next combo isn't possible + int delay = combo ? skill->delay_fix(src, MO_TRIPLEATTACK, skill_lv) : status_get_amotion(src); + sd->ud.canact_tick = max(tick + delay, sd->ud.canact_tick); break; case MO_CHAINCOMBO: if(pc->checkskill(sd, MO_COMBOFINISH) > 0 && sd->spiritball > 0) @@ -3457,7 +3462,7 @@ static int skill_attack(int attack_type, struct block_list *src, struct block_li break; } //Switch End if (combo) { //Possible to chain - combo = max(status_get_amotion(src), DIFF_TICK32(sd->ud.canact_tick, tick)); + combo = max(status_get_amotion(src), DIFF_TICK(sd->ud.canact_tick, tick)); sc_start2(NULL, src, SC_COMBOATTACK, 100, skill_id, bl->id, combo, skill_id); clif->combo_delay(src, combo); } @@ -17395,7 +17400,7 @@ static int skill_delay_fix(struct block_list *bl, uint16 skill_id, uint16 skill_ case SR_DRAGONCOMBO: case SR_FALLENEMPIRE: case SJ_PROMINENCEKICK: - time -= 4*status_get_agi(bl) - 2*status_get_dex(bl); + time -= (4 * status_get_agi(bl) + 2 * status_get_dex(bl)); break; case HP_BASILICA: if( sc && !sc->data[SC_BASILICA] )