CanSwim,CantWalk,unable.

Lemke

Squire
Sep 26, 2015
138
15
18
38
Hello guys,trying to do an shroud to get players walking in water,loading well,but no results,any advice?
Here the script:

C#:
using System;
using Server.Network;
using Server.Items;
using Server.Targeting;

namespace Server.Items
{
    public class MarineShroud : HoodedShroudOfShadows
  {

        public override int InitMinHits{ get{ return 255; } }
        public override int InitMaxHits{ get{ return 255; } }

      
      [Constructable]
        public MarineShroud()
        {
            Weight = 5;
          Name = "Marine Shroud";
          
        }

        public override bool OnEquip(Mobile m)
          {
            m.CantWalk = true;
            m.CanSwim = true;
            return base.OnEquip(m);
          }
        
        public override void OnRemoved( object parent)
          {
        if (parent is Mobile)
            {
             Mobile m = (Mobile)parent;
             m.CantWalk = false;
             m.CanSwim = false;
            }

             base.OnRemoved(parent);
          }

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

        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();
        }
    }
}
 

Falkor

Squire
Apr 11, 2018
298
105
43
wpshard.com
Shard Name
Whispering Pines
You can't do it. The client has the final decision and it won't allow the human form to move on water no matter what you do on the server side.

The closest you can do to this is make seahorses available (regular and/or ethereal) and players would still require your custom item to be able to move on water. Seahorses can walk on water but can't move an inch once mounted by a player who doesn't have the canswim flag set. Ditch the "cantwalk" part though - you'll find it makes getting into and out of the water much more difficult.
 
  • Like
Reactions: Lemke

Lemke

Squire
Sep 26, 2015
138
15
18
38
You can't do it. The client has the final decision and it won't allow the human form to move on water no matter what you do on the server side.

The closest you can do to this is make seahorses available (regular and/or ethereal) and players would still require your custom item to be able to move on water. Seahorses can walk on water but can't move an inch once mounted by a player who doesn't have the canswim flag set. Ditch the "cantwalk" part though - you'll find it makes getting into and out of the water much more difficult.
Thank you so much!