From d2fe68bfef79fc1ef3ae727058439779c0d2a962 Mon Sep 17 00:00:00 2001 From: megamage Date: Wed, 27 May 2009 23:33:21 -0500 Subject: *Some improvement of DK start zone quests (no new quest fixed) --HG-- branch : trunk --- src/game/CreatureAIImpl.h | 18 +++++++++++++++++- src/game/SpellEffects.cpp | 7 ++++++- src/game/SpellMgr.cpp | 1 + 3 files changed, 24 insertions(+), 2 deletions(-) (limited to 'src/game') diff --git a/src/game/CreatureAIImpl.h b/src/game/CreatureAIImpl.h index c7ce3198584..e48ef516b2c 100644 --- a/src/game/CreatureAIImpl.h +++ b/src/game/CreatureAIImpl.h @@ -61,7 +61,22 @@ template inline const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5) { - switch(rand()%4) + switch(rand()%5) + { + default: + case 0: return v1; + case 1: return v2; + case 2: return v3; + case 3: return v4; + case 4: return v5; + } +} + +template +inline +const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5, const T& v6) +{ + switch(rand()%6) { default: case 0: return v1; @@ -69,6 +84,7 @@ const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5) case 2: return v3; case 3: return v4; case 4: return v5; + case 5: return v6; } } diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 961dd3aa9e9..59830551cf3 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -4877,7 +4877,12 @@ void Spell::EffectScriptEffect(uint32 effIndex) m_caster->CastSpell(x, y, z, 54522, true); } break; - } + } + // Sky Darkener Assault + case 52124: + if(unitTarget) + m_caster->CastSpell(unitTarget, 52125, false); + return; // Death Gate case 52751: { diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 8b01639d1be..9da00f0e2d4 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -3360,6 +3360,7 @@ void SpellMgr::LoadSpellCustomAttr() case 45976: // Muru Portal Channel case 39365: // Thundering Storm case 41071: // Raise Dead (HACK) + case 52124: // Sky Darkener Assault spellInfo->MaxAffectedTargets = 1; break; case 41376: // Spite -- cgit v1.2.3