mirror of
https://github.com/mangosfour/server.git
synced 2025-12-27 01:37:04 +00:00
[11480] Avoid use 2 random call in dummy 14537
For random generators use in same calculation 2 random roll calls can expose internal dependences in pseudo-random generation algo and in result generated values will not so random as expected. Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
cfcac0fa0c
commit
5b128243c5
2 changed files with 5 additions and 4 deletions
|
|
@ -901,11 +901,12 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
|
|||
spell_id = 11538;
|
||||
else if (roll < 70) // Chain Lighting (20% chance)
|
||||
spell_id = 21179;
|
||||
else if (roll < 80) // Polymorph (10% chance)
|
||||
else if (roll < 77) // Polymorph (10% chance, 7% to target)
|
||||
spell_id = 14621;
|
||||
else if (roll < 80) // Polymorph (10% chance, 3% to self, backfire)
|
||||
{
|
||||
spell_id = 14621;
|
||||
if (urand(0, 9) < 3) // 30% chance to self-cast
|
||||
newTarget = m_caster;
|
||||
newTarget = m_caster;
|
||||
}
|
||||
else if (roll < 95) // Enveloping Winds (15% chance)
|
||||
spell_id = 25189;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue