Пример #1
0
    void SwitchWeapons()
    {
        switch ( GetPhase() )
        {
        case 1: // Phase 1 (Default)
			SetDisplayWeaponIds( 5192, 0 );
			_unit->SetUInt32Value( UNIT_FIELD_BASEATTACKTIME, _unit->GetUInt32Value( UNIT_FIELD_BASEATTACKTIME ) );	// 1483 is taken from NCDB creature_proto
			break;
        case 2: // Phase 2
			SetDisplayWeaponIds( 5196, 5196 );
			_unit->SetUInt32Value( UNIT_FIELD_BASEATTACKTIME, _unit->GetUInt32Value( UNIT_FIELD_BASEATTACKTIME ) / 2 );
			break;
        case 4: // Phase 4
			// Is base attack time change needed if we use aura ?
			SetDisplayWeaponIds( 7230, 0 );
			_unit->SetUInt32Value( UNIT_FIELD_BASEATTACKTIME, _unit->GetUInt32Value( UNIT_FIELD_BASEATTACKTIME ) * 2 );
			ApplyAura( SMITES_HAMMER );
			break;
        };

		// Wait at the chest for 4.5seconds -- Still needs work
		_unit->setAttackTimer( 4500, false );
		mWaitAtChest = AddTimer( 4500 );
		SetPhase( GetPhase() + 1 );
    };
Пример #2
0
        void SwitchWeapons()
        {
            // CREDITS to Skyboat on ascentemu.com/forums  he had some of this info on one of his releases
            switch (GetPhase())
            {
                case 1: // Phase 1 (Default)
                    SetDisplayWeaponIds(5192, 0);
                    _unit->SetBaseAttackTime(MELEE, _unit->GetBaseAttackTime(MELEE));    // 1483 is taken from NCDB creature_proto
                    break;
                case 2: // Phase 2
                    SetDisplayWeaponIds(5196, 5196);
                    _unit->SetBaseAttackTime(MELEE, _unit->GetBaseAttackTime(MELEE) / 2);
                    break;
                case 4: // Phase 4
                    // Is base attack time change needed if we use aura ?
                    SetDisplayWeaponIds(7230, 0);
                    _unit->SetBaseAttackTime(MELEE, _unit->GetBaseAttackTime(MELEE) * 2);
                    ApplyAura(SMITES_HAMMER);
                    break;
            }

            // Wait at the chest for 4.5seconds -- Still needs work
            _unit->setAttackTimer(4500, false);
            mWaitAtChest = AddTimer(4500);
            SetPhase(GetPhase() + 1);
        }
Пример #3
0
	void AIUpdate()
	{
		if(GetHealthPercent()<=25)
		{
			ApplyAura(SHADOW_INFUSION);
		}
	ParentClass::AIUpdate();
	}
Пример #4
0
	void OnDied( Unit* pKiller )
	{
		ParentClass::OnDied( pKiller );
		if( !mForceDied )
			ApplyAura( FELFIRE_FISSION );

		Despawn( 10000, 0 );
	};
Пример #5
0
		void AIUpdate()
		{
			if(mEnraged == false && GetHealthPercent() <= 25)
			{
				ApplyAura(ENRAGE);
				mEnraged = true;
			};
		};
Пример #6
0
	void OnLoad()
	{
		HandOfTheDeceiver1 = _unit->GetMapMgr()->GetInterface()->SpawnCreature(CN_HAND_OF_THE_DECEIVER, 1678.00f, 610.00f, 28.00f, 0.00f, true, false, 0, 0);
		HandOfTheDeceiver2 = _unit->GetMapMgr()->GetInterface()->SpawnCreature(CN_HAND_OF_THE_DECEIVER, 1712.00f, 604.00f, 28.00f, 0.00f, true, false, 0, 0);
		HandOfTheDeceiver3 = _unit->GetMapMgr()->GetInterface()->SpawnCreature(CN_HAND_OF_THE_DECEIVER, 1684.00f, 651.00f, 28.00f, 0.00f, true, false, 0, 0);
		HandOfTheDeceiver4 = _unit->GetMapMgr()->GetInterface()->SpawnCreature(CN_HAND_OF_THE_DECEIVER, 1720.00f, 642.00f, 28.00f, 0.00f, true, false, 0, 0);	
		_unit->SetUInt64Value(UNIT_FIELD_FLAGS, ( false ) ? 0 : UNIT_FLAG_NOT_ATTACKABLE_9);
		_unit->GetAIInterface()->SetAllowedToEnterCombat(false);
		SetCanMove(false);
		ShShadowbolt = dbcSpell.LookupEntry(SHIELD_ORB_SHADOWBOLT);
		Darkness_explosion = dbcSpell.LookupEntry(29973);
		Darkness = dbcSpell.LookupEntry(DARKNESS_OF_A_THOUSAND_SOULS);
		ApplyAura(46367);
		ApplyAura(46410);
		StopMovement();
		ParentClass::OnLoad();
	}
