[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:
stfxpi 2011-05-13 15:04:59 +04:00 committed by VladimirMangos
parent cfcac0fa0c
commit 5b128243c5
2 changed files with 5 additions and 4 deletions

View file

@ -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;