• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ ENSURE_AI函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: GetOtherSentinels

        void GetOtherSentinels(Unit* who)
        {
            bool chosenAbilities[9];
            memset(chosenAbilities, 0, sizeof(chosenAbilities));
            selectAbility(pickAbilityRandom(chosenAbilities));

            ClearBuddyList();
            AddSentinelsNear(me);
            int bli;
            for (bli = 0; bli < 3; ++bli)
            {
                if (!NearbyGUID[bli])
                    break;

                Creature* pNearby = ObjectAccessor::GetCreature(*me, NearbyGUID[bli]);
                if (!pNearby)
                    break;

                AddSentinelsNear(pNearby);
                ENSURE_AI(aqsentinelAI, pNearby->AI())->gatherOthersWhenAggro = false;
                ENSURE_AI(aqsentinelAI, pNearby->AI())->selectAbility(pickAbilityRandom(chosenAbilities));
            }
            /*if (bli < 3)
                DoYell("I dont have enough buddies.", LANG_NEUTRAL, 0);*/
            SendMyListToBuddies();
            CallBuddiesToAttack(who);
        }
开发者ID:AwkwardDev,项目名称:TinyCore,代码行数:27,代码来源:mob_anubisath_sentinel.cpp


示例2: SummonInfernal

        void SummonInfernal(const uint32 /*diff*/)
        {
            InfernalPoint *point = NULL;
            Position pos;
            if ((me->GetMapId() != 532) || positions.empty())
                pos = me->GetRandomNearPosition(60);
            else
            {
                point = Trinity::Containers::SelectRandomContainerElement(positions);
                pos.Relocate(point->x, point->y, INFERNAL_Z, frand(0.0f, float(M_PI * 2)));
            }

            Creature* infernal = me->SummonCreature(NETHERSPITE_INFERNAL, pos, TEMPSUMMON_TIMED_DESPAWN, 180000);

            if (infernal)
            {
                infernal->SetDisplayId(INFERNAL_MODEL_INVISIBLE);
                infernal->setFaction(me->getFaction());
                if (point)
                    ENSURE_AI(netherspite_infernal::netherspite_infernalAI, infernal->AI())->point = point;
                ENSURE_AI(netherspite_infernal::netherspite_infernalAI, infernal->AI())->malchezaar = me->GetGUID();

                infernals.push_back(infernal->GetGUID());
                DoCast(infernal, SPELL_INFERNAL_RELAY);
            }

            Talk(SAY_SUMMON);
        }
开发者ID:AwkwardDev,项目名称:TinyCore,代码行数:28,代码来源:boss_prince_malchezaar.cpp


示例3: StartEvent

        void StartEvent(Unit* target)
        {
            if (target && target->IsAlive())
            {
                Council[0] = instance->GetGuidData(DATA_GATHIOS_THE_SHATTERER);
                Council[1] = instance->GetGuidData(DATA_HIGH_NETHERMANCER_ZEREVOR);
                Council[2] = instance->GetGuidData(DATA_LADY_MALANDE);
                Council[3] = instance->GetGuidData(DATA_VERAS_DARKSHADOW);

                // Start the event for the Voice Trigger
                if (Creature* VoiceTrigger = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_BLOOD_ELF_COUNCIL_VOICE)))
                {
                    ENSURE_AI(npc_blood_elf_council_voice_trigger::npc_blood_elf_council_voice_triggerAI, VoiceTrigger->AI())->LoadCouncilGUIDs();
                    ENSURE_AI(npc_blood_elf_council_voice_trigger::npc_blood_elf_council_voice_triggerAI, VoiceTrigger->AI())->EventStarted = true;
                }

                for (uint8 i = 0; i < 4; ++i)
                {
                    if (!Council[i].IsEmpty())
                    {
                        if (Creature* member = ObjectAccessor::GetCreature(*me, Council[i]))
                            if (member->IsAlive())
                                member->AI()->AttackStart(target);
                    }
                }

                instance->SetBossState(DATA_ILLIDARI_COUNCIL, IN_PROGRESS);

                EventBegun = true;
            }
        }
开发者ID:beyourself,项目名称:DeathCore_6.x,代码行数:31,代码来源:illidari_council.cpp


