diff --git a/zone/attack.cpp b/zone/attack.cpp index 0b8cf07f1..3d05bad70 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -1288,15 +1288,18 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b mlog(COMBAT__DAMAGE, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)", damage, min_hit, max_hit, GetSTR(), GetSkill(skillinuse), weapon_damage, mylevel); + int hit_chance_bonus = 0; + if(opts) { damage *= opts->damage_percent; damage += opts->damage_flat; hate *= opts->hate_percent; hate += opts->hate_flat; + hit_chance_bonus += opts->hate_flat; } //check to see if we hit.. - if(!other->CheckHitChance(this, skillinuse, Hand)) { + if(!other->CheckHitChance(this, skillinuse, Hand, hit_chance_bonus)) { mlog(COMBAT__ATTACKS, "Attack missed. Damage set to 0."); damage = 0; } else { //we hit, try to avoid it @@ -1890,14 +1893,18 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool other->AddToHateList(this, hate); } else { + + int hit_chance_bonus = 0; + if(opts) { damage *= opts->damage_percent; damage += opts->damage_flat; hate *= opts->hate_percent; hate += opts->hate_flat; + hit_chance_bonus += opts->hit_chance; } - if(!other->CheckHitChance(this, skillinuse, Hand)) { + if(!other->CheckHitChance(this, skillinuse, Hand, hit_chance_bonus)) { damage = 0; //miss } else { //hit, check for damage avoidance other->AvoidDamage(this, damage); diff --git a/zone/common.h b/zone/common.h index fb56b3f01..c5a55d670 100644 --- a/zone/common.h +++ b/zone/common.h @@ -563,7 +563,7 @@ struct ExtraAttackOptions { : damage_percent(1.0f), damage_flat(0), armor_pen_percent(0.0f), armor_pen_flat(0), crit_percent(1.0f), crit_flat(0.0f), - hate_percent(1.0f), hate_flat(0) + hate_percent(1.0f), hate_flat(0), hit_chance(0) { } float damage_percent; @@ -574,6 +574,7 @@ struct ExtraAttackOptions { float crit_flat; float hate_percent; int hate_flat; + int hit_chance; }; #endif