Core/Spells: no longer round PPM chance calculation results and stay more faithful to the original formula
This commit is contained in:
1 parent
de82b464c8
commit
1b91ed5424
1 file changed
+3
-2
@@ -8166,7 +8166,7 @@ float Unit::GetWeaponProcChance() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
float Unit::GetPPMProcChance(uint32 WeaponSpeed, float PPM, SpellInfo const* spellProto) const
|
||||
float Unit::GetPPMProcChance(uint32 weaponSpeed, float PPM, SpellInfo const* spellProto) const
|
||||
{
|
||||
// proc per minute chance calculation
|
||||
if (PPM <= 0)
|
||||
@@ -8177,7 +8177,8 @@ float Unit::GetPPMProcChance(uint32 WeaponSpeed, float PPM, SpellInfo const* spe
|
||||
if (Player* modOwner = GetSpellModOwner())
|
||||
modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_PROC_PER_MINUTE, PPM);
|
||||
|
||||
return std::floor((WeaponSpeed * PPM) / 600.0f); // result is chance in percents (probability = Speed_in_sec * (PPM / 60))
|
||||
// result is chance in percents (probability = Speed_in_sec * (PPM / 60))
|
||||
return (((float)weaponSpeed / IN_MILLISECONDS) * PPM) / 60.0f;
|
||||
}
|
||||
|
||||
void Unit::Mount(uint32 mount, uint32 VehicleId, uint32 creatureEntry)
|
||||
|
||||
Reference in new issue
Block a user