示例#1
0
		void JustDied(Unit* /*pKiller*/) {
			_JustDied();
			if (Creature* pKrick = GetKrick()) {
				if (pKrick->AI())
					pKrick->AI()->DoAction(ACTION_OUTRO);
			}

			if (instance)
				instance->SetData(DATA_KRICKANDICK_EVENT, DONE);
		}
示例#2
0
            void JustDied(Unit* /*killer*/)
            {
                if (Creature* krick = GetKrick())
                {
                    _vehicle->RemoveAllPassengers();
                    if (krick->AI())
                        krick->AI()->DoAction(ACTION_OUTRO);
                }

                instance->SetBossState(DATA_ICK, DONE);
            }
        void KilledUnit(Unit* who)
        {
            // if during pursuit ick kills his target, set to aggressive again
            if (who && me->GetVictim() && who->GetGUID() == me->GetVictim()->GetGUID())
                if (me->GetReactState() == REACT_PASSIVE)
                    me->SetReactState(REACT_AGGRESSIVE);

            if (who->GetTypeId() == TYPEID_PLAYER)
                if (Creature* k = GetKrick())
                    k->AI()->Talk(RAND(SAY_SLAY_1, SAY_SLAY_2));
        }
示例#4
0
        void EnterCombat(Unit * /*who*/)
        {
            if (Creature* krick = GetKrick())
                DoScriptText(SAY_KRICK_AGGRO, krick);
            events.ScheduleEvent(EVENT_MIGHTY_KICK, 20000);
            events.ScheduleEvent(EVENT_TOXIC_WASTE, 5000);
            events.ScheduleEvent(EVENT_SHADOW_BOLT, 10000);
            events.ScheduleEvent(EVENT_SPECIAL, urand(30000, 35000));

            instance->SetBossState(DATA_ICK, IN_PROGRESS);
        }
            void JustEngagedWith(Unit* /*who*/) override
            {
                _JustEngagedWith();

                if (Creature* krick = GetKrick())
                    krick->AI()->Talk(SAY_KRICK_AGGRO);

                events.ScheduleEvent(EVENT_MIGHTY_KICK, 20s);
                events.ScheduleEvent(EVENT_TOXIC_WASTE, 5s);
                events.ScheduleEvent(EVENT_SHADOW_BOLT, 10s);
                events.ScheduleEvent(EVENT_SPECIAL, 30s, 35s);
            }
            void EnterCombat(Unit* /*who*/) override
            {
                _EnterCombat();

                if (Creature* krick = GetKrick())
                    krick->AI()->Talk(SAY_KRICK_AGGRO);

                events.ScheduleEvent(EVENT_MIGHTY_KICK, 20000);
                events.ScheduleEvent(EVENT_TOXIC_WASTE, 5000);
                events.ScheduleEvent(EVENT_SHADOW_BOLT, 10000);
                events.ScheduleEvent(EVENT_SPECIAL, urand(30000, 35000));
            }
        void EnterCombat(Unit* /*who*/)
        {
            if (Creature* k = GetKrick())
                k->AI()->Talk(SAY_AGGRO);
            DoZoneInCombat();
            events.Reset();
            events.RescheduleEvent(EVENT_SPELL_TOXIC_WASTE, urand(3000,5000));
            events.RescheduleEvent(EVENT_SPELL_MIGHTY_KICK, urand(10000, 20000));
            events.RescheduleEvent(EVENT_SPELL_SHADOW_BOLT, 10000);
            events.RescheduleEvent(EVENT_SPECIAL, 25000);

            if (pInstance)
                pInstance->SetData(DATA_ICK, IN_PROGRESS);
        }
