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


C++ CAST_PLR函数代码示例

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


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

示例1: MoveInLineOfSight

    void MoveInLineOfSight(Unit* who)
    {
        if (HasEscortState(STATE_ESCORT_ESCORTING))
            return;

        if (who->GetTypeId() == TYPEID_PLAYER)
        {
            if (who->HasAura(34877,1) && CAST_PLR(who)->GetQuestStatus(10277) == QUEST_STATUS_INCOMPLETE)
            {
                float Radius = 10.0f;
                if (me->IsWithinDistInMap(who, Radius))
                {
                    Start(false, false, who->GetGUID());
                }
            }
        }
    }
开发者ID:FirstCore,项目名称:Battle_2.4.3,代码行数:17,代码来源:tanaris.cpp

示例2: UpdateAI

 void UpdateAI(const uint32 uiDiff)
 {
     if (uiCheckTimer <= uiDiff)
     {
         if (Creature* pWarp = me->FindNearestCreature(NPC_WARP_CHASER, 9.0f, false))
         {
             if (pWarp->GetGUID() != uiWarpGUID && CAST_PLR(me->GetOwner())->GetQuestStatus(QUEST_BLOODY) == QUEST_STATUS_INCOMPLETE)
             {
                 uiWarpGUID = pWarp->GetGUID();
                 DoScriptText(EMOTE_GATHER_BLOOD, me);
                 me->CastSpell(me->GetOwner(), SPELL_GATHER_WARP_BLOOD, false);
             }
         }
         uiCheckTimer = 8000;
     }
     else uiCheckTimer -= uiDiff;
 }
开发者ID:Dudelzack,项目名称:blizzlikecore,代码行数:17,代码来源:netherstorm.cpp

示例3: SendItem

 void SendItem(Unit* receiver) {
     if (CAST_PLR(receiver)->HasItemCount(11169, 1, false)
             && CAST_PLR(receiver)->HasItemCount(11172, 11, false)
             && CAST_PLR(receiver)->HasItemCount(11173, 1, false)
             && !CAST_PLR(receiver)->HasItemCount(11522, 1, true)) {
         ItemPosCountVec dest;
         uint8 msg = CAST_PLR(receiver)->CanStoreNewItem(NULL_BAG,
                 NULL_SLOT, dest, 11522, 1, false);
         if (msg == EQUIP_ERR_OK)
             CAST_PLR(receiver)->StoreNewItem(dest, 11522, 1, true);
     }
 }
开发者ID:814077430,项目名称:ArkCORE,代码行数:12,代码来源:tanaris.cpp

示例4: SpellHit

        void SpellHit(Unit *caster, const SpellEntry *spell)
        {
            if (caster->GetTypeId() == TYPEID_PLAYER)
            {
                                                                //Yenniku's Release
                if (!bReset && CAST_PLR(caster)->GetQuestStatus(592) == QUEST_STATUS_INCOMPLETE && spell->Id == 3607)
                {
                    me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN);
                    me->CombatStop();                   //stop combat
                    me->DeleteThreatList();             //unsure of this
                    me->setFaction(83);                 //horde generic

                    bReset = true;
                    Reset_Timer = 60000;
                }
            }
            return;
        }
开发者ID:SkyFireArchives,项目名称:SkyFireEMU_420,代码行数:18,代码来源:stranglethorn_vale.cpp

示例5: WaypointReached

        void WaypointReached(uint32 i)
        {
            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;

            switch(i)
            {
            case 26:
                me->DespawnOrUnsummon();
                break;
            }
        }
开发者ID:CrAzY666,项目名称:TrinityCore,代码行数:18,代码来源:howling_fjord.cpp

示例6: DamageTaken

	void DamageTaken(Unit* done_by, uint32& damage)
	{
		if (done_by->GetTypeId() == TYPEID_PLAYER)
		{
			if (damage > me->GetHealth())
			{
				me->SetHealth(1);
				damage = 0;
			}

            if (me->HealthBelowPctDamaged(20, damage))
			{
				if (CAST_PLR(done_by)->GetQuestStatus(QUEST_THE_END_OF_THE_DESERTERS) == QUEST_STATUS_INCOMPLETE)
					me->CastSpell(done_by, SPELL_GAVIS_GREYSHIELD_CREDIT, true);

				phase = PHASE_GAVIS_SURRENDER;
			}
		}
	}
开发者ID:Phentora,项目名称:OregonCore,代码行数:19,代码来源:dustwallow_marsh.cpp

示例7: WaypointReached

        void WaypointReached(uint32 uiPointId) {
            Player* pPlayer = GetPlayerForEscort();

            if (!pPlayer)
                return;

            switch (uiPointId) {
            case 4:
                DoScriptText(SAY_PROGRESS_2, me, pPlayer);
                break;
            case 5:
                DoScriptText(SAY_PROGRESS_3, me, pPlayer);
                break;
            case 8:
                DoScriptText(EMOTE_PROGRESS_4, me);
                break;
            case 9: {
                me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f,
                        20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
                me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f,
                        20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
                break;
            }
            case 10:
                DoScriptText(SAY_PROGRESS_5, me, pPlayer);
                break;
            case 11:
                DoScriptText(SAY_PROGRESS_6, me, pPlayer);
                SetRun();
                break;
            case 19:
                DoScriptText(SAY_PROGRESS_7, me, pPlayer);
                break;
            case 20:
                DoScriptText(EMOTE_PROGRESS_8, me);
                DoScriptText(SAY_PROGRESS_9, me, pPlayer);
                if (pPlayer)
                    CAST_PLR(pPlayer)->GroupEventHappens(QUEST_SUNKEN_TREASURE,
                            me);
                break;
            }
        }
