コード例 #1
0
ファイル: BeetleDung.cs プロジェクト: zerodowned/UO-Forever
        public override void OnMovement(Mobile m, Point3D oldLocation)
        {
            base.OnMovement(m, oldLocation);

            if (m == null || m.Deleted || m == Beetle || !m.Alive || !m.InRange3D(this, 1, -5, 5) ||
                (Beetle != null && !Beetle.CanBeHarmful(m)))
            {
                return;
            }

            if (Beetle != null)
            {
                Beetle.DoHarmful(m, true);
            }

            if (m is BaseCreature && m.IsControlled())
            {
                m.Damage(25);
            }
            else if (m is PlayerMobile)
            {
                m.Damage(1);
            }

            if (m.Poisoned)
            {
                return;
            }

            if (m is PlayerMobile)
            {
                m.ApplyPoison(Beetle ?? m, Poison.Deadly);
            }
            else if (m is BaseCreature)
            {
                m.ApplyPoison(Beetle ?? m, Poison.Lethal);
            }
        }