Пример #7
0
	void AIUpdate()
	{
		if (!IsCasting())
		{
			if (IsTimerFinished(mGrowthTimer))
			{
				if (mGrowthStacks == 30)
				{
					RemoveAura(GRUUL_THE_DRAGONKILLER_GROWTH);
					mGrowthStacks = 0;
				}
				if (mGrowthStacks != 29)
				{
					ResetTimer(mGrowthTimer, 30000);
				}
				else if (mGrowthStacks == 29)
				{
					ResetTimer(mGrowthTimer, 300000);
				}

				ApplyAura(GRUUL_THE_DRAGONKILLER_GROWTH);
				++mGrowthStacks;
			}
			else if (IsTimerFinished(mHurtfulTimer))
			{
				Unit* pCurrentTarget = _unit->GetAIInterface()->GetNextTarget();
				if (pCurrentTarget != NULL)
				{
					Unit* pTarget = pCurrentTarget;
					for (unordered_set<Player*>::iterator itr = _unit->GetInRangePlayerSetBegin(); itr != _unit->GetInRangePlayerSetEnd(); itr++) 
					{
						Player* pPlayer = TO_PLAYER(*itr);
						if (!pPlayer->isAlive())
							continue;
//						if (pPlayer->m_auracount[SPELL_AURA_MOD_INVISIBILITY])
//							continue;
						if (pPlayer->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FEIGN_DEATH))
							continue;
						if (GetRangeToUnit(pPlayer) > 8.0f)
							continue;
						if (_unit->GetAIInterface()->getThreatByPtr(pPlayer) >= _unit->GetAIInterface()->getThreatByPtr(pCurrentTarget))
							continue;

						pTarget = TO_UNIT(pPlayer);
					}
					
					if (pTarget == pCurrentTarget)
						CastSpellNowNoScheduling(mHurtfulStrike);
					else
						_unit->CastSpell(pTarget, GRUUL_THE_DRAGONKILLER_HURTFUL_STRIKE, true);
				}

				ResetTimer(mHurtfulTimer, 8000);
			}
		}

		ParentClass::AIUpdate();
	}
Пример #8
0
	void AIUpdate()
	{
		if( GetHealthPercent() <= 25 && mEnraged == false )
		{
			ApplyAura( FRENZY );
			mEnraged = true;
		};

		ParentClass::AIUpdate();
	};
Пример #9
0
	void AIUpdate()
	{
		if( mEnraged == false && GetHealthPercent() <= 20 )
		{
			ApplyAura(SHADOW_INFUSION);
			mEnraged = true;
		};

		ParentClass::AIUpdate();
	};
Пример #10
0
	void AIUpdate()
	{
		if ( _unit->GetHealthPct() <= 10 && mEnraged == false )
		{
			ApplyAura(KRIKTHIR_ENRAGE);
			mEnraged = true;
		};

		ParentClass::AIUpdate();
	};
Пример #11
0
		void AIUpdate()
		{
			if(GetHealthPercent() <= 40 && m_bEnraged == false)
			{
				ApplyAura(ENRAGESPELL);
				Emote("Light, give me strength!", Text_Yell,  5833);
			};

			ParentClass::AIUpdate();
		};
Пример #12
0
		void AIUpdate()
		{
			if(GetHealthPercent() <= 25 && mEnraged == false)
			{
				ApplyAura(FRENZY);
				Announce("Ormorok the Tree-Shaper goes into a frenzy!");
				mEnraged = true;
			};

			ParentClass::AIUpdate();
		};
Пример #13
0
	void UpdateGO()
	{
		--mGoCount;

		if( mGoCount == 0 ) // start encounter
		{
			SetCanEnterCombat( true );
			RemoveAura( 47543 );
			ApplyAura( INTENSE_COLD );
		};
	};
	void OnCombatStart( Unit* pTarget )
	{
		ParentClass::OnCombatStart( pTarget );
		mSpeech = 1;
		ApplyAura( PULSING_SHOCKWAVE );
		mNovaTimer = AddTimer( TIMER_NOVA );
		CastOnAllInrangePlayers( PULSING_SHOCKWAVE_AURA );
		
		if( mInstance )
			mInstance->SetInstanceData( Data_EncounterState, _unit->GetEntry(), State_InProgress );
	};
