Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed MO_TRIPLEATTACK animation being suddenly reset #3240

Merged
merged 1 commit into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = (int)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