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


C++ SummonList::DoAction方法代码示例

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


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

示例1: UpdateAI

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

            events.Update(diff);

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

            switch (events.GetEvent())
            {
                case EVENT_BALL_LIGHTNING:
                    if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
                        me->CastSpell(target, me->GetMap()->IsHeroic() ? SPELL_BALL_LIGHTNING_H : SPELL_BALL_LIGHTNING_N, false);
                    
                    events.RepeatEvent(10000 + rand()%1000);
                    break;
                case EVENT_STATIC_OVERLOAD:
                    if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
                        me->CastSpell(target, me->GetMap()->IsHeroic() ? SPELL_STATIC_OVERLOAD_H : SPELL_STATIC_OVERLOAD_N, false);

                    events.RepeatEvent(5000 + rand()%1000);
                    break;
                case EVENT_CHECK_HEALTH:
                    if (HealthBelowPct(HealthCheck))
                        me->CastSpell(me, SPELL_DISPERSE, false);

                    events.RepeatEvent(1000);
                    return;
                case EVENT_CALL_SPARKS:
                {
                    EntryCheckPredicate pred(NPC_SPARK_OF_IONAR);
                    summons.DoAction(ACTION_CALLBACK, pred);
                    events.PopEvent();
                    events.ScheduleEvent(EVENT_RESTORE, 2000, 0, 2);
                    return;
                }
                case EVENT_RESTORE:
                    EntryCheckPredicate pred(NPC_SPARK_OF_IONAR);
                    summons.DoAction(ACTION_SPARK_DESPAWN, pred);
                    events.PopEvent();

                    me->SetVisible(true);
                    me->SetControlled(false, UNIT_STATE_STUNNED);
                    ScheduleEvents(true);
                    return;
            }

            DoMeleeAttackIfReady();
        }
开发者ID:Matt-One,项目名称:azerothcore-wotlk,代码行数:51,代码来源:boss_ionar.cpp

示例2: ChangePhase

 void ChangePhase()
 {
     if (!phase || phase == PHASE_CHASE)
     {
         phase = PHASE_STRIKE;
         summons.DoAction(EVENT_VOLCANO, 0);
         events.ScheduleEvent(EVENT_HATEFUL_STRIKE, 5000, GCD_CAST, PHASE_STRIKE);
         me->SetSpeed(MOVE_RUN, 1.2f);
         me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false);
         me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false);
     }
     else
     {
         phase = PHASE_CHASE;
         events.ScheduleEvent(EVENT_VOLCANO, 5000, GCD_CAST, PHASE_CHASE);
         events.ScheduleEvent(EVENT_SWITCH_TARGET, 10000, 0, PHASE_CHASE);
         me->SetSpeed(MOVE_RUN, 0.9f);
         me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
         me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
     }
     DoResetThreat();
     DoZoneInCombat();
     events.SetPhase(phase);
     events.ScheduleEvent(EVENT_SWITCH_PHASE, 60000, GCD_CAST);
 }
开发者ID:Archives,项目名称:ro_core,代码行数:25,代码来源:boss_supremus.cpp

示例3: EnterEvadeMode

 void EnterEvadeMode()
 {
     BossAI::EnterEvadeMode();
     summonsGenerator.DoAction(ACTION_DESPAWN_ALL);
     events2.ScheduleEvent(EVENT_SHADE_RESET_ENCOUNTER, 20000);
     me->SetVisible(false);
     ChannelersAction(ACTION_KILL_CHANNELERS);                   
 }
开发者ID:AzerothShard-Dev,项目名称:azerothcore,代码行数:8,代码来源:boss_shade_of_akama.cpp

示例4: DoAction

 void DoAction(int32 param)
 {
     if (param == ACTION_DESPAWN_ADDS)
     {
         summons.DoAction(ACTION_DESPAWN_ADDS);
         summons.DespawnAll();
     }
 }
开发者ID:AzerothShard-Dev,项目名称:azerothcore,代码行数:8,代码来源:boss_hadronox.cpp

