Add logging to Mob::CheckHitChance [skip ci]

This commit is contained in:
Akkadius 2019-10-06 01:53:03 -05:00
parent 690621268b
commit 0b790342e7
3 changed files with 29 additions and 4 deletions

View File

@ -75,7 +75,7 @@ function MeleeMitigation(e)
e.hit.base_damage
)
);
e.hit.damage_done = 2 * e.hit.base_damage * GetDamageTable(e.self, e.hit.skill) / 100;
e.hit = DoMeleeMitigation(e.self, e.other, e.hit, e.opts);
@ -221,6 +221,16 @@ function CheckHitChance(e)
end
local tohit_roll = Random.Real(0, 100);
eq.debug(
string.format("[%s] [Mob::CheckHitChance] Chance [%i] ToHitRoll [%i] Hit? [%t]",
e.self:GetCleanName(),
chancetohit,
tohit_roll,
(tohit_roll <= chancetohit)
)
);
if (tohit_roll <= chancetohit) then
e.ReturnValue = true;
else

View File

@ -305,6 +305,16 @@ bool Mob::CheckHitChance(Mob* other, EQEmu::skills::SkillType skillinuse, int Ha
float tohit_roll = zone->random.Real(0, 100);
Log.Out(
Logs::General,
Logs::Combat,
"[%s] [Mob::CheckHitChance] Chance [%i] ToHitRoll [%i] Hit? [%s]",
GetCleanName(),
chancetohit,
tohit_roll,
(tohit_roll <= chancetohit) ? "true" : "false"
);
Log.Out(Logs::Detail, Logs::Attack, "Final hit chance: %.2f%%. Hit roll %.2f", chancetohit, tohit_roll);
return(tohit_roll <= chancetohit);

View File

@ -4603,11 +4603,16 @@ int16 Mob::GetCritDmgMob(uint16 skill)
int critDmg_mod = 0;
// All skill dmg mod + Skill specific
critDmg_mod += itembonuses.CritDmgMob[EQEmu::skills::HIGHEST_SKILL + 1] + spellbonuses.CritDmgMob[EQEmu::skills::HIGHEST_SKILL + 1] + aabonuses.CritDmgMob[EQEmu::skills::HIGHEST_SKILL + 1] +
itembonuses.CritDmgMob[skill] + spellbonuses.CritDmgMob[skill] + aabonuses.CritDmgMob[skill];
critDmg_mod += itembonuses.CritDmgMob[EQEmu::skills::HIGHEST_SKILL + 1] +
spellbonuses.CritDmgMob[EQEmu::skills::HIGHEST_SKILL + 1] +
aabonuses.CritDmgMob[EQEmu::skills::HIGHEST_SKILL + 1] +
itembonuses.CritDmgMob[skill] +
spellbonuses.CritDmgMob[skill] +
aabonuses.CritDmgMob[skill];
if(critDmg_mod < -100)
if (critDmg_mod < -100) {
critDmg_mod = -100;
}
return critDmg_mod;
}