當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。