void Reset_Event()
    {
        SetCanMove(true);
        SetAllowMelee(true);
        SetAllowSpell(true);
        _unit->SetEmoteState(8); // to be replaced for the standstate

        if (shield)
            shield->SetState(GAMEOBJECT_STATE_OPEN);

        if (orb1)
            orb1->SetState(GAMEOBJECT_STATE_CLOSED);

        if (orb2)
            orb2->SetState(GAMEOBJECT_STATE_CLOSED);

        if (orb3)
            orb3->SetState(GAMEOBJECT_STATE_CLOSED);

        if (orb4)
            orb4->SetState(GAMEOBJECT_STATE_CLOSED);

        if (NPC_orb1)
        {
            NPC_orb1->Despawn(0);
            NPC_orb1 = NULL;
        }

        if (NPC_orb2)
        {
            NPC_orb2->Despawn(0);
            NPC_orb2 = NULL;
        }

        if (NPC_orb3)
        {
            NPC_orb3->Despawn(0);
            NPC_orb3 = NULL;
        }

        if (NPC_orb4)
        {
            NPC_orb4->Despawn(0);
            NPC_orb4 = NULL;
        }

        if (NPC_orb5)
        {
            NPC_orb5->Despawn(0);
            NPC_orb5 = NULL;
        }

    }
Example #2
0
void MoonScriptCreatureAI::PopRunToTargetCache()
{
	if( mRunToTargetCache )
	{
		mRunToTargetCache = NULL;
		mRunToTargetSpellCache = NULL;
		SetAllowMelee(true);
		SetAllowRanged(true);
		SetAllowSpell(true);
		StopMovement();
	}
}
Example #3
0
void ArcScriptCreatureAI::PushRunToTargetCache(Unit* pTarget, SpellDesc* pSpell)
{
	if( mRunToTargetCache != pTarget )
	{
		mRunToTargetCache = pTarget;
		mRunToTargetSpellCache = pSpell;
		SetCanMove(true);
		SetAllowMelee(false);
		SetAllowRanged(false);
		SetAllowSpell(false);
	}
	if( mRunToTargetCache ) MoveTo(mRunToTargetCache);
}
Example #4
0
    void AIUpdate()
    {
		if(GetHealthPercent() <= 10 && GetBehavior() != Behavior_Flee)
		{
			Emote("Skum tries to run away in fear", Text_Emote);
			SetBehavior(Behavior_Flee);
			SetAllowMelee(false);
			SetAllowRanged(false);
			SetAllowSpell(false);
			MoveTo(-262.829742f, -299.363159f, -68.293579f, true);
		}
		ParentClass::AIUpdate();
	}
Example #5
0
void MoonScriptCreatureAI::PushRunToTargetCache( Unit *pTarget, SpellDesc* pSpell, RangeStatusPair pRangeStatus )
{
	if ( mRunToTargetCache != pTarget )
	{
		mRunToTargetCache = pTarget;
		mRunToTargetSpellCache = pSpell;
		SetCanMove( true );
		SetAllowMelee( false );
		SetAllowRanged( false );
		SetAllowSpell( false );
	};

	if ( mRunToTargetCache )
		MoveTo( mRunToTargetCache, pRangeStatus );
};
Example #6
0
	void AIUpdate()
	{
		if(!Elite1->isAlive() && !Elite2->isAlive() && !Elite3->isAlive() && !Elite4->isAlive() &&
		!Healer1->isAlive() && !Healer2->isAlive() && !Healer3->isAlive() && !Healer4->isAlive() && GetPhase() == 1)
		{
			SetCanEnterCombat(false);
			SetAllowMelee(false);
			SetAllowRanged(false);
			SetAllowSpell(false);
			SetAllowTargeting(false);
			SetCanMove(false);
			RemoveAllAuras();
			_unit->SetUInt64Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_9);		
			Emote("Impossible! Stay your attack, mortal... I submit! I submit!", Text_Yell, 8045);
			SetPhase(2);
			DomoSayTimer1 = AddTimer(7000);
			DomoSayTimer2 = AddTimer(16000);
			DomoTeleportTimer3 = AddTimer(34000);
		}
		
		if(GetPhase() == 2 && IsTimerFinished(DomoSayTimer1))
		{
			Emote("Brashly, you have come to rest the secrets of the Living Flame! You will soon regret the recklessness of your quest", Text_Yell, NULL);
			RemoveTimer(DomoSayTimer1);
		}
		
		if(GetPhase() == 2 && IsTimerFinished(DomoSayTimer2))
		{
			Emote("I go now to summon the lord whose house this is. Should you seek an audience with him, your paltry lives will surely be forfeit! Nevertheless, seek out his lair, if you dare!", Text_Yell, NULL);
			RemoveTimer(DomoSayTimer2);
		}
		
		if(GetPhase() == 2 && IsTimerFinished(DomoTeleportTimer3))
		{
			_unit->SetPosition(838.719971f, -830.810974f, -232.095001f, 2.870590f);
			RemoveTimer(DomoTeleportTimer3);
		}
		
			
		ParentClass::AIUpdate();
	}
