Index: /trunk/src/bindings/scripts/VC71/71ScriptDev2.vcproj
===================================================================
--- /trunk/src/bindings/scripts/VC71/71ScriptDev2.vcproj (revision 187)
+++ /trunk/src/bindings/scripts/VC71/71ScriptDev2.vcproj (revision 223)
@@ -1567,4 +1567,16 @@
 						<File
 							RelativePath="..\scripts\zone\tempest_keep\the_mechanar\boss_nethermancer_sepethrea.cpp"
+							>
+						</File>
+						<File
+							RelativePath="..\scripts\zone\tempest_keep\the_mechanar\boss_pathaleon_the_calculator.cpp"
+							>
+						</File>
+						<File
+							RelativePath="..\scripts\zone\tempest_keep\the_mechanar\instance_mechanar.cpp"
+							>
+						</File>
+						<File
+							RelativePath="..\scripts\zone\tempest_keep\the_mechanar\def_mechanar.h"
 							>
 						</File>
Index: /trunk/src/bindings/scripts/VC80/80ScriptDev2.vcproj
===================================================================
--- /trunk/src/bindings/scripts/VC80/80ScriptDev2.vcproj (revision 187)
+++ /trunk/src/bindings/scripts/VC80/80ScriptDev2.vcproj (revision 223)
@@ -1812,4 +1812,16 @@
 						<File
 							RelativePath="..\scripts\zone\tempest_keep\the_mechanar\boss_nethermancer_sepethrea.cpp"
+							>
+						</File>
+						<File
+							RelativePath="..\scripts\zone\tempest_keep\the_mechanar\boss_pathaleon_the_calculator.cpp"
+							>
+						</File>
+						<File
+							RelativePath="..\scripts\zone\tempest_keep\the_mechanar\instance_mechanar.cpp"
+							>
+						</File>
+						<File
+							RelativePath="..\scripts\zone\tempest_keep\the_mechanar\def_mechanar.h"
 							>
 						</File>
Index: /trunk/src/bindings/scripts/VC90/90ScriptDev2.vcproj
===================================================================
--- /trunk/src/bindings/scripts/VC90/90ScriptDev2.vcproj (revision 187)
+++ /trunk/src/bindings/scripts/VC90/90ScriptDev2.vcproj (revision 223)
@@ -1798,4 +1798,16 @@
 						<File
 							RelativePath="..\scripts\zone\tempest_keep\the_mechanar\boss_nethermancer_sepethrea.cpp"
+							>
+						</File>
+						<File
+							RelativePath="..\scripts\zone\tempest_keep\the_mechanar\boss_pathaleon_the_calculator.cpp"
+							>
+						</File>
+						<File
+							RelativePath="..\scripts\zone\tempest_keep\the_mechanar\instance_mechanar.cpp"
+							>
+						</File>
+						<File
+							RelativePath="..\scripts\zone\tempest_keep\the_mechanar\def_mechanar.h"
 							>
 						</File>
Index: /trunk/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp
===================================================================
--- /trunk/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp (revision 166)
+++ /trunk/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp (revision 223)
@@ -47,8 +47,8 @@
     void Reset()
     {
-        AcidSpray_Timer = 10000;
-        ExplodingBreaker_Timer = 4000;
+        AcidSpray_Timer = 15000;
+        ExplodingBreaker_Timer = 6000;
         Domination_Timer = 120000;
-        Knockdown_Timer    = 6000;
+        Knockdown_Timer    = 10000;
     }
 
@@ -85,5 +85,5 @@
         {
             DoCast(m_creature->getVictim(),SPELL_ACID_SPRAY);
-            AcidSpray_Timer = 16000+rand()%8000;
+            AcidSpray_Timer = 15000+rand()%8000;
         }else AcidSpray_Timer -=diff;
 
Index: /trunk/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp
===================================================================
--- /trunk/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp (revision 166)
+++ /trunk/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp (revision 223)
@@ -42,8 +42,8 @@
 #define SPELL_CORRUPTION            30938
 
-#define SPELL_FIRE_NOVA             33775
+#define SPELL_FIRE_NOVA             33132
 #define H_SPELL_FIRE_NOVA           37371
 
-#define SPELL_SHADOW_BOLT_VOLLEY    17228
+#define SPELL_SHADOW_BOLT_VOLLEY    28599
 #define H_SPELL_SHADOW_BOLT_VOLLEY  40070
 
Index: /trunk/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp
===================================================================
--- /trunk/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp (revision 90)
+++ /trunk/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp (revision 223)
@@ -1,17 +1,17 @@
 /* Copyright (C) 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
 
 /* ScriptData
@@ -70,5 +70,5 @@
 #define WAR_STOMP           34716
 #define SUMMON_TREANTS      34727                           // DBC: 34727, 34731, 34733, 34734, 34736, 34739, 34741 (with Ancestral Life spell 34742)   // won't work (guardian summon)
-#define ARCANE_VOLLEY       35059                           //37078, 34785 //must additional script them (because Splinter eats them after 20 sec ^)
+#define ARCANE_VOLLEY       36705                           //37078, 34785 //must additional script them (because Splinter eats them after 20 sec ^)
 #define SPELL_HEAL_FATHER   6262
 
@@ -93,5 +93,5 @@
 #define TREANT_SPAWN_DIST   50                              //50 yards from Warp Splinter's spawn point
 
-float treant_pos[6][3] =
+float treant_pos[6][3] = 
 {
     {24.301233, 427.221100, -27.060635},
@@ -122,10 +122,13 @@
     float Treant_Spawn_Pos_Y;
 
+    bool InCombat;
 
     void Reset()
     {
-        War_Stomp_Timer = 60000;
+        InCombat = false;
+
+        War_Stomp_Timer = 25000 + rand()%15000;
         Summon_Treants_Timer = 45000;
-        Arcane_Volley_Timer = 140000;
+        Arcane_Volley_Timer = 8000 + rand()%12000;
         CheckTreantLOS_Timer = 1000;
         TreantLife_Timer = 999999;
@@ -141,4 +144,5 @@
         DoYell(SAY_COMBAT_START,LANG_UNIVERSAL,NULL);
         DoPlaySoundToSet(m_creature,SOUND_COMBAT_START);
+        InCombat = true;
     }
 
@@ -148,15 +152,16 @@
         switch(rand()%2)
         {
-            case 0:
-                DoYell(SAY_SLAY_1,LANG_UNIVERSAL,NULL);
-                DoPlaySoundToSet(m_creature, SOUND_SLAY_1);
-                break;
-            case 1:
-                DoYell(SAY_SLAY_2,LANG_UNIVERSAL,NULL);
-                DoPlaySoundToSet(m_creature, SOUND_SLAY_2);
-                break;
-        }
-    }
-
+        case 0:
+            DoYell(SAY_SLAY_1,LANG_UNIVERSAL,NULL);
+            DoPlaySoundToSet(m_creature, SOUND_SLAY_1);
+            break;
+        case 1:
+            DoYell(SAY_SLAY_2,LANG_UNIVERSAL,NULL);
+            DoPlaySoundToSet(m_creature, SOUND_SLAY_2);
+            break;
+        }
+    }
+
+    // On Death
     void JustDied(Unit* Killer)
     {
@@ -168,5 +173,5 @@
     {
         for(int i = 0; i < 6; ++i)
-        {
+        {            
             float angle = (M_PI / 3) * i;
 
@@ -186,15 +191,14 @@
             }
         }
-
         switch(rand()%2)
-        {
-            case 0:
-                DoYell(SAY_SUMMON_1,LANG_UNIVERSAL,NULL);
-                DoPlaySoundToSet(m_creature,SOUND_SUMMON_1);
-                break;
-            case 1:
-                DoYell(SAY_SUMMON_2,LANG_UNIVERSAL,NULL);
-                DoPlaySoundToSet(m_creature,SOUND_SUMMON_2);
-                break;
+        { 
+        case 0:
+            DoYell(SAY_SUMMON_1,LANG_UNIVERSAL,NULL);
+            DoPlaySoundToSet(m_creature,SOUND_SUMMON_1);
+            break;
+        case 1:
+            DoYell(SAY_SUMMON_2,LANG_UNIVERSAL,NULL);
+            DoPlaySoundToSet(m_creature,SOUND_SUMMON_2);
+            break; 
         }
     }
@@ -224,4 +228,5 @@
     void UpdateAI(const uint32 diff)
     {
+        //Return since we have no target
         if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
             return;
@@ -230,6 +235,9 @@
         if(War_Stomp_Timer < diff)
         {
+            //time to cast
             DoCast(m_creature->getVictim(),WAR_STOMP);
-            War_Stomp_Timer = 60000;
+
+            //Cast again on time
+            War_Stomp_Timer = 25000 + rand()%15000;        
         }
         else War_Stomp_Timer -= diff;
@@ -238,6 +246,9 @@
         if(Arcane_Volley_Timer < diff)
         {
+            //time to cast
             DoCast(m_creature->getVictim(),ARCANE_VOLLEY);
-            Arcane_Volley_Timer = 40000+((rand()%20)*1000);
+
+            //Cast again on time
+            Arcane_Volley_Timer = 20000 + rand()%15000; 
         }
         else Arcane_Volley_Timer -= diff;
@@ -247,5 +258,7 @@
         {
             SummonTreants();
-            Summon_Treants_Timer = 45000;
+
+            //Cast again on time
+            Summon_Treants_Timer = 45000;        
         }
         else Summon_Treants_Timer -= diff;
@@ -255,4 +268,5 @@
         {
             EatTreant();
+
             CheckTreantLOS_Timer = 1000;
         }
Index: /trunk/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp
===================================================================
--- /trunk/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp (revision 90)
+++ /trunk/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp (revision 223)
@@ -1,29 +1,31 @@
 /* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
 
 /* ScriptData
 SDName: Boss Nethermancer Sepethrea
 SD%Complete: 100
-SDComment:
+SDComment: 
 SDCategory: Tempest Keep, The Mechanar
 EndScriptData */
 
 #include "precompiled.h"
