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

C++ GetUnitOwner函数代码示例

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

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



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

示例1: HandlePeriodic

 void HandlePeriodic(AuraEffect const* aurEff)
 {
     PreventDefaultAction();
     if (aurEff->GetAmount() <= 0)
     {
         Unit* target = GetTarget();
         uint32 spellId = SPELL_HUNTER_SNIPER_TRAINING_BUFF_R1 + GetId() - SPELL_HUNTER_SNIPER_TRAINING_R1;
         target->CastSpell(target, spellId, true, 0, aurEff);
         if (Player* playerTarget = GetUnitOwner()->ToPlayer())
         {
             int32 baseAmount = aurEff->GetBaseAmount();
             int32 amount = playerTarget->CalculateSpellDamage(playerTarget, GetSpellInfo(), aurEff->GetEffIndex(), &baseAmount);
             GetEffect(EFFECT_0)->SetAmount(amount);
         }
     }
 }
开发者ID:AwkwardDev,项目名称:TinyCore,代码行数:16,代码来源:spell_hunter.cpp


示例2: CalculateDamageDoneAmount

        void CalculateDamageDoneAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
        {
            if (Unit* pet = GetUnitOwner())
                if (pet->IsPet())
                    if (Unit* owner = pet->ToPet()->GetOwner())
                    {
                        //the damage bonus used for pets is either fire or shadow damage, whatever is higher
                        int32 fire  = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE);
                        int32 shadow = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_SHADOW);
                        int32 maximum  = (fire > shadow) ? fire : shadow;
                        float bonusDamage = 0.0f;

                        if (maximum > 0)
                            bonusDamage = maximum * 0.15f;

                        amount += bonusDamage;
                    }
        }
开发者ID:redlaine,项目名称:InfinityCore-Ark,代码行数:18,代码来源:spell_pet.cpp


示例3: CalculateAmountExpertise

        void CalculateAmountExpertise(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
        {
            if (Pet* pPet = GetUnitOwner()->ToPet())
            {
                if (pPet->GetOwnerScaling())
                {
                    float bonus = 0.0f;
                    float hitchance = std::max(pPet->GetOwnerScaling()->CalculateScaling(STAT_IDENTIFIER_COMBAT_RATING, CR_HIT_MELEE, pPet->GetOwnerCombatRating(CR_HIT_MELEE)),
                                               pPet->GetOwnerScaling()->CalculateScaling(STAT_IDENTIFIER_COMBAT_RATING, CR_HIT_SPELL, pPet->GetOwnerCombatRating(CR_HIT_SPELL)));

                    // Expertise should be at max if player has hit cap
                    if (hitchance >= PetSpellHitCapPct)
                        bonus = pPet->GetOwnerScaling()->CalculateScaling(STAT_IDENTIFIER_COMBAT_RATING, CR_EXPERTISE, 60.0f);
                    else
                        bonus = pPet->GetOwnerScaling()->CalculateScaling(STAT_IDENTIFIER_COMBAT_RATING, CR_EXPERTISE, pPet->GetOwnerCombatRating(CR_EXPERTISE));

                    amount += int32(bonus);
                }
            }
        }
开发者ID:Allowed,项目名称:Strawberry335,代码行数:20,代码来源:spell_pet.cpp


示例4: CalculateAmount

            void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& canBeRecalculated)
            {
                if (Unit* caster = GetCaster())
                {
                    canBeRecalculated = false;

                    // $0.2 * (($MWB + $mwb) / 2 + $AP / 14 * $MWS) bonus per tick
                    float ap = caster->GetTotalAttackPowerValue(BASE_ATTACK);
                    int32 mws = caster->GetAttackTime(BASE_ATTACK);
                    float mwbMin = caster->GetWeaponDamageRange(BASE_ATTACK, MINDAMAGE);
                    float mwbMax = caster->GetWeaponDamageRange(BASE_ATTACK, MAXDAMAGE);
                    float mwb = ((mwbMin + mwbMax) / 2 + ap * mws / 14000) * 0.2f;
                    amount += int32(caster->ApplyEffectModifiers(GetSpellInfo(), aurEff->GetEffIndex(), mwb));

                    // "If used while your target is above 75% health, Rend does 35% more damage."
                    // as for 3.1.3 only ranks above 9 (wrong tooltip?)
                    if (GetSpellInfo()->GetRank() >= 9)
                    {
                        if (GetUnitOwner()->HasAuraState(AURA_STATE_HEALTH_ABOVE_75_PERCENT, GetSpellInfo(), caster))
                            AddPct(amount, GetSpellInfo()->Effects[EFFECT_2].CalcValue(caster));
                    }
                }
            }
开发者ID:GlassFace,项目名称:XC_CORE,代码行数:23,代码来源:spell_warrior.cpp