示例#8
0
        void EnterCombat(Unit * /*who*/)
        {
            if (pInstance)
                pInstance->SetData(DATA_KRICKANDICK_EVENT, IN_PROGRESS);

            Creature* pKrick = GetKrick();
            if (!pKrick)
                pKrick = me->SummonCreature(CREATURE_KRICK, *me, TEMPSUMMON_MANUAL_DESPAWN);

            if (pKrick)
                DoScriptText(SAY_KRICK_AGGRO, pKrick);

            events.ScheduleEvent(EVENT_MIGHTY_KICK, 20000, GCD_1);
            events.ScheduleEvent(EVENT_PURSUE, 30000, GCD_1);
            events.ScheduleEvent(EVENT_POISON_NOVA, 30000, GCD_1);
            events.ScheduleEvent(EVENT_EXPLOSIVE_BARRAGE, 35000);
            events.ScheduleEvent(EVENT_TOXIC_WASTE, 5000);
            events.ScheduleEvent(EVENT_SHADOW_BOLT, 15000);
        }
        void DamageTaken(Unit* /*doneBy*/, uint32& damage, DamageEffectType, SpellSchoolMask)
        {
            if (damage >= me->GetHealth())
                if (Creature* krick = GetKrick())
                {
                    krick->InterruptNonMeleeSpells(true);
                    krick->RemoveAllAuras();
                    Position myPos(*me), exitPos;
                    float ang = me->GetOrientation()+3*M_PI/2;
                    float dist = 3.0f;
                    exitPos.Relocate(myPos.GetPositionX()+dist*cos(ang), myPos.GetPositionY()+dist*sin(ang), 515.0f, M_PI);
                    exitPos.m_positionZ = me->GetMap()->GetHeight(exitPos.GetPositionX(), exitPos.GetPositionY(), exitPos.GetPositionZ());

                    if (exitPos.GetPositionZ() < 505.0f || exitPos.GetPositionZ() > 512.0f || !me->IsWithinLOS(exitPos.GetPositionX(), exitPos.GetPositionY(), exitPos.GetPositionZ()))
                        exitPos.Relocate(myPos);

                    krick->_ExitVehicle(&exitPos);
                    krick->AI()->DoAction(1);
                }
        }
示例#10
0
        void UpdateAI(const uint32 diff)
        {
            if (!me->isInCombat())
                return;

            if (!me->getVictim() && me->getThreatManager().isThreatListEmpty())
            {
                EnterEvadeMode();
                return;
            }

            events.Update(diff);

            if (me->hasUnitState(UNIT_STAT_CASTING))
                return;

            switch(events.ExecuteEvent())
            {
                case EVENT_PURSUE:
                    if (Creature* pKrick = GetKrick())
                        DoScriptText(RAND(SAY_KRICK_CHASE_1,SAY_KRICK_CHASE_2,SAY_KRICK_CHASE_3), pKrick);

                    if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
                    {
                        me->Attack(pTarget,false);
                        DoScriptText(SAY_ICK_CHASE_1, me, pTarget);
                        DoCast(pTarget, SPELL_PURSUED);
                    }

                    DoCast(SPELL_CONFUSION);
                    events.ScheduleEvent(EVENT_PURSUE, 30000, GCD_1);
                    return;

                case EVENT_MIGHTY_KICK:
                    DoCast(me->getVictim(), SPELL_MIGHTY_KICK);
                    events.ScheduleEvent(EVENT_MIGHTY_KICK, 25000, GCD_1);
                    return;

                case EVENT_POISON_NOVA:
                    if (Creature* pKrick = GetKrick())
                        DoScriptText(SAY_KRICK_POISON_NOVA, pKrick);

                    DoScriptText(SAY_ICK_POISON_NOVA, me);
                    DoCastAOE(SPELL_POISON_NOVA);
                    events.ScheduleEvent(EVENT_POISON_NOVA, 30000, GCD_1);
                    return;

                case EVENT_TOXIC_WASTE:
                    DoCast(me->getVictim(), SPELL_TOXIC_WASTE);
                    events.ScheduleEvent(EVENT_TOXIC_WASTE, 5000);
                    return;

                case EVENT_SHADOW_BOLT:
                    DoCast(me->getVictim(), SPELL_SHADOW_BOLT);
                    events.ScheduleEvent(EVENT_SHADOW_BOLT, 15000);
                    return;

                case EVENT_EXPLOSIVE_BARRAGE:
                    if (Creature *pKrick = GetKrick())
                    {
                        DoScriptText(SAY_KRICK_BARRAGE_1, pKrick);
                        DoScriptText(SAY_KRICK_BARRAGE_2, pKrick);
                    }

                    DoCastAOE(SPELL_EXPLOSIVE_BARRAGE);
                    me->GetMotionMaster()->MoveIdle();
                    events.DelayEvents(20000, GCD_1); // 2 sec cast + 18 sec
                    events.ScheduleEvent(EVENT_END_EXPLOSIVE_BARRAGE, 20000);
                    return;

                case EVENT_END_EXPLOSIVE_BARRAGE:
                    me->GetMotionMaster()->Clear();
                    me->GetMotionMaster()->MoveChase(me->getVictim());
                    events.ScheduleEvent(EVENT_EXPLOSIVE_BARRAGE, 25000);
                    break;
            }

            DoMeleeAttackIfReady();
        }
