#W# Initial Commit: Avatars Conquest

This commit is contained in:
WarrentyExpired 2026-07-03 20:19:48 -04:00
commit 8eae46895e
7512 changed files with 416187 additions and 0 deletions

View file

@ -0,0 +1,81 @@
using System;
using System.Xml;
using Server;
using Server.Mobiles;
using Server.Gumps;
using Server.Network;
namespace Server.Regions
{
public class DungeonRegion : BaseRegion
{
public DungeonRegion( XmlElement xml, Map map, Region parent ) : base( xml, map, parent )
{
}
public override bool AllowHousing( Mobile from, Point3D p )
{
return false;
}
public override bool NoMounts( Mobile from, Point3D p )
{
return true;
}
public override void AlterLightLevel( Mobile m, ref int global, ref int personal )
{
global = LightCycle.DungeonLevel;
}
public override bool CanUseStuckMenu( Mobile m )
{
return false;
}
public override void OnEnter( Mobile m )
{
base.OnEnter( m );
if ( m is PlayerMobile )
m.SendMessage( "You have entered " + this.Name + "." );
}
public override void OnExit(Mobile m)
{
base.OnExit( m );
if ( m is PlayerMobile )
{
if ( !PlayersLeftInRegion( m, this ) )
{
foreach ( Mobile creature in World.Mobiles.Values )
if ( creature.Region == this && creature is BaseCreature )
{
BaseCreature dweller = (BaseCreature)creature;
Point3D loc = dweller.Home;
if ( loc.X > 0 && dweller.RangeHome < 10 && dweller.SummonMaster == null && dweller.ControlMaster == null )
{
dweller.Location = dweller.Home;
}
}
}
}
}
public static bool PlayersLeftInRegion( Mobile from, Region region )
{
bool occupied = false;
foreach ( NetState state in NetState.Instances )
{
Mobile m = state.Mobile;
if ( m != null && m != from && m.Region == region )
{
occupied = true;
}
}
return occupied;
}
}
}