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


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

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


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

示例1: SummonedCreatureDespawn

 void SummonedCreatureDespawn(Creature* summon)
 {
     summons.Despawn(summon);
     if (summon->GetEntry() != NPC_SUNWELL_DEFENDER && me->isActiveObject())
     {
         if (summon->GetEntry() == NPC_MORLEN_COLDGRIP)
         {
             me->RemoveAurasDueToSpell(67541);
             me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
             me->GetMotionMaster()->MoveCharge(11779.30f, -7065.43f, 24.92f, me->GetSpeed(MOVE_RUN), EVENT_CHARGE);
             events.ScheduleEvent(EVENT_OUTRO_0, 0);
             events.ScheduleEvent(EVENT_OUTRO_1, 5000);
             events.ScheduleEvent(EVENT_OUTRO_2, 12000);
             events.ScheduleEvent(EVENT_OUTRO_3, 19000);
         }
         else if (summons.size() == 1)
         {
             me->RemoveAurasDueToSpell(67541);
             me->GetMotionMaster()->MoveCharge(11779.30f, -7065.43f, 24.92f, me->GetSpeed(MOVE_RUN), EVENT_CHARGE);
             switch(summon->GetEntry())
             {
                 case NPC_SCOURGE_ZOMBIE:
                     events.ScheduleEvent(EVENT_SPAWN_WAVE_2, 3000);
                     break;
                 case NPC_GHOUL_INVADER:
                     events.ScheduleEvent(EVENT_SPAWN_WAVE_3, 3000);
                     break;
                 case NPC_CRYPT_RAIDER:
                     events.ScheduleEvent(EVENT_SUMMONS_ATTACK, 3000);
                     break;
             }
         }
     }
 }
开发者ID:Keader,项目名称:Sunwell,代码行数:34,代码来源:zone_isle_of_queldanas.cpp

示例2: JustSummoned

 void JustSummoned(Creature* summon)
 {
     if(summon->GetEntry() != me->GetEntry())
     {
         summon->GetMotionMaster()->MovePoint(0, *me, false);
         summon->GetMotionMaster()->MoveFollow(me, 0.1f, 0.0f + M_PI*0.3f*summons.size());
     }
     summons.Summon(summon);
 }
开发者ID:AzerothShard-Dev,项目名称:azerothcore,代码行数:9,代码来源:boss_hadronox.cpp

示例3: JustSummoned

        void JustSummoned(Creature* summon)
        {
            summons.Summon(summon);
            if (Creature* thrall = ObjectAccessor::GetCreature(*me, me->GetInstanceScript()->GetData64(DATA_THRALL_GUID)))
                thrall->AI()->JustSummoned(summon);
            summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);

            if (summon->GetEntry() == NPC_SKARLOC_MOUNT)
                return;

            if (summons.size() == 1)
                summon->GetMotionMaster()->MovePoint(0, 2060.788f, 237.301f, 63.999f);
            else
                summon->GetMotionMaster()->MovePoint(0, 2056.870f, 234.853f, 63.839f);
        }
开发者ID:ReinsCoreWotlk,项目名称:Core,代码行数:15,代码来源:boss_captain_skarloc.cpp

示例4: EnterCombat

            void EnterCombat(Unit* who)
            {
				events.Reset();
				if (summons.size() < 4)
					ResetSummons();

                summons.DoZoneInCombat();

                events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 5000);
                events.ScheduleEvent(EVENT_LIGHTNING_NOVA, 40000);
                events.ScheduleEvent(EVENT_BERSERK, 360000);
                events.ScheduleEvent(EVENT_OVERCHARGE, 47000);

				if (pInstance)
					pInstance->SetData(EVENT_EMALON, IN_PROGRESS);
            }
开发者ID:AlexHjelm,项目名称:sunwell,代码行数:16,代码来源:boss_emalon.cpp

