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

Fix MO_TRIPLEATTACK animation, one cell movement, PA_SACRIFICE delay #3259

Merged
merged 6 commits into from
Dec 29, 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
1 change: 0 additions & 1 deletion db/pre-re/skill_db.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11208,7 +11208,6 @@ skill_db: (
IgnoreFlee: true
}
InterruptCast: true
AfterCastActDelay: 2000
CoolDown: 0
Requirements: {
SPCost: 100
Expand Down
3 changes: 2 additions & 1 deletion src/map/clif.c
Original file line number Diff line number Diff line change
Expand Up @@ -11835,7 +11835,8 @@ static void clif_parse_WalkToXY(int fd, struct map_session_data *sd)

// Do not allow one cell move commands if the target cell is not free
if (battle_config.official_cell_stack_limit > 0
&& check_distance_blxy(&sd->bl, x, y, 1) && map->count_oncell(sd->bl.m, x, y, BL_CHAR | BL_NPC, 1))
&& check_distance_blxy(&sd->bl, x, y, 1)
&& map->count_oncell(sd->bl.m, x, y, BL_CHAR | BL_NPC, 0x1 | 0x2) >= battle_config.official_cell_stack_limit)
return;

pc->delinvincibletimer(sd);
Expand Down
42 changes: 22 additions & 20 deletions src/map/skill.c
Original file line number Diff line number Diff line change
Expand Up @@ -3364,9 +3364,10 @@ static int skill_attack(int attack_type, struct block_list *src, struct block_li
flag|=SD_ANIMATION;
}

