Server.Mobiles.PlayerMobile.ApplyPoison C# (CSharp) Method

ApplyPoison() public method

public ApplyPoison ( Mobile from, Poison poison ) : ApplyPoisonResult
from Mobile
poison Poison
return ApplyPoisonResult
        public override ApplyPoisonResult ApplyPoison(Mobile from, Poison poison)
        {
            if (!Alive)
                return ApplyPoisonResult.Immune;

            ApplyPoisonResult result = base.ApplyPoison(from, poison);

            if (from != null && result == ApplyPoisonResult.Poisoned && PoisonTimer is PoisonImpl.PoisonTimer)
                (PoisonTimer as PoisonImpl.PoisonTimer).From = from;

            return result;
        }

Usage Example

Example #1
0
        private void Teleport()
        {
            List <PlayerMobile> toTele = new List <PlayerMobile>();

            foreach (IDamageable target in SpellHelper.AcquireIndirectTargets(this, Location, Map, StrikingRange))
            {
                if (target is PlayerMobile mobile)
                {
                    toTele.Add(mobile);
                }
            }

            if (toTele.Count > 0)
            {
                PlayerMobile from = toTele[Utility.Random(toTele.Count)];

                if (from != null)
                {
                    Combatant = from;

                    from.MoveToWorld(GetSpawnPosition(1), Map);
                    from.FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist);
                    from.PlaySound(0x1FE);

                    from.ApplyPoison(this, HitPoison);
                }
            }

            ColUtility.Free(toTele);
            m_Teleport = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(40, 60));
        }
All Usage Examples Of Server.Mobiles.PlayerMobile::ApplyPoison