#W# Region: Added a new NewbieDungeonRegion. Accelerated skill gain upto 80.0
This commit is contained in:
parent
e337ca20bc
commit
11b620b0dc
3 changed files with 57 additions and 0 deletions
44
Projects/UOContent/Regions/Custom/NewbieDungeonRegion.cs
Normal file
44
Projects/UOContent/Regions/Custom/NewbieDungeonRegion.cs
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
using Server;
|
||||||
|
using Server.Mobiles;
|
||||||
|
|
||||||
|
namespace Server.Regions
|
||||||
|
{
|
||||||
|
public class NewbieDungeonRegion : DungeonRegion
|
||||||
|
{
|
||||||
|
public NewbieDungeonRegion(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>.");
|
||||||
|
m.SendMessage($"Skill gains are accelerated but stop at 80.0 points.");
|
||||||
|
}
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -66,5 +66,6 @@ public static class RegionJsonRegistration
|
||||||
RegionJsonSerializer.Register<GreetingDungeonRegion>();
|
RegionJsonSerializer.Register<GreetingDungeonRegion>();
|
||||||
RegionJsonSerializer.Register<MountlessTownRegion>();
|
RegionJsonSerializer.Register<MountlessTownRegion>();
|
||||||
RegionJsonSerializer.Register<GreetingOverworldSpawnRegion>();
|
RegionJsonSerializer.Register<GreetingOverworldSpawnRegion>();
|
||||||
|
RegionJsonSerializer.Register<NewbieDungeonRegion>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ using System;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using Server.Factions;
|
using Server.Factions;
|
||||||
using Server.Mobiles;
|
using Server.Mobiles;
|
||||||
|
using Server.Regions;
|
||||||
|
|
||||||
namespace Server.Misc;
|
namespace Server.Misc;
|
||||||
|
|
||||||
|
|
@ -142,6 +143,11 @@ public static class SkillCheck
|
||||||
gc *= 2;
|
gc *= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (from.Region is NewbieDungeonRegion)
|
||||||
|
{
|
||||||
|
gc *= 3.0;
|
||||||
|
}
|
||||||
|
|
||||||
if (gc >= Utility.RandomDouble())
|
if (gc >= Utility.RandomDouble())
|
||||||
{
|
{
|
||||||
Gain(from, skill);
|
Gain(from, skill);
|
||||||
|
|
@ -235,6 +241,12 @@ public static class SkillCheck
|
||||||
|
|
||||||
public static void Gain(Mobile from, Skill skill)
|
public static void Gain(Mobile from, Skill skill)
|
||||||
{
|
{
|
||||||
|
if (from.Region is NewbieDungeonRegion)
|
||||||
|
{
|
||||||
|
if (skill.Base >= 80.0)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (from is BaseCreature { IsDeadPet: true })
|
if (from is BaseCreature { IsDeadPet: true })
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue