Exemplo n.º 1
0
    void AIUpdate()
    {
        if (GetHealthPercent() <= 75 && GetPhase() == 1)
        {
            _unit->SendScriptTextChatMessage(7723);     // Lapdogs, all of you!
            SetPhase(2);
        }
        else if (GetHealthPercent() <= 50 && GetPhase() == 2)
        {
            _unit->SendScriptTextChatMessage(7725);     // Fools! Our cause is righteous!

            for (int x = 0; x < 2; x++)
            {
                MoonScriptCreatureAI* Guard = SpawnCreature(636);
                if (Guard != NULL)
                {
                    Guard->SetDespawnWhenInactive(true);
                    Guard->GetUnit()->m_noRespawn = true;
                }
            }

            SetPhase(3);

        }
        else if (GetHealthPercent() <= 25 && GetPhase() == 3)
        {
            _unit->SendScriptTextChatMessage(7727);     // The Brotherhood shall prevail!
            SetPhase(4);
        }
        ParentClass::AIUpdate();
    }
Exemplo n.º 2
0
	/*
		At <= 50% He will spawn 2 Defias Blackguards
		ToDo: Make them despawn WHEN he dies, also make them unlootable
	*/
	void AIUpdate()
	{
		if(GetHealthPercent() <= 75 && GetPhase() == 1)
		{
			Emote("Lap dogs, all of you.", Text_Yell, 5782);
			SetPhase(2);
		}
		else if(GetHealthPercent() <= 50 && GetPhase() == 2)
		{
			Emote("Fools! Our cause is righteous.", Text_Yell, 5783);
			// Defias Blackguard x 2
			MoonScriptCreatureAI* Guard = NULL;
			for(int x=0; x<2; x++)
			{
				Guard = SpawnCreature(636);
				if(Guard == NULL)
					continue;
				Guard->SetDespawnWhenInactive(true);
				Guard->GetUnit()->m_noRespawn = true;
				Guard = NULL;
			}
			SetPhase(3);
		}
		else if(GetHealthPercent() <= 25 && GetPhase() == 3)
		{
			Emote("The brotherhood shall remain.", Text_Yell, 5784);
			SetPhase(4);
		}
		ParentClass::AIUpdate();
	}
Exemplo n.º 3
0
        void AIUpdate()
        {
            if (GetHealthPercent() <= 66 && GetPhase() == 1)
            {
                Emote("You landlubbers are tougher than I thought. I'll have to improvise!", Text_Yell, 5778);
                SetPhase(2, mStomp);
            }
            else if (GetHealthPercent() <= 33 && GetPhase() == 3)
            {
                Emote("D'ah! Now you're making me angry!", Text_Yell, 5779);
                SetPhase(4, mStomp);
            }

            if (GetPhase() == 2 || GetPhase() == 4)
            {
                if (NearChest())
                    SwitchWeapons();
                else if (_unit->GetAIInterface()->getAIState() != STATE_SCRIPTMOVE)
                {
                    MoveToChest();
                }
            }

            if (IsTimerFinished(mWaitAtChest))
                MoveToPlayer();

            ParentClass::AIUpdate();
        }
Exemplo n.º 4
0
    void AIUpdate()
    {
		if(GetHealthPercent() <= 50 && SerpentForm->mEnabled == true)
		{
			CastSpellNowNoScheduling(SerpentForm);
			SerpentForm->mEnabled = false;
			LightningBolt->mEnabled = false;
			DruidsSlumber->mEnabled = false;
		} // If they dont have serpent form aura then re-enable normal spells
		else if(SerpentForm->mEnabled == false && !GetUnit()->HasAura(8041))
		{
			LightningBolt->mEnabled = true;
			DruidsSlumber->mEnabled = true;
		}

		if(GetHealthPercent() <= 5 && HealingTouch->mEnabled == true)
		{
			// Remove Serpent Form
			RemoveAura(8041);
			CastSpellNowNoScheduling(HealingTouch);
			HealingTouch->mEnabled = false;
		}
		
		ParentClass::AIUpdate();
    }
