當前位置: 首頁>>代碼示例>>C++>>正文


C++ GetExplTargetUnit函數代碼示例

本文整理匯總了C++中GetExplTargetUnit函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetExplTargetUnit函數的具體用法?C++ GetExplTargetUnit怎麽用?C++ GetExplTargetUnit使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GetExplTargetUnit函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: CheckCast

            SpellCastResult CheckCast()
            {
                Unit* caster = GetCaster();
                if (caster->GetTypeId() != TYPEID_PLAYER)
                    return SPELL_FAILED_DONT_REPORT;

                if (!GetExplTargetUnit())
                    return SPELL_FAILED_BAD_IMPLICIT_TARGETS;

                if (Creature* target = GetExplTargetUnit()->ToCreature())
                {
                    if (target->getLevel() > caster->getLevel())
                        return SPELL_FAILED_HIGHLEVEL;

                    // use SMSG_PET_TAME_FAILURE?
                    if (!target->GetCreatureTemplate()->IsTameable(caster->ToPlayer()->CanTameExoticPets()))
                        return SPELL_FAILED_BAD_TARGETS;

                    if (caster->GetPetGUID())
                        return SPELL_FAILED_ALREADY_HAVE_SUMMON;

                    if (caster->GetCharmGUID())
                        return SPELL_FAILED_ALREADY_HAVE_CHARM;
                }
                else
                    return SPELL_FAILED_BAD_IMPLICIT_TARGETS;

                return SPELL_CAST_OK;
            }
開發者ID:AwkwardDev,項目名稱:RE,代碼行數:29,代碼來源:spell_hunter.cpp

示例2: HandleScript

 void HandleScript(SpellEffIndex /*effIndex*/)
 {
     if (Unit* caster = GetCaster())
         if (Unit* target = GetExplTargetUnit())
             if (caster->HasAura(SPELL_SHAMAN_PATH_OF_FLAMES_TALENT))
                 caster->CastSpell(target, SPELL_SHAMAN_PATH_OF_FLAMES_SPREAD, true);
 }
開發者ID:Lyill,項目名稱:TrinityCore,代碼行數:7,代碼來源:spell_shaman.cpp

示例3: CheckCast

		SpellCastResult CheckCast()
		{
			if (GetCaster() == GetExplTargetUnit())
				return SPELL_FAILED_BAD_TARGETS;

			return SPELL_CAST_OK;
		}
開發者ID:Tithand,項目名稱:TER-Server,代碼行數:7,代碼來源:spell_priest.cpp

示例4: FilterTargets

            void FilterTargets(std::list<WorldObject*>& targets)
            {
                if (!GetCaster()->ToPlayer()->GetGroup())
                {
                    targets.clear();
                    targets.push_back(GetCaster());
                }
                else
                {
                    targets.remove(GetExplTargetUnit());
                    std::list<Unit*> tempTargets;
                    for (std::list<WorldObject*>::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
                        if ((*itr)->GetTypeId() == TYPEID_PLAYER && GetCaster()->IsInRaidWith((*itr)->ToUnit()))
                            tempTargets.push_back((*itr)->ToUnit());

                    if (tempTargets.empty())
                    {
                        targets.clear();
                        FinishCast(SPELL_FAILED_DONT_REPORT);
                        return;
                    }

                    Unit* target = Trinity::Containers::SelectRandomContainerElement(tempTargets);
                    targets.clear();
                    targets.push_back(target);
                }
            }
開發者ID:Hlkz2,項目名稱:ACoreOld,代碼行數:27,代碼來源:spell_druid.cpp

示例5: HandleBeforeCast

            void HandleBeforeCast()
            {
                Unit* caster = GetCaster();
                Unit* target = GetExplTargetUnit();
                
                if(caster && target)
                {
                    int32 basepoints0 = 0;

                    if(AuraEffect* aurEff = caster->GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_WARRIOR, 243, EFFECT_0))
                    {
                        basepoints0 = CalculatePct(caster->CalculateDamage(BASE_ATTACK, true, true), aurEff->GetAmount());

                        // Check for IconId duplicate
                        if(aurEff->GetBase() && aurEff->GetBase()->GetId() != 84919)
                        {
                            // * 6 because I need the total remaind periodic amount
                            basepoints0 += (target->GetRemainingPeriodicAmount(caster->GetGUID(), SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC, SPELL_AURA_PERIODIC_DAMAGE) * 6);
                        }
                    }

                    // Per tick damage
                    if(basepoints0)
                    {
                        deepWoundsAmount = basepoints0 / 6;
                    }
                }
            }
開發者ID:Faydz,項目名稱:TrinityCore,代碼行數:28,代碼來源:spell_warrior.cpp

示例6: FilterTargets

            void FilterTargets(std::list<Unit*>& unitList)
            {
                if (!GetCaster()->ToPlayer()->GetGroup())
                {
                    unitList.clear();
                    unitList.push_back(GetCaster());
                }
                else
                {
                    unitList.remove(GetExplTargetUnit());
                    std::list<Unit*> tempTargets;
                    for (std::list<Unit*>::const_iterator itr = unitList.begin(); itr != unitList.end(); ++itr)
                        if ((*itr)->GetTypeId() == TYPE_ID_PLAYER && GetCaster()->IsInRaidWith(*itr))
                            tempTargets.push_back(*itr);

                    if (tempTargets.empty())
                    {
                        unitList.clear();
                        FinishCast(SPELL_FAILED_DONT_REPORT);
                        return;
                    }

                    Unit* target = Quantum::DataPackets::SelectRandomContainerElement(tempTargets);
                    unitList.clear();
                    unitList.push_back(target);
                }
            }
