SeaforiumDepthCharge(Creature* pCreature) : MoonScriptCreatureAI(pCreature) { SetCanMove( false ); SetCanEnterCombat( false ); _unit->SetFaction(21); RegisterAIUpdateEvent(3000); }
ShadeOfTheHorsemanAI(Creature* pCreature) : MoonScriptCreatureAI(pCreature) { SetCanEnterCombat(false); _unit->SetMount(22653); //Spells mSummon = AddSpell(SHADE_OF_THE_HORSEMAN_SUMMON, Target_Self, 0, 0, 0); //Emotes AddEmote(Event_OnDied, "So eager you are, for my blood to spill. Yet to vanquish me, 'tis my head you must kill!", Text_Yell, 11969); Emote("Prepare yourselves, the bells have tolled! Shelter your weak, your young, and your old! Each of you shall pay the final sum. Cry for mercy, the reckoning has come!", Text_Yell, 11966); //On Spawn? switch(_unit->GetMapMgr()->GetAreaID(_unit->GetPositionX(), _unit->GetPositionY())) { case 87: // Goldshire { WPCount = 30; WayPoints = WaypointGoldshire; } break; } for(int i = 1 ; i <= WPCount ; ++i) { AddWaypoint(CreateWaypoint(i, 0, WayPoints[i].addition, WayPoints[i])); } }
void OnCombatStart(Unit* pTarget) { SetDisplayWeapon(true, true); ParentClass::OnCombatStart(pTarget); mAliveAdds = 0; mLastYell = -1; for (int i = 0; i < 4; ++i) { Unit* pAdd = ForceCreatureFind(Adds[i]); if (pAdd != NULL && pAdd->isAlive()) { Unit* pTarget = GetBestPlayerTarget(); if (pTarget != NULL) { pAdd->GetAIInterface()->AttackReaction(pTarget, 200); } ++mAliveAdds; } } if (mAliveAdds > 1) { SetCanEnterCombat(false); SetBehavior(Behavior_Spell); SetCanMove(false); } }
void OnAddDied() { if (mAliveAdds > 0) { --mAliveAdds; if (mAliveAdds > 1) { uint32 RandomText = RandomUInt(1); while (RandomText == mLastYell) { RandomText = RandomUInt(1); } switch (RandomText) { case 0: Emote("You not kill next one so easy!", Text_Yell, 11369); break; case 1: Emote("Does not prove anything!", Text_Yell, 11370); break; } mLastYell = RandomText; } else if (mAliveAdds == 1) { Emote("Good, now you fight me!", Text_Yell, 0); SetCanEnterCombat(true); SetBehavior(Behavior_Default); SetCanMove(true); } } }
VoidZoneARC(Creature* pCreature) : MoonScriptCreatureAI(pCreature) { StopMovement(); SetCanMove(false); SetCanEnterCombat(false); RegisterAIUpdateEvent(1000); }
SeaforiumDepthCharge(Creature* pCreature) : MoonScriptCreatureAI(pCreature) { SetCanMove( false ); SetCanEnterCombat( false ); _unit->SetFaction(21); p_timer = 3000; }
void UpdateGO() { --mGoCount; if( mGoCount == 0 ) // start encounter { SetCanEnterCombat( true ); RemoveAura( 47543 ); ApplyAura( INTENSE_COLD ); }; };
void OnLoad() { RegisterAIUpdateEvent(1000); SetCanMove(false); SetCanEnterCombat(false); _unit->SetUInt64Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); _unit->CastSpell(_unit, dbcSpell.LookupEntry(CYCLON_SPELL), true); _unit->CastSpell(_unit, dbcSpell.LookupEntry(CYCLON_AURA), true); ParentClass::OnLoad(); };
void OnLoad() { SetCanEnterCombat(false); SetCanMove(false); _unit->SetUInt64Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); Despawn(4500, 0); RegisterAIUpdateEvent(500); m_part = 0; ParentClass::OnLoad(); };
ElizaAI(Creature* pCreature) : MoonScriptCreatureAI(pCreature) { mElizaCombatTimer = INVALIDATE_TIMER; SetCanEnterCombat(false); AddSpell(ELIZA_FROST_NOVA, Target_Current, 10, 0, 1, 0, 10, true); AddSpell(ELIZA_FROSTBOLT, Target_Current, 20, 3, 1); mSummonGuard = AddSpell(ELIZA_SUMMON_GUARD, Target_Self, 0, 0, 0); Emote("Wait...you are not my husband. But he must have sent you. And you...look..delicious!", Text_Say); mElizaCombatTimer = AddTimer(4000); RegisterAIUpdateEvent(1000); }
void OnLoad() { RegisterAIUpdateEvent(1000); _unit->Despawn( 11500, 0 ); SetFlyMode(true); SetCanEnterCombat(false); _unit->SetUInt64Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); _unit->CastSpell(_unit, dbcSpell.LookupEntry(TSUNAMI), true); _unit->CastSpell(_unit, dbcSpell.LookupEntry(TSUNAMI_VISUAL), true); ParentClass::OnLoad(); };
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); } } }
void OnCombatStart(Unit* mTarget) { SetPhase(0); Phasepart = 0; SetCanMove(false); Phase_Timer = AddTimer(55000); SetCanEnterCombat(false); _unit->SetEmoteState(EMOTE_ONESHOT_READY1H); // to be replaced for the standstate shield = _unit->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(445.786f, -169.263f, 43.0466f, 184802); if (shield) shield->SetState(GAMEOBJECT_STATE_CLOSED); _unit->SendScriptTextChatMessage(SAY_MELLICHAR_01); _unit->SendTimedScriptTextChatMessage(SAY_MELLICHAR_02, 27000); ParentClass::OnCombatStart(mTarget); }
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 }; };
KeristraszaAI(Creature* pCreature) : MoonScriptBossAI(pCreature) { if(IsHeroic()) AddSpell(CRYSTALFIRE_BREATH_HC, Target_Self, 30, 1, 14); else AddSpell(CRYSTALFIRE_BREATH, Target_Self, 30, 1, 14); AddSpell(CRYSTAL_CHAINS, Target_RandomPlayer, 30, 0, 12); AddSpell(TAIL_SWEEP, Target_Self, 40, 0, 8); mCrystalize = AddSpell(CRYSTALLIZE, Target_Self, 25, 0, 22); mCrystalize->AddEmote("Stay. Enjoy your final moments.", Text_Yell, 13451); AddEmote(Event_OnCombatStart, "Preserve? Why? There's no truth in it. No no no... only in the taking! I see that now!", Text_Yell, 13450); AddEmote(Event_OnTargetDied, "Now we've come to the truth!", Text_Yell, 13453); AddEmote(Event_OnDied, "Dragonqueen... Life-Binder... preserve... me.", Text_Yell, 13454); mEnraged = false; SetCanEnterCombat(false); };
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(); }
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(); };
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 ) ); };
PurifyingTotemAI(Creature* pCreature) : MoonScriptCreatureAI(pCreature) { SetCanEnterCombat( false ); SetCanMove( false ); Despawn(8000, 0); }
void AIUpdate() { if( anchorGuid == 0 ) { CheckForAnchor(); if( anchorGuid != 0 ) { state = PHASE_INACTIVE; RemoveAIUpdateEvent(); return; } } if( state == PHASE_INACTIVE ) { _unit->SetStandState( uint8(STANDSTATE_STAND) ); _unit->RemoveAllAuras(); Player * plr = _unit->GetMapMgrPlayer( _unit->GetSummonedByGUID() ); if( plr ) SetFacingToObject( plr ); Creature * anchor = _unit->GetMapMgrCreature( anchorGuid ); if( anchor ) { anchor->SetChannelSpellTargetGUID( 0 ); anchor->SetChannelSpellId( 0 ); //anchor->GetCurrentSpell()->cancel(); } timer = AddTimer(1000); state = PHASE_STANDUP; } else if( state == PHASE_STANDUP && IsTimerFinished(timer) ) { _unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "You have committed a big mistake, demon"); timer = AddTimer(5000); state = PHASE_REACH_ARMORY; } else if( state == PHASE_REACH_ARMORY && IsTimerFinished(timer) ) { // test for nearest coords of armory uint32 nearest_entry = 0; uint32 nearest_distance = 1000; for(uint32 i = 0; i < sizeof(m_ArmoryLocations) / sizeof(Location); i++) { uint32 distance = _unit->CalcDistance(m_ArmoryLocations[i].x, m_ArmoryLocations[i].y, m_ArmoryLocations[i].z); if( distance < nearest_distance ) { nearest_distance = distance; nearest_entry = i; } } // now go to nearest armory MoveTo(m_ArmoryLocations[nearest_entry].x, m_ArmoryLocations[nearest_entry].y, m_ArmoryLocations[nearest_entry].z, true); timer = AddTimer(2000); state = PHASE_ACTIVATE; } else if( state == PHASE_ACTIVATE && IsTimerFinished(timer) ) { // face off the player Player * plr = _unit->GetMapMgrPlayer( _unit->GetSummonedByGUID() ); if( plr ) SetFacingToObject( plr ); // select suitable spell uint32 spell_to_cast = 0; for(uint32 i = 0; i < sizeof(m_DisplayToSpell) / sizeof(DisplayToSpell); i++) { if( m_DisplayToSpell[i].displayid == _unit->GetDisplayId() ) { spell_to_cast = m_DisplayToSpell[i].spellid; break; } } // change look _unit->CastSpell(_unit, spell_to_cast, false); _unit->CastSpell(_unit, 48266, false); // blood presence timer = AddTimer(2000); state = PHASE_ATTACK_PLAYER; // he equips same weapon as normal DK? SetDisplayWeaponIds(38707, 0); } else if( state == PHASE_ATTACK_PLAYER && IsTimerFinished(timer) ) { _unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "And now you die!"); state = PHASE_ATTACKING; // we are fighting timer = AddTimer(1000); } else if( state == PHASE_ATTACKING && IsTimerFinished(timer) ) { _unit->SetFaction( 16 ); Player * plr = _unit->GetMapMgrPlayer( _unit->GetSummonedByGUID() ); if( plr ) { SetCanEnterCombat( true ); _unit->GetAIInterface()->AttackReaction( plr, 500, 0 ); _unit->GetAIInterface()->setNextTarget( plr ); _unit->GetAIInterface()->SetAIState(STATE_ATTACKING); _unit->GetAIInterface()->EventEnterCombat( plr, 0 ); } state = -1; //_unit->SetUInt32Value( UNIT_FIELD_FLAGS, 0 ); } ParentClass::AIUpdate(); }
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); }
BrittleGolem(Creature* pCreature) : MoonScriptCreatureAI(pCreature) { SetCanEnterCombat( false ); SetCanMove( false ); };
void OnCombatStop(Unit* pTarget) { ParentClass::OnCombatStop(pTarget); SetCanEnterCombat(true); }
void Release() { SetCanEnterCombat(true); RemoveAura(47543); ApplyAura(INTENSE_COLD); };