本文整理汇总了C#中Server.BuffInfo类的典型用法代码示例。如果您正苦于以下问题:C# BuffInfo类的具体用法?C# BuffInfo怎么用?C# BuffInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BuffInfo类属于Server命名空间,在下文中一共展示了BuffInfo类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnEnter
public override void OnEnter( Mobile m )
{
base.OnEnter( m );
if ( m is PlayerMobile )
{
PlayerMobile player = (PlayerMobile) m;
for ( int i = 0; i < player.Quests.Count; i ++ )
{
BaseQuest quest = player.Quests[ i ];
for ( int j = 0; j < quest.Objectives.Count; j ++ )
{
BaseObjective objective = quest.Objectives[ j ];
if ( objective is ApprenticeObjective && !objective.Completed )
{
ApprenticeObjective apprentice = (ApprenticeObjective) objective;
if ( IsPartOf( apprentice.Region ) )
{
if ( apprentice.Enter is int )
player.SendLocalizedMessage( (int) apprentice.Enter );
else if ( apprentice.Enter is string )
player.SendMessage( (string) apprentice.Enter );
BuffInfo info = new BuffInfo(BuffIcon.ArcaneEmpowerment, 1078511, 1078512, apprentice.Skill.ToString()); // Accelerated Skillgain Skill: ~1_val~
BuffInfo.AddBuff( m, info );
m_Table[ m ] = info;
}
}
}
}
}
}
示例2: RemoveBuff
public void RemoveBuff(BuffInfo b)
{
if (b == null)
return;
RemoveBuff(b.ID);
}
示例3: AddBuff
public void AddBuff(BuffInfo b)
{
if (!BuffInfo.Enabled || b == null)
return;
RemoveBuff(b); //Check & subsequently remove the old one.
if (m_BuffTable == null)
m_BuffTable = new Dictionary<BuffIcon, BuffInfo>();
m_BuffTable.Add(b.ID, b);
NetState state = this.NetState;
if (state != null && state.Version >= BuffInfo.RequiredClient)
{
state.Send(new AddBuffPacket(this, b));
}
}
示例4: AddBuffPacket
public AddBuffPacket( Mobile m, BuffInfo info )
: this(m, info.ID, info.TitleCliloc, info.SecondaryCliloc, info.Args, (info.TimeStart != DateTime.MinValue) ? ((info.TimeStart + info.TimeLength) - DateTime.Now) : TimeSpan.Zero)
{
}
示例5: RemoveBuffPacket
public RemoveBuffPacket( Mobile mob, BuffInfo info )
: this(mob, info.ID)
{
}
示例6: RemoveBuff
public static void RemoveBuff( Mobile m, BuffInfo b )
{
PlayerMobile pm = m as PlayerMobile;
if( pm != null )
pm.RemoveBuff( b );
}
示例7: ApplyEffect
public void ApplyEffect(FoodEffect effect, Boolean silent)
{
if (FoodEffectsCore.Core == null || !FoodEffectsCore.Core.Enabled || !Core.AOS)
{
EffectExpired(true);
return;
}
if (LinkedMobile != null)
{
if (m_Timer != null)
{
m_Timer.Stop();
m_Timer = null;
}
LinkedMobile.RemoveStatMod("Food-StrBonus");
LinkedMobile.RemoveStatMod("Food-DexBonus");
LinkedMobile.RemoveStatMod("Food-IntBonus");
if (m_BuffInfo != null)
BuffInfo.RemoveBuff(LinkedMobile, m_BuffInfo);
if (m_FoodEffect != null)
FoodEffectsCore.InvokeOnEffectCanceled(LinkedMobile, m_FoodEffect);
m_FoodEffect = new FoodEffect(effect.RegenHits, effect.RegenStam, effect.RegenMana, effect.StrBonus, effect.DexBonus, effect.IntBonus, effect.Duration);
if (m_FoodEffect.StrBonus != 0)
LinkedMobile.AddStatMod(new StatMod(StatType.Str, "Food-StrBonus", m_FoodEffect.StrBonus, m_FoodEffect.EffectTimeSpan));
if (m_FoodEffect.DexBonus != 0)
LinkedMobile.AddStatMod(new StatMod(StatType.Dex, "Food-DexBonus", m_FoodEffect.DexBonus, m_FoodEffect.EffectTimeSpan));
if (m_FoodEffect.IntBonus != 0)
LinkedMobile.AddStatMod(new StatMod(StatType.Int, "Food-IntBonus", m_FoodEffect.IntBonus, m_FoodEffect.EffectTimeSpan));
if (!silent)
{
LinkedMobile.FixedEffect(0x375A, 10, 15);
LinkedMobile.PlaySound(0x1EE);
LinkedMobile.SendMessage(12, "The food you ate is now affecting your performance...");
}
m_Timer = new EffectTimer(this);
FoodEffectsCore.InvokeOnEffectActivated(LinkedMobile, m_FoodEffect);
m_BuffInfo = new BuffInfo(BuffIcon.ActiveMeditation, 1074240, 1114057, m_FoodEffect.EffectTimeSpan, LinkedMobile, m_FoodEffect.GetBuffInfoText());
BuffInfo.AddBuff(LinkedMobile, m_BuffInfo);
}
}
示例8: AddBuff
public static void AddBuff(Mobile m, BuffInfo b)
{
var pm = m as PlayerMobile;
if (pm != null)
{
pm.AddBuff(b);
}
}
示例9: AddBuff
public void AddBuff(BuffInfo b)
{
if (!BuffInfo.Enabled || b == null)
{
return;
}
RemoveBuff(b); //Check & subsequently remove the old one.
if (m_BuffTable == null)
{
m_BuffTable = new Dictionary<BuffIcon, BuffInfo>();
}
m_BuffTable.Add(b.ID, b);
NetState state = NetState;
if (state != null && state.BuffIcon)
{
state.Send(new AddBuffPacket(this, b));
}
}