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


C++ GetKrick函数代码示例

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


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

示例1: JustDied

            void JustDied(Unit* /*killer*/)
            {
                if (Creature* krick = GetKrick())
                {
                    _vehicle->RemoveAllPassengers();
                    if (krick->AI())
                        krick->AI()->DoAction(ACTION_OUTRO);
                }

                instance->SetBossState(DATA_ICK, DONE);
            }
开发者ID:heros,项目名称:LasCore,代码行数:11,代码来源:boss_krickandick.cpp

示例2: KilledUnit

        void KilledUnit(Unit* who)
        {
            // if during pursuit ick kills his target, set to aggressive again
            if (who && me->GetVictim() && who->GetGUID() == me->GetVictim()->GetGUID())
                if (me->GetReactState() == REACT_PASSIVE)
                    me->SetReactState(REACT_AGGRESSIVE);

            if (who->GetTypeId() == TYPEID_PLAYER)
                if (Creature* k = GetKrick())
                    k->AI()->Talk(RAND(SAY_SLAY_1, SAY_SLAY_2));
        }
开发者ID:Helias,项目名称:azerothcore-wotlk,代码行数:11,代码来源:boss_krickandick.cpp

示例3: EnterCombat

        void EnterCombat(Unit * /*who*/)
        {
            if (Creature* krick = GetKrick())
                DoScriptText(SAY_KRICK_AGGRO, krick);
            events.ScheduleEvent(EVENT_MIGHTY_KICK, 20000);
            events.ScheduleEvent(EVENT_TOXIC_WASTE, 5000);
            events.ScheduleEvent(EVENT_SHADOW_BOLT, 10000);
            events.ScheduleEvent(EVENT_SPECIAL, urand(30000, 35000));

            instance->SetBossState(DATA_ICK, IN_PROGRESS);
        }
开发者ID:Zikmo,项目名称:Core,代码行数:11,代码来源:boss_krickandick.cpp

示例4: JustEngagedWith

            void JustEngagedWith(Unit* /*who*/) override
            {
                _JustEngagedWith();

                if (Creature* krick = GetKrick())
                    krick->AI()->Talk(SAY_KRICK_AGGRO);

                events.ScheduleEvent(EVENT_MIGHTY_KICK, 20s);
                events.ScheduleEvent(EVENT_TOXIC_WASTE, 5s);
                events.ScheduleEvent(EVENT_SHADOW_BOLT, 10s);
                events.ScheduleEvent(EVENT_SPECIAL, 30s, 35s);
            }
开发者ID:ElunaLuaEngine,项目名称:ElunaTrinityWotlk,代码行数:12,代码来源:boss_krickandick.cpp

示例5: EnterCombat

            void EnterCombat(Unit* /*who*/) override
            {
                _EnterCombat();

                if (Creature* krick = GetKrick())
                    krick->AI()->Talk(SAY_KRICK_AGGRO);

                events.ScheduleEvent(EVENT_MIGHTY_KICK, 20000);
                events.ScheduleEvent(EVENT_TOXIC_WASTE, 5000);
                events.ScheduleEvent(EVENT_SHADOW_BOLT, 10000);
                events.ScheduleEvent(EVENT_SPECIAL, urand(30000, 35000));
            }
开发者ID:Rastrian,项目名称:DeathCore_3.3.5,代码行数:12,代码来源:boss_krickandick.cpp

示例6: EnterCombat

        void EnterCombat(Unit* /*who*/)
        {
            if (Creature* k = GetKrick())
                k->AI()->Talk(SAY_AGGRO);
            DoZoneInCombat();
            events.Reset();
            events.RescheduleEvent(EVENT_SPELL_TOXIC_WASTE, urand(3000,5000));
            events.RescheduleEvent(EVENT_SPELL_MIGHTY_KICK, urand(10000, 20000));
            events.RescheduleEvent(EVENT_SPELL_SHADOW_BOLT, 10000);
            events.RescheduleEvent(EVENT_SPECIAL, 25000);

            if (pInstance)
                pInstance->SetData(DATA_ICK, IN_PROGRESS);
        }