示例5: UpdateAI

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

			events.Update(diff);
			if (me->HasUnitState(UNIT_STATE_CASTING))
				return;

			switch (events.GetEvent())
			{
				case EVENT_SUMMON_FERAL_DEFENDER:
					me->MonsterTextEmote("Auriaya begins to activate Feral Defender.", 0, true);
					me->CastSpell(me, SPELL_ACTIVATE_FERAL_DEFENDER, true);
					events.PopEvent();
					me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true);
					events.ScheduleEvent(EVENT_REMOVE_IMMUNE, 3000);
					break;
				case EVENT_REMOVE_IMMUNE:
					events.PopEvent();
					me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false);
					break;
				case EVENT_TERRIFYING_SCREECH:
					me->MonsterTextEmote("Auriaya begins to cast Terrifying Screech.", 0, true);
					me->CastSpell(me, SPELL_TERRIFYING_SCREECH, false);
					events.RepeatEvent(35000);
					break;
				case EVENT_SONIC_SCREECH:
					me->CastSpell(me, SPELL_SONIC_SCREECH, false);
					events.RepeatEvent(50000);
					break;
				case EVENT_GUARDIAN_SWARM:
					me->CastSpell(me->GetVictim(), SPELL_GUARDIAN_SWARM, false);
					events.RepeatEvent(40000);
					break;
				case EVENT_SENTINEL_BLAST:
					me->CastSpell(me, SPELL_SENTINEL_BLAST, false);
					events.RepeatEvent(35000);
					events.DelayEvents(5000, 0);
					break;
				case EVENT_RESPAWN_FERAL_DEFENDER:
				{
					EntryCheckPredicate pred(NPC_FERAL_DEFENDER);
					summons.DoAction(ACTION_FERAL_RESPAWN, pred);
					events.PopEvent();
					break;
				}
				case EVENT_ENRAGE:
					me->MonsterTextEmote("You waste my time!", 0);
					me->PlayDirectSound(SOUND_BERSERK);
					me->CastSpell(me, SPELL_ENRAGE, true);
					events.PopEvent();
					break;
			}

			DoMeleeAttackIfReady();
		}
开发者ID:AlexHjelm,项目名称:sunwell,代码行数:57,代码来源:boss_auriaya.cpp

示例6: Reset

        void Reset()
        {
            for (uint8 i = 0; i < 4; ++i)
            {
                bool good;
                do
                {
                    good = true;
                    RandomUnfreeze[i] = urand(0,3);

                    for (uint8 j = 0; j < i; ++j)
                        if (RandomUnfreeze[i] == RandomUnfreeze[j])
                        {
                            good = false;
                            break;
                        }
                }
                while (!good);
            }

            events.Reset();
            summons.DoAction(ACTION_DESPAWN_ADDS);
            summons.DespawnAll();
            OrbGUID = 0;
            Counter = 0;
            me->CastSpell(me, SPELL_FREEZE, true);
            me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
            me->SetControlled(false, UNIT_STATE_STUNNED);

            if (m_pInstance)
            {
                m_pInstance->SetData(DATA_GORTOK_PALEHOOF, NOT_STARTED);

                // Reset statue
                if (GameObject *statisGenerator = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(STATIS_GENERATOR)))
                {
                    statisGenerator->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
                    statisGenerator->SetGoState(GO_STATE_READY);
                }

                // Reset mini bosses
                for(uint8 i = 0; i < 4; ++i)
                {
                    if(Creature *Animal = ObjectAccessor::GetCreature(*me, m_pInstance->GetData64(DATA_NPC_FRENZIED_WORGEN+i)))
                    {
                        Animal->SetPosition(Animal->GetHomePosition());
                        Animal->StopMovingOnCurrentPos();
                        if(Animal->isDead())
                            Animal->Respawn(true);

                        Animal->CastSpell(Animal, SPELL_FREEZE, true);
                    }
                }
            }
        }
开发者ID:Helias,项目名称:azerothcore-wotlk,代码行数:55,代码来源:boss_palehoof.cpp

示例7: JustDied

		void JustDied(Unit *victim)
		{
			if (m_pInstance)
				m_pInstance->SetData(TYPE_AURIAYA, DONE);

			EntryCheckPredicate pred(NPC_FERAL_DEFENDER);
			summons.DoAction(ACTION_DESPAWN_ADDS, pred);
			summons.DespawnAll();
			me->MonsterTextEmote("Auriaya screams in agony.", 0);
			me->PlayDirectSound(SOUND_DEATH);
		}
