当前位置: 首页>>代码示例>>C++>>正文


C++ DoCastSelf函数代码示例

本文整理汇总了C++中DoCastSelf函数的典型用法代码示例。如果您正苦于以下问题:C++ DoCastSelf函数的具体用法?C++ DoCastSelf怎么用?C++ DoCastSelf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DoCastSelf函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ExecuteEvent

 void ExecuteEvent(uint32 eventId) override
 {
     switch (eventId)
     {
         case EVENT_FLAMESTRIKE:
             if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                 DoCast(target, SPELL_FLAMESTRIKE);
             Talk(SAY_COUNCIL_SPECIAL);
             events.Repeat(Seconds(40));
             break;
         case EVENT_BLIZZARD:
             if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                 DoCast(target, SPELL_BLIZZARD);
             events.Repeat(Seconds(15), Seconds(40));
             break;
         case EVENT_ARCANE_EXPLOSION_CHECK:
             _canUseArcaneExplosion = true;
             break;
         case EVENT_ARCANE_EXPLOSION:
             if (_canUseArcaneExplosion && SelectTarget(SELECT_TARGET_RANDOM, 0, 10.0f))
             {
                 DoCastSelf(SPELL_ARCANE_EXPLOSION);
                 _canUseArcaneExplosion = false;
                 events.ScheduleEvent(EVENT_ARCANE_EXPLOSION_CHECK, Seconds(5));
             }
             events.Repeat(Seconds(1));
             break;
         case EVENT_DAMPEN_MAGIC:
             DoCastSelf(SPELL_DAMPEN_MAGIC);
             break;
         default:
             break;
     }
 }
开发者ID:martial69320,项目名称:cerberus,代码行数:34,代码来源:boss_illidari_council.cpp

示例2: UpdateAI

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

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

        events.Update(diff);

        while (uint32 eventId = events.ExecuteEvent())
        {
            switch (eventId)
            {
                case EVENT_SOUL_DRAIN:
                    DoCastSelf(SPELL_SOUL_DRAIN, { SPELLVALUE_MAX_TARGETS, 5 });
                    events.Repeat(Seconds(30), Seconds(35));
                    break;
                case EVENT_FRENZY:
                    Talk(SUFF_SAY_ENRAGE);
                    DoCastSelf(SPELL_FRENZY);
                    events.Repeat(Seconds(45), Seconds(50));
                    break;
                default:
                    break;
            }

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

        DoMeleeAttackIfReady();
    }
开发者ID:lasyan3,项目名称:TrinityCore,代码行数:33,代码来源:boss_reliquary_of_souls.cpp

示例3: Emerge

    void Emerge()
    {
        me->UpdateSpeed(MOVE_RUN);
        uint32 submergeSpell = wasMobile ? SPELL_SUBMERGE : SPELL_SUBMERGE_2;
        me->RemoveAurasDueToSpell(submergeSpell);
        me->RemoveAurasDueToSpell(SPELL_GROUND_VISUAL_0);
        DoCastSelf(SPELL_EMERGE);
        DoCastAOE(SPELL_HATE_TO_ZERO, true);
        me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
        me->SetReactState(REACT_AGGRESSIVE);
        if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
            AttackStart(target);

        // if the worm was mobile before submerging, make him stationary now
        if (wasMobile)
        {
            me->SetControlled(true, UNIT_STATE_ROOT);
            me->SetDisplayId(modelStationary);
            DoCastSelf(SPELL_GROUND_VISUAL_1, true);
            events.SetPhase(PHASE_STATIONARY);
        }
        else
        {
            if (Unit* target = me->GetVictim())
                me->GetMotionMaster()->MoveChase(target);
            me->SetDisplayId(modelMobile);
            events.SetPhase(PHASE_MOBILE);
        }
        wasMobile = !wasMobile;
        ScheduleTasks();
    }
开发者ID:ElunaLuaEngine,项目名称:ElunaTrinityWotlk,代码行数:31,代码来源:boss_northrend_beasts.cpp