开发者ID:Helias,项目名称:azerothcore-wotlk,代码行数:14,代码来源:boss_krickandick.cpp

示例7: DamageTaken

        void DamageTaken(Unit* /*doneBy*/, uint32& damage, DamageEffectType, SpellSchoolMask)
        {
            if (damage >= me->GetHealth())
                if (Creature* krick = GetKrick())
                {
                    krick->InterruptNonMeleeSpells(true);
                    krick->RemoveAllAuras();
                    Position myPos(*me), exitPos;
                    float ang = me->GetOrientation()+3*M_PI/2;
                    float dist = 3.0f;
                    exitPos.Relocate(myPos.GetPositionX()+dist*cos(ang), myPos.GetPositionY()+dist*sin(ang), 515.0f, M_PI);
                    exitPos.m_positionZ = me->GetMap()->GetHeight(exitPos.GetPositionX(), exitPos.GetPositionY(), exitPos.GetPositionZ());

                    if (exitPos.GetPositionZ() < 505.0f || exitPos.GetPositionZ() > 512.0f || !me->IsWithinLOS(exitPos.GetPositionX(), exitPos.GetPositionY(), exitPos.GetPositionZ()))
                        exitPos.Relocate(myPos);

                    krick->_ExitVehicle(&exitPos);
                    krick->AI()->DoAction(1);
                }
        }
开发者ID:Helias,项目名称:azerothcore-wotlk,代码行数:20,代码来源:boss_krickandick.cpp

示例8: UpdateAI

            void UpdateAI(const uint32 diff)
            {
                if (!me->isInCombat())
                    return;

                if (!me->getVictim() && me->getThreatManager().isThreatListEmpty())
                {
                    EnterEvadeMode();
                    return;
                }

                events.Update(diff);

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

                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_TOXIC_WASTE:
                            if (Creature* krick = GetKrick())
                                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                                    krick->CastSpell(target, SPELL_TOXIC_WASTE, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE);
                            events.ScheduleEvent(EVENT_TOXIC_WASTE, urand(7000, 10000));
                            break;
                        case EVENT_SHADOW_BOLT:
                            if (Creature* krick = GetKrick())
                                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
                                    krick->CastSpell(target, SPELL_SHADOW_BOLT, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE);
                            events.ScheduleEvent(EVENT_SHADOW_BOLT, 15000);
                            return;
                        case EVENT_MIGHTY_KICK:
                            DoCastVictim(SPELL_MIGHTY_KICK);
                            events.ScheduleEvent(EVENT_MIGHTY_KICK, 25000);
                            return;
                        case EVENT_SPECIAL:
                            //select one of these three special events
                            events.ScheduleEvent(RAND(EVENT_EXPLOSIVE_BARRAGE, EVENT_POISON_NOVA, EVENT_PURSUIT), 1000);
                            events.ScheduleEvent(EVENT_SPECIAL, urand(23000, 28000));
                            break;
                        case EVENT_EXPLOSIVE_BARRAGE:
                            if (Creature* krick = GetKrick())
                            {
                                krick->AI()->Talk(SAY_KRICK_BARRAGE_1);
                                krick->AI()->Talk(SAY_KRICK_BARRAGE_2);
                                krick->CastSpell(krick, SPELL_EXPLOSIVE_BARRAGE_KRICK, true);
                                DoCast(me, SPELL_EXPLOSIVE_BARRAGE_ICK);
                            }
                            events.DelayEvents(20000);
                            break;
                        case EVENT_POISON_NOVA:
                            if (Creature* krick = GetKrick())
                                krick->AI()->Talk(SAY_KRICK_POISON_NOVA);

                            Talk(SAY_ICK_POISON_NOVA);
                            DoCast(me, SPELL_POISON_NOVA);
                            break;
                        case EVENT_PURSUIT:
                            if (Creature* krick = GetKrick())
                                krick->AI()->Talk(SAY_KRICK_CHASE);
                            DoCast(me, SPELL_PURSUIT);
                            break;
                        default:
                            break;
                    }
                }

                DoMeleeAttackIfReady();
            }
