本文整理汇总了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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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);
}