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


C++ CAST_SUM函数代码示例

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


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

示例1: JustDied

 void JustDied(Unit* /*killer*/)
 {
     if (CAST_SUM(me))
         if (Creature* pSummoner = CAST_CRE(CAST_SUM(me)->GetSummoner()))
             if (pSummoner->AI())
                 pSummoner->AI()->DoAction(ACTION_FLESH_TENTACLE_KILLED);
 }
开发者ID:kmishima,项目名称:DarkCore,代码行数:7,代码来源:boss_cthun.cpp

示例2: UpdateAI

            void UpdateAI(const uint32 diff)
            {
                events.Update(diff);

                if (events.ExecuteEvent() == EVENT_CHECK_SUMMON_AURA)
                {
                    std::list<Creature*> tigers;
                    GetCreatureListWithEntryInGrid(tigers, me, NPC_TIGER_VEHICLE, 15.0f);
                    if (!tigers.empty())
                    {
                        for (std::list<Creature*>::iterator itr = tigers.begin(); itr != tigers.end(); ++itr)
                        {
                            if (Unit* summoner = CAST_SUM(*itr)->GetSummoner())
                                if (!summoner->HasAura(SPELL_NO_SUMMON_AURA) && !summoner->HasAura(SPELL_SUMMON_ZENTABRA_TRIGGER)
                                    && !summoner->isInCombat())
                                {
                                    me->AddAura(SPELL_NO_SUMMON_AURA, summoner);
                                    me->AddAura(SPELL_DETECT_INVIS, summoner);
                                    summoner->CastSpell(summoner, SPELL_SUMMON_MATRIARCH, true);
                                    Talk(SAY_MATRIARCH_AGGRO, summoner->GetGUID());
                                }
                        }
                    }

                    events.ScheduleEvent(EVENT_CHECK_SUMMON_AURA, 5000);
                }
            }
开发者ID:Rochet-2,项目名称:MythCore-OverWoW,代码行数:27,代码来源:durotar.cpp

示例3: SetDataSummoner

        void SetDataSummoner() {
            if (!me->isSummon())
                return;

            if (Unit* pSummon = CAST_SUM(me)->GetSummoner())
                CAST_CRE(pSummon)->AI()->SetData(2, 1);
        }
开发者ID:814077430,项目名称:ArkCORE,代码行数:7,代码来源:gnomeregan.cpp

示例4: JustDied

        void JustDied(Unit* /*pKiller*/) {
            if (!me->isSummon())
                return;

            if (Unit* pSummon = CAST_SUM(me)->GetSummoner())
                CAST_CRE(pSummon)->AI()->SetData(2, 2);
        }
开发者ID:814077430,项目名称:ArkCORE,代码行数:7,代码来源:gnomeregan.cpp

示例5: EnterEvadeMode

 void EnterEvadeMode()
 {
     if (m_creature->isSummon())
         if (Creature* pSummoner = CAST_CRE(CAST_SUM(m_creature)->GetSummoner()))
             if (npc_gurgthockAI* pAI = CAST_AI(npc_gurgthockAI,pSummoner->AI()))
                 pAI->RemoveSummons();
 }
开发者ID:Ickybad,项目名称:diamondcore2,代码行数:7,代码来源:zuldrak.cpp

示例6: MoveToSummoner

 void MoveToSummoner()
 {
     if (me->isSummon())
         if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
             if (pSummoner)
                 me->GetMotionMaster()->MovePoint(0,pSummoner->GetPositionX(),pSummoner->GetPositionY(),pSummoner->GetPositionZ());
 }
开发者ID:GameOn,项目名称:gameon,代码行数:7,代码来源:sholazar_basin.cpp

示例7: JustDied

 void JustDied(Unit * /*killer*/)
 {
     if (me->isSummon())
     {
         if (Unit *owner = CAST_SUM(me)->GetSummoner())
             CombatAI::JustDied(owner);
     }
 }
开发者ID:Drethek,项目名称:Darkpeninsula-Cata-Old,代码行数:8,代码来源:boss_gothik.cpp

示例8: UpdateAI

        void UpdateAI(const uint32 /*diff*/)
        {
            if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
                WrapTargetGUID = pSummoner->GetGUID();

            Unit* temp = Unit::GetUnit((*me), WrapTargetGUID);
            if ((temp && temp->isAlive() && !temp->HasAura(SPELL_SNAKE_WRAP_STUN)) || !temp)
                me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
        }
开发者ID:St3ve,项目名称:TrinityCore,代码行数:9,代码来源:boss_slad_ran.cpp

示例9: JustDied

    void JustDied(Unit* pKiller)
    {
        if (m_creature->isSummon())
            if (Creature* pSummoner = CAST_CRE(CAST_SUM(m_creature)->GetSummoner()))
                if (npc_gurgthockAI* pAI = CAST_AI(npc_gurgthockAI,pSummoner->AI()))
                    pAI->bEventInProgress = false;

        if (pKiller->GetTypeId() == TYPEID_PLAYER)
           CAST_PLR(pKiller)->GroupEventHappens(QUEST_AMPHITHEATER_ANGUISH_MAGNATAUR, CAST_PLR(pKiller));
    }