示例4: Submerge

    void Submerge()
    {
        me->SetReactState(REACT_PASSIVE);
        me->AttackStop();

        if (wasMobile)
        {
            me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
            DoCastSelf(SPELL_SUBMERGE);
            me->SetSpeedRate(MOVE_RUN, 8.0f);
            DoCastSelf(SPELL_GROUND_VISUAL_0, true);
            events.SetPhase(PHASE_SUBMERGED);
            events.ScheduleEvent(EVENT_EMERGE, 5s, 0, PHASE_SUBMERGED);
            me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
        }
        else
        {
            me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
            DoCastSelf(SPELL_SUBMERGE_2);
            me->RemoveAurasDueToSpell(SPELL_GROUND_VISUAL_1);
            me->SetSpeedRate(MOVE_RUN, 1.1111f);
            DoCastSelf(SPELL_GROUND_VISUAL_0, true);
            events.SetPhase(PHASE_SUBMERGED);
            me->SetControlled(false, UNIT_STATE_ROOT);
            events.ScheduleEvent(EVENT_EMERGE, 6s, 0, PHASE_SUBMERGED);
            me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
        }
        me->GetMotionMaster()->MovePoint(0, ToCCommonLoc[1].GetPositionX() + frand(-40.0f, 40.0f), ToCCommonLoc[1].GetPositionY() + frand(-40.0f, 40.0f), ToCCommonLoc[1].GetPositionZ() + me->GetCollisionHeight());
    }
开发者ID:ElunaLuaEngine,项目名称:ElunaTrinityWotlk,代码行数:29,代码来源:boss_northrend_beasts.cpp

示例5: MovementInform

    void MovementInform(uint32 type, uint32 pointId) override
    {
        if (type != POINT_MOTION_TYPE && type != EFFECT_MOTION_TYPE && type != SPLINE_CHAIN_MOTION_TYPE)
            return;

        switch (pointId)
        {
            case POINT_INITIAL_MOVEMENT:
                events.ScheduleEvent(EVENT_ENGAGE, 3s);
                break;
            case POINT_MIDDLE:
                DoCastSelf(SPELL_MASSIVE_CRASH);
                events.ScheduleEvent(EVENT_SELECT_CHARGE_TARGET, 4s);
                break;
            case POINT_ICEHOWL_CHARGE:
                events.Reset();
                events.SetPhase(PHASE_COMBAT);
                RescheduleTasks();
                me->SetReactState(REACT_AGGRESSIVE);
                DoCastSelf(SPELL_TRAMPLE);
                break;
            default:
                break;
        }
    }
开发者ID:ElunaLuaEngine,项目名称:ElunaTrinityWotlk,代码行数:25,代码来源:boss_northrend_beasts.cpp

示例6: ExecuteEvent

 void ExecuteEvent(uint32 eventId) override
 {
     switch (eventId)
     {
         case EVENT_RANDOM_BEAM:
             DoCastSelf(BeamTriggers[urand(0, 3)]);
             events.Repeat(Seconds(30));
             break;
         case EVENT_PRISMATIC_SHIELD:
             DoCastSelf(PrismaticAuras[urand(0, 5)]);
             events.Repeat(Seconds(15));
             break;
         case EVENT_FATAL_ATTRACTION:
             Talk(SAY_SPELL);
             me->CastCustomSpell(SPELL_FATAL_ATTACTION_TELEPORT, SPELLVALUE_MAX_TARGETS, 3, me);
             events.Repeat(Seconds(30));
             break;
         case EVENT_SILENCING_SHRIEK:
             DoCastVictim(SPELL_SILENCING_SHRIEK);
             events.Repeat(Seconds(18), Seconds(30));
             break;
         case EVENT_TAUNT:
             Talk(SAY_TAUNT);
             events.Repeat(Seconds(30), Seconds(40));
             break;
         case EVENT_BERSERK:
             Talk(EMOTE_BERSERK, me);
             DoCastSelf(SPELL_BERSERK);
             break;
         default:
             break;
     }
 }
开发者ID:090809,项目名称:TrinityCore,代码行数:33,代码来源:boss_mother_shahraz.cpp

示例7: Reset

 void Reset() override
 {
     me->m_Events.AddEventAtOffset([this]()
     {
         DoCastSelf(SPELL_SLIME_POOL_EFFECT, true);
         DoCastSelf(SPELL_PACIFY_SELF, true);
     }, 1s);
 }
开发者ID:ElunaLuaEngine,项目名称:ElunaTrinityWotlk,代码行数:8,代码来源:boss_northrend_beasts.cpp