Example #7
0
	void AIUpdate()
	{
		if( mStarted == false ) 
		{
			ApplyAura( 44200 );
			ApplyAura( 26586 );
			mStarted = true;
			RegisterAIUpdateEvent( 11500 );
			return;
		}

		if( mStarted == true && GetCanEnterCombat() == false ) //start part 
		{
			SetCanEnterCombat( true );
			SetAllowMelee( true );
			SetAllowSpell( true );
			SetAllowTargeting( true );
			SetCanMove( false );
			AggroNearestUnit( 1 );
		};

		ParentClass::AIUpdate();
	};
Example #8
0
	KilJaedenAI(Creature* pCreature) : MoonScriptBossAI(pCreature)
	{	
		SetCanEnterCombat( false );

		DelayNextAttack( 11600 );
		SetAllowMelee( false );
		SetAllowSpell( false );
		SetAllowTargeting( false );
		SetCanMove( false );
		TriggerCooldownOnAllSpells(); 

		SetCanMove( false );
		Emote( "The expendible have perished... So be it! Now I shall succeed where Sargeras could not! I will bleed this wretched world and secure my place as the true master of the Burning Legion. The end has come! Let the unraveling of this world commence!", Text_Yell, 12500 );
		mStarted = false;
		RegisterAIUpdateEvent( 100 );

		pKJDummy = static_cast<KJDummyAI*>( GetNearestCreature( CN_KIL_JADEN_DUMMY ) );
		if( pKJDummy )
			pKJDummy->AddEncounterCreature( _unit );

		AddPhaseSpell( 1, AddSpell( SOUL_FLAY, Target_Current, 50, 0, 6 ) );
		AddPhaseSpell( 1, AddSpell( LEGION_LIGHTNING, Target_RandomPlayer, 25, 2.0f, 8 ) );
		AddPhaseSpell( 1, AddSpell( FIRE_BLOOM, Target_RandomPlayer, 20, 0, 10 ) );
	};