示例5: OozesMeetCheck

		void OozesMeetCheck()
		{
			if (summons.empty() || summons.size()==1)
				return;

			for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
			{
				Creature* ooze = ObjectAccessor::GetCreatureOrPetOrVehicle((*me), (*itr));
				if (!ooze || !ooze->isAlive())
					continue;
				if (ooze->GetEntry() != CREATURE_LITTLE_OOZE && ooze->GetEntry() != CREATURE_OOZE_BIG)
					continue;

				bool little = (ooze->GetEntry() == CREATURE_LITTLE_OOZE);

				for(SummonList::const_iterator itr2 = summons.begin(); itr2 != summons.end(); ++itr2)
				{
					Creature* ooze2 = ObjectAccessor::GetCreatureOrPetOrVehicle((*me), (*itr2));
					if (!ooze2 || !ooze2->isAlive())
						continue;
					if (ooze2->GetEntry() != CREATURE_LITTLE_OOZE && ooze2->GetEntry() != CREATURE_OOZE_BIG)
						continue;
					if (ooze2 == ooze)
						continue;

					if (ooze->GetDistance2d(ooze2) > 5.0f)
						continue;

					bool little2 = (ooze2->GetEntry() == CREATURE_LITTLE_OOZE);

					//if first ooze is big ooze
					if (!little)
					{
						//and if second ooze is little
						if (little2)
						{
							ooze->CastSpell(ooze, SPELL_UNSTABLE_OOZE, false);

							if (ooze->GetAura(SPELL_UNSTABLE_OOZE) && ooze->GetAura(SPELL_UNSTABLE_OOZE)->GetStackAmount() >= 5)
								ooze->CastSpell(ooze2->getVictim(), SPELL_UNSTABLE_EXPLOSION, true);

							continue;
						}
						else //big ooze meet another big ooze, check wich one have more buff stack and despawn second one
						{
							uint8 stack1, stack2 = 0;
							if (Aura* aura = ooze->GetAura(SPELL_UNSTABLE_OOZE))
								stack1 = aura->GetStackAmount();
							if (Aura* aura = ooze2->GetAura(SPELL_UNSTABLE_OOZE))
								stack2 = aura->GetStackAmount();

							if (stack1 < stack2)
							{
								ooze2->CastSpell(ooze, SPELL_UNSTABLE_OOZE, false);
								ooze->ForcedDespawn();
								if (ooze2->GetAura(SPELL_UNSTABLE_OOZE) && ooze2->GetAura(SPELL_UNSTABLE_OOZE)->GetStackAmount() >= 5)
								{
									ooze2->CastSpell(ooze2->getVictim(), SPELL_UNSTABLE_EXPLOSION, true);
									ooze2->ForcedDespawn();
								}

								break;
							}
							else
							{
								ooze->CastSpell(ooze, SPELL_UNSTABLE_OOZE, false);
								ooze2->ForcedDespawn();
								if (ooze->GetAura(SPELL_UNSTABLE_OOZE) && ooze->GetAura(SPELL_UNSTABLE_OOZE)->GetStackAmount() >= 5)
								{
									ooze->CastSpell(ooze2->getVictim(), SPELL_UNSTABLE_EXPLOSION, true);
									ooze->ForcedDespawn();
								}
								continue;
							}
						}
					}
					else  //if first ooze is little
					{
						if (little2) //and second ooze is little, despawn both and summon big ooze
						{
							DoSummon(CREATURE_OOZE_BIG, (*ooze));
							ooze->ForcedDespawn();
							ooze2->ForcedDespawn();
							break;
						}
						else
						{
							ooze2->CastSpell(ooze, SPELL_UNSTABLE_OOZE, false);
							ooze->ForcedDespawn();
							if (ooze2->GetAura(SPELL_UNSTABLE_OOZE) && ooze2->GetAura(SPELL_UNSTABLE_OOZE)->GetStackAmount() >= 5)
							{
								ooze2->CastSpell(ooze2->getVictim(), SPELL_UNSTABLE_EXPLOSION, true);
								ooze2->ForcedDespawn();
							}
							break;
						}
					}
				}
			}
		}
开发者ID:InkVisible,项目名称:wow,代码行数:100,代码来源:boss_rotface.cpp

