void AIUpdate()
	{
		if(SpawnTimer && IsTimerFinished(SpawnTimer))
		{
			switch(GetPhase())
			{
				case 2: Moccasin(); ResetTimer(SpawnTimer,100000); SetPhase(3); break;
				case 3: Ectoplasm(); ResetTimer(SpawnTimer,100000); SetPhase(4); break;
				case 4: BMutanus(); ResetTimer(SpawnTimer,100000); SetPhase(5); break;
			}
		}
		if(GetPhase() == 5 && (!Mutanus || !Mutanus->GetUnit()->isAlive()))
		{
			ArcTicScriptCreatureAI* Naralex = GetNearestCreature(3679);
			if(Naralex && Naralex->IsAlive())
			{
				SetDisplayId(17089);
				Naralex->SetDisplayId(17089);
				Naralex->Emote("I am awake... at last", Text_Say, 5789);
				Naralex->GetUnit()->SetStandState(STANDSTATE_STAND);
				SetFlyMode(true);
				Naralex->SetFlyMode(true);
				MoveTo(-6.704030f, 200.308838f, -26.938824f);
				Naralex->MoveTo(-6.704030f, 200.308838f, -26.938824f);
			}
			SetPhase(6);
		}
		ParentClass::AIUpdate();
	}
Пример #2
0
bool ForceofNeltharakuSpell(uint32 i, Spell* pSpell) // Becoming a Shadoweave Tailor
{
	if(pSpell->u_caster->IsPlayer() == false)
		return true;

	Player*	pPlayer= TO_PLAYER(pSpell->u_caster);
	Unit*		pUnit	= TO_UNIT(pPlayer->GetMapMgr()->GetCreature(GET_LOWGUID_PART(pPlayer->GetSelection())));

	if(pUnit == NULL)
		return true;

	if(!pUnit->IsCreature())
		return true;

	Creature*		 pTarget	= TO_CREATURE(pUnit);
	QuestLogEntry	 *pQuest	= pPlayer->GetQuestLogForEntry(10854);
	if(pQuest == NULL)
		return true;

	if(pTarget->GetEntry() == 21722 && pPlayer->CalcDistance(pUnit)<30)
	{
		if ( pQuest && pQuest->GetMobCount(0) < pQuest->GetQuest()->required_mobcount[0] )
		{
			pTarget->CastSpell(pPlayer, dbcSpell.LookupEntry(38775), true);
			pQuest->SetMobCount(0, pQuest->GetMobCount(0)+1);
			pQuest->SendUpdateAddKill(0);
			pQuest->UpdatePlayerFields();
			if ( pTarget->GetScript() != NULL )
			{
				ArcTicScriptCreatureAI *pDrakeAI = static_cast<ArcTicScriptCreatureAI*>(pTarget->GetScript());
				pDrakeAI->SetCanMove(true);
				pDrakeAI->SetWaypointToMove(0);
			}
		}
	}
	return true;
}
Пример #3
0
	void AIUpdate()
	{
		if (IsTimerFinished(mJovaanTimer))
		{
			switch( mJovaanPhase )
			{
				case 0:
					{
						ArcTicScriptCreatureAI *pRazuunAI = SpawnCreature(21502, -3300.47f, 2927.22f, 173.870f, 2.42924f, false);	// Spawn Razuun
						if ( pRazuunAI != NULL )
						{
							pRazuunAI->GetUnit()->SetUInt64Value( UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2 );
							pRazuunAI->SetCanEnterCombat(false);
							pRazuunAI->SetMoveType(Move_DontMoveWP);
							pRazuunAI->SetCanMove(false);
						}
						_unit->SetStandState(STANDSTATE_KNEEL);
						_unit->Emote(EMOTE_ONESHOT_TALK);
						_unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Everything is in readiness, warbringer.");
						mJovaanPhase = 1;
						ResetTimer(mJovaanTimer, 6000);
					}
					break;
				case 1:
					{
						_unit->Emote(EMOTE_ONESHOT_TALK);
						_unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Warbringer, that will require the use of all the hold's infernals. It may leave us vulnerable to a counterattack.");
						mJovaanPhase = 2;
						ResetTimer(mJovaanTimer, 11000);
					}
					break;
				case 2:
					{
						_unit->SetStandState(STANDSTATE_STAND);
						mJovaanPhase = 3;
						ResetTimer(mJovaanTimer, 1000);
					}
					break;
				case 3:
					{
						_unit->Emote(EMOTE_ONESHOT_SALUTE);
						_unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "It shall be as you say, warbringer. One last question, if I may...");
						mJovaanPhase = 4;
						ResetTimer(mJovaanTimer, 10000);
					}
					break;
				case 4:
					{
						_unit->Emote(EMOTE_ONESHOT_QUESTION);
						_unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "What's in the crate?");
						mJovaanPhase = 5;
						ResetTimer(mJovaanTimer, 10000);
					}
					break;
				case 5:
					{
						_unit->Emote(EMOTE_ONESHOT_SALUTE);
						mJovaanPhase = -1;
						RemoveTimer(mJovaanTimer);
					}
					break;
			}
		}
		ParentClass::AIUpdate();
	}