Example #9
0
        void AIUpdate()
        {
            SetCanEnterCombat(false);
            SetCanMove(false);
            SetAllowMelee(false);
            SetAllowSpell(false);

            // ORB ONE
            if (IsTimerFinished(Phase_Timer) && GetPhase() == 0)
            {
                if (Phasepart == 0)
                {
                    Spawncounter = 0;
                    orb1 = _unit->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(482.929f, -151.114f, 43.654f, 183961);
                    if (orb1)
                        orb1->SetState(GAMEOBJECT_STATE_OPEN);

                    switch (RandomUInt(1))
                    {
                        NPC_ID_Spawn = 0;
                        case 0:
                            NPC_ID_Spawn = CN_BLAZING_TRICKSTER;
                            break;
                        case 1:
                            NPC_ID_Spawn = CN_WARP_STALKER;
                            break;
                    }
                    ResetTimer(Phase_Timer, 8000);
                    Phasepart = 1;
                    return;
                }

                else if (Phasepart == 1)
                {
                    if (!NPC_orb1 && NPC_ID_Spawn != 0 && Spawncounter == 0)
                    {
                        ++Spawncounter;
                        NPC_orb1 = SpawnCreature(NPC_ID_Spawn, 475.672f, -147.086f, 42.567f, 3.184015f);
                        return;
                    }
                    else if (NPC_orb1 && !NPC_orb1->IsAlive())
                    {
                        _unit->SendScriptTextChatMessage(SAY_MELLICHAR_03);
                        SetPhase(1);
                        Phasepart = 0;
                        ResetTimer(Phase_Timer, 6000);
                        return;
                    }
                    else
                    {
                        return;
                    }
                    return;
                }
                //return;
            }

            // ORB TWO
            else if (IsTimerFinished(Phase_Timer) && GetPhase() == 1)
            {
                if (Phasepart == 0)
                {
                    Spawncounter = 0;
                    orb2 = _unit->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(409.062f, -152.161f, 43.653f, 183963);
                    if (orb2)
                        orb2->SetState(GAMEOBJECT_STATE_OPEN);

                    ResetTimer(Phase_Timer, 8000);
                    Phasepart = 1;
                    return;
                }

                else if (Phasepart == 1)
                {
                    if (!NPC_orb2 && Spawncounter == 0)
                    {
                        ++Spawncounter;
                        NPC_orb2 = SpawnCreature(CN_MILLHOUSE_MANASTORM, 413.192f, -148.586f, 42.569f, 0.024347f);
                        return;
                    }
                    else if (NPC_orb2 && NPC_orb2->IsAlive())
                    {
                        Creature* millhouse = static_cast<Creature*>(ForceCreatureFind(CN_MILLHOUSE_MANASTORM));
                        if (millhouse)
                        {
                            millhouse->SendTimedScriptTextChatMessage(SAY_MILLHOUS_01, 2000);

                            _unit->SendTimedScriptTextChatMessage(SAY_MELLICHAR_04, 13000);

                            millhouse->SendTimedScriptTextChatMessage(SAY_MILLHOUS_02, 22000);
                        }
                        SetPhase(2);
                        Phasepart = 0;
                        ResetTimer(Phase_Timer, 25000);
                        return;
                    }
                    else
                    {
                        return;
                    }
                    return;

                }
                //return;
            }

            // ORB THREE
            else if (IsTimerFinished(Phase_Timer) && GetPhase() == 2)
            {
                if (Phasepart == 0)
                {
                    Spawncounter = 0;
                    orb3 = _unit->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(415.167f, -174.338f, 43.654f, 183964);
                    if (orb3)
                        orb3->SetState(GAMEOBJECT_STATE_OPEN);

                    switch (RandomUInt(1))
                    {
                        NPC_ID_Spawn = 0;
                        case 0:
                            NPC_ID_Spawn = CN_SULFURON_MAGMA_THROWER;
                            break;
                        case 1:
                            NPC_ID_Spawn = CN_AKKIRIS_LIGHTNING_WAKER;
                            break;
                    }
                    ResetTimer(Phase_Timer, 8000);
                    Phasepart = 1;
                    return;
                }

                else if (Phasepart == 1)
                {
                    if (!NPC_orb3 && NPC_ID_Spawn != 0 && Spawncounter == 0)
                    {
                        /// \todo investigate.... saying "1"... really?
                        _unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "1");
                        ++Spawncounter;
                        NPC_orb3 = SpawnCreature(NPC_ID_Spawn, 420.050f, -173.500f, 42.580f, 6.110f);
                        return;
                    }
                    else if (!NPC_orb3)
                    {
                        /// \todo investigate.... saying "2"... really?
                        _unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "2");
                        NPC_orb3 = GetNearestCreature(NPC_ID_Spawn);
                    }
                    else if (NPC_orb3 && !NPC_orb3->IsAlive())
                    {
                        _unit->SendScriptTextChatMessage(SAY_MELLICHAR_05);
                        SetPhase(3);
                        Phasepart = 0;
                        ResetTimer(Phase_Timer, 8000);
                        return;
                    }
                    else
                    {
                        return;
                    }
                    return;
                }
                //return;
            }

            // ORB FOUR
            else if (IsTimerFinished(Phase_Timer) && GetPhase() == 3)
            {
                if (Phasepart == 0)
                {
                    Spawncounter = 0;
                    orb4 = _unit->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(476.422f, -174.517f, 42.748f, 183962);
                    if (orb4)
                        orb4->SetState(GAMEOBJECT_STATE_OPEN);

                    switch (RandomUInt(1))
                    {
                        NPC_ID_Spawn = 0;
                        case 0:
                            NPC_ID_Spawn = CN_TWILIGHT_DRAKONAAR;
                            break;
                        case 1:
                            NPC_ID_Spawn = CN_BLACKWING_DRAKONAAR;
                            break;
                    }
                    ResetTimer(Phase_Timer, 8000);
                    Phasepart = 1;
                    return;
                }

                else if (Phasepart == 1)
                {
                    if (!NPC_orb4 && NPC_ID_Spawn != 0 && Spawncounter == 0)
                    {
                        ++Spawncounter;
                        NPC_orb4 = SpawnCreature(NPC_ID_Spawn, 471.153f, -174.715f, 42.589f, 3.097f);
                        return;
                    }
                    else if (!NPC_orb4)
                    {
                        NPC_orb4 = GetNearestCreature(NPC_ID_Spawn);
                    }
                    else if (NPC_orb4 && !NPC_orb4->IsAlive())
                    {
                        _unit->SendScriptTextChatMessage(SAY_MELLICHAR_06);
                        SetPhase(4);
                        Phasepart = 0;
                        ResetTimer(Phase_Timer, 6000);
                        return;
                    }
                    else
                    {
                        return;
                    }
                    return;
                }
                //return;
            }

            else if (IsTimerFinished(Phase_Timer) && GetPhase() == 4)
            {}

            ParentClass::AIUpdate();
            SetCanMove(false);
            SetAllowMelee(false);
            SetAllowSpell(false);
        }
