All pastes #899620 Raw Edit

Mine

public text v1 · immutable
·published 2008-02-11 09:00 UTC
rendered paste body
Index: boss_leotheras_the_blind.cpp
===================================================================
--- boss_leotheras_the_blind.cpp	(revision 252)
+++ boss_leotheras_the_blind.cpp	(working copy)
@@ -1,25 +1,8 @@
-/* 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
-*/
+/**
+*Copyright by BloodWorld DevTeam ® 2008
+made by: aNakin, Bucu, Pandora
+**/
 
-/* ScriptData
-SDName: Boss_Leotheras_The_Blind
-SD%Complete: 50
-SDComment: Missing Inner Demons
-EndScriptData */
-
 #include "../../../sc_defines.h"
 
 #define SPELL_WHIRLWIND         40653
@@ -72,10 +55,16 @@
     uint32 Whirlwind_Timer;
     uint32 ChaosBlast_Timer;
     uint32 Switch_Timer;
+	uint32 Inner_Timer;
 
     bool DemonForm;
     bool IsFinalForm;
     bool InCombat;
+	bool demons;
+	int Rand;
+    int RandX;
+    int RandY;
+    Creature* Summoned;
 
     uint64 Demon;
 
@@ -84,7 +73,9 @@
         Whirlwind_Timer = 20000;
         ChaosBlast_Timer = 1000;
         Switch_Timer = 45000;
+		Inner_Timer = 15000;
 
+		demons=false;
         DemonForm = false;
         IsFinalForm = false;
         InCombat = false;
@@ -174,6 +165,32 @@
         if(pInstance)
             pInstance->SetData("LeotherasTheBlindEvent", 0);
     }
+	
+	    void SummonInner(Unit* victim)
+    {
+        Rand = rand()%10;
+        switch (rand()%2)
+        {
+        case 0: RandX = 0 - Rand; break;
+        case 1: RandX = 0 + Rand; break;
+        }
+        Rand = 0;
+        Rand = rand()%10;
+        switch (rand()%2)
+        {
+        case 0: RandY = 0 - Rand; break;
+        case 1: RandY = 0 + Rand; break;
+        }
+        Rand = 0;
+        Summoned = DoSpawnCreature(21857, RandX+15, RandY+15, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
+		Summoned = DoSpawnCreature(21857, RandX-15, RandY+15, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
+		Summoned = DoSpawnCreature(21857, RandX-15, RandY-15, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
+		Summoned = DoSpawnCreature(21857, RandX+10, RandY-10, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
+		Summoned = DoSpawnCreature(21857, RandX-20, RandY+20, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
+		Summoned = DoSpawnCreature(21857, RandX-20, RandY-20, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
+        if(Summoned)
+            ((CreatureAI*)Summoned->AI())->AttackStart(victim);
+    }
 
     void AttackStart(Unit *who)
     {
@@ -217,9 +234,9 @@
         if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
             return;
 
-        if(!DemonForm)
-        {
-            //Whirlwind_Timer
+   if(!DemonForm)
+        {      
+		//Whirlwind_Timer
             if(Whirlwind_Timer < diff)
             {
                 DoCast(m_creature, SPELL_WHIRLWIND);
@@ -230,6 +247,7 @@
             if(!IsFinalForm)
                 if(Switch_Timer < diff)
                 {
+					demons=false; 
                     //switch to demon form
                     m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_DEMON);
                     DoYell(SAY_SWITCH_TO_DEMON, LANG_UNIVERSAL, NULL);
@@ -243,6 +261,17 @@
         }
         else
         {
+			if (!demons){//tylko raz na demon forme
+				if(!IsFinalForm){ //i nie w ostatniej fazie
+			if (Inner_Timer < diff) //summon tylko w demonie!
+        {
+            //Cast
+            demons=true; //reset jest w zmianie formy elf->demon
+			SummonInner(m_creature->getVictim());
+            Inner_Timer = 15000; //15 sec od zaczecia fazy demona
+        }else Inner_Timer -= diff;
+				}
+			}
             //ChaosBlast_Timer
             if(ChaosBlast_Timer < diff)
             {
@@ -282,10 +311,13 @@
 
             m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_NIGHTELF);
         }
+
     }
 };
 
 //Leotheras the Blind Demon Form AI
+//uzyte tylko w 3 fazie
+//wiec nie summonuje
 struct MANGOS_DLL_DECL boss_leotheras_the_blind_demonformAI : public ScriptedAI
 {
     boss_leotheras_the_blind_demonformAI(Creature *c) : ScriptedAI(c)
@@ -295,13 +327,11 @@
     }
 
     uint32 ChaosBlast_Timer;
-
     bool InCombat;
 
     void EnterEvadeMode()
     {
         ChaosBlast_Timer = 1000;
-
         InCombat = false;
 
         m_creature->RemoveAllAuras();
@@ -317,7 +347,7 @@
 
         InCombat = true;
     }
-
+	
     void KilledUnit(Unit *victim)
     {
         if(victim->GetTypeId() != TYPEID_PLAYER)
@@ -391,7 +421,7 @@
             return;
 
         //ChaosBlast_Timer
-        if(ChaosBlast_Timer < diff)
+	    if(ChaosBlast_Timer < diff)
         {
             DoCast(m_creature->getVictim(), SPELL_CHAOS_BLAST);
             ChaosBlast_Timer = 1500;