Change NPC skill AC bonus

Basically, live doesn't have an NPC's skill at the max for their class like we
do. So for now, we'll just set their SkillDefense bonus to value / 5
This commit is contained in:
Michael Cook (mackal) 2017-01-15 13:54:10 -05:00
parent 9e824876ba
commit 7e49a21b3b

View File

@ -735,7 +735,7 @@ int Mob::ACSum()
// EQ math
ac = (ac * 4) / 3;
// anti-twink
if (GetLevel() < 50)
if (IsClient() && GetLevel() < 50)
ac = std::min(ac, 25 + 6 * GetLevel());
ac = std::max(0, ac + GetClassRaceACBonus());
if (IsNPC()) {
@ -751,12 +751,19 @@ int Mob::ACSum()
owner = entity_list.GetMobID(CastToNPC()->GetSwarmOwner());
if (owner)
ac += owner->aabonuses.PetAvoidance + owner->spellbonuses.PetAvoidance + owner->itembonuses.PetAvoidance;
auto spell_aa_ac = aabonuses.AC + spellbonuses.AC;
ac += GetSkill(EQEmu::skills::SkillDefense) / 5;
if (EQEmu::ValueWithin(static_cast<int>(GetClass()), NECROMANCER, ENCHANTER))
ac += spell_aa_ac / 3;
else
ac += spell_aa_ac / 4;
} else { // TODO: so we can't set NPC skills ... so the skill bonus ends up being HUGE so lets nerf them a bit
auto spell_aa_ac = aabonuses.AC + spellbonuses.AC;
if (EQEmu::ValueWithin(static_cast<int>(GetClass()), NECROMANCER, ENCHANTER))
ac += GetSkill(EQEmu::skills::SkillDefense) / 2 + spell_aa_ac / 3;
else
ac += GetSkill(EQEmu::skills::SkillDefense) / 3 + spell_aa_ac / 4;
}
auto spell_aa_ac = aabonuses.AC + spellbonuses.AC;
if (EQEmu::ValueWithin(static_cast<int>(GetClass()), NECROMANCER, ENCHANTER))
ac += GetSkill(EQEmu::skills::SkillDefense) / 2 + spell_aa_ac / 3;
else
ac += GetSkill(EQEmu::skills::SkillDefense) / 3 + spell_aa_ac / 4;
if (GetAGI() > 70)
ac += GetAGI() / 20;