コード例 #1
0
ファイル: boss_raigonn.cpp プロジェクト: Caydan/WoWSCore548
		void DoEventCharge()
		{
			if (!pInstance)
				return;

			if (Phase != PHASE_WEAK_SPOT)
				return;

			uint32 eventBrasierProgress = pInstance->GetData(DATA_BRASIER_CLICKED);
			uint8 baseMovement = eventBrasierProgress != DONE ? 0 : 2;

			switch (eventChargeProgress)
			{
			case 0:
				me->CastSpell(me, SPELL_BATTERING_HEADBUTT_EMOTE, false);
				events.ScheduleEvent(EVENT_RAIGONN_CHARGE, 1750, PHASE_WEAK_SPOT);
				++eventChargeProgress;
				break;
			case 1:
				// SPELL_BATTERING_HEADBUTT_EMOTE have an effect but is used here only for it's emote, we don't let him time to do his effects
				me->CastStop();

				me->GetMotionMaster()->MoveCharge(chargePos[baseMovement].GetPositionX(), chargePos[baseMovement].GetPositionY(), chargePos[baseMovement].GetPositionZ(), 84.0f, POINT_HERSE);
				++eventChargeProgress;
				break;
			case 2:
				if (eventBrasierProgress == DONE)
					RemoveWeakSpotPassengers();

				me->CastSpell(me, SPELL_BATTERING_HEADBUTT, true);
				events.ScheduleEvent(EVENT_RAIGONN_CHARGE, 3000, PHASE_WEAK_SPOT);
				++eventChargeProgress;
				break;
			case 3:
			default:
				// We are going back to main door, restart
				eventChargeProgress = 0;
				me->SetSpeed(MOVE_RUN, 0.5f, true);
				me->GetMotionMaster()->MovePoint(POINT_MAIN_DOOR, chargePos[baseMovement + 1].GetPositionX(), chargePos[baseMovement + 1].GetPositionY(), chargePos[baseMovement + 1].GetPositionZ(), 1.0f);
				//me->GetMotionMaster()->MoveBackward(POINT_MAIN_DOOR, chargePos[baseMovement + 1].GetPositionX(), chargePos[baseMovement + 1].GetPositionY(), chargePos[baseMovement + 1].GetPositionZ(), 1.0f);
				break;
			}
		}
