Skip to content

Commit

Permalink
Change NPC skill AC bonus
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mackal committed Jan 15, 2017
1 parent 9e82487 commit 7e49a21
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions zone/attack.cpp
Expand Up @@ -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()) {
Expand All @@ -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;
Expand Down

0 comments on commit 7e49a21

Please sign in to comment.