开发者ID:BlueSellafield,项目名称:ArkCORE,代码行数:42,代码来源:arathi_highlands.cpp

示例8: WaypointReached

            void WaypointReached(uint32 uiPointId)
            {
                Player* pPlayer = GetPlayerForEscort();

                if (!pPlayer)
                    return;

                switch(uiPointId)
                {
                case 9:Talk(SAY_POINT_1);break;
                case 10:
                {
                    me->SummonCreature(NPC_HAMMERFALL_GRUNT, -1459.62f, -3019.78f, 11.8f, 5.08f, TEMPSUMMON_CORPSE_DESPAWN, 0);
                    me->SummonCreature(NPC_HAMMERFALL_GRUNT, -1471.77f, -3032.95f, 12.39f, 6.03f, TEMPSUMMON_CORPSE_DESPAWN, 0);
                    break;
                }
                case 11:
                {
                    me->SummonCreature(NPC_HAMMERFALL_GRUNT, -1517.95f, -3023.16f, 12.93f, 4.79f, TEMPSUMMON_CORPSE_DESPAWN, 0);
                    me->SummonCreature(NPC_HAMMERFALL_GRUNT, -1522.69f, -3023.90f, 12.45f, 5.12f, TEMPSUMMON_CORPSE_DESPAWN, 0);
                    break;
                }
                case 13:
                {
                    if(Creature* Jorell = me->FindNearestCreature(2733,8.0f,true))
                    {
                        Jorell->MonsterSay("You will never stop the Forsaken, Kinelory. The Dark Lady shall make you suffer.",0,0);
                    }
                    break;
                }              
                case 14:Talk(SAY_HOUSE_1);break;
                case 15:Talk(SAY_HOUSE_2); break;
                case 16:Talk(SAY_HOUSE_3); break;
                case 17:SetRun(); break;
                case 27:
                    Talk(SAY_END);
                    if (pPlayer)
                        CAST_PLR(pPlayer)->GroupEventHappens(QUEST_KINELORY_STRIKES, me);
                    Reset();
                    break;
                }
            }
开发者ID:beyourself,项目名称:Wow-4.3.4,代码行数:42,代码来源:zone_arathi_highlands.cpp

示例9: DamageTaken

    void DamageTaken(Unit* pDoneBy, uint32& uiDamage)
    {
        if (m_creature->GetHealth()*100 < m_creature->GetMaxHealth()*20)
        {
            if (Player* pPlayer = GetPlayerForEscort())
            {
                if (pPlayer->GetTypeId() == TYPEID_PLAYER)
                    CAST_PLR(pPlayer)->GroupEventHappens(QUEST_MISSING_DIPLO_PT11, m_creature);

                uiDamage = 0;

                me->RestoreFaction();
                m_creature->RemoveAllAuras();
                m_creature->DeleteThreatList();
                m_creature->CombatStop(true);

                SetRun(false);
            }
        }
    }
开发者ID:Sanzzes,项目名称:wopc-core,代码行数:20,代码来源:wetlands.cpp

