Server.Poison.GetPoison C# (CSharp) Méthode

GetPoison() public static méthode

public static GetPoison ( int level ) : Poison
level int
Résultat Poison
        public static Poison GetPoison( int level )
        {
            for ( int i = 0; i < m_Poisons.Count; ++i )
            {
                Poison p = m_Poisons[i];

                if ( p.Level == level )
                    return p;
            }

            return null;
        }

Same methods

Poison::GetPoison ( string name ) : Poison

Usage Example

        public static void SpillAcid(Mobile from, bool yamandon)
        {
            ArrayList targets = GetAllAttackers(from, 2);

            if (yamandon)
            {
                targets.Add(from);
            }

            Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x3728, 8, 20, 76, 3, 5042, 0);

            if (targets.Count == 0)
            {
                return;
            }

            foreach (Mobile m in targets)
            {
                m.FixedParticles(0x374A, 10, 15, 5021, EffectLayer.Waist);
                m.PlaySound(0x474);

                if (yamandon)
                {
                    m.ApplyPoison(from, Poison.GetPoison(4));
                }
                else
                {
                    m.ApplyPoison(from, Poison.GetPoison(Utility.Random(5) - (from.GetDistanceToSqrt(m) > 1 ? 1 : 0)));
                }

                m.SendLocalizedMessage(1070820);                   // The creature spills a pool of acidic slime!
            }
        }
All Usage Examples Of Server.Poison::GetPoison