示例4: OnQuestAccept

 bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) override
 {
     if (quest->GetQuestId() == QUEST_SHATTERED_SALUTE)
     {
         ENSURE_AI(npc_shenthul::npc_shenthulAI, creature->AI())->CanTalk = true;
         ENSURE_AI(npc_shenthul::npc_shenthulAI, creature->AI())->PlayerGUID = player->GetGUID();
     }
     return true;
 }
开发者ID:JunkyBulgaria,项目名称:asdfgh,代码行数:9,代码来源:zone_orgrimmar.cpp


示例5: OnQuestAccept

    bool OnQuestAccept(Player* player, Creature* creature, const Quest *quest) override
    {
        if (quest->GetQuestId() == QUEST_PYREWOOD_AMBUSH && !ENSURE_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->QuestInProgress)
        {
            ENSURE_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->QuestInProgress = true;
            ENSURE_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->Phase = 0;
            ENSURE_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->KillCount = 0;
            ENSURE_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->PlayerGUID = player->GetGUID();
        }

        return true;
    }
开发者ID:mynew4,项目名称:Tartarus-WoW-Core-3.3.5,代码行数:12,代码来源:zone_silverpine_forest.cpp


示例6: DamageTaken

        void DamageTaken(Unit* /*done_by*/, uint32 &damage) override
        {
            if (damage < me->GetHealth())
                return;

            //anything below only used if incoming damage will kill

            if (Phase == PHASE_ROMULO)
            {
                Talk(SAY_ROMULO_DEATH);
                PretendToDie(me);
                IsFakingDeath = true;
                Phase = PHASE_BOTH;

                if (Creature* Julianne = (ObjectAccessor::GetCreature((*me), JulianneGUID)))
                {
                    ENSURE_AI(boss_julianne::boss_julianneAI, Julianne->AI())->RomuloDead = true;
                    ENSURE_AI(boss_julianne::boss_julianneAI, Julianne->AI())->ResurrectSelfTimer = 10000;
                }

                damage = 0;
                return;
            }

            if (Phase == PHASE_BOTH)
            {
                if (JulianneDead)
                {
                    if (Creature* Julianne = (ObjectAccessor::GetCreature((*me), JulianneGUID)))
                    {
                        Julianne->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                        Julianne->GetMotionMaster()->Clear();
                        Julianne->setDeathState(JUST_DIED);
                        Julianne->CombatStop(true);
                        Julianne->DeleteThreatList();
                        Julianne->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
                    }
                    return;
                }

                if (Creature* Julianne = (ObjectAccessor::GetCreature((*me), JulianneGUID)))
                {
                    PretendToDie(me);
                    IsFakingDeath = true;
                    ENSURE_AI(boss_julianne::boss_julianneAI, Julianne->AI())->ResurrectTimer = 10000;
                    ENSURE_AI(boss_julianne::boss_julianneAI, Julianne->AI())->RomuloDead = true;
                    damage = 0;
                    return;
                }
            }

            TC_LOG_ERROR("scripts", "boss_romuloAI: DamageTaken reach end of code, that should not happen.");
        }
开发者ID:cooler-SAI,项目名称:ElunaTrinityWotlk,代码行数:53,代码来源:bosses_opera.cpp


示例7: UpdateAI

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

            if (JulianneDead)
            {
                if (ResurrectTimer <= diff)
                {
                    Creature* Julianne = (ObjectAccessor::GetCreature((*me), JulianneGUID));
                    if (Julianne && ENSURE_AI(boss_julianne::boss_julianneAI, Julianne->AI())->IsFakingDeath)
                    {
                        Talk(SAY_ROMULO_RESURRECT);
                        Resurrect(Julianne);
                        ENSURE_AI(boss_julianne::boss_julianneAI, Julianne->AI())->IsFakingDeath = false;
                        JulianneDead = false;
                        ResurrectTimer = 10000;
                    }
                } else ResurrectTimer -= diff;
            }

            if (BackwardLungeTimer <= diff)
            {
                Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);
                if (target && !me->HasInArc(float(M_PI), target))
                {
                    DoCast(target, SPELL_BACKWARD_LUNGE);
                    BackwardLungeTimer = urand(15000, 30000);
                }
            } else BackwardLungeTimer -= diff;

            if (DaringTimer <= diff)
            {
                DoCast(me, SPELL_DARING);
                DaringTimer = urand(20000, 40000);
            } else DaringTimer -= diff;

            if (DeadlySwatheTimer <= diff)
            {
                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
                    DoCast(target, SPELL_DEADLY_SWATHE);
                DeadlySwatheTimer = urand(15000, 25000);
            } else DeadlySwatheTimer -= diff;

            if (PoisonThrustTimer <= diff)
            {
                DoCastVictim(SPELL_POISON_THRUST);
                PoisonThrustTimer = urand(10000, 20000);
            } else PoisonThrustTimer -= diff;

            DoMeleeAttackIfReady();
        }
