本文整理汇总了C#中Spell.GetAuraUID方法的典型用法代码示例。如果您正苦于以下问题:C# Spell.GetAuraUID方法的具体用法?C# Spell.GetAuraUID怎么用?C# Spell.GetAuraUID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Spell
的用法示例。
在下文中一共展示了Spell.GetAuraUID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddAura
/// <summary>
/// Applies the given spell as a buff or debuff.
/// Also initializes the new Aura.
/// </summary>
/// <returns>null if Spell is not an Aura</returns>
public Aura AddAura(CasterInfo caster, Spell spell, bool noTimeout)
{
try
{
var beneficial = spell.IsBeneficialFor(caster, m_owner);
var id = spell.GetAuraUID(beneficial);
var err = SpellFailedReason.Ok;
// check for existing auras & stacking
var oldAura = GetAura(caster, id, spell);
if (oldAura != null)
{
if (!CheckStackOrOverride(oldAura, caster, spell, ref err))
{
if (err == SpellFailedReason.Ok)
{
// Stacked
return oldAura;
}
if (caster.Caster is Character)
{
SpellHandler.SendCastFailed((Character)caster.Caster, 0, spell, err);
}
return null;
}
}
// create new Aura
var handlers = AuraHandler.CreateEffectHandlers(spell, caster, m_owner, beneficial);
if (handlers != null)
{
var aura = AddAura(caster, spell, handlers, beneficial);
if (aura != null)
{
aura.Start(null, noTimeout);
}
return aura;
}
}
catch (Exception ex)
{
LogUtil.ErrorException(ex, "Unable to Add Aura {0} to {1}", spell, m_owner);
}
return null;
}