开发者ID:heros,项目名称:LasCore,代码行数:70,代码来源:boss_krickandick.cpp

示例9: UpdateAI

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

            if (me->GetVictim())
            {
                float x,y,z;
                me->GetVictim()->GetPosition(x, y, z);
                if (KrickCenterPos.GetExactDist(x,y,z) > 80.0f || z > KrickCenterPos.GetPositionZ()+20.0f || z < KrickCenterPos.GetPositionZ()-20.0f)
                {
                    me->SetHealth(me->GetMaxHealth());
                    EnterEvadeMode();
                    return;
                }
            }

            events.Update(diff);

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

            switch(events.GetEvent())
            {
                case 0:
                    break;
                case EVENT_SPELL_TOXIC_WASTE:
                    if (Creature* k = GetKrick())
                        if (!k->HasUnitState(UNIT_STATE_CASTING))
                            if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true))
                            {
                                k->CastSpell(target, SPELL_TOXIC_WASTE);
                                events.RepeatEvent(urand(7000,10000));
                                break;
                            }
                    events.RepeatEvent(2500);
                    break;
                case EVENT_SPELL_MIGHTY_KICK:
                    me->CastSpell(me->GetVictim(), SPELL_MIGHTY_KICK, false);
                    events.RepeatEvent(urand(20000,25000));
                    break;
                case EVENT_SPELL_SHADOW_BOLT:
                    if (Creature* k = GetKrick())
                        if (!k->HasUnitState(UNIT_STATE_CASTING))
                            if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 35.0f, true))
                            {
                                k->CastSpell(target, SPELL_SHADOW_BOLT);
                                events.RepeatEvent(14000);
                                break;
                            }
                    events.RepeatEvent(2500);
                    break;
                case EVENT_SET_REACT_AGGRESSIVE:
                    me->SetReactState(REACT_AGGRESSIVE);
                    if (!UpdateVictim())
                        return;
                    events.PopEvent();
                    break;
                case EVENT_SPECIAL:
                    switch(urand(0,2))
                    {
                        case 0: // Pursuit
                            if (Creature* k = GetKrick())
                                k->AI()->Talk(RAND(SAY_TARGET_1, SAY_TARGET_2, SAY_TARGET_3));
                            if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 70.0f, true))
                                me->CastSpell(target, SPELL_PURSUIT, false);
                            break;
                        case 1: // Poison Nova
                            if (Creature* k = GetKrick())
                            {
                                k->AI()->Talk(SAY_ORDER_BLOW);
                                Talk(EMOTE_ICK_POISON);
                            }
                            me->CastSpell(me, SPELL_POISON_NOVA, false);
                            break;
                        case 2: // Explosive Barrage
                            if (Creature* k = GetKrick())
                            {
                                k->AI()->Talk(SAY_ORDER_STOP);
                                k->AI()->Talk(EMOTE_KRICK_MINES);
                                k->InterruptNonMeleeSpells(false);
                                me->InterruptNonMeleeSpells(false);
                                k->CastSpell(k, SPELL_EXPLOSIVE_BARRAGE_KRICK, false);
                                me->CastSpell(me, SPELL_EXPLOSIVE_BARRAGE_ICK, false);
                            }
                            events.DelayEvents(20000);
                            break;
                    }
                    events.RepeatEvent(urand(25000,30000));
                    break;
            }

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