示例5: CalculateStrengthAmount

            void CalculateStrengthAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
            {
                if (Guardian* pPet = GetUnitOwner()->ToGuardian())
                {
                    if (Player* pPlayerOwner = pPet->GetOwner()->ToPlayer())
                    {
                        float add = 0.0f;
                        float bonusStr = 0.0f;

                        if (Aura* pAura = pPlayerOwner->GetAuraOfRankedSpell(TALENT_DK_RAVENOUS_DEAD))
                            add += pAura->GetSpellInfo()->Effects[EFFECT_1].BasePoints;

                        if (const AuraEffect* pAuraEffect = pPlayerOwner->GetAuraEffect(GLYPH_DK_GLYPH_OF_GHOUL, EFFECT_0))
                            add += pAuraEffect->GetAmount();

                        if (pPet->GetOwnerScaling())
                            bonusStr = pPet->GetOwnerScaling()->CalculateScaling(STAT_IDENTIFIER_UNIT_MOD, UNIT_MOD_STAT_STRENGTH,
                                                                                    pPet->GetOwnerStat(STAT_STRENGTH), add);

                        amount += int32(bonusStr);
                    }
                }
            }
开发者ID:Allowed,项目名称:Strawberry335,代码行数:23,代码来源:spell_pet.cpp


示例6: HandleDispel

            void HandleDispel(DispelInfo* dispelInfo)
            {
                if (Unit* target = GetUnitOwner())
                {
                    if (AuraEffect const* aurEff = GetEffect(EFFECT_1))
                    {
                        // final heal
                        int32 healAmount = aurEff->GetAmount();
                        if (Unit* caster = GetCaster())
                        {
                            healAmount = caster->SpellHealingBonusDone(target, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges());
                            healAmount = target->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges());
                            target->CastCustomSpell(target, SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID());

                            // restore mana
                            int32 returnMana = CalculatePct(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * dispelInfo->GetRemovedCharges() / 2;
                            caster->CastCustomSpell(caster, SPELL_DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, NULL, GetCasterGUID());
                            return;
                        }

                        target->CastCustomSpell(target, SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID());
                    }
                }
            }
开发者ID:Hlkz2,项目名称:ACoreOld,代码行数:24,代码来源:spell_druid.cpp


示例7: CalculateAmount

 void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
 {
     amount = GetUnitOwner()->CountPctFromMaxHealth(amount);
 }
开发者ID:AlucardVoss,项目名称:Patchs,代码行数:4,代码来源:spell_dk.cpp


示例8: Load

 bool Load()
 {
     absorbChance = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0);
     return GetUnitOwner()->ToPlayer();
 }
开发者ID:antiker,项目名称:StarGateEmu-v5.x.x,代码行数:5,代码来源:spell_rogue.cpp


示例9: Load

 bool Load()
 {
     healPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_1);
     absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0);
     return GetUnitOwner()->ToPlayer();
 }
开发者ID:AwkwardDev,项目名称:StrawberryCore,代码行数:6,代码来源:spell_paladin.cpp


示例10: OnApply

 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
 {
     // Remove all auras with spell id 46221, except the one currently being applied
     while (Aura* aur = GetUnitOwner()->GetOwnedAura(SPELL_ANIMAL_BLOOD, 0, 0, 0, GetAura()))
         GetUnitOwner()->RemoveOwnedAura(aur);
 }
开发者ID:Bootz,项目名称:T-Core,代码行数:6,代码来源:spell_generic.cpp


示例11: HandlePeriodic

 void HandlePeriodic(AuraEffect const* aurEff)
 {
     PreventDefaultAction();
     GetUnitOwner()->CastSpell(GetUnitOwner(), RAND(SPELL_DUSTIN_UNDEAD_DRAGON_VISUAL1, SPELL_DUSTIN_UNDEAD_DRAGON_VISUAL2), true);
 }
开发者ID:AzerothShard-Dev,项目名称:azerothcore,代码行数:5,代码来源:zone_terokkar_forest.cpp


示例12: CalculateAmount

 void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
 {
     amount = CalculatePct(int32(GetUnitOwner()->GetCreatePowers(POWER_MANA) / aurEff->GetTotalTicks()), amount);
 }
开发者ID:Hlkz2,项目名称:ACoreOld,代码行数:4,代码来源:spell_druid.cpp


