ServUO Version
Publish 57
Ultima Expansion
Third Dawn
As the title says, trying to figure out how to set a flag in the region controller to toggle the action of being able to mount or not mount. And also wanting it to dismount when entering the region boundary. Anyone have an idea of where to start with this? Thanks for your time.
 
As the title says, trying to figure out how to set a flag in the region controller to toggle the action of being able to mount or not mount. And also wanting it to dismount when entering the region boundary. Anyone have an idea of where to start with this? Thanks for your time.
I dont think you can, there is a setting to allow/disallow ethereals, not sure if that cover all mounts or not, I would be interested in learning how to add new options, like Young, Male, Female, Guilded, not Guilded ect.
 
Hi Mordacaie. In Scripts/Services/Dungeons/BlackthornDungeon/Region.cs, there is a bit of code that disallows mounts in the area and auto-stables them. I've never tried, but maybe you can tinker with it for your use. ArenaDuel.cs also has a lot of code that limits pets, such as RidingFlyingAllowed = true;. Maybe Olorin is right and you can't, but if I tried, these are the places that I would start to play with and apply them to the area that you would like. I asked GPT4, and it said:
  • Define your region using the Region class. Set its boundaries, name it, and imbue it with mystical properties. For our purpose, let’s call it “NoMountsRegion.”
  • Next, we shall intercept the moment when a rider attempts to mount their trusty steed within our forbidden domain.
  • Override the OnMount event handler for your region. This event triggers when a player attempts to mount a creature within the region.
  • In this sacred script, thou shalt decree: “If the player is within NoMountsRegion, deny them the privilege of mounting!”
C#:
public class NoMountsRegion : Region
{
    public NoMountsRegion()
        : base("NoMountsRegion", Map.Felucca) // Choose your map (Felucca, Trammel, etc.)
    {
    }

    public override void OnMount(Mobile m, IMount mount)
    {
        if (m != null && m.Player && this.Contains(m.Location)) // Ensure it's a player and they're within the region
        {
            m.SendMessage("Mounts are forbidden here!"); // Deliver the dire message
            mount.Rider = null; // Unseat the rider
        }
    }
}

I hope you achieve your goal. Good luck!
 
Hi Mordacaie. In Scripts/Services/Dungeons/BlackthornDungeon/Region.cs, there is a bit of code that disallows mounts in the area and auto-stables them. I've never tried, but maybe you can tinker with it for your use. ArenaDuel.cs also has a lot of code that limits pets, such as RidingFlyingAllowed = true;. Maybe Olorin is right and you can't, but if I tried, these are the places that I would start to play with and apply them to the area that you would like. I asked GPT4, and it said:

C#:
public class NoMountsRegion : Region
{
    public NoMountsRegion()
        : base("NoMountsRegion", Map.Felucca) // Choose your map (Felucca, Trammel, etc.)
    {
    }

    public override void OnMount(Mobile m, IMount mount)
    {
        if (m != null && m.Player && this.Contains(m.Location)) // Ensure it's a player and they're within the region
        {
            m.SendMessage("Mounts are forbidden here!"); // Deliver the dire message
            mount.Rider = null; // Unseat the rider
        }
    }
}

I hope you achieve your goal. Good luck!
Im sure it can be done :) Just not with the Region Controller, at least I have not found a way, and I have been using it for over a decade. Appreciate this post, I was wondering the same thing myself.
 
Hi Mordacaie. In Scripts/Services/Dungeons/BlackthornDungeon/Region.cs, there is a bit of code that disallows mounts in the area and auto-stables them. I've never tried, but maybe you can tinker with it for your use. ArenaDuel.cs also has a lot of code that limits pets, such as RidingFlyingAllowed = true;. Maybe Olorin is right and you can't, but if I tried, these are the places that I would start to play with and apply them to the area that you would like. I asked GPT4, and it said:

C#:
public class NoMountsRegion : Region
{
    public NoMountsRegion()
        : base("NoMountsRegion", Map.Felucca) // Choose your map (Felucca, Trammel, etc.)
    {
    }

    public override void OnMount(Mobile m, IMount mount)
    {
        if (m != null && m.Player && this.Contains(m.Location)) // Ensure it's a player and they're within the region
        {
            m.SendMessage("Mounts are forbidden here!"); // Deliver the dire message
            mount.Rider = null; // Unseat the rider
        }
    }
}

I hope you achieve your goal. Good luck!
So to my understanding, I need to define or create a region for Orc Cave and then implement this code into that script?
 
Maybe try reading the region.cs in the BlackthornDungeon folder and see how it handles mounts ect.
 
Back