if(sd) {
if (sd != NULL) {
int combo = 0; //Used to signal if this skill can be combo'ed later on.
struct status_change_entry *sce;

if ((sce = sd->sc.data[SC_COMBOATTACK])) {//End combo state after skill is invoked. [Skotlex]
switch (skill_id) {
case TK_TURNKICK:
Expand All @@ -3390,31 +3391,32 @@ static int skill_attack(int attack_type, struct block_list *src, struct block_li
}
switch(skill_id) {
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);
// Send adelay (which matches aspd) to correctly display animation when there's no next combo
if (pc->checkskill(sd, MO_CHAINCOMBO) > 0 || pc->checkskill(sd, SR_DRAGONCOMBO) > 0) {
combo = 1;
sd->ud.canact_tick = max(tick + skill->delay_fix(src, MO_TRIPLEATTACK, skill_lv), sd->ud.canact_tick);
} else
clif->combo_delay(src, status_get_adelay(src));
break;
case MO_CHAINCOMBO:
if(pc->checkskill(sd, MO_COMBOFINISH) > 0 && sd->spiritball > 0)
combo=1;
if (pc->checkskill(sd, MO_COMBOFINISH) > 0 && sd->spiritball > 0)
combo = 1;
break;
case MO_COMBOFINISH:
if (sd->status.party_id>0) //bonus from SG_FRIEND [Komurka]
if (sd->status.party_id > 0) //bonus from SG_FRIEND [Komurka]
party->skill_check(sd, sd->status.party_id, MO_COMBOFINISH, skill_lv);

if (pc->checkskill(sd, CH_TIGERFIST) > 0 && sd->spiritball > 0)
combo=1;
/* Fall through */
combo = 1;
FALLTHROUGH
case CH_TIGERFIST:
if (!combo && pc->checkskill(sd, CH_CHAINCRUSH) > 0 && sd->spiritball > 1)
combo=1;
/* Fall through */
combo = 1;
FALLTHROUGH
case CH_CHAINCRUSH:
if (!combo && pc->checkskill(sd, MO_EXTREMITYFIST) > 0 && sd->spiritball > 0 && sd->sc.data[SC_EXPLOSIONSPIRITS])
combo=1;
combo = 1;
break;
case AC_DOUBLE:
// AC_DOUBLE can start the combo with other monster types, but the
Expand Down Expand Up @@ -3442,15 +3444,15 @@ static int skill_attack(int attack_type, struct block_list *src, struct block_li
sd->ud.attackabletime = sd->canuseitem_tick = sd->ud.canact_tick;
break;
case TK_DODGE:
if( pc->checkskill(sd, TK_JUMPKICK) > 0 )
if (pc->checkskill(sd, TK_JUMPKICK) > 0)
combo = 1;
break;
case SR_DRAGONCOMBO:
if( pc->checkskill(sd, SR_FALLENEMPIRE) > 0 )
if (pc->checkskill(sd, SR_FALLENEMPIRE) > 0)
combo = 1;
break;
case SR_FALLENEMPIRE:
if( pc->checkskill(sd, SR_TIGERCANNON) > 0 || pc->checkskill(sd, SR_GATEOFHELL) > 0 )
if (pc->checkskill(sd, SR_TIGERCANNON) > 0 || pc->checkskill(sd, SR_GATEOFHELL) > 0)
combo = 1;
break;
case SJ_PROMINENCEKICK:
Expand All @@ -3462,8 +3464,8 @@ static int skill_attack(int attack_type, struct block_list *src, struct block_li
break;
} //Switch End
if (combo) { //Possible to chain
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);
combo = (int)max(status_get_amotion(src), DIFF_TICK(sd->ud.canact_tick, tick)) + 300 * battle_config.combo_delay_rate / 100;
sc_start2(NULL, src, SC_COMBOATTACK, 100, skill_id, 0, combo, skill_id);
clif->combo_delay(src, combo);
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/map/status.c
Original file line number Diff line number Diff line change
Expand Up @@ -8066,9 +8066,8 @@ static int status_change_start_sub(struct block_list *src, struct block_list *bl
//val4: TK: Combo time
struct unit_data *ud = unit->bl2ud(bl);
if( ud && (!val3 || val3 == 2) ) {
total_tick += 300 * battle_config.combo_delay_rate/100;
ud->attackabletime = timer->gettick()+total_tick;
if( !val3 )
ud->attackabletime = timer->gettick() + total_tick;
if (!val3)
unit->set_walkdelay(bl, timer->gettick(), total_tick, 1);
}
val3 = 0;
Expand Down
11 changes: 6 additions & 5 deletions src/map/unit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1431,18 +1431,19 @@ static int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill
sc = NULL; //Unneeded

//temp: used to signal combo-skills right now.
if (sc && sc->data[SC_COMBOATTACK]
if (sc != NULL
&& skill->is_combo(skill_id)
&& sc->data[SC_COMBOATTACK] != NULL
&& (sc->data[SC_COMBOATTACK]->val1 == skill_id
|| ( sd?skill->check_condition_castbegin(sd,skill_id,skill_lv):0 )
|| (sd != NULL && skill->check_condition_castbegin(sd, skill_id, skill_lv))
)
) {
if (sc->data[SC_COMBOATTACK]->val2)
target_id = sc->data[SC_COMBOATTACK]->val2;
else if( skill->get_inf(skill_id) != 1 ) // Only non-targetable skills should use auto target
else if (src->id == target_id || ud->target > 0)
target_id = ud->target;

if( skill->get_inf(skill_id)&INF_SELF_SKILL && skill->get_nk(skill_id)&NK_NO_DAMAGE )// exploit fix
if (skill->get_inf(skill_id)&INF_SELF_SKILL && skill->get_nk(skill_id)&NK_NO_DAMAGE)// exploit fix
target_id = src->id;
temp = 1;
} else if ( target_id == src->id &&
Expand Down Expand Up @@ -2469,7 +2470,7 @@ static int unit_attack_timer_sub(struct block_list *src, int tid, int64 tick)
return 1;
}

ud->attackabletime = tick + sstatus->adelay;
ud->attackabletime = max(tick + sstatus->adelay, ud->attackabletime);
// You can't move if you can't attack neither.
if (src->type&battle_config.attack_walk_delay)
unit->set_walkdelay(src, tick, sstatus->amotion, 1);
Expand Down
Loading