-
+#include "def_mechanar.h"
+
+// Spells to be casted
 #define SPELL_SUMMON_RAGIN_FLAMES       35275
-#define SPELL_INFERNO                   19695
+#define SPELL_INFERNO                   35268
 #define SPELL_FIRE_TAIL                 35278
 
@@ -38,11 +40,13 @@
 #define SAY_SPELL_DRAGONS_BREATH_2      "Anar'endal dracon!"
 #define SOUND_SPELL_DRAGONS_BREATH_2    11190
-
+// On Aggro
 #define SAY_AGGRO                       "Don't value your life very much, do you?"
 #define SOUND_SAY_AGGRO                 11186
 
+//On Kill Unit
 #define SAY_SLAY                        "And don't come back!"
 #define SOUND_SLAY                      11187
 
+// On Death
 #define SAY_DEATH                       "Anu... bala belore...alon."
 #define SOUND_DEATH                     11192
@@ -50,5 +54,5 @@
 struct TRINITY_DLL_DECL boss_nethermancer_sepethreaAI : public ScriptedAI
 {
-    boss_nethermancer_sepethreaAI(Creature *c) : ScriptedAI(c) { Reset(); }
+    boss_nethermancer_sepethreaAI(Creature *c) : ScriptedAI(c) {Reset();}
 
     uint32 frost_attack_Timer;
@@ -58,18 +62,23 @@
     uint32 solarburn_Timer;
 
-    void Reset()
-    {
-        frost_attack_Timer = 10000;
-        arcane_blast_Timer = 15000;
-        dragons_breath_Timer = 20000;
-        knockback_Timer = 25000;
+    void Reset()    
+    {
+        frost_attack_Timer = 7000 + rand()%3000;        
+        arcane_blast_Timer = 12000 + rand()%6000;
+        dragons_breath_Timer = 18000 + rand()%4000;
+        knockback_Timer = 22000 + rand()%6000;
         solarburn_Timer = 30000;
-    }
-
-    void Aggro(Unit *who)
-    {
-    }
-
-    void KilledUnit(Unit* victim)
+    }  
+
+    void Aggro(Unit *who)    
+    {   
+        for(int i = 0; i < 1;i++)  //Summon two Guards
+	{
+            DoCast(m_creature->getVictim(),SPELL_SUMMON_RAGIN_FLAMES);  
+        }   
+    }     
+
+    // On Killed Unit    
+    void KilledUnit(Unit* victim)    
     {
         DoYell(SAY_SLAY, LANG_UNIVERSAL, NULL);
@@ -77,88 +86,128 @@
     }
 
-    void JustDied(Unit* Killer)
-    {
+    // On Death    
+    void JustDied(Unit* Killer)    
+    {        
         DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
-        DoPlaySoundToSet(m_creature, SOUND_DEATH);
+        DoPlaySoundToSet(m_creature, SOUND_DEATH);  
+        ScriptedInstance *pInstance = ((ScriptedInstance*)m_creature->GetInstanceData());
+        if(pInstance)
+            pInstance->SetData(DATA_SEPETHREA_DEATH, 0);
     }
 
     void UpdateAI(const uint32 diff)
     {
-        if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
-            return;
-
-        //Frost Attack
-        if(frost_attack_Timer < diff)
-        {
+        
+        //Return since we have no target
+        if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )            
+            return;  
+
+        //Check for Frost Attack        
+        if(frost_attack_Timer < diff)        
+        {            
+            //time to cast            
             DoCast(m_creature->getVictim(),SPELL_FROST_ATTACK);
-            frost_attack_Timer = 10000;
+
+            //Cast again on time            
+            frost_attack_Timer = 7000 + rand()%30000;               
         }else frost_attack_Timer -= diff;
 
-        //Arcane Blast
-        if(arcane_blast_Timer < diff)
-        {
+        //Check for Arcane Blast        
+        if(arcane_blast_Timer < diff)        
+        {            
+            //time to cast            
             DoCast(m_creature->getVictim(),SPELL_ARCANE_BLAST);
-            arcane_blast_Timer = 15000;
+
+            //Cast again on time            
+            arcane_blast_Timer = 15000;                
         }else arcane_blast_Timer -= diff;
 
-        //Dragons Breath
-        if(dragons_breath_Timer < diff)
-        {
+        //Check for Dragons Breath        
+        if(dragons_breath_Timer < diff)        
+        {            
+            //time to cast            
             DoCast(m_creature->getVictim(),SPELL_DRAGONS_BREATH);
-            dragons_breath_Timer = 20000;
-
-            if (rand()%2)
-                return;
-
-            switch(rand()%2)
+
             {
+
+                if (rand()%2)
+                    return;
+
+                switch(rand()%2)
+                {
                 case 0:
-                    DoYell(SAY_SPELL_DRAGONS_BREATH_1, LANG_UNIVERSAL, NULL);
+                    DoYell(SAY_SPELL_DRAGONS_BREATH_1, LANG_UNIVERSAL, NULL);                    
                     DoPlaySoundToSet(m_creature,SOUND_SPELL_DRAGONS_BREATH_1);
                     break;
+
                 case 1:
                     DoYell(SAY_SPELL_DRAGONS_BREATH_2, LANG_UNIVERSAL, NULL);
                     DoPlaySoundToSet(m_creature,SOUND_SPELL_DRAGONS_BREATH_2);
                     break;
+                }
             }
-        }else dragons_breath_Timer -= diff;
-
-        //Knockback
-        if(knockback_Timer < diff)
-        {
-            DoCast(m_creature->getVictim(),SPELL_KNOCKBACK);
-            knockback_Timer = 25000;
+            //Cast again on time            
+            dragons_breath_Timer = 12000 + rand()%10000;                
+
+        }else dragons_breath_Timer -= diff;          
+
+        //Check for Knockback        
+        if(knockback_Timer < diff)        
+        {            
+
+            //time to cast            
+            DoCast(m_creature->getVictim(),SPELL_KNOCKBACK);             
+
+            //Cast again on time            
+            knockback_Timer = 15000 + rand()%10000;                
+
         }else knockback_Timer -= diff;
 
-        //Solarburn
-        if(solarburn_Timer < diff)
-        {
-            DoCast(m_creature->getVictim(),SPELL_SOLARBURN);
-            solarburn_Timer = 30000;
+        //Check for Solarburn        
+        if(solarburn_Timer < diff)        
+
+        {            
+
+            //time to cast            
+            DoCast(m_creature->getVictim(),SPELL_SOLARBURN);             
+
+            //Cast again on time            
+            solarburn_Timer = 30000;                
+
         }else solarburn_Timer -= diff;
 
         DoMeleeAttackIfReady();
-    }
+
+    } 
 };
 
 CreatureAI* GetAI_boss_nethermancer_sepethrea(Creature *_Creature)
-{
+{    
     return new boss_nethermancer_sepethreaAI (_Creature);
 }
-
 struct TRINITY_DLL_DECL mob_ragin_flamesAI : public ScriptedAI
 {
-    mob_ragin_flamesAI(Creature *c) : ScriptedAI(c) {Reset();}
+    mob_ragin_flamesAI(Creature *c) : ScriptedAI(c)
+    {
+        pInstance = ((ScriptedInstance*)c->GetInstanceData());
+        Reset();
+    }
+
+    ScriptedInstance *pInstance;
 
     uint32 inferno_Timer;
     uint32 flame_timer;
+    uint32 Check_Timer;
 
     bool onlyonce;
 
     void Reset()
-    {
+    {   
         inferno_Timer = 10000;
-        flame_timer = 200;
+        flame_timer = 500;
+        Check_Timer = 2000;
         onlyonce = false;
+        m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
+        m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true);
     }
 
@@ -185,11 +234,9 @@
         if(inferno_Timer < diff)
         {
-            DoCast(m_creature->getVictim(),SPELL_INFERNO);
+            DoCast(m_creature->getVictim(),SPELL_INFERNO); 
+
+            m_creature->TauntApply(m_creature->getVictim());
+
             inferno_Timer = 10000;
-
-            Unit* target = NULL;
-            target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
-            m_creature->GetMotionMaster()->MoveChase(target);
         }else inferno_Timer -= diff;
 
@@ -197,9 +244,27 @@
         {
             DoCast(m_creature,SPELL_FIRE_TAIL);
-            flame_timer = 200;
+            flame_timer = 500;
+
         }else flame_timer -=diff;
 
+        //Check_Timer
+        if(Check_Timer < diff)
+        {
+            if(pInstance)
+            {
+                if(pInstance->GetData(DATA_SEPETHREAISDEAD))
+                {
+                    //remove
+                    m_creature->setDeathState(JUST_DIED);
+                    m_creature->RemoveCorpse();
+                }
+            }
+
+            Check_Timer = 1000;
+        }else Check_Timer -= diff;
+
         DoMeleeAttackIfReady();
     }
+
 };
 CreatureAI* GetAI_mob_ragin_flames(Creature *_Creature)
@@ -207,17 +272,15 @@
     return new mob_ragin_flamesAI (_Creature);
 }
-
 void AddSC_boss_nethermancer_sepethrea()
-{
-    Script *newscript;
-
-    newscript = new Script;
-    newscript->Name="boss_nethermancer_sepethrea";
-    newscript->GetAI = GetAI_boss_nethermancer_sepethrea;
+{    
+    Script *newscript;    
+    newscript = new Script;    
+    newscript->Name="boss_nethermancer_sepethrea";    
+    newscript->GetAI = GetAI_boss_nethermancer_sepethrea;    
     m_scripts[nrscripts++] = newscript;
 
-    newscript = new Script;
-    newscript->Name="mob_ragin_flames";
-    newscript->GetAI = GetAI_mob_ragin_flames;
+    newscript = new Script;    
+    newscript->Name="mob_ragin_flames";    
+    newscript->GetAI = GetAI_mob_ragin_flames;    
     m_scripts[nrscripts++] = newscript;
 }
Index: /trunk/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/def_mechanar.h
===================================================================
--- /trunk/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/def_mechanar.h (revision 223)
+++ /trunk/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/def_mechanar.h (revision 223)
@@ -0,0 +1,6 @@
+#ifndef DEF_MECHANAR_H
+#define DEF_MECHANAR_H
+
+#define DATA_SEPETHREA_DEATH 1
+#define DATA_SEPETHREAISDEAD 2
+#endif
Index: /trunk/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp
===================================================================
--- /trunk/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp (revision 223)
+++ /trunk/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp (revision 223)
@@ -0,0 +1,90 @@
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/* ScriptData
+SDName: Instance_Mechanar
+SD%Complete: 100
+SDComment: 
+SDCategory: Mechanar
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_mechanar.h"
+
+struct TRINITY_DLL_DECL instance_mechanar : public ScriptedInstance
+{
+    instance_mechanar(Map *Map) : ScriptedInstance(Map) {Initialize();};
+
+    
+    bool IsBossDied[1];
+
+    void OnCreatureCreate (Creature *creature, uint32 creature_entry)
+    {
+    } 
+
+    void Initialize()
+    {
+        IsBossDied[0] = false;
+    }
+
+    bool IsEncounterInProgress() const 
+    {
+        //not active
+        return false;
+    }
+
+    uint32 GetData(uint32 type)
+    {
+        switch(type)
+        {
+            case DATA_SEPETHREAISDEAD:
+                if(IsBossDied[0])
+                    return 1;
+                break;
+        }
+
+        return 0;
+    }
+
+    uint64 GetData64 (uint32 identifier)
+    {
+        return 0;
+    }
+
+    void SetData(uint32 type, uint32 data)
+    {
+        switch(type)
+        {
+            case DATA_SEPETHREA_DEATH:
+                IsBossDied[0] = true;
+                break;
+        }
+    }
+};
+
+InstanceData* GetInstanceData_instance_mechanar(Map* map)
+{
+    return new instance_mechanar(map);
+}
+
+void AddSC_instance_mechanar()
+{
+    Script *newscript;
+    newscript = new Script;
+    newscript->Name = "instance_mechanar";
+    newscript->GetInstanceData = GetInstanceData_instance_mechanar;
+    m_scripts[nrscripts++] = newscript;
+}
Index: /trunk/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp
===================================================================
--- /trunk/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp (revision 90)
+++ /trunk/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp (revision 223)
@@ -1,22 +1,22 @@
 /* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
 
 /* ScriptData
 SDName: Boss Gatewatcher Ironhand
 SD%Complete: 100
-SDComment:
+SDComment: 
 SDCategory: Tempest Keep, The Mechanar
 EndScriptData */
@@ -24,45 +24,48 @@
 #include "precompiled.h"
 
-#define SPELL_SHADOW_POWER              35322
-#define SPELL_JACKHAMMER                35326
-#define SPELL_STREAM_OF_MACHINE_FLUID   35311
+// Spells to be casted
+#define SPELL_SHADOW_POWER 35322
+#define SPELL_JACKHAMMER 35326
+#define SPELL_STREAM_OF_MACHINE_FLUID 35311
 
-#define SAY_SPELL_JACKHAMMER_1          "With the precise angle and velocity... "
-#define SOUND_SPELL_JACKHAMMER_1        11112
-#define SAY_SPELL_JACKHAMMER_2          "Low tech yet quiet effective!"
-#define SOUND_SPELL_JACKHAMMER_2        11113
+#define SAY_SPELL_JACKHAMMER_1   "With the precise angle and velocity... "
+#define SOUND_SPELL_JACKHAMMER_1 11112
+#define SAY_SPELL_JACKHAMMER_2  "Low tech yet quiet effective!"
+#define SOUND_SPELL_JACKHAMMER_2 11113
+// On Aggro
+#define SAY_AGGRO_1          "You have approximately five seconds to live."
+#define SOUND_SAY_AGGRO_1    11109 
 
-#define SAY_AGGRO_1                     "You have approximately five seconds to live."
-#define SOUND_SAY_AGGRO_1               11109
+//On Kill Unit
+#define SAY_SLAY_1            "A foregone conclusion."
+#define SOUND_SLAY_1 11110
+#define SAY_SLAY_2 "The processing will continue a schedule!"
+#define SOUND_SLAY_2 11111
+// On Death
+#define SAY_DEATH_1            "My calculations did not... "
+#define SOUND_DEATH_1 11114  
 
-#define SAY_SLAY_1                      "A foregone conclusion."
-#define SOUND_SLAY_1                    11110
-#define SAY_SLAY_2                      "The processing will continue a schedule!"
-#define SOUND_SLAY_2                    11111
+// Gatewatcher Iron-Hand AI
+struct TRINITY_DLL_DECL boss_gatewatcher_iron_handAI : public ScriptedAI
+{    
+    boss_gatewatcher_iron_handAI(Creature *c) : ScriptedAI(c)    { Reset(); }     
 
-#define SAY_DEATH_1                     "My calculations did not... "
-#define SOUND_DEATH_1                   11114
+    uint32 Shadow_Power_Timer;    
+    uint32 Jackhammer_Timer;
+    uint32 Stream_of_Machine_Fluid_Timer;        
 
-
-struct TRINITY_DLL_DECL boss_gatewatcher_iron_handAI : public ScriptedAI
-{
-    boss_gatewatcher_iron_handAI(Creature *c) : ScriptedAI(c) { Reset(); }
-
-    uint32 Shadow_Power_Timer;
-    uint32 Jackhammer_Timer;
-    uint32 Stream_of_Machine_Fluid_Timer;
-
-    void Reset()
-    {
-        Shadow_Power_Timer = 25000;
+    void Reset()    
+    {         
+        Shadow_Power_Timer = 25000;        
         Jackhammer_Timer = 45000;
         Stream_of_Machine_Fluid_Timer = 55000;
-    }
 
-    void Aggro(Unit *who)
-    {
-    }
+    }     
+    void Aggro(Unit *who)    
+    {        
+    }     
 
-    void KilledUnit(Unit* victim)
+    // On Killed Unit    
+    void KilledUnit(Unit* victim)    
     {
         if (rand()%2)
@@ -71,37 +74,44 @@
         switch(rand()%2)
         {
-            case 0:
-                DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
-                DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
-                break;
-            case 1:
-                DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
-                DoPlaySoundToSet(m_creature,SOUND_SLAY_2);
-                break;
+        case 0:
+            DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
+            DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
+            break;
+
+        case 1:
+            DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
+            DoPlaySoundToSet(m_creature,SOUND_SLAY_2);
+            break;        
         }
+    }   
+
+    // On Death    
+    void JustDied(Unit* Killer)    
+    {        
+        DoYell(SAY_DEATH_1,LANG_UNIVERSAL,NULL);        
+        DoPlaySoundToSet(m_creature, SOUND_DEATH_1);    
     }
 
-    void JustDied(Unit* Killer)
-    {
-        DoYell(SAY_DEATH_1,LANG_UNIVERSAL,NULL);
-        DoPlaySoundToSet(m_creature, SOUND_DEATH_1);
-    }
+    void UpdateAI(const uint32 diff)    
+    {       
+        //Return since we have no target        
+        if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )            
+            return;         
 
-    void UpdateAI(const uint32 diff)
-    {
-        if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
-            return;
+        //Check for Shadow Power        
+        if(Shadow_Power_Timer < diff)        
+        {            
+            //time to cast            
+            DoCast(m_creature,SPELL_SHADOW_POWER);
 
-        //Shadow Power
-        if(Shadow_Power_Timer < diff)
-        {
-            DoCast(m_creature,SPELL_SHADOW_POWER);
-            Shadow_Power_Timer = 25000;
-        }else Shadow_Power_Timer -= diff;
+            //Cast again on time            
+            Shadow_Power_Timer = 20000 + rand()%8000;                
+        }else Shadow_Power_Timer -= diff;         
 
-        //Jack Hammer
-        if(Jackhammer_Timer < diff)
-        {
-            DoCast(m_creature->getVictim(),SPELL_JACKHAMMER);
+        //Check for Jack Hammer        
+        if(Jackhammer_Timer < diff)        
+        {            
+            //time to cast            
+            DoCast(m_creature->getVictim(),SPELL_JACKHAMMER);             
 
             if (rand()%2)
@@ -110,38 +120,42 @@
             switch(rand()%2)
             {
-                case 0:
-                    DoYell(SAY_SPELL_JACKHAMMER_1, LANG_UNIVERSAL, NULL);
-                    DoPlaySoundToSet(m_creature,SOUND_SPELL_JACKHAMMER_1);
-                    break;
-                case 1:
-                    DoYell(SAY_SPELL_JACKHAMMER_2, LANG_UNIVERSAL, NULL);
-                    DoPlaySoundToSet(m_creature,SOUND_SPELL_JACKHAMMER_2);
-                    break;
-            }
+            case 0:
+                DoYell(SAY_SPELL_JACKHAMMER_1, LANG_UNIVERSAL, NULL);                    
+                DoPlaySoundToSet(m_creature,SOUND_SPELL_JACKHAMMER_1);
+                break;
 
-            Jackhammer_Timer = 45000;
-        }else Jackhammer_Timer -= diff;
+            case 1:
+                DoYell(SAY_SPELL_JACKHAMMER_2, LANG_UNIVERSAL, NULL);
+                DoPlaySoundToSet(m_creature,SOUND_SPELL_JACKHAMMER_2);
+                break;
+            }        
+            //Cast again on time            
+            Jackhammer_Timer = 30000;                
+        }else Jackhammer_Timer -= diff;          
 
-        //Stream of Machine Fluid
-        if(Stream_of_Machine_Fluid_Timer < diff)
-        {
-            DoCast(m_creature->getVictim(),SPELL_STREAM_OF_MACHINE_FLUID);
-            Stream_of_Machine_Fluid_Timer = 55000;
+        //Check for Stream of Machine Fluid        
+        if(Stream_of_Machine_Fluid_Timer < diff)        
+        {            
+            //time to cast            
+            DoCast(m_creature->getVictim(),SPELL_STREAM_OF_MACHINE_FLUID);             
+
+            //Cast again on time            
+            Stream_of_Machine_Fluid_Timer = 35000 + rand()%15000;                
         }else Stream_of_Machine_Fluid_Timer -= diff;
 
         DoMeleeAttackIfReady();
-    }
-};
+    } 
+};   
 CreatureAI* GetAI_boss_gatewatcher_iron_hand(Creature *_Creature)
-{
+{    
     return new boss_gatewatcher_iron_handAI (_Creature);
-}
+} 
 
 void AddSC_boss_gatewatcher_iron_hand()
-{
-    Script *newscript;
-    newscript = new Script;
-    newscript->Name="boss_gatewatcher_iron_hand";
-    newscript->GetAI = GetAI_boss_gatewatcher_iron_hand;
+{    
+    Script *newscript;    
+    newscript = new Script;    
+    newscript->Name="boss_gatewatcher_iron_hand";    
+    newscript->GetAI = GetAI_boss_gatewatcher_iron_hand;    
     m_scripts[nrscripts++] = newscript;
 }
Index: /trunk/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp
===================================================================
--- /trunk/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp (revision 223)
+++ /trunk/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp (revision 223)
@@ -0,0 +1,306 @@
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+/* ScriptData
+SDName: Boss Pathaleon the Calculator
+SD%Complete: 50
+SDComment: Event missing. Script for himself 99% blizzlike.
+SDCategory: Tempest Keep, The Mechanar
+EndScriptData */
+
+#include "precompiled.h"
+
+// Spells to be casted
+#define SPELL_SUMMON_NETHER_WRAITH    35287   //Spell not working. Summon is working but Pets dont attack and wrong HP.
+#define SPELL_MANA_TAP                36021
+#define SPELL_ARCANE_TORRENT          36022
+#define SPELL_DOMINATION              35280
+#define H_SPELL_ARCANE_EXPLOSION      34791  //Spell not right.
+#define SPELL_ENRAGE                  36992
+
+// Add Spells
+#define SPELL_DETONATION              35058
+#define SPELL_ARCANE_MISSILES         35034
+
+// On Domination
+#define SAY_SPELL_DOMINATION_1    "I'm looking for a team player... "
+#define SOUND_SPELL_DOMINATION_1  11197
+#define SAY_SPELL_DOMINATION_2    "You work for me now!"
+#define SOUND_SPELL_DOMINATION_2  11198
+
+// On Summon
+#define SAY_SUMMON_1          "Time to supplement my work force."
+#define SOUND_SAY_SUMMON_1    11196 
+
+// On Enrage
+#define SAY_ENRAGE_1          "A minor inconvenience."
+#define SOUND_SAY_ENRAGE_1    11199 
+
+// On Aggro
+#define SAY_AGGRO_1          "We are on a strict timetable. You will not interfere!"
+#define SOUND_SAY_AGGRO_1    11193 
+
+//On Kill Unit
+#define SAY_SLAY_1           "Looks like you lose"
+#define SOUND_SLAY_1         11195
+
+// On Death
+#define SAY_DEATH_1          "The project will... continue."
+#define SOUND_DEATH_1        11200  
+
+
+struct TRINITY_DLL_DECL boss_pathaleon_the_calculatorAI : public ScriptedAI
+{    
+    boss_pathaleon_the_calculatorAI(Creature *c) : ScriptedAI(c)
+    {         
+        HeroicMode = m_creature->GetMap()->IsHeroic();
+        Reset();
+    }
+
+    uint32 Summon_Timer;    
+    uint32 ManaTap_Timer;
+    uint32 ArcaneTorrent_Timer;      
+    uint32 Domination_Timer; 
+    uint32 ArcaneExplosion_Timer;   
+    bool HeroicMode;
+    bool Enraged;
+
+    uint32 Counter;
+    Creature* Wraith;
+
+    void Reset()    
+    {         
+        Summon_Timer = 30000;        
+        ManaTap_Timer = 12000 + rand()%8000;
+        ArcaneTorrent_Timer = 16000 + rand()%9000;
+        Domination_Timer = 25000 + rand()%15000;
+        ArcaneExplosion_Timer = 8000 + rand()%5000;
+        
+        Enraged = false;
+
+        Counter = 0;
+
+    }     
+    void Aggro(Unit *who)    
+    {       
+        DoYell(SAY_AGGRO_1,LANG_UNIVERSAL,NULL);        
+        DoPlaySoundToSet(m_creature, SOUND_SAY_AGGRO_1);     
+    }     
+
+    // On Killed Unit    
+    void KilledUnit(Unit* victim)    
+    {
+
+        DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
+        DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
+
+    }   
+
+    // On Death    
+    void JustDied(Unit* Killer)    
+    {        
+        DoYell(SAY_DEATH_1,LANG_UNIVERSAL,NULL);        
+        DoPlaySoundToSet(m_creature, SOUND_DEATH_1);    
+    }
+
+    void UpdateAI(const uint32 diff)    
+    {       
+        //Return since we have no target        
+        if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )            
+            return;         
+       
+        if(Summon_Timer < diff)        
+        {      
+
+            Unit* target = NULL;   
+
+            for(int i = 0; i < 3;i++)
+            {   
+            target = SelectUnit(SELECT_TARGET_RANDOM,0);
+            Wraith = m_creature->SummonCreature(21062,m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+            if (target)
+            Wraith->AI()->AttackStart(target);
+            }
+
+            DoYell(SAY_SUMMON_1,LANG_UNIVERSAL,NULL);        
+            DoPlaySoundToSet(m_creature, SOUND_SAY_SUMMON_1); 
+ 
+            Summon_Timer = 30000 + rand()%15000;         
+        }else Summon_Timer -= diff;         
+       
+        if(ManaTap_Timer < diff)        
+        {            
+            //time to cast            
+            DoCast(m_creature->getVictim(),SPELL_MANA_TAP);             
+
+            //Cast again on time            
+            ManaTap_Timer = 14000 + rand()%8000;                
+        }else ManaTap_Timer -= diff;  
+        
+        if(ArcaneTorrent_Timer < diff)        
+        {            
+            //time to cast            
+            DoCast(m_creature->getVictim(),SPELL_ARCANE_TORRENT);             
+
+            //Cast again on time            
+            ArcaneTorrent_Timer = 12000 + rand()%6000;                
+        }else ArcaneTorrent_Timer -= diff;  
+        
+        if(Domination_Timer < diff)        
+        {            
+            //time to cast        
+            switch(rand()%2)
+            {
+            case 0:
+                DoYell(SAY_SPELL_DOMINATION_1, LANG_UNIVERSAL, NULL);
+                DoPlaySoundToSet(m_creature, SOUND_SPELL_DOMINATION_1);
+            break;
+
+            case 1:
+                DoYell(SAY_SPELL_DOMINATION_2, LANG_UNIVERSAL, NULL);
+                DoPlaySoundToSet(m_creature, SOUND_SPELL_DOMINATION_2);
+            break;
+            }
+        
+            Unit* target = NULL;
+            target = SelectUnit(SELECT_TARGET_RANDOM,1);
+            if (target) DoCast(target,SPELL_DOMINATION);             
+
+            //Cast again on time            
+            Domination_Timer = 25000 + rand()%5000;               
+        }else Domination_Timer -= diff;          
+     
+        //Only casting if Heroic Mode is used
+        if (HeroicMode)
+        {
+            if(ArcaneExplosion_Timer < diff)        
+            {            
+                //time to cast            
+                DoCast(m_creature->getVictim(),H_SPELL_ARCANE_EXPLOSION);             
+
+                //Cast again on time            
+                ArcaneExplosion_Timer = 10000 + rand()%4000;                
+            }else ArcaneExplosion_Timer -= diff;
+        }
+        
+        if (!Enraged && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 21)
+        {
+
+            DoCast(m_creature, SPELL_ENRAGE);
+            DoYell(SAY_ENRAGE_1, LANG_UNIVERSAL, NULL);
+            DoPlaySoundToSet(m_creature,SOUND_SAY_ENRAGE_1);
+            Enraged = true;
+
+        }
+
+        DoMeleeAttackIfReady();
+    } 
+};   
+CreatureAI* GetAI_boss_pathaleon_the_calculator(Creature *_Creature)
+{    
+    return new boss_pathaleon_the_calculatorAI (_Creature);
+} 
+
+struct TRINITY_DLL_DECL mob_nether_wraithAI : public ScriptedAI
+{
+    mob_nether_wraithAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+    ScriptedInstance *pInstance;
+
+    uint32 ArcaneMissiles_Timer;
+    uint32 Detonation_Timer;
+    uint32 Die_Timer;
+    bool Detonation;
+
+    void Reset()
+    {   
+        ArcaneMissiles_Timer = 1000 + rand()%3000;
+        Detonation_Timer = 20000;
+        Die_Timer = 2200;
+        Detonation = false;
+
+    }
+
+    void Aggro(Unit* who)
+    {
+    }
+
+    void UpdateAI(const uint32 diff)
+    {
+        Unit* target = NULL;
+
+        if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+            return;
+
+        if(ArcaneMissiles_Timer < diff)
+        {
+
+            Unit* target = NULL;
+            target = SelectUnit(SELECT_TARGET_RANDOM,1);
+            if (!target)
+            target = m_creature->getVictim();
+            if (target)
+            {
+            DoCast(target,SPELL_ARCANE_MISSILES);
+            }
+
+            ArcaneMissiles_Timer = 5000 + rand()%5000;
+        }else ArcaneMissiles_Timer -=diff;
+
+        if (!Detonation)
+        {
+            if(Detonation_Timer < diff)        
+            {            
+                //time to cast            
+                DoCast(m_creature,SPELL_DETONATION);    
+                Detonation = true;         
+        
+            }else Detonation_Timer -= diff;  
+
+        }
+
+        if (Detonation)
+        {
+            if (Die_Timer < diff)
+            {
+                m_creature->setDeathState(JUST_DIED);
+                m_creature->RemoveCorpse();
+            }else Die_Timer -= diff;
+        }
+
+
+        DoMeleeAttackIfReady();
+    }
+
+};
+CreatureAI* GetAI_mob_nether_wraith(Creature *_Creature)
+{
+    return new mob_nether_wraithAI (_Creature);
+}
+
+void AddSC_boss_pathaleon_the_calculator()
+{    
+    Script *newscript;    
+    newscript = new Script;    
+    newscript->Name="boss_pathaleon_the_calculator";    
+    newscript->GetAI = GetAI_boss_pathaleon_the_calculator;    
+    m_scripts[nrscripts++] = newscript;
+
+    newscript = new Script;    
+    newscript->Name="mob_nether_wraith";    
+    newscript->GetAI = GetAI_mob_nether_wraith;    
+    m_scripts[nrscripts++] = newscript;
+}
Index: /trunk/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp
===================================================================
--- /trunk/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp (revision 109)
+++ /trunk/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp (revision 223)
@@ -7,16 +7,16 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /* ScriptData
-SDName: Boss_Sartura
+SDName: boss_sartura
 SD%Complete: 99
-SDComment:
+SDComment: 
 SDCategory: Temple of Ahn'Qiraj
 EndScriptData */
@@ -25,5 +25,5 @@
 
 #define SPELL_WHIRLWIND                              26083
-#define SPELL_ENRAGE                                 28747  //Not sure if right ID.
+#define SPELL_ENRAGE                                 28747            //Not sure if right ID.
 #define SPELL_ENRAGEHARD                             28798
 
@@ -31,4 +31,5 @@
 #define SPELL_WHIRLWINDADD                           26038
 #define SPELL_KNOCKBACK                              26027
+
 
 struct TRINITY_DLL_DECL boss_sarturaAI : public ScriptedAI
@@ -59,6 +60,7 @@
         WhirlWind = false;
         AggroReset = false;
-        Enraged = false;
+        Enraged = false; 
         EnragedHard = false;
+
     }
 
@@ -78,7 +80,5 @@
             {
                 //Attack random Gamers
-                Unit* target = NULL;
-                target = SelectUnit(SELECT_TARGET_RANDOM,1);
-                if (target)
+                if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1))
                     AttackStart(target);
 
@@ -105,11 +105,9 @@
             {
                 //Attack random Gamers
-                Unit* target = NULL;
-                target = SelectUnit(SELECT_TARGET_RANDOM,1);
-                if (target)
+                if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1))
                     m_creature->TauntApply(target);
 