示例#11
0
            void UpdateAI(const uint32 diff)
            {
                if (!me->isInCombat())
                    return;

                if (!me->getVictim() && me->getThreatManager().isThreatListEmpty())
                {
                    EnterEvadeMode();
                    return;
                }

                events.Update(diff);

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

                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_TOXIC_WASTE:
                            if (Creature* krick = GetKrick())
                                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                                    krick->CastSpell(target, SPELL_TOXIC_WASTE, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE);
                            events.ScheduleEvent(EVENT_TOXIC_WASTE, urand(7000, 10000));
                            break;
                        case EVENT_SHADOW_BOLT:
                            if (Creature* krick = GetKrick())
                                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
                                    krick->CastSpell(target, SPELL_SHADOW_BOLT, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE);
                            events.ScheduleEvent(EVENT_SHADOW_BOLT, 15000);
                            return;
                        case EVENT_MIGHTY_KICK:
                            DoCastVictim(SPELL_MIGHTY_KICK);
                            events.ScheduleEvent(EVENT_MIGHTY_KICK, 25000);
                            return;
                        case EVENT_SPECIAL:
                            //select one of these three special events
                            events.ScheduleEvent(RAND(EVENT_EXPLOSIVE_BARRAGE, EVENT_POISON_NOVA, EVENT_PURSUIT), 1000);
                            events.ScheduleEvent(EVENT_SPECIAL, urand(23000, 28000));
                            break;
                        case EVENT_EXPLOSIVE_BARRAGE:
                            if (Creature* krick = GetKrick())
                            {
                                krick->AI()->Talk(SAY_KRICK_BARRAGE_1);
                                krick->AI()->Talk(SAY_KRICK_BARRAGE_2);
                                krick->CastSpell(krick, SPELL_EXPLOSIVE_BARRAGE_KRICK, true);
                                DoCast(me, SPELL_EXPLOSIVE_BARRAGE_ICK);
                            }
                            events.DelayEvents(20000);
                            break;
                        case EVENT_POISON_NOVA:
                            if (Creature* krick = GetKrick())
                                krick->AI()->Talk(SAY_KRICK_POISON_NOVA);

                            Talk(SAY_ICK_POISON_NOVA);
                            DoCast(me, SPELL_POISON_NOVA);
                            break;
                        case EVENT_PURSUIT:
                            if (Creature* krick = GetKrick())
                                krick->AI()->Talk(SAY_KRICK_CHASE);
                            DoCast(me, SPELL_PURSUIT);
                            break;
                        default:
                            break;
                    }
                }

                DoMeleeAttackIfReady();
            }
        void UpdateAI(uint32 diff)
        {
            if (!UpdateVictim())
                return;

            if (me->GetVictim())
            {
                float x,y,z;
                me->GetVictim()->GetPosition(x, y, z);
                if (KrickCenterPos.GetExactDist(x,y,z) > 80.0f || z > KrickCenterPos.GetPositionZ()+20.0f || z < KrickCenterPos.GetPositionZ()-20.0f)
                {
                    me->SetHealth(me->GetMaxHealth());
                    EnterEvadeMode();
                    return;
                }
            }

            events.Update(diff);

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

            switch(events.GetEvent())
            {
                case 0:
                    break;
                case EVENT_SPELL_TOXIC_WASTE:
                    if (Creature* k = GetKrick())
                        if (!k->HasUnitState(UNIT_STATE_CASTING))
                            if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true))
                            {
                                k->CastSpell(target, SPELL_TOXIC_WASTE);
                                events.RepeatEvent(urand(7000,10000));
                                break;
                            }
                    events.RepeatEvent(2500);
                    break;
                case EVENT_SPELL_MIGHTY_KICK:
                    me->CastSpell(me->GetVictim(), SPELL_MIGHTY_KICK, false);
                    events.RepeatEvent(urand(20000,25000));
                    break;
                case EVENT_SPELL_SHADOW_BOLT:
                    if (Creature* k = GetKrick())
                        if (!k->HasUnitState(UNIT_STATE_CASTING))
                            if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 35.0f, true))
                            {
                                k->CastSpell(target, SPELL_SHADOW_BOLT);
                                events.RepeatEvent(14000);
                                break;
                            }
                    events.RepeatEvent(2500);
                    break;
                case EVENT_SET_REACT_AGGRESSIVE:
                    me->SetReactState(REACT_AGGRESSIVE);
                    if (!UpdateVictim())
                        return;
                    events.PopEvent();
                    break;
                case EVENT_SPECIAL:
                    switch(urand(0,2))
                    {
                        case 0: // Pursuit
                            if (Creature* k = GetKrick())
                                k->AI()->Talk(RAND(SAY_TARGET_1, SAY_TARGET_2, SAY_TARGET_3));
                            if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 70.0f, true))
                                me->CastSpell(target, SPELL_PURSUIT, false);
                            break;
                        case 1: // Poison Nova
                            if (Creature* k = GetKrick())
                            {
                                k->AI()->Talk(SAY_ORDER_BLOW);
                                Talk(EMOTE_ICK_POISON);
                            }
                            me->CastSpell(me, SPELL_POISON_NOVA, false);
                            break;
                        case 2: // Explosive Barrage
                            if (Creature* k = GetKrick())
                            {
                                k->AI()->Talk(SAY_ORDER_STOP);
                                k->AI()->Talk(EMOTE_KRICK_MINES);
                                k->InterruptNonMeleeSpells(false);
                                me->InterruptNonMeleeSpells(false);
                                k->CastSpell(k, SPELL_EXPLOSIVE_BARRAGE_KRICK, false);
                                me->CastSpell(me, SPELL_EXPLOSIVE_BARRAGE_ICK, false);
                            }
                            events.DelayEvents(20000);
                            break;
                    }
                    events.RepeatEvent(urand(25000,30000));
                    break;
            }

            DoMeleeAttackIfReady();
        }
            void UpdateAI(uint32 diff) override
            {
                if (!UpdateVictim())
                    return;

                events.Update(diff);

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

                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_TOXIC_WASTE:
                            if (Creature* krick = GetKrick())
                                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                                    krick->CastSpell(target, SPELL_TOXIC_WASTE);
                            events.ScheduleEvent(EVENT_TOXIC_WASTE, 7s, 10s);
                            break;
                        case EVENT_SHADOW_BOLT:
                            if (Creature* krick = GetKrick())
                                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
                                    krick->CastSpell(target, SPELL_SHADOW_BOLT);
                            events.ScheduleEvent(EVENT_SHADOW_BOLT, 15s);
                            return;
                        case EVENT_MIGHTY_KICK:
                            DoCastVictim(SPELL_MIGHTY_KICK);
                            events.ScheduleEvent(EVENT_MIGHTY_KICK, 25s);
                            return;
                        case EVENT_SPECIAL:
                            //select one of these three special events
                            events.ScheduleEvent(RAND(EVENT_EXPLOSIVE_BARRAGE, EVENT_POISON_NOVA, EVENT_PURSUIT), 1000);
                            events.ScheduleEvent(EVENT_SPECIAL, 23s, 28s);
                            break;
                        case EVENT_EXPLOSIVE_BARRAGE:
                            if (Creature* krick = GetKrick())
                            {
                                krick->AI()->Talk(SAY_KRICK_BARRAGE_1);
                                krick->AI()->Talk(SAY_KRICK_BARRAGE_2);
                                krick->CastSpell(krick, SPELL_EXPLOSIVE_BARRAGE_KRICK, true);
                                DoCastAOE(SPELL_EXPLOSIVE_BARRAGE_ICK);
                            }
                            events.DelayEvents(20000);
                            break;
                        case EVENT_POISON_NOVA:
                            if (Creature* krick = GetKrick())
                                krick->AI()->Talk(SAY_KRICK_POISON_NOVA);

                            Talk(SAY_ICK_POISON_NOVA);
                            DoCastAOE(SPELL_POISON_NOVA);
                            break;
                        case EVENT_PURSUIT:
                            if (Creature* krick = GetKrick())
                                krick->AI()->Talk(SAY_KRICK_CHASE);
                            DoCastSelf(SPELL_PURSUIT, { SPELLVALUE_MAX_TARGETS, 1 });
                            break;
                        default:
                            break;
                    }

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

                DoMeleeAttackIfReady();
            }
