Updated Kyomu effect and Magic Reflection effect
* All skills have a chance of failing at 25%, not just Shield Reflect and Reflect Damage. * Kaite, Magic Mirror, and Shield Spell - Defense are not nullified by Kyomu. * Item-based and Magic Mirror reflection damage Boss monsters, Kaite does not.
This commit is contained in:
parent
6f74f67da0
commit
1b9a0b5af5
@ -6735,7 +6735,7 @@ int64 battle_calc_return_damage(struct block_list* bl, struct block_list *src, i
|
||||
#endif
|
||||
}
|
||||
|
||||
if( sc && sc->data[SC_KYOMU] ) // Nullify reflecting ability
|
||||
if (sc && sc->data[SC_KYOMU] && (!ssc || !ssc->data[SC_SHIELDSPELL_DEF])) // Nullify reflecting ability except for Shield Spell - Def
|
||||
rdamage = 0;
|
||||
|
||||
return cap_value(min(rdamage,max_damage),INT_MIN,INT_MAX);
|
||||
|
@ -2576,11 +2576,14 @@ static int skill_magic_reflect(struct block_list* src, struct block_list* bl, in
|
||||
struct status_change *sc = status_get_sc(bl);
|
||||
struct map_session_data* sd = BL_CAST(BL_PC, bl);
|
||||
|
||||
if( sc && sc->data[SC_KYOMU] ) // Nullify reflecting ability
|
||||
return 0;
|
||||
if (!sc || !sc->data[SC_KYOMU]) { // Kyomu doesn't reflect
|
||||
// Item-based reflection - Bypasses Boss check
|
||||
if (sd && sd->bonus.magic_damage_return && type && rnd()%100 < sd->bonus.magic_damage_return)
|
||||
return 1;
|
||||
}
|
||||
|
||||
// item-based reflection
|
||||
if( sd && sd->bonus.magic_damage_return && type && rnd()%100 < sd->bonus.magic_damage_return )
|
||||
// Magic Mirror reflection - Bypasses Boss check
|
||||
if (sc && sc->data[SC_MAGICMIRROR] && rnd()%100 < sc->data[SC_MAGICMIRROR]->val2)
|
||||
return 1;
|
||||
|
||||
if( is_boss(src) )
|
||||
@ -2590,11 +2593,10 @@ static int skill_magic_reflect(struct block_list* src, struct block_list* bl, in
|
||||
if( !sc || sc->count == 0 )
|
||||
return 0;
|
||||
|
||||
if( sc->data[SC_MAGICMIRROR] && rnd()%100 < sc->data[SC_MAGICMIRROR]->val2 )
|
||||
return 1;
|
||||
|
||||
if( sc->data[SC_KAITE] && (src->type == BL_PC || status_get_lv(src) <= 80) )
|
||||
{// Kaite only works against non-players if they are low-level.
|
||||
// Kaite reflection - Does not bypass Boss check
|
||||
if( sc->data[SC_KAITE] && (src->type == BL_PC || status_get_lv(src) <= 80) ) {
|
||||
// Kaite only works against non-players if they are low-level.
|
||||
// Kyomu doesn't disable Kaite, but the "skill fail chance" part of Kyomu applies to it.
|
||||
clif_specialeffect(bl, 438, AREA);
|
||||
if( --sc->data[SC_KAITE]->val2 <= 0 )
|
||||
status_change_end(bl, SC_KAITE, INVALID_TIMER);
|
||||
@ -15117,13 +15119,6 @@ bool skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_i
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case LG_REFLECTDAMAGE:
|
||||
case CR_REFLECTSHIELD:
|
||||
if( sc && sc->data[SC_KYOMU] && rnd()%100 < 30){
|
||||
clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case KO_JYUMONJIKIRI:
|
||||
if (sd->weapontype1 && (sd->weapontype2 || sd->status.shield))
|
||||
return true;
|
||||
|
@ -1939,7 +1939,10 @@ bool status_check_skilluse(struct block_list *src, struct block_list *target, ui
|
||||
if (sc->data[SC_ALL_RIDING])
|
||||
return false; //You can't use skills while in the new mounts (The client doesn't let you, this is to make cheat-safe)
|
||||
|
||||
if (flag == 1 && sc->data[SC_ASH] && rnd()%2 && !(status->mode&MD_BOSS)) {
|
||||
if (flag == 1 && !(status->mode&MD_BOSS) && ( // Applies to after cast completion only and doesn't apply to Boss monsters.
|
||||
(sc->data[SC_ASH] && rnd()%2) || // Volcanic Ash has a 50% chance of causing skills to fail.
|
||||
(sc->data[SC_KYOMU] && rnd()%100 < 25) // Kyomu has a 25% chance of causing skills fail.
|
||||
)) {
|
||||
if (src->type == BL_PC)
|
||||
clif_skill_fail((TBL_PC*)src,skill_id,USESKILL_FAIL_LEVEL,0);
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user