-                AggroReset = true;
-                AggroReset_Timer = 2000 + rand()%3000;
+                    AggroReset = true;
+                    AggroReset_Timer = 2000 + rand()%3000;
             }else AggroReset_Timer -= diff;
 
@@ -120,5 +118,6 @@
                     AggroReset = false;
                     AggroResetEnd_Timer = 5000;
-                }AggroResetEnd_Timer -= diff;
+                    AggroReset_Timer = 35000 + rand()%10000;
+                } else AggroResetEnd_Timer -= diff;
             }
 
@@ -131,5 +130,5 @@
                     Enraged = true;
                 }
-            }
+            } 
 
             //After 10 minutes hard enrage
@@ -140,5 +139,5 @@
                     DoCast(m_creature, SPELL_ENRAGEHARD);
                     EnragedHard = true;
-                }EnrageHard_Timer -= diff;
+                } else EnrageHard_Timer -= diff;
             }
 
@@ -146,5 +145,6 @@
         }
     }
-};
+}; 
+
 
 struct TRINITY_DLL_DECL mob_sartura_royal_guardAI : public ScriptedAI
@@ -158,5 +158,5 @@
     uint32 AggroResetEnd_Timer;
     uint32 KnockBack_Timer;
-
+    
     bool WhirlWind;
     bool AggroReset;