开发者ID:AlexHjelm,项目名称:sunwell,代码行数:11,代码来源:boss_auriaya.cpp

示例8: JustDied

 void JustDied(Unit* killer)
 {
     BossAI::JustDied(killer);
     summonsGenerator.DoAction(ACTION_DESPAWN_ALL);
     summonsChanneler.DespawnAll();
     me->CastSpell(me, SPELL_SHADE_OF_AKAMA_TRIGGER, true);
     if (Creature* akama = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_AKAMA_SHADE)))
     {
         akama->SetHomePosition(*akama);
         akama->AI()->DoAction(ACTION_SHADE_DIED);
     }
 }
开发者ID:AzerothShard-Dev,项目名称:azerothcore,代码行数:12,代码来源:boss_shade_of_akama.cpp

示例9: DoAction

 void DoAction(int32 param)
 {
     if (param == ACTION_START_ENCOUNTER)
     {
         summonsGenerator.DoAction(ACTION_START_ENCOUNTER);
         ChannelersAction(ACTION_START_ENCOUNTER);
         events.ScheduleEvent(EVENT_SHADE_CHECK_DISTANCE, 1000);
     }
     else if (param == ACTION_AKAMA_DIED)
     {
         EnterEvadeMode();
     }
 }
开发者ID:AzerothShard-Dev,项目名称:azerothcore,代码行数:13,代码来源:boss_shade_of_akama.cpp

示例10: UpdateAI

        void UpdateAI(uint32 diff)
        {
            //Return since we have no target
            if (!UpdateVictim())
                return;

            events.Update(diff);

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

            switch (events.GetEvent())
            {
                case EVENT_HEAT:
                    me->CastSpell(me, me->GetMap()->IsHeroic() ? SPELL_HEAT_H : SPELL_HEAT_N, true);
                    events.RepeatEvent(8000);
                    break;
                case EVENT_CHECK_HEALTH:
                    if (HealthBelowPct(HealthCheck))
                        GoToAnvil();

                    events.RepeatEvent(1000);
                    return;
                case EVENT_SHATTER:
                {
                    events.RepeatEvent(10000);
                    summons.DoAction(ACTION_SHATTER);
                    break;
                }
                case EVENT_MOVE_TO_ANVIL:
                    GetNextPos();
                    me->GetMotionMaster()->MovePoint(PointID, x, y, z);
                    events.PopEvent();
                    return;
                case EVENT_POSITION:
                    if (me->GetDistance(1331.9f, -106, 56) > 95)
                        EnterEvadeMode();
                    else
                        events.RepeatEvent(4000);
                
                    return;
            }
            
            DoMeleeAttackIfReady();
        }
开发者ID:AzerothShard-Dev,项目名称:azerothcore,代码行数:45,代码来源:boss_volkhan.cpp

示例11: Reset

		void Reset()
		{
			_feralDied = false;
			_nineLives = false;

			events.Reset();
			EntryCheckPredicate pred(NPC_FERAL_DEFENDER);
			summons.DoAction(ACTION_DESPAWN_ADDS, pred);
			summons.DespawnAll();

			if (m_pInstance)
				m_pInstance->SetData(TYPE_AURIAYA, NOT_STARTED);

			for (uint8 i = 0; i < RAID_MODE(2,4); ++i)
				me->SummonCreature(NPC_SANCTUM_SENTRY, me->GetPositionX()+urand(4,12), me->GetPositionY()+urand(4,12), me->GetPositionZ());
				
			me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false);
		}
开发者ID:AlexHjelm,项目名称:sunwell,代码行数:18,代码来源:boss_auriaya.cpp

示例12: EnterCombat

 void EnterCombat(Unit* /*who*/)
 {
     Talk(SAY_AGGRO);
     me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
     me->SetInCombatWithZone();
     if (instance)
         instance->SetData(TYPE_ANUBARAK, IN_PROGRESS);
     //Despawn Scarab Swarms neutral
     EntryCheckPredicate pred(NPC_SCARAB);
     Summons.DoAction(ACTION_SCARAB_SUBMERGE, pred);
     //Spawn Burrow
     for (int i=0; i < 4; i++)
         me->SummonCreature(NPC_BURROW, AnubarakLoc[i+2]);
     //Spawn Frost Spheres
     for (int i=0; i < 6; i++)
         if (Unit* summoned = me->SummonCreature(NPC_FROST_SPHERE, SphereSpawn[i]))
             m_aSphereGUID[i] = summoned->GetGUID();
 }
