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


C++ DoSummon函数代码示例

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


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

示例1: UpdateAI

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

            events.Update(diff);

            while (uint32 eventId = events.ExecuteEvent())
            {
                switch(eventId)
                {
                    case EVENT_IMPALE:
                        //Cast Impale on a random target
                        //Do NOT cast it when we are afflicted by locust swarm
                        if (!me->HasAura(RAID_MODE(SPELL_LOCUST_SWARM_10,SPELL_LOCUST_SWARM_25)))
                            if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
                                DoCast(pTarget, RAID_MODE(SPELL_IMPALE_10,SPELL_IMPALE_25));
                        events.ScheduleEvent(EVENT_IMPALE, urand(10000,20000));
                        break;
                    case EVENT_LOCUST:
                        // TODO : Add Text
                        DoCast(me, RAID_MODE(SPELL_LOCUST_SWARM_10,SPELL_LOCUST_SWARM_25));
                        DoSummon(MOB_CRYPT_GUARD, GuardSummonPos, 0, TEMPSUMMON_CORPSE_DESPAWN);
                        events.ScheduleEvent(EVENT_LOCUST, 90000);
                        break;
                    case EVENT_SPAWN_GUARDIAN_NORMAL:
                        // TODO : Add Text
                        DoSummon(MOB_CRYPT_GUARD, GuardSummonPos, 0, TEMPSUMMON_CORPSE_DESPAWN);
                        break;
                    case EVENT_BERSERK:
                        DoCast(me, SPELL_BERSERK, true);
                        events.ScheduleEvent(EVENT_BERSERK, 600000);
                        break;
                }
            }

            DoMeleeAttackIfReady();
        }
开发者ID:InkVisible,项目名称:wow,代码行数:38,代码来源:boss_anubrekhan.cpp

示例2: UpdateAI

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

                events.Update(diff);

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

                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_SLIME_SPRAY:
                            if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true))
                            {
                                DoSummon(NPC_OOZE_SPRAY_STALKER, *target, 8000, TEMPSUMMON_TIMED_DESPAWN);
                                Talk(EMOTE_SLIME_SPRAY);
                                DoCast(me, SPELL_SLIME_SPRAY);
                            }
                            events.ScheduleEvent(EVENT_SLIME_SPRAY, 20000);
                            break;
                        case EVENT_HASTEN_INFECTIONS:
                            if (infectionStage++ < 4)
                            {
                                infectionCooldown -= 2000;
                                events.ScheduleEvent(EVENT_HASTEN_INFECTIONS, 90000);
                            }
                            break;
                        case EVENT_MUTATED_INFECTION:
                        {
                            Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, -MUTATED_INFECTION);
                            if (!target)
                                target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -MUTATED_INFECTION);
                            if (target)
                            {
                                me->CastCustomSpell(SPELL_MUTATED_INFECTION, SPELLVALUE_MAX_TARGETS, 1, target, false);
                                Talk(EMOTE_MUTATED_INFECTION, target->GetGUID());
                            }
                            events.ScheduleEvent(EVENT_MUTATED_INFECTION, infectionCooldown);
                            break;
                        }
                        default:
                            break;
                    }
                }

                DoMeleeAttackIfReady();
            }
开发者ID:Archives,项目名称:MMOCore,代码行数:50,代码来源:boss_rotface.cpp

示例3: EnterCombat

            void EnterCombat(Unit* /*who*/) override
            {
                for (uint32 i = 0; i < POS_LIVE; ++i)
                    if (Creature* trigger = DoSummon(WORLD_TRIGGER, PosSummonLive[i]))
                        LiveTriggerGUID.push_back(trigger->GetGUID());
                for (uint32 i = 0; i < POS_DEAD; ++i)
                    if (Creature* trigger = DoSummon(WORLD_TRIGGER, PosSummonDead[i]))
                        DeadTriggerGUID.push_back(trigger->GetGUID());

                if (LiveTriggerGUID.size() < POS_LIVE || DeadTriggerGUID.size() < POS_DEAD)
                {
                    TC_LOG_ERROR("scripts", "Script Gothik: cannot summon triggers!");
                    EnterEvadeMode();
                    return;
                }

                _EnterCombat();
                waveCount = 0;
                events.ScheduleEvent(EVENT_SUMMON, 30000);
                DoTeleportTo(PosPlatform);
                Talk(SAY_SPEECH);
                instance->SetData(DATA_GOTHIK_GATE, GO_STATE_READY);
            }