Пример #15
0
		void ChargeRift()
		{
			SummonRift(true);

			Announce("Anomalus shields himself and diverts his power to the rifts!");
			Emote("Indestructible.", Text_Yell, 13189);
			ApplyAura(47748);   // me immune
			SetCanMove(false);

			mRift = true;
			mSummon += 1;
		};
Пример #16
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();
		};
	void switchStance(int32 pStance)
	{
		switch( pStance )
		{
		case STANCE_BATTLE:
			ApplyAura(SPELL_BATTLE_AURA);
			ApplyAura(SPELL_BATTLE_STANCE);
			Emote("Defend yourself, for all the good it will do!", Text_Yell, 14151);
			Announce( "General Bjarngrim switches to Battle Stance!" );
			SetPhase(1);
			break;
		case STANCE_BERSERKER:
			ApplyAura(SPELL_BERSERKER_AURA);
			ApplyAura(SPELL_BERSERKER_STANCE);
			Emote("GRAAAAAH! Behold the fury of iron and steel! ", Text_Yell, 14152);
			Announce( "General Bjarngrim switches to Berserker Stance!" );
			SetPhase(2);
			break;
		case STANCE_DEFENSIVE:
			ApplyAura(SPELL_DEFENSIVE_AURA);
			ApplyAura(SPELL_DEFENSIVE_STANCE);
			Emote("Give me your worst! ", Text_Yell, 14150);
			Announce( "General Bjarngrim switches to Defensive Stance!" );
			SetPhase(3);
			break;
		}
	};
Пример #18
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();
	};
Пример #19
0
	void OnLoad()
	{
		_unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, SAY_KJ_OFFCOMBAT1);
		_unit->PlaySoundToSet(SOUND_KJ_OFFCOMBAT1);
		HandOfTheDeceiver1 = _unit->GetMapMgr()->GetInterface()->SpawnCreature(CN_HAND_OF_THE_DECEIVER, 1678.00f, 610.00f, 28.00f, 0.00f, true, false, 0, 0);
		HandOfTheDeceiver2 = _unit->GetMapMgr()->GetInterface()->SpawnCreature(CN_HAND_OF_THE_DECEIVER, 1712.00f, 604.00f, 28.00f, 0.00f, true, false, 0, 0);
		HandOfTheDeceiver3 = _unit->GetMapMgr()->GetInterface()->SpawnCreature(CN_HAND_OF_THE_DECEIVER, 1684.00f, 651.00f, 28.00f, 0.00f, true, false, 0, 0);
		SpawnCreature(CREATURE_ANVEENA, 1698, 629, 62, 0, true);
		_unit->SetUInt64Value(UNIT_FIELD_FLAGS, ( false ) ? 0 : UNIT_FLAG_NOT_ATTACKABLE_9);
		_unit->GetAIInterface()->SetAllowedToEnterCombat(false);
		_unit->m_invisible = true;
		ApplyAura(42866);
		Darkness = dbcSpell.LookupEntry(SPELL_DARKNESS_OF_A_THOUSAND_SOULS);
		starter = 0;
		ParentClass::OnLoad();
	}
Пример #20
0
	void AIUpdate()
	{
		if(GetHealthPercent() <= 50 && GetPhase() == 1)
		{
			const char * Text = "";
			uint32 pSoundID = 0;
			uint32 Random = rand()%2;
			switch (Random)	
			{
				case 0:
					Text =  "I'll give you more than you can handle.";
					pSoundID = 13321;
					break;
				case 1:
					Text = "There's plenty of me to go around.";
					pSoundID = 13322;
					break;
			}
			
			Emote(Text, Text_Yell, pSoundID);

			SetPhase(2);
			SetCanMove(false);
			ApplyAura(60191);

			pFire = _unit->GetMapMgr()->GetInterface()->SpawnCreature( CN_TELESTRA_FIRE, 494.726990f, 89.128799f, -15.941300f, 6.021390f, true, true, NULL, NULL );
			pFrost = _unit->GetMapMgr()->GetInterface()->SpawnCreature( CN_TELESTRA_FROST, 495.006012f, 89.328102f, -16.124609f, 0.027486f, true, true, NULL, NULL );
			pArcane = _unit->GetMapMgr()->GetInterface()->SpawnCreature( CN_TELESTRA_ARCANE, 504.798431f, 102.248375f, -16.124609f, 4.629921f, true, true, NULL, NULL );
		};

		if( GetPhase() == 2 )
		{
			if( ( pFrost != NULL && pFrost->isAlive() ) || ( pFire != NULL && pFire->isAlive() ) || ( pArcane != NULL && pArcane->isAlive() ) )
				return;

			Emote("Now to finish the job!", Text_Yell, 13323);
			RemoveAura(60191);
			SetCanMove(true);
			SetPhase(3);
		};

		ParentClass::AIUpdate();
	};
