OpenNos.GameObject.Character.AddBuff(Buff, bool)

Here are the examples of the csharp api class OpenNos.GameObject.Character.AddBuff(Buff, bool) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

3 Examples 7

1. Example

Project: OpenNos
Source File: Character.cs
View license
public void AddStaticBuff(StaticBuffDTO staticBuff)
        {
            Buff bf = new Buff(staticB/n ..... /n //View Source file for more details /n }

2. Example

Project: OpenNos
Source File: Character.cs
View license
public void AddBuff(Buff indicator, bool notify = true)
        {
            if (indicator?.Card == null)
            {
                return;
            }
            if (!notify && Buff.Any(s => s.Card.CardId == indicator.Card.CardId))
            {
                return;
            }
            Buff = Buff.Replace(s => !s.Card.CardId.Equals(indicator.Card.CardId));
            indicator.RemainingTime = indicator.Card.Duration;
            indicator.Start = DateTime.Now;
            Buff.Add(indicator);

            Session.SendPacket($"bf 1 {Session.Character.CharacterId} 0.{indicator.Card.CardId}.{indicator.RemainingTime} {Level}");
            Session.SendPacket(Session.Character.GenerateSay(string.Format(Language.Instance.GetMessageFromKey("UNDER_EFFECT"), indicator.Card.Name), 20));

            indicator.Card.BCards.ForEach(c => c.ApplyBCards(Session.Character));

            if (indicator.Card.EffectId > 0)
            {
                GenerateEff(indicator.Card.EffectId);
            }

            Observable.Timer(TimeSpan.FromMilliseconds(indicator.Card.Duration * 100)).Subscribe(o =>
            {
                RemoveBuff(indicator.Card.CardId);
                if (indicator.Card.TimeoutBuff != 0 && ServerManager.Instance.RandomNumber() < indicator.Card.TimeoutBuffChance)
                {
                    AddBuff(new Buff(indicator.Card.TimeoutBuff, Level));
                }
            });
        }

3. Example

Project: OpenNos
Source File: Character.cs
View license
public void CharacterLife()
        {
            bool change = false;
            if (Hp == 0 && La/n ..... /n //View Source file for more details /n }