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


C++ DamageInfo::GetAttacker方法代码示例

本文整理汇总了C++中DamageInfo::GetAttacker方法的典型用法代码示例。如果您正苦于以下问题:C++ DamageInfo::GetAttacker方法的具体用法?C++ DamageInfo::GetAttacker怎么用?C++ DamageInfo::GetAttacker使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DamageInfo的用法示例。


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

示例1: OnAbsorb

            void OnAbsorb(AuraEffect* aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount)
            {
                Unit* target = GetTarget();
                if (dmgInfo.GetAttacker() == target)
                    return;

                int32 bp = absorbAmount / 2;
                target->CastCustomSpell(dmgInfo.GetAttacker(), SPELL_REFLECTIVE_SHIELD_DAMAGE, &bp, nullptr, nullptr, true, nullptr, aurEff);
            }
开发者ID:martial69320,项目名称:cerberus,代码行数:9,代码来源:boss_illidari_council.cpp

示例2: ReflectDamage

            void ReflectDamage(AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& absorbAmount)
            {
                Unit* target = GetTarget();
                if (dmgInfo.GetAttacker() == target)
                    return;

                if (AuraEffect const* talentAurEff = target->GetAuraEffectOfRankedSpell(SPELL_PRIEST_REFLECTIVE_SHIELD_R1, EFFECT_0))
                {
                    int32 bp = CalculatePct(absorbAmount, talentAurEff->GetAmount());
                    target->CastCustomSpell(dmgInfo.GetAttacker(), SPELL_PRIEST_REFLECTIVE_SHIELD_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff);
                }
            }
开发者ID:DSlayerMan,项目名称:ArkCORE-NG,代码行数:12,代码来源:spell_priest.cpp

示例3: Trigger

            void Trigger(AuraEffect* aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount)
            {
                Unit* target = GetTarget();
                if (dmgInfo.GetAttacker() == target)
                    return;

                Unit* caster = GetCaster();
                if (!caster)
                    return;

                    if (AuraEffect* talentAurEff = target->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 4880, EFFECT_0)) 
                    {
                        int32 bp = CalculatePct(absorbAmount, talentAurEff->GetAmount());
                        target->CastCustomSpell(dmgInfo.GetAttacker(), SPELL_PRIEST_REFLECTIVE_SHIELD_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff);
                    }
            }
开发者ID:H4D3S,项目名称:cataclysm,代码行数:16,代码来源:spell_priest.cpp

示例4: Trigger

 void Trigger(AuraEffect * aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount)
 {
     Unit * target = dmgInfo.GetAttacker();
     if (!target)
         return;
     Unit * caster = GetCaster();
     if (!caster)
         return;
     int32 bp = CalculatePct(absorbAmount, 25);
     target->CastCustomSpell(target, SPELL_REFLECTIVE_SHIELD_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff);
 }
开发者ID:mynew3,项目名称:Trinity-Core,代码行数:11,代码来源:boss_argent_challenge.cpp

示例5: HandleOnEffectAbsorb

void ShieldScript::HandleOnEffectAbsorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
{
    Unit* caster = GetCaster();
    Unit* attacker = dmgInfo.GetAttacker();

    if (!caster || !attacker)
        return;

    absorbAmount = dmgInfo.GetDamage();

    // Deal the damage and show it on caster's log
    caster->DealDamage(attacker, (uint32)(absorbAmount*0.25f), NULL, dmgInfo.GetDamageType(), dmgInfo.GetSchoolMask());
    caster->SendSpellNonMeleeDamageLog(attacker, GetSpellInfo()->Id, (uint32) (absorbAmount*0.25f),  dmgInfo.GetSchoolMask(), 0, 0, true, 0);
}
开发者ID:Allowed,项目名称:Strawberry335,代码行数:14,代码来源:Spell_ArgentumChallenge.cpp


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