开发者ID:cooler-SAI,项目名称:ElunaTrinityWotlk,代码行数:52,代码来源:bosses_opera.cpp


示例8: OnQuestAccept

 bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) override
 {
     if (quest->GetQuestId() == QUEST_THE_ATTACK)
     {
         if (Creature* pSpybot = creature->FindNearestCreature(NPC_TYRION_SPYBOT, 5.0f, true))
         {
             ENSURE_AI(npc_tyrion_spybot::npc_tyrion_spybotAI, pSpybot->AI())->Start(false, false, player->GetGUID());
             ENSURE_AI(npc_tyrion_spybot::npc_tyrion_spybotAI, pSpybot->AI())->SetMaxPlayerDistance(200.0f);
         }
         return true;
     }
     return false;
 }
开发者ID:Cyph3r,项目名称:LordPsyanBots,代码行数:13,代码来源:zone_stormwind_city.cpp


示例9: JustDied

        void JustDied(Unit* /*killer*/) override
        {
            Talk(SAY_SATH_DEATH);
            me->SetPosition(me->GetPositionX(), me->GetPositionY(), DRAGON_REALM_Z, me->GetOrientation());
            TeleportAllPlayersBack();
            if (Creature* Kalecgos = ObjectAccessor::GetCreature(*me, KalecgosGUID))
            {
                ENSURE_AI(boss_kalecgos::boss_kalecgosAI, Kalecgos->AI())->TalkTimer = 1;
                ENSURE_AI(boss_kalecgos::boss_kalecgosAI, Kalecgos->AI())->isFriendly = true;
            }

            instance->SetBossState(DATA_KALECGOS, DONE);
        }
开发者ID:AwkwardDev,项目名称:RE,代码行数:13,代码来源:boss_kalecgos.cpp


示例10: OnQuestReward

    bool OnQuestReward(Player* player, GameObject* go, Quest const* /*quest*/, uint32 /*opt*/) override
    {
        if (InstanceScript* instance = go->GetInstanceScript())
            if (instance->GetBossState(DATA_HORSEMAN_EVENT) == IN_PROGRESS)
                return false;

            player->AreaExploredOrEventHappens(11405);
            if (Creature* horseman = go->SummonCreature(HH_MOUNTED, FlightPoint[20].x, FlightPoint[20].y, FlightPoint[20].z, 0, TEMPSUMMON_MANUAL_DESPAWN, 0))
            {
                ENSURE_AI(boss_headless_horseman::boss_headless_horsemanAI, horseman->AI())->PlayerGUID = player->GetGUID();
                ENSURE_AI(boss_headless_horseman::boss_headless_horsemanAI, horseman->AI())->FlyMode();
            }
        return true;
    }
开发者ID:HevdavDEV,项目名称:DeathCore_3.3.5a,代码行数:14,代码来源:boss_headless_horseman.cpp


示例11: OnQuestReward

    bool OnQuestReward(Player* /*player*/, Creature* creature, const Quest *_Quest, uint32 /*slot*/) override
    {
        if (_Quest->GetQuestId() == QUEST_JOURNEY_TO_UNDERCITY)
        {
            ENSURE_AI(npc_lady_sylvanas_windrunner::npc_lady_sylvanas_windrunnerAI, creature->AI())->LamentEvent = true;
            ENSURE_AI(npc_lady_sylvanas_windrunner::npc_lady_sylvanas_windrunnerAI, creature->AI())->DoPlaySoundToSet(creature, SOUND_CREDIT);
            creature->CastSpell(creature, SPELL_SYLVANAS_CAST, false);

            for (uint8 i = 0; i < 4; ++i)
                creature->SummonCreature(ENTRY_HIGHBORNE_LAMENTER, HighborneLoc[i][0], HighborneLoc[i][1], HIGHBORNE_LOC_Y, HighborneLoc[i][2], TEMPSUMMON_TIMED_DESPAWN, 160000);
        }

        return true;
    }