コード例 #2
0
ファイル: boss_raigonn.cpp プロジェクト: cnmir2/camarote
            void UpdateAI(const uint32 diff) override
            {
                if (uint32 eventId = chargeEvents.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_RAIGON_MOVE_BACK:
                            {
                                 uint32 eventBrasierProgress = instance->GetBossState(DATA_RIMOK);
                                 uint8 baseMovement = eventBrasierProgress != DONE ? 0 : 2;
                                 Movement::MoveSplineInit init(me);
                                 init.MoveTo(chargePos[baseMovement + 1].GetPositionX(), chargePos[baseMovement + 1].GetPositionY(), chargePos[baseMovement + 1].GetPositionZ());
                                 init.SetVelocity(5.0f);
                                 init.SetOrientationInversed();
                                 init.Launch();

                                 chargeEvents.ScheduleEvent(EVENT_BATTERING_HEADBUTT_EMOTE, me->GetSplineDuration());
                                 chargeEvents.ScheduleEvent(EVENT_RAIGONN_CHARGE, me->GetSplineDuration() + 2);
                            }
                            break;
                        case EVENT_BATTERING_HEADBUTT_EMOTE:
                            me->CastSpell(me, SPELL_BATTERING_HEADBUTT_EMOTE, false);
                            break;
                        case EVENT_RAIGONN_CHARGE:
                            {
                                 me->CastStop();
                                 uint32 eventBrasierProgress = instance->GetBossState(DATA_RIMOK);
                                 uint8 baseMovement = eventBrasierProgress != DONE ? 0 : 2;
                                 Movement::MoveSplineInit init(me);
                                 init.MoveTo(chargePos[baseMovement].GetPositionX(), chargePos[baseMovement].GetPositionY(), chargePos[baseMovement].GetPositionZ());
                                 init.SetVelocity(37.0f);
                                 init.Launch();

                                 chargeEvents.ScheduleEvent(EVENT_BATTERING_HEADBUTT, me->GetSplineDuration());
                            }
                            break;
                        case EVENT_BATTERING_HEADBUTT:
                            RemoveWeakSpotPassengers();
                            chargeEvents.ScheduleEvent(EVENT_RAIGON_MOVE_BACK, 3 * IN_MILLISECONDS);
                            break;
                        case EVENT_INITIALIZE:
                            if (vehicle)
                            {
                                if (Creature* weakSpot = me->SummonCreature(NPC_WEAK_SPOT, *me))
                                {
                                    weakSpot->EnterVehicle(me, 1);

                                    if (instance)
                                        instance->SetData64(NPC_WEAK_SPOT, weakSpot->GetGUID());
                                }
                            }
                            break;
                    }
                }

                chargeEvents.Update(diff);
                events.Update(diff);

                if (!UpdateVictim())
                    return;

                if (me->HasUnitState(UNIT_STATE_CASTING))
                    return;

                if (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_SUMMON_PROTECTORAT:
                            Talk(TALK_PROTECT);
                            for (uint8 i = 0; i < 8; ++i)
                                 if (Creature* summon = me->SummonCreature(NPC_KRIKTHIK_PROTECTORAT, frand(941.0f, 974.0f), 2374.85f, 296.67f, 4.73f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000))
                                     if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
                                         if (summon->IsAIEnabled)
                                             summon->AI()->AttackStart(target);

                            events.ScheduleEvent(EVENT_SUMMON_PROTECTORAT, urand(30, 45) * IN_MILLISECONDS);
                            break;
                        case EVENT_SUMMON_ENGULFER:
                            Talk(TALK_ENGULFER);
                            for (uint8 i = 0; i < 3; ++i)
                                me->SummonCreature(NPC_KRIKTHIK_ENGULFER, frand(941.0f, 974.0f), me->GetPositionY(), me->GetPositionZ() + 30.0f, 4.73f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);

                            events.ScheduleEvent(EVENT_SUMMON_ENGULFER, urand(95, 105) * IN_MILLISECONDS);
                            break;
                        case EVENT_SUMMON_SWARM_BRINGER:
                            Talk(TALK_SWARM);
                            if (Creature* summon = me->SummonCreature(NPC_KRIKTHIK_SWARM_BRINGER, frand(941.0f, 974.0f), 2374.85f, 296.67f, 4.73f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000))
                                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
                                   if (summon->IsAIEnabled)
                                       summon->AI()->AttackStart(target);

                            events.ScheduleEvent(EVENT_SUMMON_ENGULFER, urand(35, 50) * IN_MILLISECONDS);
                            break;
                        case EVENT_FIXATE:
                            if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 150.0f, true))
                                me->CastSpell(target, SPELL_FIXATE, TRIGGERED_FULL_MASK);

                            me->SetReactState(REACT_PASSIVE);
                            events.ScheduleEvent(EVENT_FIXATE_STOP, 15 * IN_MILLISECONDS);
                            break;
                        case EVENT_FIXATE_STOP:
                            events.Reset();
                            me->SetReactState(REACT_AGGRESSIVE);
                            events.ScheduleEvent(EVENT_FIXATE, 30 * IN_MILLISECONDS);
                            events.ScheduleEvent(EVENT_STOMP, urand(14, 20) * IN_MILLISECONDS);
                            break;
                        case EVENT_STOMP:
                            me->CastSpell(me, SPELL_STOMP, false);
                            break;
                    }  
                }

                if (Phase == PHASE_VULNERABILITY)
                    DoMeleeAttackIfReady();
            }