Пример #21
0
	void AIUpdate()
	{
		if (!IsInCombat())
			CastSpellOnTarget(_unit, Target_Self, dbcSpell.LookupEntry(SPELL_SHADOW_CHANNELING), false);
		
		if (timmer == 6 && IsInCombat())
		{
			SpawnCreature(CN_VOLATILE_FELFIRE_FIEND, _unit->GetPositionX()+1, _unit->GetPositionY()+1, _unit->GetPositionZ(), 0, true);
			timmer = 0;
		}

		if(GetHealthPercent()<=25 && infusion == false)
		{
			ApplyAura(SPELL_SHADOW_INFUSION);
			infusion = true;
		}
		timmer++;
		ParentClass::AIUpdate();
	}
Пример #22
0
	void RestartEncounter()
	{
		for( vector<Creature*>::iterator CreatureIter = mEncounterArray.begin(); CreatureIter != mEncounterArray.end(); ++CreatureIter )
		{
			Creature* pCreature = (*CreatureIter);
			if( pCreature != NULL )
			{
				if( pCreature->isAlive() )
					pCreature->Despawn( 1000, 0);
				else
					sEventMgr.AddEvent( pCreature, &Creature::SafeDelete, EVENT_CREATURE_REMOVE_CORPSE, 1000, 1, 0);
			}
		};

		mEncounterArray.clear();

		// lets remove adds =>
		for( std::set< Object* >::iterator itr = _unit->GetInRangeSetBegin(); itr != _unit->GetInRangeSetEnd(); ++itr )
		{
			if( (*itr)->IsInWorld() && (*itr)->IsCreature() )
			{
				Creature* pAdd = static_cast<Creature*>(*itr);
				if( pAdd->isAlive() && ( pAdd->GetEntry() ==  CN_FELFIRE_PORTAL || pAdd->GetEntry() == CN_VOLATILE_FELFIRE_FIEND ) )
					pAdd->Despawn( 1000, 0 );
			};
		};

		MoonScriptCreatureAI* Anveena = SpawnCreature(CN_ANVEENA, 1698.550049f, 628.033020f, 72.541901f, 3.864760f);
		if( Anveena && Anveena->GetUnit() )
			AddEncounterCreature( Anveena->GetUnit() );

		for( int i = 0; i < 3; ++i )
		{
			MoonScriptCreatureAI* pHand = SpawnCreature( CN_HAND_OF_THE_DECEIVER, HandSpawn[i].mX, HandSpawn[i].mY, HandSpawn[i].mZ, HandSpawn[i].mO );
			if( pHand && pHand->GetUnit() )
				AddEncounterCreature( pHand->GetUnit() );
		};
	
		mStartCount = 0;
		ApplyAura( 46410 );
	};
Пример #23
0
	void AIUpdate()
	{
		ApplyAura( ANVEENAS_PRISON );
		RemoveAIUpdateEvent();
	};
Пример #24
0
	void OnCombatStart(Unit* pTarget)
	{
		ApplyAura(FELMYST_NOXIOUS_FUME);
		ParentClass::OnCombatStart(pTarget);
	}
Пример #25
0
	void OnReachWP( uint32 iWaypointId, bool bForwards )
	{
		ApplyAura( FELFIRE_FISSION );
		mForceDied = true;
		_unit->DealDamage( _unit, 3000, 0, 0, 0, true );
	};
Пример #26
0
	void AIUpdate()
	{
		ApplyAura( 46464 );
		RemoveAIUpdateEvent();
		Despawn( 7000, 0 );
	};
Пример #27
0
	void AIUpdate()
	{
		ApplyAura( 46410 );
		RemoveAIUpdateEvent();
	};
Пример #28
0
		void Release()
		{
			SetCanEnterCombat(true);
			RemoveAura(47543);
			ApplyAura(INTENSE_COLD);
		};
Пример #29
0
		void OnLoad()
		{
			ApplyAura(47543);   // frozen prison
			ParentClass::OnLoad();
		};
Пример #30
0
		void OnLoad()
		{
			ApplyAura(CHAOTIC_RIFT_AURA);
			Despawn(40000, 0);
			ParentClass::OnLoad();
		};