From 5b128243c5db7b3cab300b2695f33340ba5944a3 Mon Sep 17 00:00:00 2001 From: stfxpi Date: Fri, 13 May 2011 15:04:59 +0400 Subject: [PATCH] [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 --- src/game/SpellEffects.cpp | 7 ++++--- src/shared/revision_nr.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 6b4e689b6..93558367b 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -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; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 06f81f98a..bac8d3f39 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11479" + #define REVISION_NR "11480" #endif // __REVISION_NR_H__