Exemplo n.º 5
0
	void phaseTester()
	{

		_unit->Root();
		GetAllowMelee();
		SetBehavior(Behavior_Spell);

		if ((HandOfTheDeceiver1 && HandOfTheDeceiver2 && HandOfTheDeceiver3) && (HandOfTheDeceiver1->isDead() && HandOfTheDeceiver2->isDead() && HandOfTheDeceiver3->isDead()) && (GetPhase() != 1) && (GetPhase() != 2) && (starter == 0))
		{
			_unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, SAY_KJ_EMERGE);
			_unit->PlaySoundToSet(SOUND_KJ_EMERGE);
			RemoveAura(42866);
			_unit->m_invisible = false;
			starter = 1;
		}

		switch(GetPhase())
		{
		case 1:
			{
				if(GetHealthPercent()<=85 && phase == 2)
				{
					_unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, SAY_KJ_PHASE3);
					_unit->PlaySoundToSet(SOUND_KJ_PHASE3);
					AddPhaseSpell(1, AddSpell(SPELL_SINISTER_REFLECTION, Target_RandomPlayer, 10, 1.5f, 4, 0, 35));
					AddPhaseSpell(1, AddSpell(SPELL_SHADOW_SPIKE, Target_RandomDestination, 10, 2.0f, 6, 0, 35));
					AddPhaseSpell(1, AddSpell(SPELL_FLAME_DART, Target_RandomPlayer, 10, 1.3f, 4, 0, 35));
					ShieldOrb2 = _unit->GetMapMgr()->GetInterface()->SpawnCreature(CN_SHIELD_ORB, 1712.00f, 604.00f, 48.00f, 0.00f, true, true, 0, 0);
					phase++;
				}

				if(GetHealthPercent()<=55 && phase == 3)
				{
					_unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, SAY_KJ_PHASE4);
					_unit->PlaySoundToSet(SOUND_KJ_PHASE4);
					ShieldOrb3 = _unit->GetMapMgr()->GetInterface()->SpawnCreature(CN_SHIELD_ORB, 1684.00f, 651.00f, 48.00f, 0.00f, true, true, 0, 0);
					dtimmer = 0;
					phase++;
				}

				if(GetHealthPercent()<=25 && phase == 4 && (dtimmer > 54 || dtimmer == 0))
				{
					_unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, SAY_KJ_PHASE5);
					_unit->PlaySoundToSet(SOUND_KJ_PHASE5);
					ShieldOrb4 = _unit->GetMapMgr()->GetInterface()->SpawnCreature(CN_SHIELD_ORB, 1720.00f, 642.00f, 48.00f, 0.00f, true, true, 0, 0);
					CastSpellOnTarget(_unit, Target_Self, dbcSpell.LookupEntry(SPELL_SACRIFICE_OF_ANVEENA), true);
					dtimmer = 0;
					phase++;
				}
			}break;
		}
	}
Exemplo n.º 6
0
 void AIUpdate()
 {
     if (GetHealthPercent() <= 66 && IllusionCount == 0)
     {
         IllusionCount = 1;
         CastSpell(Illusion66);
     }
     else if (GetHealthPercent() <= 33 && IllusionCount == 1)
     {
         IllusionCount = 2;
         CastSpell(Illusion33);
     }
     ParentClass::AIUpdate();
 }
Exemplo n.º 7
0
    void AIUpdate()
    {
		if(GetHealthPercent() <= 20 && SerpentForm->mEnabled == true)
		{
			CastSpellNowNoScheduling(SerpentForm);
			SerpentForm->mEnabled = false;
			// Disable Lightning Bolt
			LightningBolt->mEnabled = false;
		}
		else if(GetHealthPercent() <= 20 && SerpentForm->mEnabled == false && !GetUnit()->HasAura(7965))
		{
			// Enable Lightning Bolt
			LightningBolt->mEnabled = true;
		}
		ParentClass::AIUpdate();
    }
	void AIUpdate()
	{
		if ( IsTimerFinished( mStompTimer ) )
		{
			if( m_bStomp == false )
			{
				m_bStomp = true;
				Announce( "Volkhan prepares to shatter his Brittle Golems!" );
				CastSpellNowNoScheduling( mStomp );
				ResetTimer( mStompTimer, 3000 );
			}
			else
			{
				DoStomp();
				ResetTimer( mStompTimer, TIMER_STOMP + ( RandomUInt( 6 ) * 1000 ) );
			}
		};

		if ( GetHealthPercent() <= ( 100 - ( 20 * mPhase ) ) )
		{
			ForceWaypointMove( 1 );
			Announce( "Volkhan runs to his anvil!" );
			++mPhase;
		}

		ParentClass::AIUpdate();
	};
Exemplo n.º 9
0
void ArcScriptCreatureAI::OnTargetDied(Unit* pTarget)
{
	if( GetHealthPercent() > 0 )	//Prevent double yelling (OnDied and OnTargetDied)
	{
		RandomEmote(mOnTargetDiedEmotes);
	}
}
Exemplo n.º 10
0
		void AIUpdate()
		{
			if(GetHealthPercent() <= 75 && m_uiSay == 0)
			{
				Emote("Naughty secrets!", Text_Yell, 5849);
				m_uiSay = 1;
			};

			if(GetHealthPercent() <= 25 && m_uiSay == 1)
			{
				Emote("I'll rip the secrets from your flesh!", Text_Yell, 5850);
				m_uiSay = 2;
			};

			ParentClass::AIUpdate();
		};
