本文整理汇总了C++中DamageInfo::GetSpellInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ DamageInfo::GetSpellInfo方法的具体用法?C++ DamageInfo::GetSpellInfo怎么用?C++ DamageInfo::GetSpellInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DamageInfo
的用法示例。
在下文中一共展示了DamageInfo::GetSpellInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CheckProc
bool CheckProc(ProcEventInfo& eventInfo)
{
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
if (!damageInfo || !damageInfo->GetSpellInfo())
return false;
return true;
}
示例2: Absorb
void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & /*absorbAmount*/)
{
if (Unit* owner = GetUnitOwner())
{
if (dmgInfo.GetSpellInfo())
{
if (urand(0, 99) < 5)
GetTarget()->CastSpell(GetTarget(), spellId, true);
// Twin Vortex part
uint32 lightVortex = SPELL_LIGHT_VORTEX_DAMAGE;
uint32 darkVortex = SPELL_DARK_VORTEX_DAMAGE;
int32 stacksCount = dmgInfo.GetSpellInfo()->GetEffect(EFFECT_0)->CalcValue() / 1000 - 1;
if (lightVortex && darkVortex && stacksCount)
{
if (dmgInfo.GetSpellInfo()->Id == darkVortex || dmgInfo.GetSpellInfo()->Id == lightVortex)
{
Aura* pAura = owner->GetAura(SPELL_POWERING_UP);
if (pAura)
{
pAura->ModStackAmount(stacksCount);
owner->CastSpell(owner, SPELL_POWERING_UP, true);
}
else
{
owner->CastSpell(owner, SPELL_POWERING_UP, true);
if (Aura* pTemp = owner->GetAura(SPELL_POWERING_UP))
pTemp->ModStackAmount(stacksCount);
}
}
}
// Picking floating balls
uint32 unleashedDark = SPELL_UNLEASHED_DARK;
uint32 unleashedLight = SPELL_UNLEASHED_LIGHT;
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(SPELL_POWERING_UP);
if (pAura)
{
// 2 lines together add the correct amount of buff stacks
pAura->ModStackAmount(stacksCount);
owner->CastSpell(owner, SPELL_POWERING_UP, true);
}
else
{
owner->CastSpell(owner, SPELL_POWERING_UP, true);
if (Aura* pTemp = owner->GetAura(SPELL_POWERING_UP))
pTemp->ModStackAmount(stacksCount);
}
}
}
}
}
}