Index: trunk/src/game/SpellEffects.cpp
===================================================================
--- trunk/src/game/SpellEffects.cpp (revision 178)
+++ trunk/src/game/SpellEffects.cpp (revision 180)
@@ -2634,11 +2634,12 @@
 {
     float radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
-
-    if(Player* modOwner = m_caster->GetSpellModOwner())
+    Unit *caster = m_originalCasterGUID ? m_originalCaster : m_caster;
+
+    if(Player* modOwner = caster->GetSpellModOwner())
         modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, radius);
 
     int32 duration = GetSpellDuration(m_spellInfo);
     DynamicObject* dynObj = new DynamicObject;
-    if(!dynObj->Create(objmgr.GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), m_caster, m_spellInfo->Id, i, m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, duration, radius))
+    if(!dynObj->Create(objmgr.GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), caster, m_spellInfo->Id, i, m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, duration, radius))
     {
         delete dynObj;
@@ -2648,5 +2649,5 @@
     dynObj->SetUInt32Value(GAMEOBJECT_DISPLAYID, 368003);
     dynObj->SetUInt32Value(DYNAMICOBJECT_BYTES, 0x01eeeeee);
-    m_caster->AddDynObject(dynObj);
+    caster->AddDynObject(dynObj);
     MapManager::Instance().GetMap(dynObj->GetMapId(), dynObj)->Add(dynObj);
 }
Index: trunk/src/game/Spell.cpp
===================================================================
--- trunk/src/game/Spell.cpp (revision 176)
+++ trunk/src/game/Spell.cpp (revision 180)
@@ -982,6 +982,7 @@
 
     // Recheck immune (only for delayed spells)
-    if( m_spellInfo->speed && (
-        unit->IsImmunedToDamage(GetSpellSchoolMask(m_spellInfo),true) ||
+    if( m_spellInfo->speed && 
+        !(m_spellInfo->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY)
+        && (unit->IsImmunedToDamage(GetSpellSchoolMask(m_spellInfo),true) ||
         unit->IsImmunedToSpell(m_spellInfo,true) ))
     {
Index: trunk/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp
===================================================================
--- trunk/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp (revision 178)
+++ trunk/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp (revision 180)
@@ -385,17 +385,5 @@
     void Reset();
 
-    void JustSummoned(Creature* summon)
-    {
-        if(summon->GetCreatureInfo()->Entry == SHADOW_DEMON)
-        {
-            Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0);
-            if(target && target->GetTypeId() == TYPEID_PLAYER) // only on players.
-            {
-                summon->AddThreat(target, 5000000.0f);
-                summon->AI()->AttackStart(target);
-            }
-            DoZoneInCombat(summon);
-        }
-    }
+    void JustSummoned(Creature* summon);
 
     void SummonedCreatureDespawn(Creature* summon)
@@ -781,5 +769,5 @@
             case EVENT_FLAME_CRASH:
                 DoCast(m_creature->getVictim(), SPELL_FLAME_CRASH);
-                Timer[EVENT_FLAME_CRASH] = 35000;
+                Timer[EVENT_FLAME_CRASH] = 30000 + rand()%10000;
                 break;
 
@@ -790,4 +778,5 @@
                     if(target)
                         m_creature->CastSpell(target, SPELL_PARASITIC_SHADOWFIEND, true);
+                    Timer[EVENT_PARASITIC_SHADOWFIEND] = 35000 + rand()%10000;
                 }break;
 
@@ -798,5 +787,5 @@
             case EVENT_DRAW_SOUL:
                 DoCast(m_creature->getVictim(), SPELL_DRAW_SOUL);
-                Timer[EVENT_DRAW_SOUL] = 55000;          
+                Timer[EVENT_DRAW_SOUL] = 50000 + rand()%10000;          
                 break;
 
@@ -1060,4 +1049,5 @@
 
     void Aggro(Unit *who) {}
+    void MoveInLineOfSight(Unit *) {}
 
     void MovementInform(uint32 MovementType, uint32 Data) {Timer = 1;}
@@ -1691,16 +1681,15 @@
     uint64 TargetGUID;
 
-    void Aggro(Unit *who) {}
+    void Aggro(Unit *who) {DoZoneInCombat();}
 
     void Reset()
     {
         TargetGUID = 0;
-        DoCast(m_creature, SPELL_SHADOW_DEMON_PASSIVE, true);
+        m_creature->CastSpell(m_creature, SPELL_SHADOW_DEMON_PASSIVE, true);
     }
 
     void JustDied(Unit *killer)
     {
-        Unit* target = Unit::GetUnit((*m_creature), TargetGUID);
-        if(target)
+        if(Unit* target = Unit::GetUnit((*m_creature), TargetGUID))
             target->RemoveAurasDueToSpell(SPELL_PARALYZE);
     }
@@ -1708,5 +1697,5 @@
     void UpdateAI(const uint32 diff)
     {
-        if(!m_creature->SelectHostilTarget() || !m_creature->getVictim()) return;
+        if(!m_creature->SelectHostilTarget() && !m_creature->getVictim()) return;
 
         if(m_creature->getVictim()->GetTypeId() != TYPEID_PLAYER) return; // Only cast the below on players.
@@ -1935,4 +1924,29 @@
     m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true);
     m_creature->setActive(false);
+}
+
+void boss_illidan_stormrageAI::JustSummoned(Creature* summon)
+{
+    switch(summon->GetEntry())
+    {
+    case SHADOW_DEMON:
+        {
+            if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0, 999, true)) // only on players.
+            {
+                summon->AddThreat(target, 5000000.0f);
+                summon->AI()->AttackStart(target);
+            }
+        }break;
+    case MAIEV_SHADOWSONG:
+        {
+            summon->SetVisibility(VISIBILITY_OFF); // Leave her invisible until she has to talk
+            summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+            MaievGUID = summon->GetGUID();
+            ((boss_maievAI*)summon->AI())->GetIllidanGUID(m_creature->GetGUID());
+            ((boss_maievAI*)summon->AI())->EnterPhase(PHASE_TALK_SEQUENCE);
+        }break;
+    default:
+        break;
+    }
 }
 
@@ -2095,15 +2109,7 @@
 void boss_illidan_stormrageAI::SummonMaiev()
 {
-    DoCast(m_creature, SPELL_SHADOW_PRISON, true);
-    Creature* Maiev = m_creature->SummonCreature(MAIEV_SHADOWSONG, m_creature->GetPositionX() + 10, m_creature->GetPositionY() + 5, m_creature->GetPositionZ(), 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
-    if(Maiev)
-    {
-        Maiev->SetVisibility(VISIBILITY_OFF); // Leave her invisible until she has to talk
-        Maiev->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
-        MaievGUID = Maiev->GetGUID();
-        ((boss_maievAI*)Maiev->AI())->GetIllidanGUID(m_creature->GetGUID());
-        ((boss_maievAI*)Maiev->AI())->EnterPhase(PHASE_TALK_SEQUENCE);
-    }
-    else // If Maiev cannot be summoned, reset the encounter and post some errors to the console.
+    m_creature->CastSpell(m_creature, SPELL_SHADOW_PRISON, true);
+    m_creature->CastSpell(m_creature, 40403, true);
+    if(!MaievGUID) // If Maiev cannot be summoned, reset the encounter and post some errors to the console.
     {
         EnterEvadeMode();
