diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index 8bbeb1ad7..4d56745eb 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -827,6 +827,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite this function is then run again to do the damage portion */ bool LaunchProjectile = false; + bool ProjectileImpact = false; bool ProjectileMiss = false; if (RuleB(Combat, ProjectileDmgOnImpact)){ @@ -843,6 +844,8 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite if (!RangeWeapon && !Ammo && range_id && ammo_id){ + ProjectileImpact = true; + if (weapon_damage == 0) ProjectileMiss = true; //This indicates that MISS was originally calculated. @@ -864,7 +867,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite else if (AmmoItem) SendItemAnimation(other, AmmoItem, SkillArchery); - if (ProjectileMiss || !other->CheckHitChance(this, SkillArchery, MainPrimary, chance_mod)) { + if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillArchery, MainPrimary, chance_mod))) { mlog(COMBAT__RANGED, "Ranged attack missed %s.", other->GetName()); if (LaunchProjectile){ @@ -1380,6 +1383,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite this function is then run again to do the damage portion */ bool LaunchProjectile = false; + bool ProjectileImpact = false; bool ProjectileMiss = false; if (RuleB(Combat, ProjectileDmgOnImpact)){ @@ -1389,6 +1393,8 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite else{ if (!RangeWeapon && range_id){ + ProjectileImpact = true; + if (weapon_damage == 0) ProjectileMiss = true; //This indicates that MISS was originally calculated. @@ -1406,7 +1412,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite else if (AmmoItem) SendItemAnimation(other, AmmoItem, SkillThrowing); - if (ProjectileMiss || !other->CheckHitChance(this, SkillThrowing, MainPrimary, chance_mod)){ + if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillThrowing, MainPrimary, chance_mod))){ mlog(COMBAT__RANGED, "Ranged attack missed %s.", other->GetName()); if (LaunchProjectile){ TryProjectileAttack(other, AmmoItem, SkillThrowing, 0, RangeWeapon, nullptr, AmmoSlot, speed);