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


C++ Creature::ApplySpellImmune方法代码示例

本文整理汇总了C++中Creature::ApplySpellImmune方法的典型用法代码示例。如果您正苦于以下问题:C++ Creature::ApplySpellImmune方法的具体用法?C++ Creature::ApplySpellImmune怎么用?C++ Creature::ApplySpellImmune使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Creature的用法示例。


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

示例1: UpdateAI


//.........这里部分代码省略.........
        {
            uint8 Available[2];

            switch (LastSuperSpell)
            {
                case SUPER_AE:
                    Available[0] = SUPER_FLAME;
                    Available[1] = SUPER_BLIZZARD;
                    break;
                case SUPER_FLAME:
                    Available[0] = SUPER_AE;
                    Available[1] = SUPER_BLIZZARD;
                    break;
                case SUPER_BLIZZARD:
                    Available[0] = SUPER_FLAME;
                    Available[1] = SUPER_AE;
                    break;
            }

            LastSuperSpell = Available[urand(0, 1)];
            SetImmune(true);
 
            Map::PlayerList const &PlayerList = pInstance->instance->GetPlayers();
            WorldPacket data;
            switch (LastSuperSpell)
            {
            case SUPER_AE:
                DoScriptText(RAND(SAY_EXPLOSION1, SAY_EXPLOSION2), me);

                DoCast(me, SPELL_BLINK_CENTER, true);
                DoCast(me, SPELL_PLAYERPULL, true);
                DoCast(me, SPELL_MASSSLOW, true);
                DoCast(me, SPELL_ARCANE_BUBBLE, true);
                me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true);
                me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_INTERRUPT, true);
                AETimer = 1500;
                CastAE = true;
                break;

            case SUPER_FLAME:
                DoScriptText(RAND(SAY_FLAMEWREATH1, SAY_FLAMEWREATH2), me);

                FlameWreathTimer = 20000;
                FlameWreathCheckTime = 500;

                FlameWreathTarget[0] = 0;
                FlameWreathTarget[1] = 0;
                FlameWreathTarget[2] = 0;

                FlameWreathEffect();
                SecondarySpellTimer = 20500;
                break;

            case SUPER_BLIZZARD:
                DoScriptText(RAND(SAY_BLIZZARD1, SAY_BLIZZARD2), me);

                Creature* Blizzard = NULL;
                Blizzard = me->SummonCreature(NPC_ARAN_BLIZZARD, -11179.080f, -1905.279f, 232.008f, 2.9f, TEMPSUMMON_TIMED_DESPAWN, 25000);
                if (Blizzard)
                {
                    Blizzard->SetInCombatWithZone();
                    Blizzard->SetFaction(me->GetFaction());
                    me->CastSpell(Blizzard, SPELL_SUMMON_BLIZZ, false);
                    Blizzard->CastSpell(Blizzard, SPELL_CIRCULAR_BLIZZARD, false);
                    Blizzard->GetMotionMaster()->MovePath(110110101, false);
                }
开发者ID:Phentora,项目名称:OregonCore,代码行数:67,代码来源:boss_shade_of_aran.cpp

示例2: UpdateAI

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

        DoSpecialThings(diff, DO_COMBAT_N_EVADE, 135.0f);

        if (!evocating && m_creature->GetPower(POWER_MANA) <= 1000)
        {
            evocating = true;
            ForceSpellCastWithScriptText(SPELL_EVOCATION, CAST_SELF, SAY_EVOCATE);
        }

        if (!enraged && !evocating)
        {
            if (addTimer < diff)
            {
                //Summon Astral Flare
                Creature* astralFlare = DoSpawnCreature(17096, rand()%37, rand()%37, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
                Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);

                if (astralFlare && target)
                {
                    astralFlare->CastSpell(astralFlare, SPELL_ASTRAL_FLARE_PASSIVE, false);
                    astralFlare->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true);
                    astralFlare->AI()->AttackStart(target);
                }

                //Reduce Mana by 10%
                int32 mana = (int32)(0.1f*(m_creature->GetMaxPower(POWER_MANA)));
                m_creature->ModifyPower(POWER_MANA, -mana);

                DoScriptText(RAND(SAY_SUMMON1, SAY_SUMMON2, 0, 0), m_creature);

                addTimer = 10000;
            }
            else
                addTimer -= diff;

            if (hatefulBoltTimer < diff)
            {
                AddSpellToCast(SPELL_HATEFUL_BOLT, CAST_THREAT_SECOND);
                hatefulBoltTimer = enraged ? 7000 : 15000;
            }
            else
                hatefulBoltTimer -= diff;

            if (!enraged && HealthBelowPct(15))
            {
                enraged = true;
                ForceSpellCastWithScriptText(SPELL_ENRAGE, CAST_SELF, SAY_ENRAGE);
            }
        }

        if (berserkTimer < diff)
        {
            ForceSpellCastWithScriptText(SPELL_BERSERK, CAST_SELF, SAY_ENRAGE);
            berserkTimer = 60000;
        }
        else
            berserkTimer -= diff;

        CastNextSpellIfAnyAndReady();

        if (!evocating)
            DoMeleeAttackIfReady();
    }
开发者ID:Looking4Group,项目名称:L4G_Core,代码行数:67,代码来源:boss_curator.cpp


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