示例13: Absorb

            void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & /*absorbAmount*/)
            {
                if (Unit* owner = GetUnitOwner())
                {
                    if (dmgInfo.GetSpellInfo())
                    {
                        if (uint32 poweringUp = sSpellMgr->GetSpellIdForDifficulty(SPELL_POWERING_UP, owner))
                        {
                            if (urand(0, 99) < 5)
                                GetTarget()->CastSpell(GetTarget(), spellId, true);

                            // Twin Vortex part
                            uint32 lightVortex = sSpellMgr->GetSpellIdForDifficulty(SPELL_LIGHT_VORTEX_DAMAGE, owner);
                            uint32 darkVortex = sSpellMgr->GetSpellIdForDifficulty(SPELL_DARK_VORTEX_DAMAGE, owner);
                            int32 stacksCount = int32(dmgInfo.GetSpellInfo()->Effects[EFFECT_0].CalcValue()) * 0.001 - 1;

                            if (lightVortex && darkVortex && stacksCount)
                            {
                                if (dmgInfo.GetSpellInfo()->Id == darkVortex || dmgInfo.GetSpellInfo()->Id == lightVortex)
                                {
                                    Aura* pAura = owner->GetAura(poweringUp);
                                    if (pAura)
                                    {
                                        pAura->ModStackAmount(stacksCount);
                                        owner->CastSpell(owner, poweringUp, true);
                                    }
                                    else
                                    {
                                        owner->CastSpell(owner, poweringUp, true);
                                        if (Aura* pTemp = owner->GetAura(poweringUp))
                                            pTemp->ModStackAmount(stacksCount);
                                    }
                                }
                            }

                            // Picking floating balls
                            uint32 unleashedDark = sSpellMgr->GetSpellIdForDifficulty(SPELL_UNLEASHED_DARK, owner);
                            uint32 unleashedLight = sSpellMgr->GetSpellIdForDifficulty(SPELL_UNLEASHED_LIGHT, owner);

                            if (unleashedDark && unleashedLight)
                            {
                                if (dmgInfo.GetSpellInfo()->Id == unleashedDark || dmgInfo.GetSpellInfo()->Id == unleashedLight)
                                {
                                    // need to do the things in this order, else players might have 100 charges of Powering Up without anything happening
                                    Aura* pAura = owner->GetAura(poweringUp);
                                    if (pAura)
                                    {
                                        // 2 lines together add the correct amount of buff stacks
                                        pAura->ModStackAmount(stacksCount);
                                        owner->CastSpell(owner, poweringUp, true);
                                    }
                                    else
                                    {
                                        owner->CastSpell(owner, poweringUp, true);
                                        if (Aura* pTemp = owner->GetAura(poweringUp))
                                            pTemp->ModStackAmount(stacksCount);
                                    }
                                }
                            }
                        }
                    }
                }
            }
开发者ID:janus18,项目名称:TrinityCore,代码行数:63,代码来源:boss_twin_valkyr.cpp


示例14: OnRemove

 void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
 {
     if (GetUnitOwner()->GetAuraCount(GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell) == 5)
         GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_STONED, true);
 }
开发者ID:lineagedr,项目名称:azerothcore-wotlk,代码行数:5,代码来源:boss_gruul.cpp


示例15: Load

 bool Load()
 {
     healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue();
     absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue();
     return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER;
 }
开发者ID:ReluctantX,项目名称:TrinityCore,代码行数:6,代码来源:spell_paladin.cpp


示例16: OnPeriodic

 void OnPeriodic(AuraEffect const* /*aurEffect*/)
 {
     PreventDefaultAction();
     GetUnitOwner()->CastSpell(GetUnitOwner(), RandomBeam[urand(0, 3)], true);
 }
开发者ID:090809,项目名称:TrinityCore,代码行数:5,代码来源:boss_mother_shahraz.cpp


示例17: Load

 bool Load() override
 {
     // 6.x has basepoint = 0 !
     absorbChance = GetSpellInfo()->GetEffect(EFFECT_0)->CalcValue();
     return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER;
 }
开发者ID:090809,项目名称:TrinityCore,代码行数:6,代码来源:spell_rogue.cpp


示例18: Load

 bool Load() override
 {
     return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER;
 }
开发者ID:Brokentrojan,项目名称:ngen,代码行数:4,代码来源:spell_holiday.cpp


示例19: OnRemove

 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
 {
     if (GetUnitOwner()->IsInWater())
         GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SPAWN_BLOOD_POOL, true);
 }
开发者ID:Bootz,项目名称:T-Core,代码行数:5,代码来源:spell_generic.cpp


示例20: OnApply

			void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
            {
				int32 duration = urand(15,60);
				if (GetUnitOwner()->HasAura(SPELL_SEARING_SEEDS))
					GetUnitOwner()->GetAura(SPELL_SEARING_SEEDS)->SetDuration(duration*IN_MILLISECONDS);
            }
开发者ID:Jildor,项目名称:4.3.4-Core,代码行数:6,代码来源:boss_majordomostaghelm.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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