Refactor CheckHitChance

Pulled the accuracy/avoidance spell bonuses into their own functions so
we can show the total values in #showstats
This commit is contained in:
Michael Cook (mackal)
2017-01-15 16:08:22 -05:00
parent c030e1ce8d
commit e03a90b05d
2 changed files with 89 additions and 70 deletions
+2
View File
@@ -166,7 +166,9 @@ public:
virtual void TryBackstab(Mob *other,int ReuseTime = 10);
bool AvoidDamage(Mob* attacker, int &damage, int hand);
int compute_tohit(EQEmu::skills::SkillType skillinuse);
int GetTotalToHit(EQEmu::skills::SkillType skill, int chance_mod); // compute_tohit + spell bonuses
int compute_defense();
int GetTotalDefense(); // compute_defense + spell bonuses
bool CheckHitChance(Mob* attacker, EQEmu::skills::SkillType skillinuse, int chance_mod = 0);
virtual void TryCriticalHit(Mob *defender, uint16 skill, int &damage, int min_damage, ExtraAttackOptions *opts = nullptr);
void TryPetCriticalHit(Mob *defender, uint16 skill, int &damage);