Exemplo n.º 11
0
	void AIUpdate()
	{
		SetAllowMelee(false);
		SetCanMove(false);
		timmer++;
		if (summoningst == true && (timmer == 20 || timmer == 60 || timmer == 100))
		{
			SpawnCreature(CN_SHADOWSWORD_BERSERKER, 1871, 650, 71, 0, false);
			SpawnCreature(CN_SHADOWSWORD_FURY_MAGE, 1871, 650, 71, 0, false);
			SpawnCreature(CN_SHADOWSWORD_FURY_MAGE, 1748, 700, 71, 0, false);
			SpawnCreature(CN_SHADOWSWORD_BERSERKER, 1748, 700, 71, 0, false);
		}

		if (timmer == 120)
		{
			timmer = 0;
			summoningst = true;
			switch (spawnplace)
			{
			case 1:
				{
				SpawnCreature(CN_VOID_SENTINEL, 1800, 652, 71, 0, false);
				++spawnplace;
				}break;
			case 2:
				{
				SpawnCreature(CN_VOID_SENTINEL, 1798, 605, 71, 0, false);
				++spawnplace;
				}break;
			case 3:
				{
				SpawnCreature(CN_VOID_SENTINEL, 1826, 650, 71, 0, false);
				++spawnplace;
				}break;
			case 4:
				{
				SpawnCreature(CN_VOID_SENTINEL, 1783, 625, 71, 0, false);
				++spawnplace;
				}break;
			case 5:
				{
				SpawnCreature(CN_VOID_SENTINEL, 1816, 595, 71, 0, false);
				++spawnplace;
				}break;
			case 6:
				{
				SpawnCreature(CN_VOID_SENTINEL, 1844, 641, 71, 0, false);
				spawnplace = 1;
				}break;
			}
		}

		if (GetHealthPercent() <= 35)
		{
			SpawnCreature(CN_ENTROPIUS, true);
			Despawn(100,0);
		}

		ParentClass::AIUpdate();
	}
Exemplo n.º 12
0
	void AIUpdate()
	{
		if(GetHealthPercent()<=25)
		{
			ApplyAura(SHADOW_INFUSION);
		}
	ParentClass::AIUpdate();
	}
Exemplo n.º 13
0
		void AIUpdate()
		{
			if(mEnraged == false && GetHealthPercent() <= 25)
			{
				ApplyAura(ENRAGE);
				mEnraged = true;
			};
		};
Exemplo n.º 14
0
		void AIUpdate()
		{
			if(GetHealthPercent() <= 30 && !morph)
			{
				morph = true;
				_unit->CastSpell(_unit, 11089, true);	//Theka Transform
			}
			MoonScriptCreatureAI::AIUpdate();
		}
Exemplo n.º 15
0
    void AIUpdate()
    {
		if((GetHealthPercent() <= 76 && summon == 0) 
		|| (GetHealthPercent() <= 51 && summon == 2) 
		|| (GetHealthPercent() <= 25 && summon == 4))
			summon += 1;
		
		if(summon == 1 || summon == 3 || summon == 5) 
			Summon();

		if( mRift == true && ( pChaoticRift == NULL || !pChaoticRift->isAlive() ))
		{
			RemoveAura(47748);
			mRift = false;
		};

		ParentClass::AIUpdate();
    };
Exemplo n.º 16
0
 void AIUpdate()
 {
     if(GetHealthPercent() <= 20 && DivineProt->mEnabled == true)
     {
         CastSpellNowNoScheduling(DivineProt);
         DivineProt->mEnabled = false;
     }
     ParentClass::AIUpdate();
 }
Exemplo n.º 17
0
	void AIUpdate()
	{
		if( mEnraged == false && GetHealthPercent() <= 20 )
		{
			ApplyAura(SHADOW_INFUSION);
			mEnraged = true;
		};

		ParentClass::AIUpdate();
	};
Exemplo n.º 18
0
		void AIUpdate()
		{
			if(GetHealthPercent() <= 40 && m_bEnraged == false)
			{
				ApplyAura(ENRAGESPELL);
				Emote("Light, give me strength!", Text_Yell,  5833);
			};

			ParentClass::AIUpdate();
		};
Exemplo n.º 19
0
	void AIUpdate()
	{
		if( GetHealthPercent() <= 25 && mEnraged == false )
		{
			ApplyAura( FRENZY );
			mEnraged = true;
		};

		ParentClass::AIUpdate();
	};
Exemplo n.º 20
0
        void AIUpdate()
        {
            if (GetHealthPercent() <= 42 && Heal)
            {
                CastSpell(mHealDf);
                Heal = false;
            }

            ParentClass::AIUpdate();
        }
Exemplo n.º 21
0
        void AIUpdate()
        {
            if (GetHealthPercent() <= 20 && Enrage)
            {
                CastSpell(mDfEnrage);
                Enrage = false;
            }

            ParentClass::AIUpdate();
        }