@@ -170,7 +170,8 @@
         AggroResetEnd_Timer = 5000;
         KnockBack_Timer = 10000;
-
+        
         WhirlWind = false;
         AggroReset = false;
+
     }
 
@@ -198,7 +199,5 @@
             {
                 //Attack random Gamers
-                Unit* target = NULL;
-                target = SelectUnit(SELECT_TARGET_RANDOM,1);
-                if (target)
+                if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1))
                     m_creature->TauntApply(target);
 
@@ -214,10 +213,8 @@
         if (!WhirlWind)
         {
-            if(AggroReset_Timer < diff)
-            {
-                //Attack random Gamers
-                Unit* target = NULL;
-                target = SelectUnit(SELECT_TARGET_RANDOM,1);
-                if (target)
+            if (AggroReset_Timer < diff)
+            {
+                //Attack random Gamers
+                if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1))
                     AttackStart(target);
 
@@ -239,5 +236,6 @@
                 AggroReset = false;
                 AggroResetEnd_Timer = 5000;
-            }AggroResetEnd_Timer -= diff;
+                AggroReset_Timer = 30000 + rand()%10000;
+            } else AggroResetEnd_Timer -= diff;
         }
 
@@ -259,5 +257,4 @@
 {
     Script *newscript;
-
     newscript = new Script;
     newscript->Name="boss_sartura";
Index: /trunk/src/bindings/scripts/scripts/zone/shadowmoon_valley/boss_doomwalker.cpp
===================================================================
--- /trunk/src/bindings/scripts/scripts/zone/shadowmoon_valley/boss_doomwalker.cpp (revision 158)
+++ /trunk/src/bindings/scripts/scripts/zone/shadowmoon_valley/boss_doomwalker.cpp (revision 223)
@@ -1,22 +1,22 @@
 /* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
 
 /* ScriptData
 SDName: Boss_Doomwalker
 SD%Complete: 100
-SDComment:
+SDComment: 
 SDCategory: Shadowmoon Valley
 EndScriptData */
@@ -26,5 +26,5 @@
 //--------------------------------------
 //Spells
-#define SPELL_SUNDER_ARMOR          30901
+#define SPELL_SUNDER_ARMOR          33661
 
 #define SPELL_CHAIN_LIGHTNING       33665
@@ -36,5 +36,5 @@
 #define SOUND_OVERRUN_2             11348
 
-#define SPELL_ENRAGE                34624
+#define SPELL_ENRAGE                33653
 
 #define SPELL_MARK_DEATH            37128
@@ -45,8 +45,10 @@
 #define SAY_EARTHQUAKE_2            "Magnitude set. Release."
 #define SOUND_EARTHQUAKE_2          11346
-
+//---------------------------------------
+//Aggro
 #define SAY_AGGRO                   "Do not proceed. You will be eliminated!"
 #define SOUND_AGGRO                 11344
-
+//---------------------------------------
+//Slay
 #define SAY_SLAY_1                  "Threat level zero."
 #define SOUND_SLAY_1                11349
@@ -55,5 +57,6 @@
 #define SAY_SLAY_3                  "Target exterminated."
 #define SOUND_SLAY_3                11351
-
+//---------------------------------------
+//Death
 #define SAY_DEATH                   "System failure in five... four..."
 #define SOUND_DEATH                 11352
@@ -63,8 +66,9 @@
     boss_doomwalkerAI(Creature *c) : ScriptedAI(c) {Reset();}
 
+
     uint32 Chain_Timer;
-    uint32 Enrage_Timer;
+    uint32 Enrage_Timer; 
     uint32 Overrun_Timer;
-    uint32 Quake_Timer;
+    uint32 Quake_Timer; 
     uint32 Armor_Timer;
 
@@ -74,10 +78,10 @@
     {
         Enrage_Timer    = 0;
-        Armor_Timer     = 10000;
-        Chain_Timer     = 20000;
-        Quake_Timer     = 60000;
-        Overrun_Timer   = 120000;
-
-        InEnrage = false;
+        Armor_Timer     = 5000 + rand()%8000;
+        Chain_Timer     = 10000 + rand()%20000;
+        Quake_Timer     = 25000 + rand()%10000;
+        Overrun_Timer   = 30000 + rand()%15000;
+
+        InEnrage = false;        
     }
 
@@ -89,16 +93,16 @@
         switch(rand()%3)
         {
-            case 0:
-                DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
-                DoPlaySoundToSet(m_creature, SOUND_SLAY_1);
-                break;
-            case 1:
-                DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
-                DoPlaySoundToSet(m_creature, SOUND_SLAY_2);
-                break;
-            case 2:
-                DoYell(SAY_SLAY_3, LANG_UNIVERSAL, NULL);
-                DoPlaySoundToSet(m_creature, SOUND_SLAY_3);
-                break;
+        case 0:
+            DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
+            DoPlaySoundToSet(m_creature, SOUND_SLAY_1);
+            break;
+        case 1:
+            DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
+            DoPlaySoundToSet(m_creature, SOUND_SLAY_2);
+            break;
+        case 2:
+            DoYell(SAY_SLAY_3, LANG_UNIVERSAL, NULL);
+            DoPlaySoundToSet(m_creature, SOUND_SLAY_3);
+            break;
         }
     }
