mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 07:38:36 +00:00
Added 'hit chance' extra attack option can be applied to future special attacks ect.
This commit is contained in:
+9
-2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user