mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 09:39:11 +00:00
feat(Core/Conf): Rate.MissChanceMultiplier (#10639)
This commit is contained in:
@@ -3004,19 +3004,21 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit* victim, SpellInfo const* spellInfo
|
||||
}
|
||||
|
||||
SpellSchoolMask schoolMask = spellInfo->GetSchoolMask();
|
||||
// PvP - PvE spell misschances per leveldif > 2
|
||||
int32 lchance = victim->GetTypeId() == TYPEID_PLAYER ? 7 : 11;
|
||||
int32 thisLevel = getLevelForTarget(victim);
|
||||
if (GetTypeId() == TYPEID_UNIT && ToCreature()->IsTrigger())
|
||||
thisLevel = std::max<int32>(thisLevel, spellInfo->SpellLevel);
|
||||
int32 leveldif = int32(victim->getLevelForTarget(this)) - thisLevel;
|
||||
int32 levelDiff = int32(victim->getLevelForTarget(this)) - thisLevel;
|
||||
|
||||
int32 MISS_CHANCE_MULTIPLIER = sWorld->getRate(
|
||||
victim->GetTypeId() == TYPEID_PLAYER
|
||||
? RATE_MISS_CHANCE_MULTIPLIER_TARGET_PLAYER
|
||||
: RATE_MISS_CHANCE_MULTIPLIER_TARGET_CREATURE
|
||||
);
|
||||
|
||||
// Base hit chance from attacker and victim levels
|
||||
int32 modHitChance;
|
||||
if (leveldif < 3)
|
||||
modHitChance = 96 - leveldif;
|
||||
else
|
||||
modHitChance = 94 - (leveldif - 2) * lchance;
|
||||
int32 modHitChance = levelDiff < 3
|
||||
? 96 - levelDiff
|
||||
: 94 - (levelDiff - 2) * MISS_CHANCE_MULTIPLIER;
|
||||
|
||||
// Spellmod from SPELLMOD_RESIST_MISS_CHANCE
|
||||
if (Player* modOwner = GetSpellModOwner())
|
||||
|
||||
Reference in New Issue
Block a user