开发者ID:Anbush,项目名称:TrinityCore,代码行数:14,代码来源:zone_undercity.cpp


示例12: OnGossipSelect

    bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
    {
        ClearGossipMenuFor(player);
        InstanceScript* instance = creature->GetInstanceScript();
        switch (action)
        {
            case GOSSIP_ACTION_INFO_DEF+1:
                CloseGossipMenuFor(player);
                if (instance)
                {
                    instance->SetData(TYPE_THRALL_EVENT, IN_PROGRESS);
                    instance->SetData(TYPE_THRALL_PART1, IN_PROGRESS);
                }

                creature->AI()->Talk(SAY_TH_START_EVENT_PART1);

                if (npc_escortAI* pEscortAI = CAST_AI(npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI, creature->AI()))
                    pEscortAI->Start(true, true, player->GetGUID());

                ENSURE_AI(npc_escortAI, (creature->AI()))->SetMaxPlayerDistance(100.0f);//not really needed, because it will not despawn if player is too far
                ENSURE_AI(npc_escortAI, (creature->AI()))->SetDespawnAtEnd(false);
                ENSURE_AI(npc_escortAI, (creature->AI()))->SetDespawnAtFar(false);
                break;

            case GOSSIP_ACTION_INFO_DEF+2:
                AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_SKARLOC2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+20);
                SendGossipMenuFor(player, GOSSIP_ID_SKARLOC2, creature->GetGUID());
                break;

            case GOSSIP_ACTION_INFO_DEF+20:
                SendGossipMenuFor(player, GOSSIP_ID_SKARLOC3, creature->GetGUID());
                creature->SummonCreature(SKARLOC_MOUNT, 2038.81f, 270.26f, 63.20f, 5.41f, TEMPSUMMON_TIMED_DESPAWN, 12000);
                if (instance)
                    instance->SetData(TYPE_THRALL_PART2, IN_PROGRESS);

                creature->AI()->Talk(SAY_TH_START_EVENT_PART2);

                ENSURE_AI(npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI, creature->AI())->StartWP();
                break;

            case GOSSIP_ACTION_INFO_DEF+3:
                CloseGossipMenuFor(player);
                if (instance)
                    instance->SetData(TYPE_THRALL_PART3, IN_PROGRESS);
                ENSURE_AI(npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI, creature->AI())->StartWP();
                break;
        }
        return true;
    }
开发者ID:Lyill,项目名称:TrinityCore,代码行数:49,代码来源:old_hillsbrad.cpp


示例13: KilledUnit

 void KilledUnit(Unit* target) override
 {
     if (target->GetGUID() == KalecGUID)
     {
         TeleportAllPlayersBack();
         if (Creature* Kalecgos = ObjectAccessor::GetCreature(*me, KalecgosGUID))
         {
             ENSURE_AI(boss_kalecgos::boss_kalecgosAI, Kalecgos->AI())->TalkTimer = 1;
             ENSURE_AI(boss_kalecgos::boss_kalecgosAI, Kalecgos->AI())->isFriendly = false;
         }
         EnterEvadeMode();
         return;
     }
     Talk(SAY_SATH_SLAY);
 }
开发者ID:AwkwardDev,项目名称:RE,代码行数:15,代码来源:boss_kalecgos.cpp