示例10: 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_TOXIC_WASTE:
                            if (Creature* krick = GetKrick())
                                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                                    krick->CastSpell(target, SPELL_TOXIC_WASTE);
                            events.ScheduleEvent(EVENT_TOXIC_WASTE, 7s, 10s);
                            break;
                        case EVENT_SHADOW_BOLT:
                            if (Creature* krick = GetKrick())
                                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
                                    krick->CastSpell(target, SPELL_SHADOW_BOLT);
                            events.ScheduleEvent(EVENT_SHADOW_BOLT, 15s);
                            return;
                        case EVENT_MIGHTY_KICK:
                            DoCastVictim(SPELL_MIGHTY_KICK);
                            events.ScheduleEvent(EVENT_MIGHTY_KICK, 25s);
                            return;
                        case EVENT_SPECIAL:
                            //select one of these three special events
                            events.ScheduleEvent(RAND(EVENT_EXPLOSIVE_BARRAGE, EVENT_POISON_NOVA, EVENT_PURSUIT), 1000);
                            events.ScheduleEvent(EVENT_SPECIAL, 23s, 28s);
                            break;
                        case EVENT_EXPLOSIVE_BARRAGE:
                            if (Creature* krick = GetKrick())
                            {
                                krick->AI()->Talk(SAY_KRICK_BARRAGE_1);
                                krick->AI()->Talk(SAY_KRICK_BARRAGE_2);
                                krick->CastSpell(krick, SPELL_EXPLOSIVE_BARRAGE_KRICK, true);
                                DoCastAOE(SPELL_EXPLOSIVE_BARRAGE_ICK);
                            }
                            events.DelayEvents(20000);
                            break;
                        case EVENT_POISON_NOVA:
                            if (Creature* krick = GetKrick())
                                krick->AI()->Talk(SAY_KRICK_POISON_NOVA);

                            Talk(SAY_ICK_POISON_NOVA);
                            DoCastAOE(SPELL_POISON_NOVA);
                            break;
                        case EVENT_PURSUIT:
                            if (Creature* krick = GetKrick())
                                krick->AI()->Talk(SAY_KRICK_CHASE);
                            DoCastSelf(SPELL_PURSUIT, { SPELLVALUE_MAX_TARGETS, 1 });
                            break;
                        default:
                            break;
                    }

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

                DoMeleeAttackIfReady();
            }
开发者ID:ElunaLuaEngine,项目名称:ElunaTrinityWotlk,代码行数:67,代码来源:boss_krickandick.cpp

