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

C++ GetExplTargetUnit函数代码示例

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

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



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


示例16: CheckCast

 SpellCastResult CheckCast()
 {
     Player* caster = GetCaster()->ToPlayer();
     if (Unit* target = GetExplTargetUnit())
         if (!caster->IsFriendlyTo(target))
         {
             if (!caster->IsValidAttackTarget(target))
                 return SPELL_FAILED_BAD_TARGETS;
             if (!caster->isInFront(target))
                 return SPELL_FAILED_UNIT_NOT_INFRONT;
         }
     return SPELL_CAST_OK;
 }
开发者ID:AwkwardDev,项目名称:RE,代码行数:13,代码来源:spell_priest.cpp


示例17: CheckCast

        SpellCastResult CheckCast()
        {
            Unit* caster = GetCaster();
            // Death Grip should not be castable while jumping/falling
            if (caster->HasUnitState(UNIT_STATE_JUMPING) || caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLING))
                return SPELL_FAILED_MOVING;

            // Patch 3.3.3 (2010-03-23): Minimum range has been changed to 8 yards in PvP.
            Unit* target = GetExplTargetUnit();
            if (target && target->GetTypeId() == TYPEID_PLAYER)
                if (caster->GetDistance(target) < 8.f)
                    return SPELL_FAILED_TOO_CLOSE;

            return SPELL_CAST_OK;
        }
开发者ID:DSlayerMan,项目名称:DraenorCore,代码行数:15,代码来源:spell_dk.cpp


示例18: CheckCast

            SpellCastResult CheckCast()
            {
                Unit* caster = GetCaster();
                if (Unit* target = GetExplTargetUnit())
                {
                    if (!caster->IsFriendlyTo(target) && !caster->isInFront(target))
                        return SPELL_FAILED_UNIT_NOT_INFRONT;

                    if (target->IsFriendlyTo(caster) && target->GetCreatureType() != CREATURE_TYPE_UNDEAD)
                        return SPELL_FAILED_BAD_TARGETS;
                }
                else
                    return SPELL_FAILED_BAD_TARGETS;

                return SPELL_CAST_OK;
            }
开发者ID:AlucardVoss,项目名称:Patchs,代码行数:16,代码来源:spell_dk.cpp


示例19: CheckCast

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

                if (Unit* target = GetExplTargetUnit())
                {
                    if (!target->IsFriendlyTo(caster) || target->getAttackers().empty())
                        return SPELL_FAILED_BAD_TARGETS;
                }
                else
                    return SPELL_FAILED_BAD_TARGETS;

                return SPELL_CAST_OK;
            }
开发者ID:Diyvol,项目名称:TrinityCore,代码行数:16,代码来源:spell_paladin.cpp


示例20: GetCaster

void HammerOfRighteousScript::HandleBeforeHit()
{
    Unit* caster = GetCaster();
    Unit* target = GetExplTargetUnit();

    if (!caster || !target)
        return;

    Aura* hammerJustice = target->GetAura(SPELL_HAMMER_JUSTICE_STUN);

    // Target isn't affected by HoJ so is able to pickup the Hammer
    if (!hammerJustice)
    {
        caster->CastSpell(target, SPELL_HAMMER_RIGHTEOUS_P);
        PreventHitDamage();
    }
}
开发者ID:Allowed,项目名称:Strawberry335,代码行数:17,代码来源:Spell_ArgentumChallenge.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GetExt函数代码示例发布时间:2022-05-30
下一篇:
C++ GetExitCodeThread函数代码示例发布时间: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