示例14: OnGossipSelect

    bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
    {
        ClearGossipMenuFor(player);
        npc_barnesAI* pBarnesAI = ENSURE_AI(npc_barnes::npc_barnesAI, creature->AI());

        switch (action)
        {
            case GOSSIP_ACTION_INFO_DEF+1:
                AddGossipItemFor(player, GOSSIP_ICON_CHAT, OZ_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
                SendGossipMenuFor(player, 8971, creature->GetGUID());
                break;
            case GOSSIP_ACTION_INFO_DEF+2:
                CloseGossipMenuFor(player);
                pBarnesAI->StartEvent();
                break;
            case GOSSIP_ACTION_INFO_DEF+3:
                CloseGossipMenuFor(player);
                pBarnesAI->m_uiEventId = EVENT_OZ;
                TC_LOG_DEBUG("scripts", "player (%s) manually set Opera event to EVENT_OZ", player->GetGUID().ToString().c_str());
                break;
            case GOSSIP_ACTION_INFO_DEF+4:
                CloseGossipMenuFor(player);
                pBarnesAI->m_uiEventId = EVENT_HOOD;
                TC_LOG_DEBUG("scripts", "player (%s) manually set Opera event to EVENT_HOOD", player->GetGUID().ToString().c_str());
                break;
            case GOSSIP_ACTION_INFO_DEF+5:
                CloseGossipMenuFor(player);
                pBarnesAI->m_uiEventId = EVENT_RAJ;
                TC_LOG_DEBUG("scripts", "player (%s) manually set Opera event to EVENT_RAJ", player->GetGUID().ToString().c_str());
                break;
        }

        return true;
    }
开发者ID:Declipe,项目名称:ElunaTrinityWotlk,代码行数:34,代码来源:karazhan.cpp


示例15: OnGossipSelect

    bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
    {
        player->PlayerTalkClass->ClearMenus();
        npc_barnesAI* pBarnesAI = ENSURE_AI(npc_barnes::npc_barnesAI, creature->AI());

        switch (action)
        {
            case GOSSIP_ACTION_INFO_DEF+1:
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, OZ_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
                player->SEND_GOSSIP_MENU(8971, creature->GetGUID());
                break;
            case GOSSIP_ACTION_INFO_DEF+2:
                player->CLOSE_GOSSIP_MENU();
                pBarnesAI->StartEvent();
                break;
            case GOSSIP_ACTION_INFO_DEF+3:
                player->CLOSE_GOSSIP_MENU();
                pBarnesAI->m_uiEventId = EVENT_OZ;
                TC_LOG_DEBUG("scripts", "player (%s) manually set Opera event to EVENT_OZ", player->GetGUID().ToString().c_str());
                break;
            case GOSSIP_ACTION_INFO_DEF+4:
                player->CLOSE_GOSSIP_MENU();
                pBarnesAI->m_uiEventId = EVENT_HOOD;
                TC_LOG_DEBUG("scripts", "player (%s) manually set Opera event to EVENT_HOOD", player->GetGUID().ToString().c_str());
                break;
            case GOSSIP_ACTION_INFO_DEF+5:
                player->CLOSE_GOSSIP_MENU();
                pBarnesAI->m_uiEventId = EVENT_RAJ;
                TC_LOG_DEBUG("scripts", "player (%s) manually set Opera event to EVENT_RAJ", player->GetGUID().ToString().c_str());
                break;
        }

        return true;
    }
开发者ID:Rastrian,项目名称:DeathCore_6.x-1,代码行数:34,代码来源:karazhan.cpp


示例16: Reset

        void Reset() override
        {
            for (uint8 i = 0; i < 2; ++i)
            {
                if (!PortalGUID[i].IsEmpty())
                {
                    if (Creature* pPortal = ObjectAccessor::GetCreature(*me, PortalGUID[i]))
                    {
                        ENSURE_AI(npc_fiendish_portal::npc_fiendish_portalAI, pPortal->AI())->DespawnAllImp();
                        pPortal->DespawnOrUnsummon();
                    }

                    PortalGUID[i].Clear();
                }
            }

            Initialize();

            instance->SetBossState(DATA_TERESTIAN, NOT_STARTED);

            me->RemoveAurasDueToSpell(SPELL_BROKEN_PACT);

            if (Minion* Kilrek = me->GetFirstMinion())
            {
                if (!Kilrek->IsAlive())
                {
                    Kilrek->UnSummon();
                    DoCast(me, SPELL_SUMMON_IMP, true);
                }
            }
            else DoCast(me, SPELL_SUMMON_IMP, true);
        }
开发者ID:090809,项目名称:TrinityCore,代码行数:32,代码来源:boss_terestian_illhoof.cpp


示例17: OnGossipHello

        bool OnGossipHello(Player* /*player*/, GameObject* go) override
        {
            InstanceScript* instance = go->GetInstanceScript();
            if (!instance)
                return false;

            Creature* PrinceTaldaram = ObjectAccessor::GetCreature(*go, instance->GetGuidData(DATA_PRINCE_TALDARAM));
            if (PrinceTaldaram && PrinceTaldaram->IsAlive())
            {
                go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
                go->SetGoState(GO_STATE_ACTIVE);

                switch (go->GetEntry())
                {
                    case GO_SPHERE_1:
                        instance->SetData(DATA_SPHERE_1, IN_PROGRESS);
                        PrinceTaldaram->AI()->Talk(SAY_1);
                        break;
                    case GO_SPHERE_2:
                        instance->SetData(DATA_SPHERE_2, IN_PROGRESS);
                        PrinceTaldaram->AI()->Talk(SAY_1);
                        break;
                }

                ENSURE_AI(boss_prince_taldaram::boss_prince_taldaramAI, PrinceTaldaram->AI())->CheckSpheres();
            }
            return true;
        }
开发者ID:AwkwardDev,项目名称:RE,代码行数:28,代码来源:boss_prince_taldaram.cpp


示例18: UpdateAI

        void UpdateAI(uint32 diff) override
        {
            if (!VashjGUID)
                return;

            if (Move <= diff)
            {
                me->SetWalk(true);
                if (Phase == 1)
                    me->GetMotionMaster()->MovePoint(0, X, Y, Z);
                if (Phase == 1 && me->IsWithinDist3d(X, Y, Z, 0.1f))
                    Phase = 2;
                if (Phase == 2)
                {
                    me->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z);
                    Phase = 3;
                }
                if (Phase == 3)
                {
                    me->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z);
                    if (me->IsWithinDist3d(MIDDLE_X, MIDDLE_Y, MIDDLE_Z, 3))
                        DoCast(me, SPELL_SURGE);
                }
                if (Creature* vashj = ObjectAccessor::GetCreature(*me, VashjGUID))
                    if (!vashj->IsInCombat() || ENSURE_AI(boss_lady_vashj::boss_lady_vashjAI, vashj->AI())->Phase != 2 || vashj->isDead())
                        me->KillSelf();
                Move = 1000;
            } else Move -= diff;
        }
