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


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

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


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

示例1: DamageTaken

            void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/)
            {
                if (!IsHeroic())
                    return;

                if ((me->GetHealthPct() < 60.0f && me->GetHealthPct() > 20.0f && _phase < PHASE_FIRST_PLANAR)
                    || (me->GetHealthPct() < 20.0f && _phase < PHASE_SECOND_PLANAR))
                {
                    events.Reset();
                    _phase = (me->GetHealthPct() < 60.0f && me->GetHealthPct() > 20.0f) ? PHASE_FIRST_PLANAR : PHASE_SECOND_PLANAR;

                    DoCast(SPELL_PLANAR_SHIFT);

                    // not sure about the amount, and if we should despawn previous spawns (dragon trashs)
                    summons.DespawnAll();

                    //! TODO: TEST
                    for (uint8 i = 0; i < 6; ++i)
                    {
                        Creature* summoned = me->SummonCreature(NPC_PLANAR_ANOMALY, *me, TEMPSUMMON_TIMED_DESPAWN, 15000);
                        Unit* target = summoned->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
                        if (target && target->GetVehicleBase())
                        {
                            summoned->CombatStart(target->GetVehicleBase(), true);
                            summoned->AddThreat(target->GetVehicleBase(), 50000.0f);
                        }
                        summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED);
                        summoned->SetDisplayId(11686);
                    }
                }
            }
开发者ID:FrenchCORE,项目名称:OLD_FrenchCORE,代码行数:31,代码来源:boss_eregos.cpp

示例2: EnterCombat

		void EnterCombat(Unit* /*who*/)
		{
			if(!Feludius->isInCombat())
				Feludius->CombatStart(me->getVictim(), 1.0f);

			events.ScheduleEvent(EVENT_BUNRING_BLOOD, urand(31000,33000));
			events.ScheduleEvent(EVENT_FLAME_TORRENT, urand(10000,12000));
			events.ScheduleEvent(EVENT_AEGIS_OF_FLAME, urand(54000,57000));
			events.ScheduleEvent(EVENT_INFERNO_LEAP, urand(25000,27000));
		}
开发者ID:AtVirus,项目名称:Merciless-Gaming-Cata,代码行数:10,代码来源:boss_council_of_ascendents.cpp

