diff --git a/src/server/game/AI/NpcBots/bot_ai.cpp b/src/server/game/AI/NpcBots/bot_ai.cpp index 1807c1efdc50e..7af01d9101342 100644 --- a/src/server/game/AI/NpcBots/bot_ai.cpp +++ b/src/server/game/AI/NpcBots/bot_ai.cpp @@ -2208,9 +2208,10 @@ void bot_ai::_listAuras(Player const* player, Unit const* unit) const botstring << "\n" << LocalizedNpcText(player, BOT_TEXT_REGEN_MP_CAST) << ": " << float((_botclass == BOT_CLASS_SPHYNX ? -1.f : 1.f) * me->GetFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER) * sWorld->getRate(RATE_POWER_MANA) * 5.0f); botstring << "\n" << LocalizedNpcText(player, BOT_TEXT_REGEN_MP_NOCAST) << ": " << float((_botclass == BOT_CLASS_SPHYNX ? -1.f : 1.f) * me->GetFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER) * sWorld->getRate(RATE_POWER_MANA) * 5.0f); } + int32 bot_expertise = expertise + me->GetTotalAuraModifier(SPELL_AURA_MOD_EXPERTISE); botstring << "\n" << LocalizedNpcText(player, BOT_TEXT_HASTE) << ": " << (haste >= 0 ? "+" : "-") << float(haste) << " " << LocalizedNpcText(player, BOT_TEXT_PCT); botstring << "\n" << LocalizedNpcText(player, BOT_TEXT_HIT) << ": +" << float(hit) << " " << LocalizedNpcText(player, BOT_TEXT_PCT); - botstring << "\n" << LocalizedNpcText(player, BOT_TEXT_EXPERTISE) << ": " << int32(expertise) << " (-" << float(float(expertise) * 0.25f) << " " << LocalizedNpcText(player, BOT_TEXT_PCT) << ")"; + botstring << "\n" << LocalizedNpcText(player, BOT_TEXT_EXPERTISE) << ": " << int32(bot_expertise) << " (-" << float(float(bot_expertise) * 0.25f) << " " << LocalizedNpcText(player, BOT_TEXT_PCT) << ")"; botstring << "\n" << LocalizedNpcText(player, BOT_TEXT_ARMOR_PEN) << ": " << float(me->GetCreatureArmorPenetrationCoef()) << " " << LocalizedNpcText(player, BOT_TEXT_PCT); botstring << "\n" << LocalizedNpcText(player, BOT_TEXT_SPELL_PEN) << ": " << uint32(spellpen) + uint32(std::abs(me->GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_TARGET_RESISTANCE, SPELL_SCHOOL_MASK_MAGIC))); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 1ad0bc8fbc955..9e58204d98b92 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2282,15 +2282,6 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(Unit const* victim, WeaponAttackTy int32 block_chance = int32(GetUnitBlockChance(attType, victim) * 100.0f); int32 parry_chance = int32(GetUnitParryChance(attType, victim) * 100.0f); - //npcbot - expertise - if (IsNPCBot()) - { - int32 reductionFromExpertise = ToCreature()->GetCreatureExpertise() * 100 / 4; - dodge_chance -= reductionFromExpertise; - parry_chance -= reductionFromExpertise; - } - //end npcbot - // melee attack table implementation // outcome priority: // 1. > 2. > 3. > 4. > 5. > 6. > 7. > 8. @@ -2770,6 +2761,13 @@ float Unit::GetUnitDodgeChance(WeaponAttackType attType, Unit const* victim) con // Reduce dodge chance by attacker expertise rating if (GetTypeId() == TYPEID_PLAYER) chance -= ToPlayer()->GetExpertiseDodgeOrParryReduction(attType); + //npcbot - manual expertise instead of auras + else if (IsNPCBot()) + { + chance -= ToCreature()->GetCreatureExpertise() * 25; + chance -= GetTotalAuraModifier(SPELL_AURA_MOD_EXPERTISE) * 25; + } + //end npcbot else chance -= GetTotalAuraModifier(SPELL_AURA_MOD_EXPERTISE) / 4.0f; return std::max(chance, 0.0f); @@ -2824,6 +2822,13 @@ float Unit::GetUnitParryChance(WeaponAttackType attType, Unit const* victim) con // Reduce parry chance by attacker expertise rating if (GetTypeId() == TYPEID_PLAYER) chance -= ToPlayer()->GetExpertiseDodgeOrParryReduction(attType); + //npcbot - manual expertise instead of auras + else if (IsNPCBot()) + { + chance -= ToCreature()->GetCreatureExpertise() * 25; + chance -= GetTotalAuraModifier(SPELL_AURA_MOD_EXPERTISE) * 25; + } + //end npcbot else chance -= GetTotalAuraModifier(SPELL_AURA_MOD_EXPERTISE) / 4.0f; return std::max(chance, 0.0f);