Initial commit

This commit is contained in:
Ubuntu
2026-06-19 00:00:16 -04:00
commit 73701ff86e
7100 changed files with 1952988 additions and 0 deletions
+58
View File
@@ -0,0 +1,58 @@
using Server.Gumps;
using Server.Mobiles;
using Server.Multis;
using Server.Regions;
namespace Server.Custom.RegionBanner
{
internal class RegionBannerCore
{
public static void Initialize()
{
EventSink.OnEnterRegion += EventSink_OnEnterRegion;
}
private static void EventSink_OnEnterRegion(OnEnterRegionEventArgs e)
{
if (e.From is PlayerMobile pm && !RegionBannerCommand.IsExcludedPlayer(pm))
{
bool isGood = true;
if (e.OldRegion != null)
{
isGood = ValidateRegion(e.OldRegion, isGood);
}
if (isGood && e.NewRegion != null)
{
isGood = ValidateRegion(e.NewRegion, isGood);
}
if (isGood)
{
if (pm.HasGump(typeof(RegionBannerGump)))
{
pm.CloseGump(typeof(RegionBannerGump));
}
BaseGump.SendGump(new RegionBannerGump(pm, e.NewRegion.Name));
}
}
}
private static bool ValidateRegion(Region region, bool isGood)
{
if (!region.IsPartOf(typeof(DungeonRegion)) && region.Name != null && region.Name.Contains("Cave"))
{
return false;
}
if (region is HouseRegion || region is NoHousingRegion || region is TempNoHousingRegion)
{
return false;
}
return isGood;
}
}
}