开发者ID:Ickybad,项目名称:diamondcore2,代码行数:10,代码来源:zuldrak.cpp

示例10: JustDied

 void JustDied(Unit* pKiller)
 {
     if (me->isSummon())
     {
         if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
         {
             if (pSummoner && pSummoner->isAlive())
                 CAST_CRE(pSummoner)->AI()->SetData(1, 0);
         }
     }
 }
开发者ID:Drethek,项目名称:Darkpeninsula-Cata-Old,代码行数:11,代码来源:boss_argent_challenge.cpp

示例11: InitScriptData

        void InitScriptData() {
            Player* pPlayer = NULL;
            if (me->isSummon())
                if (Unit* summoner = CAST_SUM(me)->GetSummoner())
                    if (summoner->GetTypeId() == TYPEID_PLAYER)
                        pPlayer = CAST_PLR(summoner);

            if (!pPlayer)
                return;

            me->SetUnitMovementFlags(MOVEMENTFLAG_WALKING);
            Start(false, false, pPlayer->GetGUID());
        }
开发者ID:814077430,项目名称:ArkCORE,代码行数:13,代码来源:howling_fjord.cpp

示例12: EnterEvadeMode

    void EnterEvadeMode()
    {
        me->DisappearAndDie();

        if (me->isSummon())
        {
            if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
            {
                if (pSummoner && pSummoner->isAlive())
                    CAST_CRE(pSummoner)->DisappearAndDie();
            }
        }
    }
开发者ID:LolJK,项目名称:PhantomCore,代码行数:13,代码来源:stormwind_city.cpp

示例13: EnterCombat

    void EnterCombat(Unit* pWho)
    {
        DoScriptText(SAY_MARZON_2, me);

        if (me->isSummon())
        {
            if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
            {
                if (pSummoner && pSummoner->isAlive() && !pSummoner->isInCombat())
                    CAST_CRE(pSummoner)->AI()->AttackStart(pWho);
            }
        }
    }
开发者ID:LolJK,项目名称:PhantomCore,代码行数:13,代码来源:stormwind_city.cpp

示例14: UpdateAI

        void UpdateAI(const uint32 diff)
        {
            if (FlyBackTimer <= diff)
            {
                Player *plr = NULL;
                if (me->isSummon())
                    if (Unit *summoner = CAST_SUM(me)->GetSummoner())
                        if (summoner->GetTypeId() == TYPEID_PLAYER)
                            plr = CAST_PLR(summoner);

                if (!plr)
                    phase = 3;

                switch(phase)
                {
                    case 0:
                        me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
                        me->HandleEmoteCommand(EMOTE_STATE_FLYGRABCLOSED);
                        FlyBackTimer = 500;
                        break;
                    case 1:
                        plr->GetClosePoint(x, y, z, me->GetObjectSize());
                        z += 2.5; x -= 2; y -= 1.5;
                        me->GetMotionMaster()->MovePoint(0, x, y, z);
                        me->SetUInt64Value(UNIT_FIELD_TARGET, plr->GetGUID());
                        me->SetVisible(true);
                        FlyBackTimer = 4500;
                        break;
                    case 2:
                        if (!plr->isRessurectRequested())
                        {
                            me->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOMSPELL01);
                            DoCast(plr, SPELL_REVIVE, true);
                            me->MonsterWhisper(VALK_WHISPER, plr->GetGUID());
                        }
                        FlyBackTimer = 5000;
                        break;
                    case 3:
                        me->SetVisible(false);
                        FlyBackTimer = 3000;
                        break;
                    case 4:
                        me->DisappearAndDie();
                        break;
                    default:
                        //Nothing To DO
                        break;
                }
                ++phase;
            } else FlyBackTimer-=diff;
        }
开发者ID:Bootz,项目名称:SkyFireEMU_420,代码行数:51,代码来源:the_scarlet_enclave.cpp

示例15: KilledUnit

            void KilledUnit(Unit* victim)
            {
                if (victim->GetTypeId() != TYPEID_UNIT)
                    return;

                if (Unit* vehSummoner = CAST_SUM(victim)->GetSummoner())
                {
                    vehSummoner->RemoveAurasDueToSpell(SPELL_NO_SUMMON_AURA);
                    vehSummoner->RemoveAurasDueToSpell(SPELL_DETECT_INVIS);
                    vehSummoner->RemoveAurasDueToSpell(SPELL_SPIRIT_OF_THE_TIGER_RIDER);
                    vehSummoner->RemoveAurasDueToSpell(SPELL_SUMMON_ZENTABRA_TRIGGER);
                }
                me->ForcedDespawn();
            }
开发者ID:Rochet-2,项目名称:MythCore-OverWoW,代码行数:14,代码来源:durotar.cpp


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