开发者ID:DebugProject,项目名称:Lua-Other,代码行数:18,代码来源:boss_anubarak_trial.cpp

示例13: UpdateAI


//.........这里部分代码省略.........
                    timer = 0;
                }
            }

            if (!UpdateVictim())
                return;

            events.Update(diff);
            if (me->HasUnitState(UNIT_STATE_CASTING))
                return;

            switch (events.GetEvent())
            {
                case EVENT_MINIBOSS_SHADOW_BREATH:
                    if (!urand(0,10))
                        Talk(SAY_TENEBRON_BREATH);
                    me->CastSpell(me->GetVictim(), SPELL_SHADOW_BREATH, false);
                    events.RepeatEvent(17500);
                    break;
                case EVENT_MINIBOSS_SHADOW_FISSURE:
                    if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
                        me->CastSpell(target, SPELL_SHADOW_FISSURE, false);
                    events.RepeatEvent(22500);
                    break;
                case EVENT_MINIBOSS_OPEN_PORTAL:
                    Talk(WHISPER_OPEN_PORTAL);
                    Talk(SAY_TENEBRON_SPECIAL);
                    
                    if (!isSartharion)
                    {
                        if (GameObject* Portal = me->GetVictim()->SummonGameObject(GO_TWILIGHT_PORTAL, portalPos[BOSS_TENEBRON_EVENT].GetPositionX(), portalPos[BOSS_TENEBRON_EVENT].GetPositionY(), portalPos[BOSS_TENEBRON_EVENT].GetPositionZ(), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0))
                            portalGUID = Portal->GetGUID();
                    }
                    else if (pInstance)
                        pInstance->SetData(DATA_ADD_PORTAL, 0);

                        
                    events.ScheduleEvent(EVENT_MINIBOSS_SPAWN_HELPERS, 2000);
                    events.RepeatEvent(60000);
                    break;
                case EVENT_MINIBOSS_SPAWN_HELPERS:
                {
                    Talk(WHISPER_HATCH_EGGS);
                    Creature* cr = NULL;
                    for (uint8 i = 0; i < 6; ++i)
                    {
                        if (cr = me->SummonCreature(NPC_TWILIGHT_EGG, EggsPos[isSartharion ? i+6 : i].GetPositionX(), EggsPos[isSartharion ? i+6 : i].GetPositionY(), EggsPos[isSartharion ? i+6 : i].GetPositionZ(), EggsPos[isSartharion ? i+6 : i].GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000))
                        {
                            summons.Summon(cr);
                            cr->SetPhaseMask(16, true);
                        }
                        if (cr = me->SummonCreature(NPC_TWILIGHT_WHELP, EggsPos[isSartharion ? i+6 : i].GetPositionX(), EggsPos[isSartharion ? i+6 : i].GetPositionY(), EggsPos[isSartharion ? i+6 : i].GetPositionZ(), EggsPos[isSartharion ? i+6 : i].GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000))
                        {
                            summons.Summon(cr);
                            cr->SetPhaseMask(16, true);
                        }
                    }

                    events.ScheduleEvent(EVENT_MINIBOSS_HATCH_EGGS, 25000);
                    events.PopEvent();
                    break;
                }
                case EVENT_MINIBOSS_HATCH_EGGS:
                {
                    Creature* cr = NULL;
                    summons.RemoveNotExisting();
                    summons.DespawnEntry(NPC_TWILIGHT_WHELP);
                    for (SummonList::iterator i = summons.begin(); i != summons.end(); ++i)
                    {
                        if (cr = ObjectAccessor::GetCreature(*me, *i))
                        {
                            if (!cr->IsAlive())
                                continue;

                            if (cr->GetEntry() == NPC_TWILIGHT_EGG)
                                if (cr = me->SummonCreature(NPC_TWILIGHT_WHELP, cr->GetPositionX(), cr->GetPositionY(), cr->GetPositionZ(), cr->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000))
                                    summons2.Summon(cr);
                        }
                    }

                    if (!isSartharion)
                    {
                        // Remove phase shift
                        if (InstanceScript* instance = me->GetInstanceScript())
                            instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_TWILIGHT_SHIFT);

                        RemoveTwilightPortal();
                    }
                    else if (pInstance)
                        pInstance->SetData(DATA_CLEAR_PORTAL, 0);

                    EntryCheckPredicate pred(NPC_TWILIGHT_EGG);
                    summons.DoAction(ACTION_SWITCH_PHASE, pred);
                    events.PopEvent();
                    break;
                }
            }

            DoMeleeAttackIfReady();
        }
