Found it I think in attack.cpp
attack.cpp
Code:
// called when a mob is attacked, does the checks to see if it's a hit
// and does other mitigation checks. 'this' is the mob being attacked.
bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 chance_mod)
{
/*/
//Reworked a lot of this code to achieve better balance at higher levels.
//The old code basically meant that any in high level (50+) combat,
//both parties always had 95% chance to hit the other one.
/*/
Mob *attacker=other;
Mob *defender=this;
float chancetohit = RuleR(Combat, BaseHitChance);
if(attacker->IsNPC() && !attacker->IsPet())
chancetohit += RuleR(Combat, NPCBonusHitChance);
Log.Out(Logs::Detail, Logs::Attack, "CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName());
bool pvpmode = false;
if(IsClient() && other->IsClient())
pvpmode = true;
if (chance_mod >= 10000)
return true;
float avoidanceBonus = 0;
float hitBonus = 0;
and more I didn't wanna spam post with
EDIT :
Code:
if(attacker->IsNPC())
hitBonus += (attacker->CastToNPC()->GetAccuracyRating() / 10.0f); //Modifier from database