示例8: UpdateAI

        void UpdateAI(uint32 diff) override
        {
            if (!events.IsInPhase(PHASE_INTRO) && (!UpdateVictim() || !CheckInRoom()))
                return;

            events.Update(diff);

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

            while (uint32 eventId = events.ExecuteEvent())
            {
                switch (eventId)
                {
                    case EVENT_ANRAPHET_APPEAR:
                        me->GetMotionMaster()->MoveSmoothPath(POINT_ANRAPHET_ACTIVATE, AnraphetPath, AnraphetPathSize);
                        break;
                    case EVENT_ANRAPHET_ACTIVATE:
                        Talk(ANRAPHET_SAY_INTRO);
                        events.ScheduleEvent(EVENT_ANRAPHET_DESTRUCTION, Seconds(10), 0, PHASE_INTRO); // Note: 10800 ms
                        break;
                    case EVENT_ANRAPHET_DESTRUCTION:
                        DoCastAOE(SPELL_DESTRUCTION_PROTOCOL);
                        events.ScheduleEvent(EVENT_ANRAPHET_READY, Seconds(6), 0, PHASE_INTRO); // Note: 6400 ms
                        break;
                    case EVENT_ANRAPHET_READY:
                        me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                        events.SetPhase(PHASE_COMBAT);
                        ScheduleCombatEvents();
                        break;
                    case EVENT_ANRAPHET_NEMESIS_STRIKE:
                        DoCastVictim(SPELL_NEMESIS_STRIKE);
                        events.ScheduleEvent(EVENT_ANRAPHET_NEMESIS_STRIKE, Seconds(21), 0, PHASE_COMBAT);
                        break;
                    case EVENT_ANRAPHET_ALPHA_BEAMS:
                        DoCastSelf(SPELL_ALPHA_BEAMS);
                        events.ScheduleEvent(EVENT_ANRAPHET_CRUMBLING_RUIN, Seconds(12), 0, PHASE_COMBAT);
                        events.ScheduleEvent(EVENT_ANRAPHET_ALPHA_BEAMS, Seconds(40), Seconds(45), 0, PHASE_COMBAT);
                        break;
                    case EVENT_ANRAPHET_OMEGA_STANCE:
                        DoCastSelf(SPELL_OMEGA_STANCE_SUMMON);
                        DoCastSelf(SPELL_OMEGA_STANCE);
                        Talk(ANRAPHET_SAY_OMEGA_STANCE);
                        events.ScheduleEvent(EVENT_ANRAPHET_OMEGA_STANCE, Seconds(45), Seconds(50), 0, PHASE_COMBAT);
                        events.ScheduleEvent(EVENT_ANRAPHET_CRUMBLING_RUIN, Seconds(13), 0, PHASE_COMBAT);
                        break;
                    case EVENT_ANRAPHET_CRUMBLING_RUIN:
                        DoCastSelf(SPELL_CRUMBLING_RUIN);
                        break;
                }

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

            if (UpdateVictim())
                DoMeleeAttackIfReady();
        }
开发者ID:Mihapro,项目名称:TrinityCore,代码行数:58,代码来源:boss_anraphet.cpp

示例9: UpdateAI

            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_FLIGHT:
                        {
                            me->SetCanFly(true);
                            me->SetDisableGravity(true);
                            me->SetByteFlag(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_ANIM_TIER, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
                            me->SetReactState(REACT_PASSIVE);
                            me->AttackStop();
                            Position pos;
                            pos.Relocate(me);
                            pos.m_positionZ += 10.0f;
                            me->GetMotionMaster()->MoveTakeoff(POINT_TAKEOFF, pos);
                            events.CancelEventGroup(EVENT_GROUP_LAND_PHASE);
                            break;
                        }
                        case EVENT_CONFLAGRATION:
                            DoCastSelf(SPELL_CONFLAGRATION, true);
                            break;
                        case EVENT_ENRAGE:
                            DoCastSelf(SPELL_ENRAGE);
                            Talk(EMOTE_ENRAGED);
                            events.Repeat(Seconds(24));
                            break;
                        case EVENT_FLAME_BREATH:
                            DoCastVictim(SPELL_FLAME_BREATH);
                            events.Repeat(Seconds(20), Seconds(30));
                            break;
                        case EVENT_AIR_MOVEMENT:
                            me->GetMotionMaster()->MovePoint(POINT_FLIGHT, SavianaRagefireFlyOutPos);
                            break;
                        case EVENT_LAND_GROUND:
                            me->GetMotionMaster()->MoveLand(POINT_LAND_GROUND, SavianaRagefireLandPos);
                            break;
                        default:
                            break;
                    }

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

                DoMeleeAttackIfReady();
            }