开发者ID:AllThing,项目名称:TrinityCore,代码行数:23,代码来源:boss_gothik.cpp

示例4: UpdateAI

    void UpdateAI(const uint32 diff)
    {
        if (pInstance && pInstance->GetData(DATA_REMOVE_NPC) == 1)
        {
            me->ForcedDespawn();
            pInstance->SetData(DATA_REMOVE_NPC, 0);
        }

        if (uiSpawnTimer <= diff)
        {
            if (bPortalGuardianOrKeeperSpawn)
            {
                uint8 k = pInstance && pInstance->GetData(DATA_WAVE_COUNT) < 12 ? 2 : 3;
                for (uint8 i = 0; i < k; ++i)
                {
                    uint32 entry = RAND(CREATURE_AZURE_CAPTAIN,CREATURE_AZURE_RAIDER,CREATURE_AZURE_STALKER,CREATURE_AZURE_SORCEROR);
                    if (Creature* pSummon = DoSummon(entry, me, 2.0f, 30000, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT))
                        pSummon->GetMotionMaster()->MovePoint(0, DoorPosition);
                }
            }
            else
            {
                bPortalGuardianOrKeeperSpawn = true;
                uint32 entry = RAND(CREATURE_PORTAL_GUARDIAN, CREATURE_PORTAL_KEEPER);
                if (Creature *pPortalKeeper = DoSummon(entry, me, 2.0f, 0, TEMPSUMMON_DEAD_DESPAWN))
                    me->CastSpell(pPortalKeeper, SPELL_PORTAL_CHANNEL, false);
            }
            uiSpawnTimer = SPAWN_TIME;
        } else uiSpawnTimer -= diff;

        if (bPortalGuardianOrKeeperSpawn && !me->IsNonMeleeSpellCasted(false))
        {
            me->Kill(me, false);
            me->RemoveCorpse();
            return;
        }
    }
开发者ID:Asandru,项目名称:Script-Land,代码行数:37,代码来源:violet_hold.cpp

示例5: UpdateAI

    void UpdateAI(const uint32 uiDiff) override
    {
        if (m_uiTimer < uiDiff)
        {
            switch (m_uiWave)
            {
            case 0:
                DoSummon(0);
                m_uiTimer = 15000;
                ++m_uiWave;
                break;
            case 1:
                DoSummon(1);
                DoSummon(2);
                m_uiTimer = 15000;
                ++m_uiWave;
                break;
            case 2:
                {
                    DoSummon(3);
                    m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PACIFIED | UNIT_FLAG_PASSIVE);
                    m_creature->SetVisibility(VISIBILITY_ON);
                    if (auto pPlayer = m_creature->GetMap()->GetPlayer(m_PlayerGuid))
                    {
                        if (pPlayer->isAlive())
                            m_creature->AI()->AttackStart(pPlayer);
                    }
                    ++m_uiWave;
                }
                break;
            }
        }
        else
            m_uiTimer -= uiDiff;

        ScriptedAI::UpdateAI(uiDiff);
    }
开发者ID:Maduse,项目名称:server,代码行数:37,代码来源:thousand_needles.cpp

