mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 21:26:23 +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())
|
||||
|
||||
@@ -486,6 +486,8 @@ enum Rates
|
||||
RATE_DURABILITY_LOSS_ABSORB,
|
||||
RATE_DURABILITY_LOSS_BLOCK,
|
||||
RATE_MOVESPEED,
|
||||
RATE_MISS_CHANCE_MULTIPLIER_TARGET_CREATURE,
|
||||
RATE_MISS_CHANCE_MULTIPLIER_TARGET_PLAYER,
|
||||
MAX_RATES
|
||||
};
|
||||
|
||||
|
||||
@@ -566,6 +566,10 @@ void World::LoadConfigSettings(bool reload)
|
||||
rate_values[RATE_HONOR] = sConfigMgr->GetOption<float>("Rate.Honor", 1.0f);
|
||||
rate_values[RATE_ARENA_POINTS] = sConfigMgr->GetOption<float>("Rate.ArenaPoints", 1.0f);
|
||||
rate_values[RATE_INSTANCE_RESET_TIME] = sConfigMgr->GetOption<float>("Rate.InstanceResetTime", 1.0f);
|
||||
|
||||
rate_values[RATE_MISS_CHANCE_MULTIPLIER_TARGET_CREATURE] = sConfigMgr->GetOption<float>("Rate.MissChanceMultiplier.TargetCreature", 11.0f);
|
||||
rate_values[RATE_MISS_CHANCE_MULTIPLIER_TARGET_PLAYER] = sConfigMgr->GetOption<float>("Rate.MissChanceMultiplier.TargetPlayer", 7.0f);
|
||||
|
||||
rate_values[RATE_TALENT] = sConfigMgr->GetOption<float>("Rate.Talent", 1.0f);
|
||||
if (rate_values[RATE_TALENT] < 0.0f)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user