开发者ID:ElunaLuaEngine,项目名称:ElunaTrinityWotlk,代码行数:56,代码来源:boss_saviana_ragefire.cpp

示例10: UpdateAI

            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_SEARING_LIGHT:
                            if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                                DoCast(target, SPELL_SEARING_LIGHT);

                            events.ScheduleEvent(EVENT_SEARING_LIGHT, TIMER_SEARING_LIGHT);
                            break;
                        case EVENT_GRAVITY_BOMB:
                            if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                                DoCast(target, SPELL_GRAVITY_BOMB);

                            events.ScheduleEvent(EVENT_GRAVITY_BOMB, TIMER_GRAVITY_BOMB);
                            break;
                        case EVENT_TYMPANIC_TANTRUM:
                            Talk(SAY_TYMPANIC_TANTRUM);
                            Talk(EMOTE_TYMPANIC_TANTRUM);
                            DoCast(SPELL_TYMPANIC_TANTRUM);
                            events.ScheduleEvent(EVENT_TYMPANIC_TANTRUM, urand(TIMER_TYMPANIC_TANTRUM_MIN, TIMER_TYMPANIC_TANTRUM_MAX));
                            break;
                        case EVENT_DISPOSE_HEART:
                            SetPhaseOne();
                            break;
                        case EVENT_ENRAGE:
                            Talk(SAY_BERSERK);
                            DoCastSelf(SPELL_ENRAGE);
                            break;
                        case EVENT_ENTER_HARD_MODE:
                            me->SetFullHealth();
                            DoCastSelf(SPELL_HEARTBREAK, true);
                            me->AddLootMode(LOOT_MODE_HARD_MODE_1);
                            _hardMode = true;
                            SetPhaseOne();
                            break;
                    }

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

                if (_phase == 1)
                    DoMeleeAttackIfReady();
            }
开发者ID:Delicate90,项目名称:TrinityCore,代码行数:55,代码来源:boss_xt002.cpp

示例11: UpdateAI

    void UpdateAI(uint32 diff) override
    {
        if (!events.IsInPhase(PHASE_INTRO) && !UpdateVictim())
            return;

        events.Update(diff);

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

        while (uint32 eventId = events.ExecuteEvent())
        {
            switch (eventId)
            {
                case EVENT_ENRAGE:
                    DoCast(SPELL_BERSERK);
                    break;
                case EVENT_INCINERATE:
                    if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                        DoCast(target, SPELL_INCINERATE);
                    Talk(SAY_INCINERATE);
                    events.Repeat(Seconds(12), Seconds(20));
                    break;
                case EVENT_SUMMON_DOOM_BLOSSOM:
                    DoCastSelf(SPELL_SUMMON_DOOM_BLOSSOM, true);
                    Talk(SAY_BLOSSOM);
                    events.Repeat(Seconds(30), Seconds(40));
                    break;
                case EVENT_SHADOW_DEATH:
                    if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100.0f, true, true, -SPELL_SPIRITUAL_VENGEANCE))
                        DoCast(target, SPELL_SHADOW_OF_DEATH);
                    events.Repeat(Seconds(30), Seconds(35));
                    break;
                case EVENT_CRUSHING_SHADOWS:
                    DoCastSelf(SPELL_CRUSHING_SHADOWS, { SPELLVALUE_MAX_TARGETS, 5 });
                    Talk(SAY_CRUSHING);
                    events.Repeat(Seconds(18), Seconds(30));
                    break;
                case EVENT_FINISH_INTRO:
                    me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
                    me->SetReactState(REACT_AGGRESSIVE);
                    break;
                default:
                    break;
            }

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

        DoMeleeAttackIfReady();
    }
开发者ID:lasyan3,项目名称:TrinityCore,代码行数:52,代码来源:boss_teron_gorefiend.cpp

