#W# Added: Added some custom regions.
This commit is contained in:
parent
40dd003fa8
commit
0a4d972af6
5 changed files with 152 additions and 1 deletions
39
Projects/UOContent/Regions/Custom/GreetingBusinessRegion.cs
Normal file
39
Projects/UOContent/Regions/Custom/GreetingBusinessRegion.cs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Custom;
|
||||
|
||||
namespace Server.Regions
|
||||
{
|
||||
public class GreetingBusinessRegion : TownRegion
|
||||
{
|
||||
public GreetingBusinessRegion(string name, Map map, int priority, params Rectangle3D[] area)
|
||||
: base(name, map, priority, area)
|
||||
{
|
||||
}
|
||||
public override bool MountsAllowed => false;
|
||||
public override void OnEnter(Mobile m)
|
||||
{
|
||||
base.OnEnter(m);
|
||||
if (m.Player)
|
||||
{
|
||||
m.SendMessage($"Welcome to <BASEFONT COLOR='#FFD700'>{this.Name}</BASEFONT>.");
|
||||
}
|
||||
if (m is PlayerMobile player )
|
||||
{
|
||||
if ( player.Mounted )
|
||||
{
|
||||
Server.Custom.AutoStable.StoreMount(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnExit(Mobile m)
|
||||
{
|
||||
base.OnExit(m);
|
||||
if ( m is PlayerMobile player )
|
||||
{
|
||||
Server.Custom.AutoStable.RestoreMount(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
43
Projects/UOContent/Regions/Custom/GreetingDungeonRegion.cs
Normal file
43
Projects/UOContent/Regions/Custom/GreetingDungeonRegion.cs
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
using Server;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Regions
|
||||
{
|
||||
public class GreetingDungeonRegion : DungeonRegion
|
||||
{
|
||||
public GreetingDungeonRegion(string name, Map map, int priority, params Rectangle3D[] area)
|
||||
: base(name, map, priority, area)
|
||||
{
|
||||
}
|
||||
public override bool MountsAllowed => false;
|
||||
public override void OnEnter(Mobile m)
|
||||
{
|
||||
base.OnEnter(m);
|
||||
if (m.Player)
|
||||
{
|
||||
m.SendMessage($"You entered <BASEFONT COLOR='#FF0000'>{this.Name}</BASEFONT>.");
|
||||
}
|
||||
if (m is PlayerMobile player && player.Mounted )
|
||||
{
|
||||
if ( player.Mount is BaseMount )
|
||||
{
|
||||
Server.Custom.AutoStable.StoreMount(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
BaseMount.Dismount(player);
|
||||
player.SendMessage("Mounts are not permitted in this Dungeon.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnExit(Mobile m)
|
||||
{
|
||||
base.OnExit(m);
|
||||
if ( m is PlayerMobile player )
|
||||
{
|
||||
Server.Custom.AutoStable.RestoreMount(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
28
Projects/UOContent/Regions/Custom/GreetingTownRegion.cs
Normal file
28
Projects/UOContent/Regions/Custom/GreetingTownRegion.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
using Server;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Regions
|
||||
{
|
||||
public class GreetingTownRegion : TownRegion
|
||||
{
|
||||
public GreetingTownRegion(string name, Map map, int priority, params Rectangle3D[] area)
|
||||
: base(name, map, priority, area)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnEnter(Mobile m)
|
||||
{
|
||||
base.OnEnter(m);
|
||||
|
||||
if (m.Player)
|
||||
{
|
||||
m.SendMessage($"Welcome to <BASEFONT COLOR='#3BB143'>{this.Name}</BASEFONT>.");
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnExit(Mobile m)
|
||||
{
|
||||
base.OnExit(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
35
Projects/UOContent/Regions/Custom/MountlessTownRegion.cs
Normal file
35
Projects/UOContent/Regions/Custom/MountlessTownRegion.cs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Custom;
|
||||
|
||||
namespace Server.Regions
|
||||
{
|
||||
public class MountlessTownRegion : TownRegion
|
||||
{
|
||||
public MountlessTownRegion(string name, Map map, int priority, params Rectangle3D[] area)
|
||||
: base(name, map, priority, area)
|
||||
{
|
||||
}
|
||||
public override bool MountsAllowed => false;
|
||||
public override void OnEnter(Mobile m)
|
||||
{
|
||||
base.OnEnter(m);
|
||||
if (m is PlayerMobile player )
|
||||
{
|
||||
if ( player.Mounted )
|
||||
{
|
||||
Server.Custom.AutoStable.StoreMount(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnExit(Mobile m)
|
||||
{
|
||||
base.OnExit(m);
|
||||
if ( m is PlayerMobile player )
|
||||
{
|
||||
Server.Custom.AutoStable.RestoreMount(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
namespace Server.Regions;
|
||||
namespace Server.Regions;
|
||||
|
||||
public static class RegionJsonRegistration
|
||||
{
|
||||
|
|
@ -59,5 +59,11 @@ public static class RegionJsonRegistration
|
|||
|
||||
// Myrmidex
|
||||
RegionJsonSerializer.Register<BattleRegion>();
|
||||
|
||||
// Custom
|
||||
RegionJsonSerializer.Register<GreetingBusinessRegion>();
|
||||
RegionJsonSerializer.Register<GreetingTownRegion>();
|
||||
RegionJsonSerializer.Register<GreetingDungeonRegion>();
|
||||
RegionJsonSerializer.Register<MountlessTownRegion>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue