diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/map/skill.c | 58 | ||||
-rw-r--r-- | src/map/skill.h | 1 | ||||
-rw-r--r-- | src/map/unit.c | 8 |
3 files changed, 42 insertions, 25 deletions
diff --git a/src/map/skill.c b/src/map/skill.c index 18fe46afe..390900d4f 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -12496,6 +12496,35 @@ int skill_isammotype (struct map_session_data *sd, int skill_id) ); } +/** + * Checks whether a skill can be used in combos or not + **/ +bool skill_is_combo( int skill_id ) +{ + switch( skill_id ) + { + case MO_CHAINCOMBO: + case MO_COMBOFINISH: + case CH_TIGERFIST: + case CH_CHAINCRUSH: + case MO_EXTREMITYFIST: + case TK_TURNKICK: + case TK_STORMKICK: + case TK_DOWNKICK: + case TK_COUNTER: + case TK_JUMPKICK: + case HT_POWER: + case GC_COUNTERSLASH: + case GC_WEAPONCRUSH: + case SR_FALLENEMPIRE: + case SR_DRAGONCOMBO: + case SR_TIGERCANNON: + case SR_GATEOFHELL: + return true; + } + return false; +} + int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id, uint16 skill_lv) { struct status_data *st; struct status_change *sc; @@ -13389,29 +13418,11 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id return 0; } - if( sd->sc.data[SC_COMBOATTACK] ) { - switch( skill_id ) { - case MO_CHAINCOMBO: - case MO_COMBOFINISH: - case CH_TIGERFIST: - case CH_CHAINCRUSH: - case MO_EXTREMITYFIST: - case TK_TURNKICK: - case TK_STORMKICK: - case TK_DOWNKICK: - case TK_COUNTER: - case TK_JUMPKICK: - case HT_POWER: - case GC_COUNTERSLASH: - case GC_WEAPONCRUSH: - case SR_FALLENEMPIRE: - case SR_DRAGONCOMBO: - case SR_TIGERCANNON: - case SR_GATEOFHELL: - break; - default: return 0; - } - } + // There's no need to check if the skill is part of a combo if it's + // already been checked before, see unit_skilluse_id2 [Panikon] + // Note that if this check is readded part of issue:8047 will reapear! + //if( sd->sc.data[SC_COMBOATTACK] && !skill->is_combo(skill_id ) ) + // return 0; return 1; } @@ -18471,6 +18482,7 @@ void skill_defaults(void) { skill->chk = skill_chk; skill->get_casttype = skill_get_casttype; skill->get_casttype2 = skill_get_casttype2; + skill->is_combo = skill_is_combo; skill->name2id = skill_name2id; skill->isammotype = skill_isammotype; skill->castend_id = skill_castend_id; diff --git a/src/map/skill.h b/src/map/skill.h index 13d34d267..dda310bd4 100644 --- a/src/map/skill.h +++ b/src/map/skill.h @@ -1870,6 +1870,7 @@ struct skill_interface { /* whether its CAST_GROUND, CAST_DAMAGE or CAST_NODAMAGE */ int (*get_casttype) (uint16 skill_id); int (*get_casttype2) (uint16 index); + bool (*is_combo) (int skill_id); int (*name2id) (const char* name); int (*isammotype) (struct map_session_data *sd, int skill_id); int (*castend_id) (int tid, int64 tick, int id, intptr_t data); diff --git a/src/map/unit.c b/src/map/unit.c index 5dd63879f..39fff0eab 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -1092,8 +1092,12 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui sc = NULL; //Unneeded //temp: used to signal combo-skills right now. - if (sc && sc->data[SC_COMBOATTACK] && (sc->data[SC_COMBOATTACK]->val1 == skill_id || - (sd?skill->check_condition_castbegin(sd,skill_id,skill_lv):0) )) { + if (sc && sc->data[SC_COMBOATTACK] + && skill->is_combo(skill_id) + && (sc->data[SC_COMBOATTACK]->val1 == skill_id + || ( sd?skill->check_condition_castbegin(sd,skill_id,skill_lv):0 ) + ) + ) { if (sc->data[SC_COMBOATTACK]->val2) target_id = sc->data[SC_COMBOATTACK]->val2; else |