示例6: UpdateAI

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

            if (uiSpawnTimer <= diff)
            {
                uint32 spawnNumber = urand(2, DUNGEON_MODE(3, 5));
                for (uint8 i = 0; i < spawnNumber; ++i)
                    DoSummon(RAND(NPC_DRAKKARI_INVADER_1, NPC_DRAKKARI_INVADER_2), AddSpawnPoint, 0, TEMPSUMMON_DEAD_DESPAWN);
                uiSpawnTimer = urand(30*IN_MILLISECONDS, 40*IN_MILLISECONDS);
            } else uiSpawnTimer -= diff;

            if (uiConsumeTimer <= diff)
            {
                DoScriptText(SAY_CONSUME, me);
                DoCast(SPELL_CONSUME);
                uiConsumeTimer = 15*IN_MILLISECONDS;
            } else uiConsumeTimer -= diff;

            if (consumptionJunction)
            {
                Aura* ConsumeAura = me->GetAura(DUNGEON_MODE(SPELL_CONSUME_AURA, H_SPELL_CONSUME_AURA));
                if (ConsumeAura && ConsumeAura->GetStackAmount() > 9)
                    consumptionJunction = false;
            }

            if (uiCrushTimer <= diff)
            {
                DoCastVictim(SPELL_CRUSH);
                uiCrushTimer = urand(10*IN_MILLISECONDS, 15*IN_MILLISECONDS);
            } else uiCrushTimer -= diff;

            if (uiInfectedWoundTimer <= diff)
            {
                DoCastVictim(SPELL_INFECTED_WOUND);
                uiInfectedWoundTimer = urand(25*IN_MILLISECONDS, 35*IN_MILLISECONDS);
            } else uiInfectedWoundTimer -= diff;

            if (uiExplodeCorpseTimer <= diff)
            {
                DoCast(SPELL_CORPSE_EXPLODE);
                DoScriptText(SAY_EXPLODE, me);
                uiExplodeCorpseTimer = urand(15*IN_MILLISECONDS, 19*IN_MILLISECONDS);
            } else uiExplodeCorpseTimer -= diff;

            DoMeleeAttackIfReady();
        }
开发者ID:Rouen-X,项目名称:SkyFireEMU,代码行数:49,代码来源:boss_trollgore.cpp

示例7: UpdateAI

        void UpdateAI(const uint32 diff)
        {
            if (!UpdateVictimWithGaze() || !CheckInRoom())
                return;

            events.Update(diff);

            while (uint32 eventId = events.ExecuteEvent())
            {
                switch (eventId)
                {
                    case EVENT_WOUND:
                        DoCast(me->getVictim(), SPELL_MORTAL_WOUND);
                        events.ScheduleEvent(EVENT_WOUND, 10000);
                        break;
                    case EVENT_ENRAGE:
                        // TODO : Add missing text
                        DoCast(me, SPELL_ENRAGE);
                        events.ScheduleEvent(EVENT_ENRAGE, 15000);
                        break;
                    case EVENT_DECIMATE:
                        // TODO : Add missing text
                        DoCastAOE(SPELL_DECIMATE);
                        events.ScheduleEvent(EVENT_DECIMATE, 105000);
                        break;
                    case EVENT_BERSERK:
                        DoCast(me, SPELL_BERSERK);
                        events.ScheduleEvent(EVENT_BERSERK, 5*60000);
                        break;
                    case EVENT_SUMMON:
                        for (int32 i = 0; i < RAID_MODE(1, 2); ++i)
                            DoSummon(MOB_ZOMBIE, PosSummon[rand() % RAID_MODE(1, 3)]);
                        events.ScheduleEvent(EVENT_SUMMON, 10000);
                        break;
                }
            }

            if (me->getVictim() && me->getVictim()->GetEntry() == MOB_ZOMBIE)
            {
                if (me->IsWithinMeleeRange(me->getVictim()))
                {
                    me->Kill(me->getVictim());
                    me->ModifyHealth(int32(me->CountPctFromMaxHealth(5)));
                }
            }
            else
                DoMeleeAttackIfReady();
        }
开发者ID:Eralan,项目名称:Darkcore,代码行数:48,代码来源:boss_gluth.cpp

示例8: boss_flame_leviathanAI

        boss_flame_leviathanAI(Creature *pCreature) : BossAI(pCreature, BOSS_LEVIATHAN), vehicle(me->GetVehicleKit())
        {
            assert(vehicle);
            pInstance = pCreature->GetInstanceScript();
            ColossusCount = 0;
            me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
            me->ApplySpellImmune(0, IMMUNITY_ID, 49560, true);  // Death Grip
        
            me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED);
            me->SetReactState(REACT_PASSIVE);

        // Summon Ulduar Colossus
        if (me->isAlive())
            for(uint32 i = 0; i < 2; ++i)
                DoSummon(MOB_COLOSSUS, PosColossus[i], 7000, TEMPSUMMON_CORPSE_TIMED_DESPAWN);
    	}