@@ -112,18 +116,19 @@
     void Aggro(Unit *who)
     {
-        DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
-        DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+                DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+                DoPlaySoundToSet(m_creature, SOUND_AGGRO);
     }
 
     void UpdateAI(const uint32 diff)
     {
+
         if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
             return;
 
-        if (m_creature->IsWithinCombatDist(m_creature->getVictim(), ATTACK_DISTANCE))
+        if (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
         {
-            //when hp <= 20% gain enrage
-            if (((m_creature->GetHealth()*100)/ m_creature->GetMaxHealth()) <= 20)
-            {
+            //Spell Enrage   
+            if (((m_creature->GetHealth()*100)/ m_creature->GetMaxHealth()) <= 20)//when hp <= 20% gain enrage
+            {   
                 if(Enrage_Timer < diff)
                 {
@@ -136,18 +141,18 @@
             //Spell Overrun
             if (Overrun_Timer < diff)
-            {
+            {   
                 switch(rand()%2)
                 {
-                    case 0:
-                        DoYell(SAY_OVERRUN_1, LANG_UNIVERSAL, NULL);
-                        DoPlaySoundToSet(m_creature, SOUND_OVERRUN_1);
-                        break;
-                    case 1:
-                        DoYell(SAY_OVERRUN_2, LANG_UNIVERSAL, NULL);
-                        DoPlaySoundToSet(m_creature, SOUND_OVERRUN_2);
-                        break;
+                case 0:
+                    DoYell(SAY_OVERRUN_1, LANG_UNIVERSAL, NULL);
+                    DoPlaySoundToSet(m_creature, SOUND_OVERRUN_1);
+                    break;
+                case 1:
+                    DoYell(SAY_OVERRUN_2, LANG_UNIVERSAL, NULL);
+                    DoPlaySoundToSet(m_creature, SOUND_OVERRUN_2);
+                    break;
                 }
                 DoCast(m_creature->getVictim(),SPELL_OVERRUN);
-                Overrun_Timer = (30 + rand()% 40) * 1000;   //30-70sec cooldown
+                Overrun_Timer = 25000 + rand()%15000;
 
             }else Overrun_Timer -= diff;
@@ -161,12 +166,12 @@
                 switch(rand()%2)
                 {
-                    case 0:
-                        DoYell(SAY_EARTHQUAKE_1, LANG_UNIVERSAL, NULL);
-                        DoPlaySoundToSet(m_creature, SOUND_EARTHQUAKE_1);
-                        break;
-                    case 1:
-                        DoYell(SAY_EARTHQUAKE_2, LANG_UNIVERSAL, NULL);
-                        DoPlaySoundToSet(m_creature, SOUND_EARTHQUAKE_2);
-                        break;
+                case 0:
+                    DoYell(SAY_EARTHQUAKE_1, LANG_UNIVERSAL, NULL);
+                    DoPlaySoundToSet(m_creature, SOUND_EARTHQUAKE_1);
+                    break;
+                case 1:
+                    DoYell(SAY_EARTHQUAKE_2, LANG_UNIVERSAL, NULL);
+                    DoPlaySoundToSet(m_creature, SOUND_EARTHQUAKE_2);
+                    break;
                 }
                 if(InEnrage)
@@ -175,5 +180,5 @@
                 }
                 DoCast(m_creature,SPELL_EARTHQUAKE);
-                Quake_Timer = (70 + rand()% 30) * 1000;     //70-100sec cooldown
+                Quake_Timer = 30000 + rand()%25000;
             }else Quake_Timer -= diff;
 
@@ -182,12 +187,12 @@
             {
                 DoCast(m_creature->getVictim(),SPELL_CHAIN_LIGHTNING);
-                Chain_Timer = (50 + rand()% 50) * 1000;     //50-100sec cooldown
+                Chain_Timer = 15000 + rand()%25000;
             }else Chain_Timer -= diff;
 
-            //Spell Sunder Armor
+            //Spell Sunder Armor        
             if (Armor_Timer < diff)
             {
                 DoCast(m_creature->getVictim(),SPELL_SUNDER_ARMOR);
-                Armor_Timer = (15 + rand()% 7) * 1000;      //15-23sec cooldown about 70 proc to stack
+                Armor_Timer = 15000 + rand()%15000;
             }else Armor_Timer -= diff;
 
@@ -195,5 +200,5 @@
         }
     }
-};
+}; 
 
 CreatureAI* GetAI_boss_doomwalker(Creature *_Creature)
Index: /trunk/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp
===================================================================
--- /trunk/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp (revision 115)
+++ /trunk/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp (revision 223)
@@ -163,7 +163,7 @@
         soulclass = 0;
 
-        Fear_timer = 20000;
+        Fear_timer = 15000 + rand()% 5000;
         Ribbon_of_Souls_timer = 5000;
-        StolenSoul_Timer = 30000;
+        StolenSoul_Timer = 25000 + rand()% 10000;
 
         HasTaunted = false;
@@ -251,5 +251,5 @@
             DoCast(m_creature, SPELL_SUMMON_AVATAR);
             Avatar_summoned = true;
-            StolenSoul_Timer = 45000;
+            StolenSoul_Timer = 15000 + rand()% 15000;
         }
 