Example #10
0
	void AIUpdate()
	{
		_unit->Root();
		GetAllowMelee();
		SetBehavior(Behavior_Spell);

		phaseTester();

		switch (starter)
		{
		case 3:
			{
				_unit->CastSpell(_unit, dbcSpell.LookupEntry(35177), true);
			}break;
		case 16:
			{
				SetPhase(1);
				_unit->SetUInt64Value(UNIT_FIELD_FLAGS, ( true ) ? 0 : UNIT_FLAG_NOT_ATTACKABLE_9);
				_unit->GetAIInterface()->SetAllowedToEnterCombat(true);
				ShieldOrb1 = _unit->GetMapMgr()->GetInterface()->SpawnCreature(CN_SHIELD_ORB, 1678.00f, 610.00f, 48.00f, 0.00f, true, true, 0, 0);
				//BlueDragon = _unit->GetMapMgr()->GetInterface()->SpawnCreature(CREATURE_POWER_OF_THE_BLUE_DRAGONFLIGHT, 1720.00f, 642.00f, 28.00f, 0.00f, true, true, 0, 0);
				phase = 2;
				starter++;
			}break;
		}

		if (starter > 0 && starter < 16)
			starter++;

		if (phase == 4)
		{
			switch (dtimmer)
			{
				case 2:
					{
						ArmageddonSpawn();
						dtimmer++;
					}break;
				case 10:
					{
						_unit->SendChatMessage(CHAT_MSG_MONSTER_YELL,LANG_UNIVERSAL,"Who can you trust?");
						_unit->PlaySoundToSet(12503);
						SinisterReflect();
						dtimmer++;
					}break;
				case 104:
				{
					SetPhase(2);
					ClearHateList();
					SetAllowMelee(true);
					_unit->Root();
					_unit->SetUInt64Value(UNIT_FIELD_FLAGS, ( false ) ? 0 : UNIT_FLAG_NOT_ATTACKABLE_9);
					_unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, SAY_KJ_DARKNESS1);
					_unit->PlaySoundToSet(SOUND_KJ_DARKNESS1);
					_unit->SetUInt32Value(UNIT_NPC_EMOTESTATE, 407);
					dtimmer++;
					}break;
				case 112:
				{
					SetAllowMelee(true);
					BlueShild();
					dtimmer++;
				}break;
				case 120:
				{
					CastSpellOnTarget(_unit, Target_RandomPlayer, Darkness, true);
					_unit->Root();
					SetAllowMelee(true);
					dtimmer++;
					}break;
				case 122:
				{
					SetPhase(1);
					_unit->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
					_unit->SetUInt64Value(UNIT_FIELD_FLAGS, ( true ) ? 0 : UNIT_FLAG_NOT_ATTACKABLE_9);
					ClearHateList();
					dtimmer = 0;
					}break;
				default:
				{
					_unit->Root();
					dtimmer++;
				}break;
			}
		}

		if (phase == 5)
		{
			switch (dtimmer)
			{
				case 10:
				{
					SinisterReflect();
					dtimmer++;
				}break;
				case 54:
				{
					SetPhase(2);
					ClearHateList();
					SetAllowMelee(true);
					_unit->Root();
					_unit->SetUInt64Value(UNIT_FIELD_FLAGS, ( false ) ? 0 : UNIT_FLAG_NOT_ATTACKABLE_9);
					_unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, SAY_KJ_DARKNESS2);
					_unit->PlaySoundToSet(SOUND_KJ_DARKNESS2);
					_unit->SetUInt32Value(UNIT_NPC_EMOTESTATE, 407);
					dtimmer++;
					}break;
				case 62:
				{
					BlueShild();
					SetAllowMelee(true);
					dtimmer++;
				}break;
				case 70:
				{
					CastSpellOnTarget(_unit, Target_RandomPlayer, Darkness, true);
					SetAllowMelee(true);
					_unit->Root();
					dtimmer++;
					}break;
				case 72:
				{
					SetPhase(1);
					_unit->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
					_unit->SetUInt64Value(UNIT_FIELD_FLAGS, ( true ) ? 0 : UNIT_FLAG_NOT_ATTACKABLE_9);
					ClearHateList();
					dtimmer = 0;
					}break;
				default:
				{
					SetAllowMelee(true);
					_unit->Root();
					dtimmer++;
				}break;
			}
		}
		ParentClass::AIUpdate();
	}