开发者ID:boom8866,项目名称:azerothcore-wotlk,代码行数:101,代码来源:boss_sartharion.cpp

示例14: UpdateAI

            void UpdateAI(uint32 diff)
            {
                events2.Update(diff);
                switch (events2.ExecuteEvent())
                {
                    case EVENT_SHADE_GATHER_NPCS:
                    {
                        std::list<Creature*> ChannelerList;
                        me->GetCreaturesWithEntryInRange(ChannelerList, 100.0f, NPC_ASHTONGUE_CHANNELER);
                        for (std::list<Creature*>::const_iterator itr = ChannelerList.begin(); itr != ChannelerList.end(); ++itr)
                            summonsChanneler.Summon(*itr);

                        std::list<Creature*> SpawnerList;
                        me->GetCreaturesWithEntryInRange(SpawnerList, 100.0f, NPC_CREATURE_GENERATOR_AKAMA);
                        for (std::list<Creature*>::const_iterator itr = SpawnerList.begin(); itr != SpawnerList.end(); ++itr)
                            summonsGenerator.Summon(*itr);

                        summonsChanneler.Respawn();
                        summonsGenerator.Respawn();
                        ChannelersAction(ACTION_CHANNELERS_START_CHANNEL);
                        
                        if (Creature* akama = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_AKAMA_SHADE)))
                            akama->Respawn(true);
                        break;
                    }
                    case EVENT_SHADE_RESET_ENCOUNTER:
                        me->SetVisible(true);
                        summonsGenerator.Respawn();
                        summonsChanneler.Respawn();
                        ChannelersAction(ACTION_CHANNELERS_START_CHANNEL);

                        if (Creature* akama = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_AKAMA_SHADE)))
                            akama->Respawn(true);
                        break;
                }

                if (!UpdateVictim())
                    return;

                events.Update(diff);
                if (me->HasUnitState(UNIT_STATE_CASTING))
                    return;

                switch (events.ExecuteEvent())
                {
                    case EVENT_SHADE_CHECK_DISTANCE:
                        if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE)
                        {
                            int32 slow = me->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_DECREASE_SPEED);
                            if (slow > -100)
                            {
                                me->SetWalk(true);
                                me->GetMotionMaster()->MovePoint(POINT_START, 510.0f, 400.7993f, 112.7837f);
                            }
                        }
                        else
                        {
                            int32 slow = me->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_DECREASE_SPEED);
                            if (slow < -100)
                                me->GetMotionMaster()->Clear();
                            else if (slow == 0)
                            {
                                summonsGenerator.DoAction(ACTION_NO_SORCERERS);
                                me->SetWalk(false);
                            }
                        }

                        if (me->IsWithinMeleeRange(me->GetVictim()))
                        {
                            me->SetReactState(REACT_AGGRESSIVE);
                            DoResetThreat();
                            me->GetVictim()->InterruptNonMeleeSpells(false);
                            me->AddThreat(me->GetVictim(), 1000000.0f);
                            me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC|UNIT_FLAG_NOT_SELECTABLE);
                            summonsGenerator.DoAction(ACTION_STOP_SPAWNING);
                            break;
                        }
                        events.ScheduleEvent(EVENT_SHADE_CHECK_DISTANCE, 1000);
                        break;
                }

                DoMeleeAttackIfReady();
                EnterEvadeIfOutOfCombatArea();
            }
开发者ID:AzerothShard-Dev,项目名称:azerothcore,代码行数:84,代码来源:boss_shade_of_akama.cpp


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