Boss script phase's not working right

I made this boss and he never stops casting spells he just kinda goes in a weird loop with the spells i think its my timers which i have changed 20 times and still doesnt work


#include "ScriptPCH.h"

enum eNums

{

SPELL_BLIZZARD = 10,

SPELL_FEAR = 5484,

SPELL_LIGHTNING = 421

};

class boss_event_first : public CreatureScript

{

public:

boss_event_first() : CreatureScript("boss_event_first") { }

CreatureAI* GetAI(Creature* pCreature) const

{

	 return new boss_event_firstAI (pCreature);

}

struct boss_event_firstAI : public ScriptedAI

{

boss_event_firstAI(Creature* pCreature) : ScriptedAI(pCreature) {}



uint32 blizzard_Timer;

uint32 Fear_Timer;

uint32 Lightning_Timer;


uint32 Phase;


void Reset()

{

uint32 Fear_Timer = 200;

uint32 blizzard_Timer = 300;

uint32 Lightning_Timer = 400;


Phase = 1;

}


void KilledUnit(Unit * /*victim*/)

{

me->MonsterYell("How is this possible", LANG_UNIVERSAL, NULL);

}


void JustDied(Unit * /*victim*/)

{

me->MonsterYell("Better luck next time.", LANG_UNIVERSAL, NULL);

}

void EnterCombat(Unit * /*who*/)

{

me->MonsterYell("Ready to DIE!", LANG_UNIVERSAL, NULL);

}

void UpdateAI(const uint32 uiDiff)

{

if (!me->getVictim())

{

	 if (Fear_Timer <= uiDiff)


			 DoCast(me, SPELL_FEAR);

	 Fear_Timer = 1000;

			 }

	 else

	 Fear_Timer -= uiDiff;


if (!UpdateVictim())

	 return;

	 //if (blizzard_Timer <= uiDiff)

	 //{

	 // DoCast(me, SPELL_BLIZZARD);

	 //}



if (((me->GetHealth()*100 / me->GetMaxHealth()) < 85) && (Phase == 1))

{

	 Phase = 2;

	 }

	 if (Phase == 1)

	 {

	 if (Fear_Timer <= uiDiff)

	 {

	 if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))

	 DoCast(pTarget, SPELL_FEAR);

	 Fear_Timer = 100;

	 }

	 else

	 Fear_Timer -= uiDiff;

	 if (blizzard_Timer <= uiDiff)

	 {

	 DoCast(me->getVictim(), SPELL_BLIZZARD);

	 blizzard_Timer = 300;

	 }

	 else

	 blizzard_Timer -= uiDiff;

}


	 if (Phase == 2)

	 {

	 if (blizzard_Timer <= uiDiff)

	 {

	 DoCast(me->getVictim(), SPELL_BLIZZARD);

	 blizzard_Timer = 100;

	 }

	 else

	 blizzard_Timer -= uiDiff;


	 if (Lightning_Timer <= uiDiff)

	 {

	 DoCast(me->getVictim(), SPELL_LIGHTNING);

	 Lightning_Timer = 100;

	 }

	 else

	 Lightning_Timer -= uiDiff;

	 }



DoMeleeAttackIfReady();

}

};

};

void AddSC_boss_event_first()

{

new boss_event_first();

}

This script is all kinds of messed up because you are missing some brackets… for example


if (!me->getVictim())

{

if (Fear_Timer <= uiDiff)


DoCast(me, SPELL_FEAR);

Fear_Timer = 1000;

}

else

Fear_Timer -= uiDiff;

should be


if (!me->getVictim())

{

        if (Fear_Timer <= uiDiff)

        {

                DoCast(me, SPELL_FEAR);

                Fear_Timer = 1000;

        }

        else

                Fear_Timer -= uiDiff;

}

or


if (!me->getVictim())

{

        if (Fear_Timer <= uiDiff)

        {

                DoCast(me, SPELL_FEAR);

                Fear_Timer = 1000;

        }

}

else

        Fear_Timer -= uiDiff;

depending on what you intended to happen here.

^This. Lesson one, indent your code.