本文整理汇总了C++中Aura::GetMaxDuration方法的典型用法代码示例。如果您正苦于以下问题:C++ Aura::GetMaxDuration方法的具体用法?C++ Aura::GetMaxDuration怎么用?C++ Aura::GetMaxDuration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aura
的用法示例。
在下文中一共展示了Aura::GetMaxDuration方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnHitTarget
void OnHitTarget(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
Unit* target = GetHitUnit();
Aura* aura = target->GetAura(SPELL_WARLOCK_UNSTABLE_AFFLICTION, caster->GetGUID());
if (!aura)
aura = target->GetAura(SPELL_WARLOCK_IMMOLATE, caster->GetGUID());
if (!aura)
return;
int32 newDuration = aura->GetDuration() + GetSpellInfo()->Effects[EFFECT_1].CalcValue() * 1000;
aura->SetDuration(std::min(newDuration, aura->GetMaxDuration()));
}
示例2: HandleScriptEffect
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
if (Unit* unitTarget = GetHitUnit())
if (AuraEffect const* aurEff = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, flag128(0x2, 0, 0), caster->GetGUID()))
{
Aura* aura = aurEff->GetBase();
uint32 countMin = aura->GetMaxDuration();
uint32 countMax = aura->GetSpellInfo()->GetMaxDuration() + 9000;
if (caster->HasAura(SPELL_DRUID_INCREASED_MOONFIRE_DURATION))
countMax += 3000;
if (countMin < countMax)
{
aura->SetDuration(uint32(aura->GetDuration() + 3000));
aura->SetMaxDuration(countMin + 3000);
}
}
}
示例3: HandleProc
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
Unit* target = eventInfo.GetProcTarget();
// try to find spell Flame Shock on the target
AuraEffect* flameShock = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_SHAMAN, flag128(0x10000000), caster->GetGUID());
if (!flameShock)
return;
Aura* flameShockAura = flameShock->GetBase();
int32 maxDuration = flameShockAura->GetMaxDuration();
int32 newDuration = flameShockAura->GetDuration() + aurEff->GetAmount() * IN_MILLISECONDS;
flameShockAura->SetDuration(newDuration);
// is it blizzlike to change max duration for FS?
if (newDuration > maxDuration)
flameShockAura->SetMaxDuration(newDuration);
}