示例11: UpdateAI

        void UpdateAI(const uint32 diff)
        {
            if(!me->isInCombat())
                return;

            if(!me->getVictim() && me->getThreatManager().isThreatListEmpty())
            {
                EnterEvadeMode();
                return;
            }

            events.Update(diff);

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

                while(uint32 eventId = events.ExecuteEvent())
                {
                    switch(eventId)
                    {
                case EVENT_TOXIC_WASTE:
                            if(Creature* krick = GetKrick())
                                if(Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                                    krick->CastSpell(target, SPELL_TOXIC_WASTE, false);
                            events.ScheduleEvent(EVENT_TOXIC_WASTE, urand(7000, 10000));
                            break;
                case EVENT_SHADOW_BOLT:
                            if(Creature* krick = GetKrick())
                                if(Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
                                    krick->CastSpell(target, SPELL_SHADOW_BOLT, false);
                    events.ScheduleEvent(EVENT_SHADOW_BOLT, 15000);
                    return;
                        case EVENT_MIGHTY_KICK:
                            DoCastVictim(SPELL_MIGHTY_KICK);
                            events.ScheduleEvent(EVENT_MIGHTY_KICK, 25000);
                            return;
                        case EVENT_SPECIAL:
                            events.ScheduleEvent(RAND(EVENT_EXPLOSIVE_BARRAGE, EVENT_POISON_NOVA, EVENT_PURSUIT), 1000);
                            events.ScheduleEvent(EVENT_SPECIAL, urand(23000, 28000));
                            break;
                case EVENT_EXPLOSIVE_BARRAGE:
                            if(Creature* krick = GetKrick())
                    {
                                DoScriptText(SAY_KRICK_BARRAGE_1, krick);
                                DoScriptText(SAY_KRICK_BARRAGE_2, krick);
                                krick->CastSpell(krick, SPELL_EXPLOSIVE_BARRAGE_KRICK, true);
                                DoCast(me, SPELL_EXPLOSIVE_BARRAGE_ICK);
                            }
                            events.DelayEvents(20000);
                    break;
                        case EVENT_POISON_NOVA:
                            if(Creature* krick = GetKrick())
                                DoScriptText(SAY_KRICK_POISON_NOVA, krick);

                            DoScriptText(SAY_ICK_POISON_NOVA, me);
                            DoCast(me, SPELL_POISON_NOVA);
                            break;
                        case EVENT_PURSUIT:
                            if(Creature* krick = GetKrick())
                                DoScriptText(RAND(SAY_KRICK_CHASE_1, SAY_KRICK_CHASE_2, SAY_KRICK_CHASE_3), krick);
                            DoCast(me, SPELL_PURSUIT);
                            break;
                        default:
                            break;
                    }
            }

            DoMeleeAttackIfReady();
        }
开发者ID:Naios,项目名称:MythCore,代码行数:69,代码来源:boss_krickandick.cpp

示例12: UpdateAI

            void UpdateAI(uint32 diff) override
            {
                if (!me->IsEngaged())
                    return;

                if (!me->GetVictim() && me->GetThreatManager().IsThreatListEmpty())
                {
                    EnterEvadeMode(EVADE_REASON_NO_HOSTILES);
                    return;
                }

                events.Update(diff);

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

                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_TOXIC_WASTE:
                            if (Creature* krick = GetKrick())
                                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                                    krick->CastSpell(target, SPELL_TOXIC_WASTE);
                            events.ScheduleEvent(EVENT_TOXIC_WASTE, urand(7000, 10000));
                            break;
                        case EVENT_SHADOW_BOLT:
                            if (Creature* krick = GetKrick())
                                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
                                    krick->CastSpell(target, SPELL_SHADOW_BOLT);
                            events.ScheduleEvent(EVENT_SHADOW_BOLT, 15000);
                            return;
                        case EVENT_MIGHTY_KICK:
                            DoCastVictim(SPELL_MIGHTY_KICK);
                            events.ScheduleEvent(EVENT_MIGHTY_KICK, 25000);
                            return;
                        case EVENT_SPECIAL:
                            //select one of these three special events
                            events.ScheduleEvent(RAND(EVENT_EXPLOSIVE_BARRAGE, EVENT_POISON_NOVA, EVENT_PURSUIT), 1000);
                            events.ScheduleEvent(EVENT_SPECIAL, urand(23000, 28000));
                            break;
                        case EVENT_EXPLOSIVE_BARRAGE:
                            if (Creature* krick = GetKrick())
                            {
                                krick->AI()->Talk(SAY_KRICK_BARRAGE_1);
                                krick->AI()->Talk(SAY_KRICK_BARRAGE_2);
                                krick->CastSpell(krick, SPELL_EXPLOSIVE_BARRAGE_KRICK, true);
                                DoCast(me, SPELL_EXPLOSIVE_BARRAGE_ICK);
                            }
                            events.DelayEvents(20000);
                            break;
                        case EVENT_POISON_NOVA:
                            if (Creature* krick = GetKrick())
                                krick->AI()->Talk(SAY_KRICK_POISON_NOVA);

                            Talk(SAY_ICK_POISON_NOVA);
                            DoCast(me, SPELL_POISON_NOVA);
                            break;
                        case EVENT_PURSUIT:
                            if (Creature* krick = GetKrick())
                                krick->AI()->Talk(SAY_KRICK_CHASE);
                            me->CastCustomSpell(SPELL_PURSUIT, SPELLVALUE_MAX_TARGETS, 1, me);
                            break;
                        default:
                            break;
                    }

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

                DoMeleeAttackIfReady();
            }
开发者ID:kemlg,项目名称:trinitycore-conciens,代码行数:73,代码来源:boss_krickandick.cpp


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