mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-13 00:42:26 +00:00
Converted mlogs in Mob::CheckHitChance to new logs
This commit is contained in:
parent
c10f5b2cbc
commit
2828d51308
@ -189,8 +189,6 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c
|
|||||||
|
|
||||||
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName());
|
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName());
|
||||||
|
|
||||||
mlog(COMBAT__TOHIT,"CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName());
|
|
||||||
|
|
||||||
bool pvpmode = false;
|
bool pvpmode = false;
|
||||||
if(IsClient() && other->IsClient())
|
if(IsClient() && other->IsClient())
|
||||||
pvpmode = true;
|
pvpmode = true;
|
||||||
@ -210,7 +208,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c
|
|||||||
|
|
||||||
//Calculate the level difference
|
//Calculate the level difference
|
||||||
|
|
||||||
mlog(COMBAT__TOHIT, "Chance to hit before level diff calc %.2f", chancetohit);
|
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit before level diff calc %.2f", chancetohit);
|
||||||
|
|
||||||
double level_difference = attacker_level - defender_level;
|
double level_difference = attacker_level - defender_level;
|
||||||
double range = defender->GetLevel();
|
double range = defender->GetLevel();
|
||||||
@ -238,32 +236,32 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c
|
|||||||
chancetohit += (RuleR(Combat,HitBonusPerLevel) * level_difference);
|
chancetohit += (RuleR(Combat,HitBonusPerLevel) * level_difference);
|
||||||
}
|
}
|
||||||
|
|
||||||
mlog(COMBAT__TOHIT, "Chance to hit after level diff calc %.2f", chancetohit);
|
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after level diff calc %.2f", chancetohit);
|
||||||
|
|
||||||
chancetohit -= ((float)defender->GetAGI() * RuleR(Combat, AgiHitFactor));
|
chancetohit -= ((float)defender->GetAGI() * RuleR(Combat, AgiHitFactor));
|
||||||
|
|
||||||
mlog(COMBAT__TOHIT, "Chance to hit after agil calc %.2f", chancetohit);
|
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after Agility calc %.2f", chancetohit);
|
||||||
|
|
||||||
if(attacker->IsClient())
|
if(attacker->IsClient())
|
||||||
{
|
{
|
||||||
chancetohit -= (RuleR(Combat,WeaponSkillFalloff) * (attacker->CastToClient()->MaxSkill(skillinuse) - attacker->GetSkill(skillinuse)));
|
chancetohit -= (RuleR(Combat,WeaponSkillFalloff) * (attacker->CastToClient()->MaxSkill(skillinuse) - attacker->GetSkill(skillinuse)));
|
||||||
mlog(COMBAT__TOHIT, "Chance to hit after weapon falloff calc (attack) %.2f", chancetohit);
|
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after agil calc %.2f", "Chance to hit after weapon falloff calc (attack) %.2f", chancetohit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(defender->IsClient())
|
if(defender->IsClient())
|
||||||
{
|
{
|
||||||
chancetohit += (RuleR(Combat,WeaponSkillFalloff) * (defender->CastToClient()->MaxSkill(SkillDefense) - defender->GetSkill(SkillDefense)));
|
chancetohit += (RuleR(Combat,WeaponSkillFalloff) * (defender->CastToClient()->MaxSkill(SkillDefense) - defender->GetSkill(SkillDefense)));
|
||||||
mlog(COMBAT__TOHIT, "Chance to hit after weapon falloff calc (defense) %.2f", chancetohit);
|
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after weapon falloff calc (defense) %.2f", chancetohit);
|
||||||
}
|
}
|
||||||
|
|
||||||
//I dont think this is 100% correct, but at least it does something...
|
//I dont think this is 100% correct, but at least it does something...
|
||||||
if(attacker->spellbonuses.MeleeSkillCheckSkill == skillinuse || attacker->spellbonuses.MeleeSkillCheckSkill == 255) {
|
if(attacker->spellbonuses.MeleeSkillCheckSkill == skillinuse || attacker->spellbonuses.MeleeSkillCheckSkill == 255) {
|
||||||
chancetohit += attacker->spellbonuses.MeleeSkillCheck;
|
chancetohit += attacker->spellbonuses.MeleeSkillCheck;
|
||||||
mlog(COMBAT__TOHIT, "Applied spell melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit);
|
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Applied spell melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit);
|
||||||
}
|
}
|
||||||
if(attacker->itembonuses.MeleeSkillCheckSkill == skillinuse || attacker->itembonuses.MeleeSkillCheckSkill == 255) {
|
if(attacker->itembonuses.MeleeSkillCheckSkill == skillinuse || attacker->itembonuses.MeleeSkillCheckSkill == 255) {
|
||||||
chancetohit += attacker->itembonuses.MeleeSkillCheck;
|
chancetohit += attacker->itembonuses.MeleeSkillCheck;
|
||||||
mlog(COMBAT__TOHIT, "Applied item melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit);
|
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Applied item melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Avoidance Bonuses on defender decreases baseline hit chance by percent.
|
//Avoidance Bonuses on defender decreases baseline hit chance by percent.
|
||||||
@ -310,7 +308,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c
|
|||||||
|
|
||||||
//Calculate final chance to hit
|
//Calculate final chance to hit
|
||||||
chancetohit += ((chancetohit * (hitBonus - avoidanceBonus)) / 100.0f);
|
chancetohit += ((chancetohit * (hitBonus - avoidanceBonus)) / 100.0f);
|
||||||
mlog(COMBAT__TOHIT, "Chance to hit %.2f after accuracy calc %.2f and avoidance calc %.2f", chancetohit, hitBonus, avoidanceBonus);
|
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit %.2f after accuracy calc %.2f and avoidance calc %.2f", chancetohit, hitBonus, avoidanceBonus);
|
||||||
|
|
||||||
chancetohit = mod_hit_chance(chancetohit, skillinuse, attacker);
|
chancetohit = mod_hit_chance(chancetohit, skillinuse, attacker);
|
||||||
|
|
||||||
@ -338,7 +336,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c
|
|||||||
|
|
||||||
float tohit_roll = zone->random.Real(0, 100);
|
float tohit_roll = zone->random.Real(0, 100);
|
||||||
|
|
||||||
mlog(COMBAT__TOHIT, "Final hit chance: %.2f%%. Hit roll %.2f", chancetohit, tohit_roll);
|
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Final hit chance: %.2f%%. Hit roll %.2f", chancetohit, tohit_roll);
|
||||||
|
|
||||||
return(tohit_roll <= chancetohit);
|
return(tohit_roll <= chancetohit);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user