I bought the Magical Robe from Lucius outside The Palace Of Paroxysmus. It deleted when I entered the sinkhole (even though it has a lifespan).
How do I fix this where it doesn't delete when I enter the sinkhole?
Here's my script?
Code:
using System;

namespace Server.Items
{
    public class ParoxysmusTele : Teleporter
    {
        [Constructable]
        public ParoxysmusTele()
            : base(new Point3D(6222, 335, 60), Map.Trammel)
        {
        }

        public ParoxysmusTele(Serial serial)
            : base(serial)
        {
        }

        public override bool OnMoveOver(Mobile m)
        {
            if (m.NetState == null || !m.NetState.SupportsExpansion(Expansion.ML))
            {
                m.SendLocalizedMessage(1072608); // You must upgrade to the Mondain's Legacy expansion in order to enter here.               
                return true;
            }
            else if (!MondainsLegacy.PalaceOfParoxysmus && (int)m.AccessLevel < (int)AccessLevel.GameMaster)
            {
                m.SendLocalizedMessage(1042753, "Palace of Paroxysmus"); // ~1_SOMETHING~ has been temporarily disabled.
                return true;
            }
       
            if (m.Backpack != null)
            {
                Item rope = m.Backpack.FindItemByType(typeof(MagicalRope), true);
               
                if (rope == null)
                    rope = m.Backpack.FindItemByType(typeof(AcidProofRope), true);
           
                if (rope != null && !rope.Deleted)                   
                {
                    if (Utility.RandomDouble() < 0.3)
                    {
                        m.SendLocalizedMessage(1075097); // Your rope is severely damaged by the acidic environment.  You're lucky to have made it safely to the ground.
                        rope.Delete();
                    }
                    else
                        m.SendLocalizedMessage(1075098); // Your rope has been weakened by the acidic environment.
                   
                    return base.OnMoveOver(m);                   
                }
            }
            else
              //m.SendLocalizedMessage(1074272); // You have no way to lower yourself safely into the enormous sinkhole.
                m.SendMessage("You have no way to lower yourself safely through the enormous sinkhole!");               
            return true;   
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
           
            int version = reader.ReadInt();
        }
    }

    public class ParoxysmusTeleFel : Teleporter
    {
        [Constructable]
        public ParoxysmusTeleFel()
            : base(new Point3D(6222, 335, 60), Map.Felucca)
        {
        }

        public ParoxysmusTeleFel(Serial serial)
            : base(serial)
        {
        }

        public override bool OnMoveOver(Mobile m)
        {
            if (m.NetState == null || !m.NetState.SupportsExpansion(Expansion.ML))
            {
                m.SendLocalizedMessage(1072608); // You must upgrade to the Mondain's Legacy expansion in order to enter here.               
                return true;
            }
            else if (!MondainsLegacy.PalaceOfParoxysmus && (int)m.AccessLevel < (int)AccessLevel.GameMaster)
            {
                m.SendLocalizedMessage(1042753, "Palace of Paroxysmus"); // ~1_SOMETHING~ has been temporarily disabled.
                return true;
            }

            if (m.Backpack != null)
            {
                Item rope = m.Backpack.FindItemByType(typeof(MagicalRope), true);

                if (rope == null)
                    rope = m.Backpack.FindItemByType(typeof(AcidProofRope), true);

                if (rope != null && !rope.Deleted)
                {
                    if (Utility.RandomDouble() < 0.3)
                    {
                        m.SendLocalizedMessage(1075097); // Your rope is severely damaged by the acidic environment.  You're lucky to have made it safely to the ground.
                        rope.Delete();
                    }
                    else
                        m.SendLocalizedMessage(1075098); // Your rope has been weakened by the acidic environment.

                    return base.OnMoveOver(m);
                }
            }
            else
                //m.SendLocalizedMessage(1074272); // You have no way to lower yourself safely into the enormous sinkhole.
                        m.SendMessage("You have no way to lower yourself safely through the enormous sinkhole!");
            return true;
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }
}
 
  • if (rope != null && !rope.Deleted)
  • {
  • m.SendLocalizedMessage(1075098); // Your rope has been weakened by the acidic environment.
  • return base.OnMoveOver(m);
  • }
  • }
  • else
  • //m.SendLocalizedMessage(1074272); // You have no way to lower yourself safely into the enormous sinkhole.
  • m.SendMessage("You have no way to lower yourself safely through the enormous sinkhole!");
  • return true;
  • }

Removed this part:

  1. if (Utility.RandomDouble() < 0.3)
  2. {
  3. m.SendLocalizedMessage(1075097); // Your rope is severely damaged by the acidic environment. You're lucky to have made it safely to the ground.
  4. rope.Delete();
  5. }

Though you might consider leaving it in and changing the RandomDouble so that the rope gets deleted less frequently so that you don't eventually end up with a ton of ropes laying about.
 
Back