開發者ID:boom8866,項目名稱:new,代碼行數:27,代碼來源:spell_druid.cpp

示例7: HandleDummy

 void HandleDummy(SpellEffIndex /*effIndex*/)
 {
     if (Unit* target = GetExplTargetUnit())
         if (target->GetTypeId() == TYPEID_UNIT && target->HasAura(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3))
             // Make sure nobody else is channeling the same target
             if (!target->HasAura(SPELL_SCOURGING_CRYSTAL_CONTROLLER))
                 GetCaster()->CastSpell(target, SPELL_SCOURGING_CRYSTAL_CONTROLLER, true, GetCastItem());
 }
開發者ID:S-proyect,項目名稱:Emu-S,代碼行數:8,代碼來源:spell_quest.cpp

示例8: FilterTargets

 void FilterTargets(std::list<WorldObject*>& targets)
 {
     targets.remove(GetExplTargetUnit());
     Trinity::Containers::RandomResize(targets, [this](WorldObject* target)
     {
         return target->GetTypeId() == TYPEID_UNIT && !target->ToUnit()->HasAura(SPELL_SHAMAN_FLAME_SHOCK_MAELSTROM, GetCaster()->GetGUID());
     }, 1);
 }
開發者ID:Lyill,項目名稱:TrinityCore,代碼行數:8,代碼來源:spell_shaman.cpp

示例9: CheckCast

 SpellCastResult CheckCast()
 {
     Player* caster = GetCaster()->ToPlayer();
     if (Unit* target = GetExplTargetUnit())
         if (!caster->IsFriendlyTo(target) && !caster->IsValidAttackTarget(target))
             return SPELL_FAILED_BAD_TARGETS;
     return SPELL_CAST_OK;
 }
開發者ID:Stylerdk,項目名稱:TrinityCore,代碼行數:8,代碼來源:spell_priest.cpp

示例10: CheckCast

        SpellCastResult CheckCast()
        {
            if (Unit* target = GetExplTargetUnit())
                if (target->GetEntry() == NPC_LUCKY_WILHELM)
                    return SPELL_CAST_OK;

            SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_TARGET_WILHELM);
            return SPELL_FAILED_CUSTOM_ERROR;
        }
開發者ID:090809,項目名稱:TrinityCore,代碼行數:9,代碼來源:zone_sholazar_basin.cpp

示例11: CheckCast

        SpellCastResult CheckCast()
        {
            Unit* caster = GetCaster();
            Unit* target = GetExplTargetUnit();

            if (!target || (!caster->HasAura(SPELL_PRIEST_ABSOLUTION) && caster != target && target->IsFriendlyTo(caster)))
                return SPELL_FAILED_BAD_TARGETS;
            return SPELL_CAST_OK;
        }
開發者ID:DSlayerMan,項目名稱:ArkCORE-NG,代碼行數:9,代碼來源:spell_priest.cpp

示例12: CheckCast

 SpellCastResult CheckCast()
 {
     if (Battlefield* wg = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG))
         if (Player* target = GetExplTargetUnit()->ToPlayer())
             // check if we are in Wintergrasp at all, SotA uses same teleport spells
             if ((target->GetZoneId() == 4197 && target->GetTeamId() != wg->GetDefenderTeam()) || target->HasAura(SPELL_WINTERGRASP_TELEPORT_TRIGGER))
                 return SPELL_FAILED_BAD_TARGETS;
     return SPELL_CAST_OK;
 }
開發者ID:AvariusProject,項目名稱:AvariusCore,代碼行數:9,代碼來源:zone_wintergrasp.cpp

示例13: CheckCast

            SpellCastResult CheckCast()
            {
                Unit* caster = GetCaster();
                if (Unit* target = GetExplTargetUnit())
                    if (caster == target)
                        if (target->HasAura(SPELL_PALADIN_FORBEARANCE) || target->HasAura(SPELL_PALADIN_IMMUNE_SHIELD_MARKER))
                            return SPELL_FAILED_TARGET_AURASTATE;

                return SPELL_CAST_OK;
            }
開發者ID:Regigicas,項目名稱:TrinityCore,代碼行數:10,代碼來源:spell_paladin.cpp

示例14: CheckTarget

            SpellCastResult CheckTarget()
            {
                if (IsVampire(GetExplTargetUnit()))
                {
                    SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_CANT_TARGET_VAMPIRES);
                    return SPELL_FAILED_CUSTOM_ERROR;
                }

                return SPELL_CAST_OK;
            }
開發者ID:Darkelmo,項目名稱:bliz,代碼行數:10,代碼來源:boss_blood_queen_lana_thel.cpp

示例15: CheckRequirement

            SpellCastResult CheckRequirement()
            {
                if (!GetCaster()->HasAura(GetSpellInfo()->Effects[EFFECT_1].CalcValue()))
                    return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; // This is actually correct

                if (!GetExplTargetUnit())
                    return SPELL_FAILED_BAD_TARGETS;

                return SPELL_CAST_OK;
            }
開發者ID:H4D3S,項目名稱:cataclysm,代碼行數:10,代碼來源:zone_dustwallow_marsh.cpp


注:本文中的GetExplTargetUnit函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。