示例12: IsSummonedBy

            void IsSummonedBy(Unit* summoner) override
            {
                _summonerGUID = summoner->GetGUID();

                _scheduler.Schedule(Milliseconds(3650), [this](TaskContext /*context*/)
                {
                    DoCastSelf(SPELL_ICICLE_FALL_TRIGGER, true);
                    DoCastSelf(SPELL_ICICLE_FALL_VISUAL);

                    if (Unit* caster = ObjectAccessor::GetUnit(*me, _summonerGUID))
                        caster->RemoveDynObject(SPELL_ICICLE_SUMMON);
                });
            }
开发者ID:kemlg,项目名称:trinitycore-conciens,代码行数:13,代码来源:pit_of_saron.cpp

示例13: DoAction

 void DoAction(int32 action) override
 {
     if (action == ACTION_ENRAGE)
     {
         DoCastSelf(SPELL_FROTHING_RAGE, true);
         Talk(EMOTE_TRAMPLE_ENRAGE);
     }
     else if (action == ACTION_TRAMPLE_FAIL)
     {
         DoCastSelf(SPELL_STAGGERED_DAZE, true);
         Talk(EMOTE_TRAMPLE_FAIL);
         events.DelayEvents(15s);
     }
 }
开发者ID:ElunaLuaEngine,项目名称:ElunaTrinityWotlk,代码行数:14,代码来源:boss_northrend_beasts.cpp

示例14: ExposeHeart

            void ExposeHeart()
            {
                Talk(SAY_HEART_OPENED);
                Talk(EMOTE_HEART_OPENED);

                DoCastSelf(SPELL_SUBMERGE);  // Will make creature untargetable
                me->AttackStop();
                me->SetReactState(REACT_PASSIVE);

                Unit* heart = me->GetVehicleKit() ? me->GetVehicleKit()->GetPassenger(HEART_VEHICLE_SEAT_NORMAL) : nullptr;
                if (heart)
                {
                    heart->CastSpell(heart, SPELL_HEART_OVERLOAD);
                    heart->CastSpell(me, SPELL_HEART_LIGHTNING_TETHER);
                    heart->CastSpell(heart, SPELL_HEART_HEAL_TO_FULL, true);
                    heart->CastSpell(me, SPELL_RIDE_VEHICLE_EXPOSED, true);
                    heart->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                    heart->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_29);
               }

                events.CancelEvent(EVENT_SEARING_LIGHT);
                events.CancelEvent(EVENT_GRAVITY_BOMB);
                events.CancelEvent(EVENT_TYMPANIC_TANTRUM);

                // Start "end of phase 2 timer"
                events.ScheduleEvent(EVENT_DISPOSE_HEART, TIMER_HEART_PHASE);

                // Phase 2 has officially started
                _phase = 2;
                _heartExposed++;
            }
开发者ID:Delicate90,项目名称:TrinityCore,代码行数:31,代码来源:boss_xt002.cpp

示例15: DoAction

 void DoAction(int32 action) override
 {
     switch (action)
     {
         case ACTION_PET_DIED:
             if (!_petCount) // underflow check - something has gone horribly wrong
             {
                 EnterEvadeMode(EVADE_REASON_OTHER);
                 return;
             }
             if (!--_petCount) // last pet died, emerge
             {
                 me->RemoveAurasDueToSpell(SPELL_SUBMERGE);
                 me->RemoveAurasDueToSpell(SPELL_IMPALE_AURA);
                 me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
                 DoCastSelf(SPELL_EMERGE);
                 events.SetPhase(PHASE_EMERGE);
                 events.ScheduleEvent(EVENT_POUND, randtime(Seconds(13), Seconds(18)), 0, PHASE_EMERGE);
                 events.ScheduleEvent(EVENT_LEECHING_SWARM, randtime(Seconds(3), Seconds(7)), 0, PHASE_EMERGE);
                 events.ScheduleEvent(EVENT_CARRION_BEETLES, randtime(Seconds(10), Seconds(15)), 0, PHASE_EMERGE);
             }
             break;
         case ACTION_PET_EVADE:
             EnterEvadeMode(EVADE_REASON_OTHER);
             break;
     }
 }
开发者ID:Declipe,项目名称:ElunaTrinityWotlk,代码行数:27,代码来源:boss_anubarak.cpp


注:本文中的DoCastSelf函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。