@@ -276,5 +276,5 @@
                     DoSpawnCreature(ENTRY_STOLEN_SOUL,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
 
-                    StolenSoul_Timer = 45000;
+                    StolenSoul_Timer = 20000 + rand()% 10000;
                 } else StolenSoul_Timer = 1000;
             }
@@ -292,5 +292,5 @@
         {
             DoCast(m_creature,SPELL_SOUL_SCREAM);
-            Fear_timer = 25000 + rand()% 10000;
+            Fear_timer = 15000 + rand()% 15000;
         }else Fear_timer -= diff;
 
Index: /trunk/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp
===================================================================
--- /trunk/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp (revision 166)
+++ /trunk/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp (revision 223)
@@ -60,5 +60,5 @@
     void Reset()
     {
-        LightningCloud_Timer = 28000;
+        LightningCloud_Timer = 15000;
         LungBurst_Timer = 7000;
         EnvelopingWinds_Timer = 9000;
@@ -112,5 +112,5 @@
                 if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
                     DoCast(target, SPELL_LIGHTNING_CLOUD);
-            LightningCloud_Timer = 28000;
+            LightningCloud_Timer = 15000+rand()%10000;
         }else LightningCloud_Timer -=diff;
 
@@ -120,5 +120,5 @@
             if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
                 DoCast(target, SPELL_LUNG_BURST);