开发者ID:ElunaLuaEngine,项目名称:ElunaTrinityWotlk,代码行数:29,代码来源:boss_lady_vashj.cpp


示例19: OnGossipSelect

    bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
    {
        player->PlayerTalkClass->ClearMenus();
        InstanceScript* instance = creature->GetInstanceScript();
        if (action == GOSSIP_ACTION_INFO_DEF+1)
        {
            player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_EPOCH2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
            player->SEND_GOSSIP_MENU(GOSSIP_ID_EPOCH2, creature->GetGUID());
        }
        if (action == GOSSIP_ACTION_INFO_DEF+2)
        {
            player->CLOSE_GOSSIP_MENU();

            if (instance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS)
            {
                instance->SetData(TYPE_THRALL_PART4, IN_PROGRESS);
                if (instance->GetData64(DATA_EPOCH) == 0)
                     creature->SummonCreature(ENTRY_EPOCH, 2639.13f, 698.55f, 65.43f, 4.59f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);

                if (Creature* thrall = (ObjectAccessor::GetCreature(*creature, instance->GetData64(DATA_THRALL))))
                    ENSURE_AI(npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI, thrall->AI())->StartWP();
            }
        }
        return true;
    }
开发者ID:Anbush,项目名称:TrinityCore,代码行数:25,代码来源:old_hillsbrad.cpp


示例20: UpdateAI

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

            if (Rage_Timer <= diff)
            {
                if (Creature* distiller = me->FindNearestCreature(17954, 100.0f))
                {
                    Talk(SAY_REGEN);
                    DoCast(me, SPELL_WARLORDS_RAGE);
                    ENSURE_AI(npc_naga_distiller::npc_naga_distillerAI, distiller->AI())->StartRageGen(me);
                }
                Rage_Timer = 3000 + rand32() % 15000;
            } else Rage_Timer -= diff;

            //Reflection_Timer
            if (Reflection_Timer <= diff)
            {
                DoCast(me, SPELL_SPELL_REFLECTION);
                Reflection_Timer = 15000 + rand32() % 10000;
            } else Reflection_Timer -= diff;

            //Impale_Timer
            if (Impale_Timer <= diff)
            {
                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                    DoCast(target, SPELL_IMPALE);

                Impale_Timer = 7500 + rand32() % 5000;
            } else Impale_Timer -= diff;

            DoMeleeAttackIfReady();
        }
开发者ID:mysql1,项目名称:TournamentCore,代码行数:34,代码来源:boss_warlord_kalithresh.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ENSURE_INDEX_VALUE函数代码示例发布时间:2022-05-30
下一篇:
C++ ENSURES函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap