Skip to content

Commit

Permalink
Remove fixed target for combo skills
Browse files Browse the repository at this point in the history
  • Loading branch information
csnv committed Dec 18, 2023
1 parent 80270e1 commit 2517f07
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
28 changes: 15 additions & 13 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 Down Expand Up @@ -3399,22 +3400,23 @@ static int skill_attack(int attack_type, struct block_list *src, struct block_li
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 @@ -3463,7 +3465,7 @@ static int skill_attack(int attack_type, struct block_list *src, struct block_li
} //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);
sc_start2(NULL, src, SC_COMBOATTACK, 100, skill_id, 0, combo, skill_id);
clif->combo_delay(src, combo);
}
}
Expand Down
9 changes: 5 additions & 4 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

0 comments on commit 2517f07

Please sign in to comment.