示例6: UpdateAI

        void UpdateAI(const uint32 diff)
        {
            // World Notify Cooldown
            if (notifyCooldown >= diff)
                notifyCooldown -= diff;
            else
                notifyCooldown = 0;

            if (!UpdateVictim())
                return;

            // Defender Quest Credit
            if (!defenderCredit)
                if (me->getThreatManager().getThreatList().size() >= 5 && me->GetHealthPct() < 90.f) // Anti-Farming Conditions
                    defenderCredit = true;

            // Boss rescaling
            if (rescaleTimer <= diff)
            {
                HandleScaling();
                rescaleTimer = 10000;
            } else rescaleTimer -= diff;

            events.Update(diff);

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

            while (uint32 eventId = events.ExecuteEvent())
            {
                switch (eventId)
                {
                    case SPELL_BLIZZARD:
                        if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, true))
                            DoCast(target, SPELL_BLIZZARD);
                        events.ScheduleEvent(SPELL_BLIZZARD, urand(15000, 18000));
                        break;
                    case SPELL_FIRE_BLAST:
                        if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 20.0f, true))
                            DoCast(target, SPELL_FIRE_BLAST);
                        events.ScheduleEvent(SPELL_FIRE_BLAST, urand(5000, 8000));
                        break;
                    case SPELL_FIREBALL:
                        if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
                            DoCast(target, SPELL_FIREBALL);
                        events.ScheduleEvent(SPELL_FIREBALL, urand(7000, 10000));
                        break;
                    case SPELL_SUMMON_WATER_ELEMENT:
                        if (Summons.size() < 4)
                            DoCast(me, SPELL_SUMMON_WATER_ELEMENT);
                        events.ScheduleEvent(SPELL_SUMMON_WATER_ELEMENT, urand(20000, 30000));
                        break;
                    case SPELL_TELEPORT:
                        if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
                        {
                            DoModifyThreatPercent(target, 100); // Delete Target from Threat List
                            DoCast(target, SPELL_TELEPORT);
                        }
                        events.ScheduleEvent(SPELL_TELEPORT, urand(37000, 52000));
                        break;
                }
            }

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

示例7: UpdateAI


//.........这里部分代码省略.........
                                            spawnPos.m_positionY += 2.5f*sin(4.5f);
                                        }
                                }
                                break;
                            case EVENT_SPAWN_WAVE_2:
                                {
                                    Position spawnPos;
                                    c->GetPosition(&spawnPos);
                                    spawnPos.m_orientation = 5.80f;
                                    spawnPos.m_positionX += 7.0f*cos(4.0f);
                                    spawnPos.m_positionY += 7.0f*sin(4.0f);
                                    for (uint8 i=0; i<3; ++i)
                                        if (Creature* s = me->SummonCreature(NPC_GHOUL_INVADER, spawnPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000))
                                        {
                                            s->CastSpell(s, 66947, false); // emerge effect
                                            spawnPos.m_positionX += 4.0f*cos(4.5f);
                                            spawnPos.m_positionY += 4.0f*sin(4.5f);
                                        }
                                }
                                break;
                            case EVENT_SPAWN_WAVE_3:
                                {
                                    Position spawnPos;
                                    c->GetPosition(&spawnPos);
                                    spawnPos.m_orientation = 5.80f;
                                    spawnPos.m_positionX += 8.0f*cos(4.0f);
                                    spawnPos.m_positionY += 8.0f*sin(4.0f);
                                    for (uint8 i=0; i<3; ++i)
                                        if (Creature* s = me->SummonCreature(NPC_CRYPT_RAIDER, spawnPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000))
                                        {
                                            s->CastSpell(s, 66947, false); // emerge effect
                                            spawnPos.m_positionX += 4.0f*cos(4.5f);
                                            spawnPos.m_positionY += 4.0f*sin(4.5f);
                                        }
                                }
                                break;
                        }
                    }
                    events.PopEvent();
                    events.ScheduleEvent(EVENT_SUMMONS_ATTACK, 3000);
                    break;
                case EVENT_SUMMONS_ATTACK:
                    for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
                        if (Creature* c = ObjectAccessor::GetCreature(*me, *itr))
                        {
                            if (c->GetEntry() == NPC_MORLEN_COLDGRIP && summons.size() != 1)
                                continue;
                            else
                                c->AI()->Talk(SAY_MORLEN_4);
                            c->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
                            c->AI()->AttackStart(me);
                        }
                    events.PopEvent();
                    break;
                case EVENT_OUTRO_0:
                case EVENT_OUTRO_1:
                case EVENT_OUTRO_2:
                case EVENT_OUTRO_3:
                    Talk(SAY_OUTRO_0 + (evId-EVENT_OUTRO_0));
                    events.PopEvent();
                    if (evId == EVENT_OUTRO_3)
                        events.ScheduleEvent(EVENT_OUTRO_KNEEL, 6000);
                    break;
                case EVENT_OUTRO_KNEEL:
                    if (Player* p = ObjectAccessor::GetPlayer(*me, playerGUID))
                        p->KilledMonsterCredit(NPC_THALORIEN_KILL_CREDIT, 0);
                    me->SetStandState(UNIT_STAND_STATE_KNEEL);
                    events.PopEvent();
                    events.ScheduleEvent(EVENT_DISAPPEAR, 6000);
                    break;
                case EVENT_DISAPPEAR:
                    events.PopEvent();
                    me->SetVisible(false);
                    me->setActive(false);
                    EnterEvadeMode();
                    break;
                case EVENT_SET_FACING:
                    me->SetFacingTo(2.45f);
                    events.PopEvent();
                    break;

                case EVENT_SPELL_BLADESTORM:
                    if (me->GetVictim() && me->IsWithinMeleeRange(me->GetVictim()))
                        me->CastSpell(me->GetVictim(), 67541, false);
                    events.RepeatEvent(urand(25000, 35000));
                    break;
                case EVENT_SPELL_MORTAL_STRIKE:
                    if (me->GetVictim() && me->IsWithinMeleeRange(me->GetVictim()))
                        me->CastSpell(me->GetVictim(), 67542, false);
                    events.RepeatEvent(urand(7000, 12000));
                    break;
                case EVENT_SPELL_HEROIC_STRIKE:
                    if (me->GetVictim() && me->IsWithinMeleeRange(me->GetVictim()))
                        me->CastSpell(me->GetVictim(), 57846, false);
                    events.RepeatEvent(urand(5000, 10000));
                    break;
            }

            DoMeleeAttackIfReady();
        }