示例10: JustDied

        void JustDied(Unit* Killer)
        {
            uint32 spawnCreatureID = 0;

            switch (urand(0, 2))
            {
                case 0:
                    spawnCreatureID = 17681;
                    if (Killer->GetTypeId() == TYPEID_PLAYER)
                        CAST_PLR(Killer)->KilledMonsterCredit(spawnCreatureID, 0);
                    break;
                case 1:
                case 2:
                    spawnCreatureID = possibleSpawns[urand(0, 30)];
                    break;
            }

            if (spawnCreatureID)
                me->SummonCreature(spawnCreatureID, 0.0f, 0.0f, 0.0f, me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
        }
开发者ID:Crazzeye,项目名称:TrinityCore,代码行数:20,代码来源:bloodmyst_isle.cpp

示例11: DamageTaken

        void DamageTaken(Unit* /*doneBy*/, uint32& Damage)
        {
            if (HealthBelowPct(20))
            {
                if (Player* player = GetPlayerForEscort())
                {
                    if (player->GetTypeId() == TYPEID_PLAYER)
                        CAST_PLR(player)->GroupEventHappens(QUEST_MISSING_DIPLO_PT11, me);

                    Damage = 0;

                    me->RestoreFaction();
                    me->RemoveAllAuras();
                    me->DeleteThreatList();
                    me->CombatStop(true);

                    SetRun(false);
                }
            }
        }
开发者ID:naffbeats,项目名称:SkyFireEMU_rebase,代码行数:20,代码来源:wetlands.cpp

示例12: WaypointReached

            void WaypointReached(uint32 uiPointId)
            {
                Player* player = GetPlayerForEscort();

                if (!player)
                    return;

                switch (uiPointId)
                {
                case 4:
                    Talk(SAY_PROGRESS_2, player->GetGUID());
                    break;
                case 5:
                    Talk(SAY_PROGRESS_3, player->GetGUID());
                    break;
                case 8:
                    Talk(EMOTE_PROGRESS_4);
                    break;
                case 9:
                    me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
                    me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
                    break;
                case 10:
                    Talk(SAY_PROGRESS_5, player->GetGUID());
                    break;
                case 11:
                    Talk(SAY_PROGRESS_6, player->GetGUID());
                    SetRun();
                    break;
                case 19:
                    Talk(SAY_PROGRESS_7, player->GetGUID());
                    break;
                case 20:
                    Talk(EMOTE_PROGRESS_8);
                    Talk(SAY_PROGRESS_9, player->GetGUID());
                    if (player)
                        CAST_PLR(player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, me);
                    break;
                }
            }
开发者ID:Bulbucan,项目名称:TrinityCore,代码行数:40,代码来源:arathi_highlands.cpp

示例13: JustDied

        void JustDied(Unit* /*killer*/)
        {
            DoScriptText(EMOTE_ABORT, me);

            if (someplayer)
            {
                Unit* p = Unit::GetUnit((*me), someplayer);
                if (p && p->GetTypeId() == TYPEID_PLAYER)
                {
                    switch (me->GetEntry())
                    {
                        case ENTRY_BNAAR_C_CONSOLE:
                            CAST_PLR(p)->FailQuest(10299);
                            CAST_PLR(p)->FailQuest(10329);
                            break;
                        case ENTRY_CORUU_C_CONSOLE:
                            CAST_PLR(p)->FailQuest(10321);
                            CAST_PLR(p)->FailQuest(10330);
                            break;
                        case ENTRY_DURO_C_CONSOLE:
                            CAST_PLR(p)->FailQuest(10322);
                            CAST_PLR(p)->FailQuest(10338);
                            break;
                        case ENTRY_ARA_C_CONSOLE:
                            CAST_PLR(p)->FailQuest(10323);
                            CAST_PLR(p)->FailQuest(10365);
                            break;
                    }
                }
            }

            if (goConsole)
            {
                if (GameObject* go = GameObject::GetGameObject((*me), goConsole))
                    go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
            }
        }
开发者ID:Albis,项目名称:TrinityCore,代码行数:37,代码来源:netherstorm.cpp

示例14: UpdateAI

    void UpdateAI(const uint32 /*diff*/)
    {
        if (KillCount >= 3 && PlayerGUID)
        {
            if (Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID))
            {
                me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
                CAST_PLR(pPlayer)->CompleteQuest(QUEST_UNEXPECTED_RESULT);
                KillCount = 0;
            }
        }


        if (Summon)
        {
            me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
            me->SummonCreature(MOB_GHARZUL, 8726, -7148.23f, 35.22f, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
            me->SummonCreature(MOB_ANGERSHADE, 8726, -7148.23f, 35.22f, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
            me->SummonCreature(MOB_ANGERSHADE, 8726, -7148.23f, 35.22f, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
            Summon = false;
        }
    }
开发者ID:OregonCore,项目名称:OregonCore,代码行数:22,代码来源:eversong_woods.cpp

示例15: MoveInLineOfSight

    void MoveInLineOfSight(Unit* pWho)
    {
        if (!m_uiRandomTalkCooldown && pWho->GetTypeId() == TYPEID_UNIT && me->IsWithinDistInMap(pWho, 10.0f))
        {
            switch(pWho->GetEntry())
            {
                case NPC_HAGGARD:
                    if (Player* pPlayer = GetPlayerForEscort())
                        DoScriptText(SAY_KHAD_HAGGARD, pWho, pPlayer);
                    m_uiRandomTalkCooldown = 7500;
                    break;
                case NPC_ANCHORITE:
                    if (Player* pPlayer = GetPlayerForEscort())
                        DoScriptText(SAY_KHAD_ALDOR_GREET, pWho, pPlayer);
                    m_uiRandomTalkCooldown = 7500;
                    break;
                case NPC_ARCANIST:
                    if (Player* pPlayer = GetPlayerForEscort())
                        DoScriptText(SAY_KHAD_SCRYER_GREET, pWho, pPlayer);
                    m_uiRandomTalkCooldown = 7500;
                    break;
            }
        }

        if (HasEscortState(STATE_ESCORT_ESCORTING))
            return;

        if (pWho->GetTypeId() == TYPEID_PLAYER)
        {
            if (CAST_PLR(pWho)->GetQuestStatus(10211) == QUEST_STATUS_INCOMPLETE)
            {
                float Radius = 10.0f;
                if (me->IsWithinDistInMap(pWho, Radius))
                {
                    Start(false, false, pWho->GetGUID());
                }
            }
        }
    }
开发者ID:Agustin1010,项目名称:Oregon-Core,代码行数:39,代码来源:shattrath_city.cpp


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