-            LungBurst_Timer = 10000+rand()%5000;
+            LungBurst_Timer = 7000+rand()%5000;
         }else LungBurst_Timer -=diff;
 
@@ -165,5 +165,5 @@
         {
             DoCast(m_creature, HeroicMode ? H_SPELL_WATER_BOLT_VOLLEY : SPELL_WATER_BOLT_VOLLEY);
-            WaterBoltVolley_Timer = 10000+rand()%5000;
+            WaterBoltVolley_Timer = 7000+rand()%5000;
         }else WaterBoltVolley_Timer -= diff;
 
Index: /trunk/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp
===================================================================
--- /trunk/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp (revision 166)
+++ /trunk/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp (revision 223)
@@ -106,5 +106,5 @@
     {
         Reflection_Timer = 10000;
-        Impale_Timer = 30000;
+        Impale_Timer = 7000+rand()%7000;
         Rage_Timer = 45000;
         CanRage = false;
@@ -187,5 +187,5 @@
                 ((mob_naga_distillerAI*)distiller->AI())->StartRageGen(m_creature);
             }
-            Rage_Timer = 45000;
+            Rage_Timer = 3000+rand()%15000;
         }else Rage_Timer -= diff;
 
@@ -194,5 +194,5 @@
         {
             DoCast(m_creature, SPELL_SPELL_REFLECTION);
-            Reflection_Timer = 20000+rand()%5000;
+            Reflection_Timer = 15000+rand()%10000;
         }else Reflection_Timer -= diff;
 
Index: /trunk/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_ghazan.cpp
===================================================================
--- /trunk/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_ghazan.cpp (revision 90)
+++ /trunk/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_ghazan.cpp (revision 223)
@@ -23,4 +23,5 @@
 
 #include "../../../creature/simple_ai.h"