开发者ID:Keader,项目名称:Sunwell,代码行数:101,代码来源:zone_isle_of_queldanas.cpp

示例8: UpdateAI

        void UpdateAI(const uint32 diff)
        {
            if (LamentEvent)
            {
                if (LamentEventTimer <= diff)
                {
                    DoSummon(ENTRY_HIGHBORNE_BUNNY, me, 10.0f, 3000, TEMPSUMMON_TIMED_DESPAWN);

                    LamentEventTimer = 2000;
                    if (!me->HasAura(SPELL_SYLVANAS_CAST))
                    {
                        DoScriptText(SAY_LAMENT_END, me);
                        DoScriptText(EMOTE_LAMENT_END, me);
                        LamentEvent = false;
                    }
                } else LamentEventTimer -= diff;
            }

            // World Notify Cooldown
            if (notifyCooldown >= diff)
                notifyCooldown -= diff;
            else
                notifyCooldown = 0;

            if (!UpdateVictim())
                return;

            // Defender Quest Credit
            if (!defenderCredit)
                if (me->getThreatManager().getThreatList().size() >= 5 && me->GetHealthPct() < 90.f) // Anti-Farming Conditions
                    defenderCredit = true;

            // Boss rescaling
            if (rescaleTimer <= diff)
            {
                HandleScaling();
                rescaleTimer = 10000;
            } else rescaleTimer -= diff;

            events.Update(diff);

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

            while (uint32 eventId = events.ExecuteEvent())
            {
                switch (eventId)
                {
                    case SPELL_BLACK_ARROW:
                        if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45.0f, true))
                            DoCast(target, SPELL_BLACK_ARROW);
                        events.ScheduleEvent(SPELL_BLACK_ARROW, urand(15000, 25000));
                        break;
                    case SPELL_FADE:
                        DoCast(me, SPELL_FADE);
                        events.ScheduleEvent(SPELL_FADE, urand(25000, 35000));
                        break;
                    case SPELL_MULTI_SHOT:
                        DoCastVictim(SPELL_MULTI_SHOT);
                        events.ScheduleEvent(SPELL_MULTI_SHOT, urand(11000, 14000));
                        break;
                    case SPELL_SHOOT_SYLVANAS:
                        if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, true))
                            if (me->GetDistance(target) > 5.0f)
                                DoCast(target, SPELL_SHOOT_SYLVANAS);
                        events.ScheduleEvent(SPELL_SHOOT_SYLVANAS, urand(6000, 9000));
                        break;
                    case SPELL_SUMMON_SKELETON:
                        if (Summons.size() < 7)
                            DoCast(me, SPELL_SUMMON_SKELETON);
                        events.ScheduleEvent(SPELL_SUMMON_SKELETON, urand(17000, 23000));
                        break;
                }
            }

            DoMeleeAttackIfReady();
        }
开发者ID:Marchmalo,项目名称:TrinityElron103,代码行数:77,代码来源:undercity.cpp


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