void OnReachWP(uint32 iWaypointId, bool bForwards) { if(iWaypointId == 1) { switch(RandomUInt(2)) { case 0: Emote("Life from the lifelessness... death for you.", Text_Yell, 13961); break; case 1: Emote("Nothing is wasted in the process. You will see....", Text_Yell, 13962); break; }; MoonScriptCreatureAI* pAnvil = GetNearestCreature(CN_VOLKHANS_ANVIL); if(pAnvil) _unit->CastSpell(pAnvil->GetUnit(), SPELL_TEMPER, true); else _unit->CastSpell(GetUnit(), SPELL_TEMPER, true); SetCanEnterCombat(true); _unit->GetAIInterface()->AttackReaction(GetNearestPlayer() , 1); // hackfix }; };
void AIUpdate() { if(IsTimerFinished(mJovaanTimer)) { switch(mJovaanPhase) { case 0: { MoonScriptCreatureAI* 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(); }