示例#14
0
        void UpdateAI(const uint32 diff)
        {
            if(!me->isInCombat())
                return;

            if(!me->getVictim() && me->getThreatManager().isThreatListEmpty())
            {
                EnterEvadeMode();
                return;
            }

            events.Update(diff);

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

                while(uint32 eventId = events.ExecuteEvent())
                {
                    switch(eventId)
                    {
                case EVENT_TOXIC_WASTE:
                            if(Creature* krick = GetKrick())
                                if(Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                                    krick->CastSpell(target, SPELL_TOXIC_WASTE, false);
                            events.ScheduleEvent(EVENT_TOXIC_WASTE, urand(7000, 10000));
                            break;
                case EVENT_SHADOW_BOLT:
                            if(Creature* krick = GetKrick())
                                if(Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
                                    krick->CastSpell(target, SPELL_SHADOW_BOLT, false);
                    events.ScheduleEvent(EVENT_SHADOW_BOLT, 15000);
                    return;
                        case EVENT_MIGHTY_KICK:
                            DoCastVictim(SPELL_MIGHTY_KICK);
                            events.ScheduleEvent(EVENT_MIGHTY_KICK, 25000);
                            return;
                        case EVENT_SPECIAL:
                            events.ScheduleEvent(RAND(EVENT_EXPLOSIVE_BARRAGE, EVENT_POISON_NOVA, EVENT_PURSUIT), 1000);
                            events.ScheduleEvent(EVENT_SPECIAL, urand(23000, 28000));
                            break;
                case EVENT_EXPLOSIVE_BARRAGE:
                            if(Creature* krick = GetKrick())
                    {
                                DoScriptText(SAY_KRICK_BARRAGE_1, krick);
                                DoScriptText(SAY_KRICK_BARRAGE_2, krick);
                                krick->CastSpell(krick, SPELL_EXPLOSIVE_BARRAGE_KRICK, true);
                                DoCast(me, SPELL_EXPLOSIVE_BARRAGE_ICK);
                            }
                            events.DelayEvents(20000);
                    break;
                        case EVENT_POISON_NOVA:
                            if(Creature* krick = GetKrick())
                                DoScriptText(SAY_KRICK_POISON_NOVA, krick);

                            DoScriptText(SAY_ICK_POISON_NOVA, me);
                            DoCast(me, SPELL_POISON_NOVA);
                            break;
                        case EVENT_PURSUIT:
                            if(Creature* krick = GetKrick())
                                DoScriptText(RAND(SAY_KRICK_CHASE_1, SAY_KRICK_CHASE_2, SAY_KRICK_CHASE_3), krick);
                            DoCast(me, SPELL_PURSUIT);
                            break;
                        default:
                            break;
                    }
            }

            DoMeleeAttackIfReady();
        }
            void UpdateAI(uint32 diff) override
            {
                if (!me->IsEngaged())
                    return;

                if (!me->GetVictim() && me->GetThreatManager().IsThreatListEmpty())
                {
                    EnterEvadeMode(EVADE_REASON_NO_HOSTILES);
                    return;
                }

                events.Update(diff);

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

                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_TOXIC_WASTE:
                            if (Creature* krick = GetKrick())
                                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                                    krick->CastSpell(target, SPELL_TOXIC_WASTE);
                            events.ScheduleEvent(EVENT_TOXIC_WASTE, urand(7000, 10000));
                            break;
                        case EVENT_SHADOW_BOLT:
                            if (Creature* krick = GetKrick())
                                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
                                    krick->CastSpell(target, SPELL_SHADOW_BOLT);
                            events.ScheduleEvent(EVENT_SHADOW_BOLT, 15000);
                            return;
                        case EVENT_MIGHTY_KICK:
                            DoCastVictim(SPELL_MIGHTY_KICK);
                            events.ScheduleEvent(EVENT_MIGHTY_KICK, 25000);
                            return;
                        case EVENT_SPECIAL:
                            //select one of these three special events
                            events.ScheduleEvent(RAND(EVENT_EXPLOSIVE_BARRAGE, EVENT_POISON_NOVA, EVENT_PURSUIT), 1000);
                            events.ScheduleEvent(EVENT_SPECIAL, urand(23000, 28000));
                            break;
                        case EVENT_EXPLOSIVE_BARRAGE:
                            if (Creature* krick = GetKrick())
                            {
                                krick->AI()->Talk(SAY_KRICK_BARRAGE_1);
                                krick->AI()->Talk(SAY_KRICK_BARRAGE_2);
                                krick->CastSpell(krick, SPELL_EXPLOSIVE_BARRAGE_KRICK, true);
                                DoCast(me, SPELL_EXPLOSIVE_BARRAGE_ICK);
                            }
                            events.DelayEvents(20000);
                            break;
                        case EVENT_POISON_NOVA:
                            if (Creature* krick = GetKrick())
                                krick->AI()->Talk(SAY_KRICK_POISON_NOVA);

                            Talk(SAY_ICK_POISON_NOVA);
                            DoCast(me, SPELL_POISON_NOVA);
                            break;
                        case EVENT_PURSUIT:
                            if (Creature* krick = GetKrick())
                                krick->AI()->Talk(SAY_KRICK_CHASE);
                            me->CastCustomSpell(SPELL_PURSUIT, SPELLVALUE_MAX_TARGETS, 1, me);
                            break;
                        default:
                            break;
                    }

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

                DoMeleeAttackIfReady();
            }