开发者ID:InkVisible,项目名称:wow,代码行数:16,代码来源:boss_flame_leviathan.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_SLIME_SPRAY:
                    if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true))
                    {
                        DoSummon(NPC_OOZE_SPRAY_STALKER, *target, 8000, TEMPSUMMON_TIMED_DESPAWN);
                        Talk(EMOTE_SLIME_SPRAY);
                        DoCast(me, SPELL_SLIME_SPRAY);
                    }
                    events.ScheduleEvent(EVENT_SLIME_SPRAY, 20000);
                    break;
                case EVENT_HASTEN_INFECTIONS:
                    if (infectionStage++ < 4)
                    {
                        infectionCooldown -= 2000;
                        events.ScheduleEvent(EVENT_HASTEN_INFECTIONS, 90000);
                    }
                    break;
                case EVENT_MUTATED_INFECTION:
                    DoCastAOE(SPELL_MUTATED_INFECTION);
                    events.ScheduleEvent(EVENT_MUTATED_INFECTION, infectionCooldown);
                    break;
                case EVENT_VILE_GAS:
                    DoCastAOE(SPELL_VILE_GAS_TRIGGER);
                    events.ScheduleEvent(EVENT_VILE_GAS, urand(30000, 35000));
                    break;
                default:
                    break;
                }
            }

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

示例10: UpdateAI

    void UpdateAI(const uint32 diff)
    {
        if (!UpdateVictimWithGaze() || !CheckInRoom())
            return;

        events.Update(diff);

        while(uint32 eventId = events.ExecuteEvent())
        {
            switch(eventId)
            {
                case EVENT_WOUND:
                    DoCast(me->getVictim(), SPELL_MORTAL_WOUND);
                    events.ScheduleEvent(EVENT_WOUND, 10000);
                    return;
                case EVENT_ENRAGE:
                    DoCast(me, SPELL_ENRAGE);
                    events.ScheduleEvent(EVENT_ENRAGE, 30000);
                    return;
                case EVENT_DECIMATE:
                    DoCastAOE(SPELL_DECIMATE);
                    events.ScheduleEvent(EVENT_DECIMATE, 105000);
                    return;
                case EVENT_BERSERK:
                    DoCast(me, SPELL_BERSERK);
                    return;
                case EVENT_SUMMON:
                    for(uint32 i = 0; i < HEROIC(1,2); ++i)
                        DoSummon(MOB_ZOMBIE, triggers[rand()%3]);
                    events.ScheduleEvent(EVENT_SUMMON, 10000);
                    return;
            }
        }

        if (me->getVictim()->GetEntry() == MOB_ZOMBIE)
        {
            if (me->IsWithinMeleeRange(me->getVictim()))
            {
                me->Kill(me->getVictim());
                me->ModifyHealth(me->GetMaxHealth() * 0.05f);
            }
        }
        else
            DoMeleeAttackIfReady();
    }
开发者ID:pfchrono,项目名称:mangos-mods,代码行数:45,代码来源:boss_gluth.cpp

示例11: UpdateAI

        void UpdateAI(uint32 diff) override
        {
            if (!UpdateVictimWithGaze() || !CheckInRoom())
                return;

            events.Update(diff);

            while (uint32 eventId = events.ExecuteEvent())
            {
                switch (eventId)
                {
                    case EVENT_WOUND:
                        DoCastVictim(SPELL_MORTAL_WOUND);
                        events.ScheduleEvent(EVENT_WOUND, 10000);
                        break;
                    case EVENT_ENRAGE:
                        Talk(EMOTE_ENRAGE);
                        DoCast(me, SPELL_ENRAGE);
                        events.ScheduleEvent(EVENT_ENRAGE, 15000);
                        break;
                    case EVENT_DECIMATE:
                        Talk(EMOTE_DECIMATE);
                        DoCastAOE(SPELL_DECIMATE);
                        events.ScheduleEvent(EVENT_DECIMATE, 105000);
                        break;
                    case EVENT_BERSERK:
                        DoCast(me, SPELL_BERSERK);
                        events.ScheduleEvent(EVENT_BERSERK, 5*60000);
                        break;
                    case EVENT_SUMMON:
                        for (int32 i = 0; i < RAID_MODE(1, 2); ++i)
                            DoSummon(NPC_ZOMBIE, PosSummon[rand32() % RAID_MODE(1, 3)]);
                        // There's probably a better way to handle this
                        for (SummonList::iterator itr = summons.begin(); itr != summons.end(); ++itr)
                            if(Unit* unit = ObjectAccessor::GetUnit(*me, *itr))
                                if (unit->GetEntry() == NPC_ZOMBIE)
                                    unit->ToCreature()->AI()->AttackStart(me);
                        events.ScheduleEvent(EVENT_SUMMON, 10000);
                        break;
                }
            }
                DoMeleeAttackIfReady();
        }
