예제 #1
0
        void UpdateAI(uint32 diff) override
        {
            if (!UpdateVictim())
                return;

            events.Update(diff);

            while (uint32 eventId = events.ExecuteEvent())
            {
                switch (eventId)
                {
                    case EVENT_INITIAL_EMERGE:
                        DoCast(me, SPELL_STAND);
                        DoCast(me, SPELL_AHUNE_SPANKY_HANDS);
                        DoCast(me, SPELL_AHUNES_SHIELD);
                        break;
                    case EVENT_EMERGE:
                        Emerge();
                        break;
                    case EVENT_SYNCH_HEALTH:
                        if (Creature* frozenCore = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_FROZEN_CORE)))
                            DoCast(frozenCore, SPELL_SYNCH_HEALTH);
                        else
                            DoCast(me, SPELL_SUICIDE);
                        events.ScheduleEvent(EVENT_SYNCH_HEALTH, 3000);
                        break;
                    default:
                        break;
                }
            }
            DoMeleeAttackIfReady();
        }
 void ExecuteEvent(uint32 eventId) override
 {
     switch (eventId)
     {
         case EVENT_ENGAGE:
             if (me->GetEntry() == NPC_DREADSCALE)
             {
                 instance->DoCloseDoorOrButton(instance->GetGuidData(DATA_MAIN_GATE));
                 me->SetImmuneToPC(false);
                 events.SetPhase(PHASE_MOBILE);
                 me->SetReactState(REACT_AGGRESSIVE);
                 DoZoneInCombat();
                 events.ScheduleEvent(EVENT_SUMMON_ACIDMAW, 1ms);
             }
             else
             {
                 me->SetReactState(REACT_AGGRESSIVE);
                 DoZoneInCombat();
             }
             break;
         case EVENT_EMERGE:
             Emerge();
             break;
         case EVENT_SUBMERGE:
             Submerge();
             break;
         case EVENT_BITE:
             DoCastVictim(biteSpell);
             events.Repeat(15s);
             break;
         case EVENT_SPEW:
             DoCastAOE(spewSpell);
             events.Repeat(21s);
             break;
         case EVENT_SLIME_POOL:
             DoCastSelf(SUMMON_SLIME_POOL);
             events.Repeat(12s);
             break;
         case EVENT_SUMMON_ACIDMAW:
             me->SummonCreature(NPC_ACIDMAW, ToCCommonLoc[9]);
             break;
         case EVENT_SPRAY:
             if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true))
                 DoCast(target, spraySpell);
             events.Repeat(21s);
             break;
         case EVENT_SWEEP:
             DoCastAOE(SPELL_SWEEP);
             events.Repeat(17s);
             break;
         default:
             break;
     }
 }
예제 #3
0
            void Reset()
            {
                boss_jormungarAI::Reset();
                BiteSpell = SPELL_PARALYTIC_BITE;
                SpewSpell = SPELL_ACID_SPEW;
                SpitSpell = SPELL_ACID_SPIT;
                SpraySpell = SPELL_PARALYTIC_SPRAY;
                ModelStationary = MODEL_ACIDMAW_STATIONARY;
                ModelMobile = MODEL_ACIDMAW_MOBILE;
                OtherWormEntry = NPC_DREADSCALE;

                WasMobile = true;
                Emerge();
            }
예제 #4
0
    void UpdateAI(uint32 const diff)
    {
        if (!UpdateVictim())
            return;

        if (!Enraged && instance && instance->GetData(TYPE_NORTHREND_BEASTS) == SNAKES_SPECIAL)
        {
            me->RemoveAurasDueToSpell(SPELL_SUBMERGE_0);
            me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
            DoCast(SPELL_ENRAGE);
            Enraged = true;
            Talk(EMOTE_ENRAGE);
        }

        events.Update(diff);

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

        while (uint32 eventId = events.ExecuteEvent())
        {
            switch (eventId)
            {
                case EVENT_EMERGE:
                    Emerge();
                    return;
                case EVENT_SUBMERGE:
                    Submerge();
                    return;
                case EVENT_BITE:
                    DoCastVictim(BiteSpell);
                    events.ScheduleEvent(EVENT_BITE, urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS), 0, PHASE_MOBILE);
                    return;
                case EVENT_SPEW:
                    DoCastAOE(SpewSpell);
                    events.ScheduleEvent(EVENT_SPEW, urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS), 0, PHASE_MOBILE);
                    return;
                case EVENT_SLIME_POOL:
                    DoCast(me, SUMMON_SLIME_POOL);
                    events.ScheduleEvent(EVENT_SLIME_POOL, 30*IN_MILLISECONDS, 0, PHASE_MOBILE);
                    return;
                case EVENT_SUMMON_ACIDMAW:
                    if (Creature* acidmaw = me->SummonCreature(NPC_ACIDMAW, ToCCommonLoc[9].GetPositionX(), ToCCommonLoc[9].GetPositionY(), ToCCommonLoc[9].GetPositionZ(), 5, TEMPSUMMON_MANUAL_DESPAWN))
                    {
                        acidmaw->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
                        acidmaw->SetReactState(REACT_AGGRESSIVE);
                        acidmaw->SetInCombatWithZone();
                        acidmaw->CastSpell(acidmaw, SPELL_EMERGE_0);
                    }
                    return;
                case EVENT_SPRAY:
                    if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
                        DoCast(target, SpraySpell);
                    events.ScheduleEvent(EVENT_SPRAY, urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS), 0, PHASE_STATIONARY);
                    return;
                case EVENT_SWEEP:
                    DoCastAOE(SPELL_SWEEP_0);
                    events.ScheduleEvent(EVENT_SWEEP, urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS), 0, PHASE_STATIONARY);
                    return;
                default:
                    return;
            }
        }
        if (events.GetPhaseMask() & PHASE_MASK_MOBILE)
            DoMeleeAttackIfReady();
        if (events.GetPhaseMask() & PHASE_MASK_STATIONARY)
            DoSpellAttackIfReady(SpitSpell);
    }