Example #11
0
	void AIUpdate()
	{
		if ((HandOfTheDeceiver1 && HandOfTheDeceiver2 && HandOfTheDeceiver3 && HandOfTheDeceiver4) && (HandOfTheDeceiver1->isDead() || HandOfTheDeceiver2->isDead() || HandOfTheDeceiver3->isDead() || HandOfTheDeceiver4->isDead()) && (GetPhase() != 1))
		{
			RemoveAura(46410);
		}

		if ((HandOfTheDeceiver1 && HandOfTheDeceiver2 && HandOfTheDeceiver3 && HandOfTheDeceiver4) && (HandOfTheDeceiver1->isDead() && HandOfTheDeceiver2->isDead() && HandOfTheDeceiver3->isDead() && HandOfTheDeceiver4->isDead()) && (GetPhase() != 1) && (GetPhase() != 2))
		{
			SetPhase(1);
			_unit->SetUInt64Value(UNIT_FIELD_FLAGS, ( true ) ? 0 : UNIT_FLAG_NOT_ATTACKABLE_9);
			_unit->GetAIInterface()->SetAllowedToEnterCombat(true);
			RemoveAura(46367);
			ShieldOrb1 = _unit->GetMapMgr()->GetInterface()->SpawnGameObject(CN_SHIELD_ORB, 1678.00f, 610.00f, 28.00f, 0.00f, false, 0, 0);
		}

		if (ShieldOrb1)
		{
			//ShieldOrb1->CastSpell(ShShadowbolt);
		}
		if (ShieldOrb2)
		{
			//ShieldOrb2->CastSpell(ShShadowbolt);
		}
		if (ShieldOrb3)
		{
			//ShieldOrb3->CastSpell(ShShadowbolt);
		}
		if (ShieldOrb4)
		{
			//ShieldOrb4->CastSpell(ShShadowbolt);
		}

		switch (dtimmer)
		{
		case 100:
			{
				dtimmer++;
				if (GetHealthPercent()<=85)
				{
					SetPhase(2);
					SetAllowMelee(false);
					SetCanMove(false);
					_unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "Kil'jaeden begins to channel dark energy");
				}
			}break;
		case 120:
			{
				dtimmer++;
				if (GetPhase() == 2)
					CastSpellOnTarget(_unit, Target_RandomPlayer, Darkness_explosion, true);
					//CastSpellOnTarget(_unit, Target_RandomPlayer, Darkness, true); //this is the correct, but the dragon doesn't work.
				SetAllowMelee(false);
				SetCanMove(false);
			}break;
		case 128:
			{
				SetPhase(1);
				SetAllowMelee(false);
				SetCanMove(false);
				dtimmer = 1;
			}break;
		default:
			{
				SetCanMove(false);
				SetAllowMelee(false);
				dtimmer++;
			}break;
		}

		switch(GetPhase())
		{
		case 1:
			{
				if(GetHealthPercent()<=85)
				{
					AddPhaseSpell(1, AddSpell(SINISTER_REFLECTION, Target_RandomPlayer, 10, 1.5f, 4, 0, 35));
					AddPhaseSpell(1, AddSpell(SHADOW_SPIKE, Target_RandomDestination, 10, 2.0f, 6, 0, 35));
					AddPhaseSpell(1, AddSpell(FLAME_DART_EXPLOSION, Target_RandomPlayer, 10, 1.3f, 4, 0, 35));
					ShieldOrb1 = _unit->GetMapMgr()->GetInterface()->SpawnGameObject(CN_SHIELD_ORB, 1678.00f, 610.00f, 28.00f, -1.72788f, false, 0, 0);
				}

				if(GetHealthPercent()<=55)
				{
					ShieldOrb1 = _unit->GetMapMgr()->GetInterface()->SpawnGameObject(CN_SHIELD_ORB, 1684.00f, 651.00f, 28.00f, 0.00f, false, 0, 0);
				}

				if(GetHealthPercent()<=25)
				{
					//Armageddon
					ShieldOrb1 = _unit->GetMapMgr()->GetInterface()->SpawnGameObject(CN_SHIELD_ORB, 1720.00f, 642.00f, 28.00f, 0.00f, false, 0, 0);
					AddPhaseSpell(1, AddSpell(SACRIFICE_OF_ANVEENA, Target_RandomPlayer, 50, 0.5f, 10, 0, 35));
				}
			}break;
		}
		ParentClass::AIUpdate();
	}