+#include "precompiled.h"
 
 /*
Index: /trunk/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp
===================================================================
--- /trunk/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp (revision 90)
+++ /trunk/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp (revision 223)
@@ -93,4 +93,7 @@
         BellowingRoarTimer = 30000;
         WingBuffetTimer = 17000;
+
+        m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
+        m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
     }
 
@@ -98,4 +101,5 @@
     {
         DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+        DoZoneInCombat();
     }
 
@@ -148,5 +152,5 @@
             {
                 DoCast(m_creature->getVictim(), SPELL_CLEAVE);
-                CleaveTimer = 10000;
+                CleaveTimer = 7000;
             }else CleaveTimer -= diff;
 
@@ -187,5 +191,5 @@
             {
                 DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_ENGULFINGFLAMES);
-                EngulfingFlamesTimer = 10000;
+                EngulfingFlamesTimer = 8000;
             }else EngulfingFlamesTimer -= diff;
 
@@ -200,5 +204,5 @@
                         Whelp->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0));
                 }
-                SummonWhelpsTimer = 45000;
+                SummonWhelpsTimer = 30000;
             }else SummonWhelpsTimer -= diff;
         }
Index: /trunk/src/bindings/scripts/scripts/zone/scholomance/boss_jandice_barov.cpp
===================================================================
--- /trunk/src/bindings/scripts/scripts/zone/scholomance/boss_jandice_barov.cpp (revision 90)
+++ /trunk/src/bindings/scripts/scripts/zone/scholomance/boss_jandice_barov.cpp (revision 223)
@@ -1,22 +1,22 @@
 /* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
 
 /* ScriptData
 SDName: Boss_jandicebarov
 SD%Complete: 100
-SDComment:
+SDComment: 
 SDCategory: Scholomance
 EndScriptData */
@@ -61,6 +61,6 @@
         switch (rand()%2)
         {
-            case 0: RandX = 0 - Rand; break;
-            case 1: RandX = 0 + Rand; break;
+        case 0: RandX = 0 - Rand; break;
+        case 1: RandX = 0 + Rand; break;
         }
         Rand = 0;
@@ -68,6 +68,6 @@
         switch (rand()%2)
         {
-            case 0: RandY = 0 - Rand; break;
-            case 1: RandY = 0 + Rand; break;
+        case 0: RandY = 0 - Rand; break;
+        case 1: RandY = 0 + Rand; break;
         }
         Rand = 0;
@@ -81,9 +81,8 @@
         if (Invisible && Invisible_Timer < diff)
         {
-            //Become visible again
+            //Become visible again 
             m_creature->setFaction(14);
             m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
-            //Jandice Model
-            m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,11073);
+            m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,11073);     //Jandice Model
             Invisible = false;
         } else if (Invisible)
@@ -101,5 +100,8 @@
         if (CurseOfBlood_Timer < diff)
         {
+            //Cast
             DoCast(m_creature->getVictim(),SPELL_CURSEOFBLOOD);
+
+            //45 seconds
             CurseOfBlood_Timer = 30000;
         }else CurseOfBlood_Timer -= diff;
@@ -108,10 +110,11 @@
         if (!Invisible && Illusion_Timer < diff)
         {
+
             //Inturrupt any spell casting
             m_creature->InterruptNonMeleeSpells(false);
             m_creature->setFaction(35);
             m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
-            // Invisible Model
-            m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,11686);
+            m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,11686);  // Invisible Model
+            m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-99);
 
             //Summon 10 Illusions attacking random gamers
@@ -125,6 +128,8 @@
             Invisible_Timer = 3000;
 
+            //25 seconds until we should cast this agian
             Illusion_Timer = 25000;
         }else Illusion_Timer -= diff;
+
 
         //            //Illusion_Timer
@@ -133,5 +138,5 @@
         //                  //Cast
         //                DoCast(m_creature->getVictim(),SPELL_ILLUSION);
-        //
+        //                                
         //                  //3 Illusion will be summoned
         //                  if (Illusioncounter < 3)
@@ -141,8 +146,9 @@
         //                  }
         //                  else {
+        //                      //15 seconds until we should cast this again
         //                      Illusion_Timer = 15000;
         //                      Illusioncounter=0;
         //                  }
-        //
+        //                  
         //            }else Illusion_Timer -= diff;
 
@@ -161,5 +167,6 @@
     void Reset()
     {
-        Cleave_Timer = 4000;
+        Cleave_Timer = 2000 + rand()%6000;       
+        m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
     }
 
@@ -170,4 +177,5 @@
     void UpdateAI(const uint32 diff)
     {
+        //Return since we have no target
         if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
             return;
@@ -176,5 +184,8 @@
         if (Cleave_Timer < diff)
         {
+            //Cast
             DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+
+            //5-8 seconds
             Cleave_Timer = 5000 + rand()%3000;
         }else Cleave_Timer -= diff;
@@ -182,5 +193,6 @@
         DoMeleeAttackIfReady();
     }
-};
+}; 
+
 
 CreatureAI* GetAI_boss_jandicebarov(Creature *_Creature)
@@ -193,4 +205,5 @@
     return new mob_illusionofjandicebarovAI (_Creature);
 }
+
 
 void AddSC_boss_jandicebarov()
Index: /trunk/src/bindings/scripts/Makefile.am
===================================================================
--- /trunk/src/bindings/scripts/Makefile.am (revision 187)
+++ /trunk/src/bindings/scripts/Makefile.am (revision 223)
@@ -349,4 +349,7 @@
 scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp \
 scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp \
+scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp \
+scripts/zone/tempest_keep/the_mechanar/def_mechanar.h \
+scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp \
 scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp \
 scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp \
Index: /trunk/src/bindings/scripts/ScriptMgr.cpp
===================================================================
--- /trunk/src/bindings/scripts/ScriptMgr.cpp (revision 206)
+++ /trunk/src/bindings/scripts/ScriptMgr.cpp (revision 223)
@@ -514,4 +514,6 @@
 extern void AddSC_boss_gatewatcher_iron_hand();
 extern void AddSC_boss_nethermancer_sepethrea();
+extern void AddSC_boss_pathaleon_the_calculator();
+extern void AddSC_instance_mechanar();
 
 //Temple of ahn'qiraj
@@ -1697,4 +1699,6 @@
     AddSC_boss_gatewatcher_iron_hand();
     AddSC_boss_nethermancer_sepethrea();
+    AddSC_boss_pathaleon_the_calculator();
+    AddSC_instance_mechanar();
 
     //Temple of ahn'qiraj
Index: /trunk/sql/updates/147_world.sql
===================================================================
--- /trunk/sql/updates/147_world.sql (revision 141)
+++ /trunk/sql/updates/147_world.sql (revision 223)
@@ -10,5 +10,5 @@
 INSERT INTO spell_target_position () VALUES (46020, 580, 1704.34, 928.17, 53.079, 0);
 
---Magtheridon Earthquake
+-- Magtheridon Earthquake
 DELETE FROM spell_script_target WHERE `entry` IN (30657);
 INSERT INTO spell_script_target VALUES ('30657', '1', '24136');
Index: /trunk/sql/updates/231_world_scripts.sql
===================================================================
--- /trunk/sql/updates/231_world_scripts.sql (revision 223)
+++ /trunk/sql/updates/231_world_scripts.sql (revision 223)
@@ -0,0 +1,3 @@
+UPDATE `creature_template` SET `ScriptName`='boss_pathaleon_the_calculator' WHERE `entry`=19220;
+UPDATE `creature_template` SET `ScriptName`='mob_nether_wraith' WHERE `entry`=21062;
+UPDATE `instance_template` SET `script`='instance_mechanar' WHERE `map`=554;
Index: /trunk/sql/world_scripts_full.sql
===================================================================
--- /trunk/sql/world_scripts_full.sql (revision 167)
+++ /trunk/sql/world_scripts_full.sql (revision 223)
@@ -722,4 +722,7 @@
 UPDATE `creature_template` SET `ScriptName`='boss_nethermancer_sepethrea' WHERE `entry`=19221;
 UPDATE `creature_template` SET `ScriptName`='mob_ragin_flames' WHERE `entry`=20481;
+UPDATE `creature_template` SET `ScriptName`='boss_pathaleon_the_calculator' WHERE `entry`=19220;
+UPDATE `creature_template` SET `ScriptName`='mob_nether_wraith' WHERE `entry`=21062;
+UPDATE `instance_template` SET `script`='instance_mechanar' WHERE `map`=554;
 
 /* THE BOTANICA */