开发者ID:OniBoov,项目名称:TCOLD,代码行数:43,代码来源:boss_gluth.cpp

示例12: EnterCombat

    void EnterCombat(Unit *who)
    {
        for(uint32 i = 0; i < 3; ++i)
            if (Creature *trigger = DoSummon(WORLD_TRIGGER, PosSummon[i]))
                triggers.push_back(trigger);
        if (triggers.size() < 3)
        {
            error_log("Script Gluth: cannot summon triggers!");
            EnterEvadeMode();
            return;
        }

        _EnterCombat();
        events.ScheduleEvent(EVENT_WOUND, 10000);
        events.ScheduleEvent(EVENT_ENRAGE, 30000);
        events.ScheduleEvent(EVENT_DECIMATE, 105000);
        events.ScheduleEvent(EVENT_BERSERK, 8*60000);
        events.ScheduleEvent(EVENT_SUMMON, 10000);
    }
开发者ID:pfchrono,项目名称:mangos-mods,代码行数:19,代码来源:boss_gluth.cpp

示例13: MovementInform

        void MovementInform(uint32 type, uint32 id) override
        {
            if (type != POINT_MOTION_TYPE)
                return;

            if (id < 10)
                wpreached = true;

            if (id == 8)
            {
                for (uint8 i = 0; i < 2; i++)
                    DoSummon(NPC_FOUL_PURGE, exorcismPos[8]);
            }

            if (id == 10)
            {
                wpreached = true;
                point = 3;
            }
        }
开发者ID:Lyill,项目名称:TrinityCore,代码行数:20,代码来源:zone_hellfire_peninsula.cpp

示例14: DoSummonAtRift

        void DoSummonAtRift(uint32 creature_entry)
        {
            if (!creature_entry)
                return;

            if (instance->GetData(TYPE_MEDIVH) != IN_PROGRESS)
            {
                me->InterruptNonMeleeSpells(true);
                me->RemoveAllAuras();
                return;
            }

            Position pos = me->GetRandomNearPosition(10.0f);

            //normalize Z-level if we can, if rift is not at ground level.
            pos.m_positionZ = std::max(me->GetMap()->GetHeight(pos.m_positionX, pos.m_positionY, MAX_HEIGHT), me->GetMap()->GetWaterLevel(pos.m_positionX, pos.m_positionY));

            if (Unit* Summon = DoSummon(creature_entry, pos, 30000, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT))
                if (Unit* temp = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_MEDIVH)))
                    AddThreat(temp, 0.0f, Summon);
        }
开发者ID:ElunaLuaEngine,项目名称:ElunaTrinityWotlk,代码行数:21,代码来源:the_black_morass.cpp

示例15: SummonPlanarAnomaly

	void SummonPlanarAnomaly()
	{
		std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
		std::list<HostileReference*>::const_iterator i = m_threatlist.begin();
		for (i = m_threatlist.begin(); i!= m_threatlist.end(); ++i)
		{
			Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
			if (pUnit )
			{
				Creature* summon = DoSummon(PLANAR_ANOMALY, me, 3.0f, 30000, TEMPSUMMON_DEAD_DESPAWN);
				if(summon)
				{
					summon->Attack(pUnit,true);
					printf("PLANAR_ANOMALY attack uinit %s \n",pUnit->GetName());
					summon->SetVisibility(VISIBILITY_ON);
					summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
					summon->SetUnitMovementFlags(MOVEMENTFLAG_FLYING);
				}
			}
		}
	}
开发者ID:SergeySV,项目名称:RoCore,代码行数:21,代码来源:boss_eregos.cpp


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