Exemplo n.º 22
0
 void AIUpdate()
 {
     ParentClass::AIUpdate();
     if (IsTimerFinished(mElizaCombatTimer))
     {
         SetCanEnterCombat(true);
         AggroNearestUnit();
         RemoveTimer(mElizaCombatTimer);
     }
     if ( GetHealthPercent()>=10 && GetHealthPercent()<=98 && !IsCasting())
     {
         // Correct me if I'm wrong but I saw only 1 guard spawning
         mElizaGuard = _unit->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(_unit->GetPositionX(), _unit->GetPositionY(), _unit->GetPositionZ(), 1871);
         if ( mElizaGuard == NULL )
         {
             CastSpellNowNoScheduling(mSummonGuard);
         }
     }
 }
Exemplo n.º 23
0
	void AIUpdate()
	{
		// If Health is less than 50% and Golemagg is still alive then they regain full health
		if(GetHealthPercent() <= 50 && Golemagg && Golemagg->isAlive())
		{
			Regenerate();
			Emote("Core Rager refuses to die while it's master is in trouble.", Text_Emote);
		}
		ParentClass::AIUpdate();
	}
Exemplo n.º 24
0
		void AIUpdate()
		{
			if(GetHealthPercent() <= 50 && m_bEmoted == false)
			{
				Emote("No rest, for the angry dead.", Text_Yell, 5846);
				m_bEmoted = true;
			};

			ParentClass::AIUpdate();
		};
Exemplo n.º 25
0
		void AIUpdate()
		{
			if(GetHealthPercent() <= 25 && mEnraged == false)
			{
				ApplyAura(FRENZY);
				Announce("Ormorok the Tree-Shaper goes into a frenzy!");
				mEnraged = true;
			};

			ParentClass::AIUpdate();
		};
Exemplo n.º 26
0
 void AIUpdate()
 {
     if(GetHealthPercent() <= 75 && GetPhase() == 1)
     {
         SetPhase(2, HowlingRage1);
     }
     else if(GetHealthPercent() <= 45 && GetPhase() == 2)
     {
         if(GetUnit()->HasAura(7481))
             RemoveAura(7481);
         SetPhase(3, HowlingRage2);
     }
     else if(GetHealthPercent() <= 20 && GetPhase() == 3)
     {
         if(GetUnit()->HasAura(7483))
             RemoveAura(7483);
         SetPhase(4, HowlingRage3);
     }
     ParentClass::AIUpdate();
 }
Exemplo n.º 27
0
		void AIUpdate()
		{
			// Every 25% Halazzi calls on the lynx
			if(!mLynx && GetHealthPercent() <= (100 - SplitCount * 25))
				Split();

			// Lynx OR Halazzi is at 20% HP Merge them together again
			if(mLynx && (mLynx->GetHealthPct() <= 20 || GetHealthPercent() <= 20))
				Merge();

			// At <25% Phase 3 begins
			if(GetHealthPercent() < 25 && GetPhase() == 1)
			{
				ResetTimer(mTotemTimer, 30000);
				SetPhase(3);
			}

			if(GetPhase() == 2 || GetPhase() == 3)
			{
				if(IsTimerFinished(mTotemTimer))
				{
					MoonScriptCreatureAI* Totem = NULL;
					Totem = SpawnCreature(CN_TOTEM, (_unit->GetPositionX() + RandomFloat(3) - 3), (_unit->GetPositionY() + RandomFloat(3) - 3), _unit->GetPositionZ(), 0, true);
					if(Totem)
					{
						Totem->Despawn(60000); // Despawn in 60 seconds
						Totem->AggroNearestPlayer();
						Totem = NULL;
					}
					switch(GetPhase())
					{
						case 2:
							ResetTimer(mTotemTimer, 60000);
							break;
						case 3:
							ResetTimer(mTotemTimer, 30000);
							break; // Spawn them faster then phase 2
					}
				}
			}
		}
Exemplo n.º 28
0
	void AIUpdate()
	{
		if (mAliveAdds > 1)
			return;

		if (GetPhase() == 1 && GetHealthPercent() <= 50)
		{
			SetPhase(2, mEnrage);
		}

		ParentClass::AIUpdate();
	}
Exemplo n.º 29
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();
		};
Exemplo n.º 30
0
	void AIUpdate()
	{
		if(GetHealthPercent() <= 2) // 5 SECONDS HE GO BOOM.
		{
			Emote("Baron Geddon performs one last service for Ragnaros.", Text_Emote, 0);
			ExplodeTimer = AddTimer(5000);
			Explode->mEnabled = true;
		}
		if(Explode->mEnabled == true && IsTimerFinished(ExplodeTimer))
			CastSpellNowNoScheduling(Explode);
		ParentClass::AIUpdate();
	}