コード例 #1
0
	void PreventActions(bool Allow)
	{
		FelExplosion->mEnabled = Allow;
		SetAllowMelee(Allow);
		SetAllowRanged(Allow);
		SetAllowSpell(Allow);
		SetAllowTargeting(Allow);
	}
コード例 #2
0
ファイル: Base.cpp プロジェクト: AegisEmu/AegisEmu
void ArcScriptCreatureAI::PopRunToTargetCache()
{
	if( mRunToTargetCache )
	{
		mRunToTargetCache = NULL;
		mRunToTargetSpellCache = NULL;
		SetAllowMelee(true);
		SetAllowRanged(true);
		SetAllowSpell(true);
		StopMovement();
	}
}
コード例 #3
0
ファイル: Instance_Arcatraz.cpp プロジェクト: lev1976g/AscEmu
        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;
            }

        }
コード例 #4
0
		void AIUpdate()
		{
			if(GetPhase() == 1 && GetHealthPercent() <= (mPhaseRepeat * 25))
			{
				switch(rand() % 2)
				{
					case 0:
						Emote("I'll give you more than you can handle.", Text_Yell, 13321);
						break;
					case 1:
						Emote("There's plenty of me to go around.", Text_Yell, 13322);
						break;
				}
				SetPhase(2);
				SetCanMove(false);
				SetAllowRanged(false);
				SetAllowSpell(false);
				SetAllowTargeting(false);
				ApplyAura(60191);

				for(int i = 0; i < 3; ++i)
				{
					mAddArray[i] = _unit->GetMapMgr()->GetInterface()->SpawnCreature(CN_TELESTRA_FIRE + i, FormSpawns[i].x, FormSpawns[i].y, FormSpawns[i].z, FormSpawns[i].o, true, true, 0, 0);
					if(mAddArray[i] != NULL)
						++mAddCount;
				}

			};

			if(GetPhase() == 2)
			{
				for(int i = 0; i < 3; ++i)
				{
					if(mAddArray[i] != NULL)
					{
						mAddArray[i]->Despawn(1000, 0);
						mAddArray[i] = NULL;
						--mAddCount;
					}
				}

				if(mAddCount != 0)
					return;

				Emote("Now to finish the job!", Text_Yell, 13323);
				RemoveAura(60191);
				SetCanMove(true);
				mPhaseRepeat = 1;
				SetPhase(mHeroic  ? 1 : 3);   //3 disables p2
			};

			ParentClass::AIUpdate();
		};
コード例 #5
0
ファイル: Base.cpp プロジェクト: AegisEmu/AegisEmu
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);
}
コード例 #6
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();
	}
コード例 #7
0
ファイル: Base.cpp プロジェクト: Refuge89/Hearthstone
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 );
};
コード例 #8
0
ファイル: Raid_MoltenCore.cpp プロジェクト: wow4all/wowtbc
	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();
	}
コード例 #9
0
ファイル: kil'jaeden.cpp プロジェクト: Tulba/wowtbc
	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();
	};
コード例 #10
0
ファイル: kil'jaeden.cpp プロジェクト: Tulba/wowtbc
	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 ) );
	};
コード例 #11
0
ファイル: Instance_Arcatraz.cpp プロジェクト: lev1976g/AscEmu
        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);
        }