示例3: DoIntro

    void DoIntro()
    {
        Creature* Madrigosa = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_MADRIGOSA) : 0);
        if (!Madrigosa)
            return;

        float x, y, z, ground_Z;
        switch (IntroPhase)
        {
        case 0:
            me->SetFacingToObject(Madrigosa);
            Madrigosa->SetFacingToObject(me);
            IntroPhaseTimer = 1000;
            break;
        case 1:
            DoScriptText(YELL_MADR_ICE_BARRIER, Madrigosa);
            IntroPhaseTimer = 8000;
            break;
        case 2:
            DoScriptText(YELL_MADR_INTRO, Madrigosa, me);
            IntroPhaseTimer = 7000;
            break;
        case 3:
            DoScriptText(YELL_INTRO, me, Madrigosa);
            IntroPhaseTimer = 4000;
            break;
        case 4:
            Madrigosa->CombatStart(me, true);
            IntroAttackTimer = 2000;
            IntroPhaseTimer = 10000;
            break;
        case 5:
            me->AttackStop();
            Madrigosa->AttackStop();
            Madrigosa->SetSpeed(MOVE_RUN, 3.0f, true);
            Madrigosa->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
            IntroPhaseTimer = 500;
            break;
        case 6:
            Madrigosa->GetMotionMaster()->MovePoint(0, Madrigosa->GetPositionX(), Madrigosa->GetPositionY() + 2, Madrigosa->GetPositionZ() + 8);
            IntroPhaseTimer = 2000;
            break;
        case 7:
            Madrigosa->SetInFront(me);
            Madrigosa->SendMovementFlagUpdate();
            IntroAttackTimer = 3500;
            IntroFrostBoltTimer = 3500;
            IntroPhaseTimer = 13000;
            break;
        case 8:
            DoScriptText(YELL_INTRO_BREAK_ICE, me);
            IntroPhaseTimer = 5000;
            break;
        case 9:
            Madrigosa->SetWalk(true);
            Madrigosa->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
            IntroPhaseTimer = 500;
            break;
        case 10:
            Madrigosa->GetPosition(x, y, z);
            ground_Z = me->GetMap()->GetHeight(x, y, MAX_HEIGHT, true);
            Madrigosa->GetMotionMaster()->MovePoint(1, x, y, ground_Z);
            IntroPhaseTimer = 2000;
            break;
        case 11:
            Madrigosa->SetInFront(me);
            Madrigosa->SendMovementFlagUpdate();
            Madrigosa->CastSpell(me, SPELL_INTRO_ENCAPSULATE_CHANELLING, true);
            DoScriptText(YELL_MADR_TRAP, Madrigosa);
            DoCast(me, SPELL_INTRO_ENCAPSULATE);
            me->SetSpeed(MOVE_RUN, 4.0f, true);

            me->GetPosition(x, y, z);
            me->GetMotionMaster()->MovePoint(1, x - 6, y - 15, z + 10);

            IntroAttackTimer = 3000;
            IntroPhaseTimer = 6000;
            break;
        case 12:
            DoScriptText(YELL_INTRO_CHARGE, me);
            me->SetSpeed(MOVE_RUN, 3.0f, true);
            //me->GetMotionMaster()->MovePath(30000, false);
            me->GetPosition(x, y, z);
            ground_Z = me->GetMap()->GetHeight(x, y, MAX_HEIGHT, true);
            me->GetMotionMaster()->MovePoint(2, x + 6, y + 15, ground_Z);
            IntroPhaseTimer = 5000;
            break;
        case 13:
            me->Kill(Madrigosa);
            DoScriptText(YELL_MADR_DEATH, Madrigosa);
            me->SetSpeed(MOVE_RUN, 2.0f, true);
            IntroPhaseTimer = 7000;
            break;
        case 14:
            DoScriptText(YELL_INTRO_KILL_MADRIGOSA, me);
            me->SetSpeed(MOVE_RUN, 1.0f, true);
            Madrigosa->setDeathState(CORPSE);
            IntroPhaseTimer = 8000;
            break;
        case 15:
//.........这里部分代码省略.........
开发者ID:Adeer,项目名称:OregonCore,代码行数:101,代码来源:boss_brutallus.cpp

示例4: UpdateAI


//.........这里部分代码省略.........
                    me->CastSpell(Blizzard, SPELL_SUMMON_BLIZZ, false);
                    Blizzard->CastSpell(Blizzard, SPELL_CIRCULAR_BLIZZARD, false);
                    Blizzard->GetMotionMaster()->MovePath(110110101, false);
                }
                break;
            }

            SuperCastTimer = urand(35000, 40000);
        }
        else SuperCastTimer -= diff;

        if (!ElementalsSpawned && HealthBelowPct(40))
        {
            ElementalsSpawned = true;

            Creature* ElementalOne   = NULL;
            Creature* ElementalTwo   = NULL;
            Creature* ElementalThree = NULL;
            Creature* ElementalFour  = NULL;

            ElementalOne     = me->SummonCreature(NPC_WATER_ELEMENTAL, -11168.1f, -1939.29f, 232.092f, 1.46f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000);
            ElementalTwo     = me->SummonCreature(NPC_WATER_ELEMENTAL, -11138.2f, -1915.38f, 232.092f, 3.00f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000);
            ElementalThree   = me->SummonCreature(NPC_WATER_ELEMENTAL, -11161.7f, -1885.36f, 232.092f, 4.59f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000);
            ElementalFour    = me->SummonCreature(NPC_WATER_ELEMENTAL, -11192.4f, -1909.36f, 232.092f, 6.19f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000);

            if (ElementalOne)
            {
                Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
                if (!pTarget)
                    return;

                DoStartNoMovement(pTarget);
                ElementalOne->SetInCombatWithZone();
                ElementalOne->CombatStart(pTarget);
                ElementalOne->SetFaction(me->GetFaction());
                ElementalOne->SetRooted(true);
                ElementalOne->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
                ElementalOne->SetModifierValue(UNIT_MOD_RESISTANCE_FROST,  BASE_VALUE, 0);
            }

            if (ElementalTwo)
            {
                Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
                if (!pTarget)
                    return;

                DoStartNoMovement(pTarget);
                ElementalTwo->SetInCombatWithZone();
                ElementalTwo->CombatStart(pTarget);
                ElementalTwo->SetFaction(me->GetFaction());
                ElementalTwo->SetRooted(true);
                ElementalTwo->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
                ElementalTwo->SetModifierValue(UNIT_MOD_RESISTANCE_FROST,  BASE_VALUE, 0);
            }

            if (ElementalThree)
            {
                Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
                if (!pTarget)
                    return;

                DoStartNoMovement(pTarget);
                ElementalThree->SetInCombatWithZone();
                ElementalThree->CombatStart(pTarget);
                ElementalThree->SetFaction(me->GetFaction());
                ElementalThree->SetRooted(true);
开发者ID:Phentora,项目名称:OregonCore,代码行数:67,代码来源:boss_shade_of_aran.cpp

示例5: DoIntro

    void DoIntro()
    {
        Creature *Madrigosa = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_MADRIGOSA) : 0);
        if (!Madrigosa)
            return;
 
        switch (IntroPhase)
        {
   case 0:
IntroPhaseTimer = 1000;
break;
   case 1:
                DoScriptText(YELL_MADR_ICE_BARRIER, Madrigosa);
IntroPhaseTimer = 8000;
                break;
            case 2:
                DoScriptText(YELL_MADR_INTRO, Madrigosa, me);
Madrigosa->SetReactState(REACT_PASSIVE);
                IntroPhaseTimer = 7000;
                break;
            case 3:
                DoScriptText(YELL_INTRO, me, Madrigosa);
me->SetInFront(Madrigosa);
                Madrigosa->SetInFront(me);
                IntroPhaseTimer = 4000;
                break;
case 4:
Madrigosa->CombatStart(me, true);
IntroAttackTimer = 2000;
IntroPhaseTimer = 10000;
break;
case 5:
me->AttackStop();
                Madrigosa->AttackStop();
Madrigosa->SetUnitMovementFlags(MOVEFLAG_LEVITATING | MOVEFLAG_ONTRANSPORT);
Madrigosa->SetSpeed(MOVE_RUN, 3.0f, true);
Madrigosa->GetMotionMaster()->MovePath(31000, false);
Madrigosa->SetInFront(me);
IntroAttackTimer = 3500;
                IntroFrostBoltTimer = 3500;
                IntroPhaseTimer = 13000;
                break;
            case 6:
Madrigosa->SetPosition(Madrigosa->GetPositionX(),Madrigosa->GetPositionY(),Madrigosa->GetPositionZ(),4.1f,true);
                DoScriptText(YELL_INTRO_BREAK_ICE, me);
                IntroPhaseTimer = 6000;
                break;
            case 7:
Madrigosa->SetUnitMovementFlags(MOVEFLAG_NONE);
                Madrigosa->CastSpell(me, 45661, true);
                DoScriptText(YELL_MADR_TRAP, Madrigosa);
                DoCast(me, SPELL_INTRO_ENCAPSULATE);
me->SetSpeed(MOVE_RUN, 4.0f, true);
me->GetMotionMaster()->MovePoint(0,1494.691895, 548.588989, 39.162289);
me->SetPosition(1494.691895, 548.588989, 25.652, 1.34f, true);
IntroAttackTimer = 3000;
                IntroPhaseTimer = 6000;
                break;
case 8:
DoScriptText(YELL_INTRO_CHARGE, me);
me->SetSpeed(MOVE_RUN, 3.0f, true);
me->GetMotionMaster()->MovePath(30000, false);
   IntroPhaseTimer = 4000;
                break;
case 9:
                me->DealDamage(Madrigosa, Madrigosa->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, true);
                DoScriptText(YELL_MADR_DEATH, Madrigosa);
                me->SetHealth(me->GetMaxHealth());
                me->AttackStop();
me->SetSpeed(MOVE_RUN, 2.0f, true);
IntroPhaseTimer = 7000;
                break;
            case 10:
                DoScriptText(YELL_INTRO_KILL_MADRIGOSA, me);
                me->StopMoving();
me->SetSpeed(MOVE_RUN, 1.0f, true);
me->GetMotionMaster()->MovePoint(0, me->GetPositionX()+3,me->GetPositionY(),me->GetPositionZ());
me->SetPosition(me->GetPositionX()+3,me->GetPositionY(),me->GetPositionZ(), 1.1, false);
                Madrigosa->setDeathState(CORPSE);
                IntroPhaseTimer = 8000;
                break;
            case 11:
                DoScriptText(YELL_INTRO_TAUNT, me);
                IntroPhaseTimer = 5000;
                break;
            case 12:
                EndIntro();
                break;
        }
    }
开发者ID:FirstCore,项目名称:OregonCore,代码行数:90,代码来源:boss_brutallus.cpp


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