Skip to content

Commit

Permalink
Fixed MO_TRIPLEATTACK animation being suddenly resetted
Browse files Browse the repository at this point in the history
Fixed MO_TRIPLEATTACK not applying delay
Fixed Monk combo's delay formula
  • Loading branch information
csnv committed Oct 28, 2023
1 parent b097666 commit d3a88ad
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/map/battle.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
9 changes: 7 additions & 2 deletions src/map/skill.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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] )
Expand Down

0 comments on commit d3a88ad

Please sign in to comment.