Go Back   RunUO - Ultima Online Emulation > RunUO > Server Support on Windows

Server Support on Windows Get (and give) support on general questions related to the RunUO server itself.

Reply
 
Thread Tools Display Modes
Old 09-22-2006, 10:55 PM   #1 (permalink)
Forum Newbie
 
Join Date: Jan 2006
Posts: 31
Default Light level in custom region

They is my trouble... I built a Gate Hall ( PvP server ) and it's in a custom dungeon... But it's so dark that's players can't see a damn thing...

I want to know how to modify the light for this region... but not with the lightlevel on every mobile because i want to keep other dungeon with dark...

how can i do this...
memories is offline   Reply With Quote
Old 09-23-2006, 10:54 AM   #2 (permalink)
Forum Expert
 
Mortis's Avatar
 
Join Date: Oct 2002
Location: In My Cold Cell
Age: 44
Posts: 1,848
Default

Did you create a region script for it or specify the type in regions.xml?
__________________
I'm waiting in my cold cell when the bell begins to chime
Reflecting on my past life and it doesn't have much time.
Mortis is offline   Reply With Quote
Old 09-23-2006, 01:14 PM   #3 (permalink)
Forum Newbie
 
Join Date: Jan 2006
Posts: 31
Default

to specify the type of the region, i need to write my new GateHall in the Regions.xml file as a townregion type or is there another way to do this... because the last time i tries this, some guard killed my Npc Vendors
memories is offline   Reply With Quote
Old 09-23-2006, 02:13 PM   #4 (permalink)
Forum Expert
 
Mortis's Avatar
 
Join Date: Oct 2002
Location: In My Cold Cell
Age: 44
Posts: 1,848
Default

First You add something like this to Regions.xml

Code:
        <region type="GateHall" priority="50" name="GateHall">
                  <rect x="1568" y="1381" width="238" height="219" />
                  <go location="(737,1644,-95)" />
            <music name="Dungeon9" />
        </region>
The parts in red you will have to change to the region bounds where you want it.

Place it under the facet you have your gatehall in.

Next open lightcycle.cs and add a custom entry.

Code:
namespace Server
{
    public class LightCycle
    {
        public const int DayLevel = 0;
        public const int NightLevel = 12;
        public const int DungeonLevel = 26;
        public const int JailLevel = 9;
        public const int CustomLevel = 5;

        private static int m_LevelOverride = int.MinValue;

        public static int LevelOverride
        {
Name it what you want I am useing CustomLevel as an example.

Use what ever number light level you want I used 5 as an example.

Next.

Well seeing as I allready did it you can just use this and put it in your regions folder. Had I not you would have needed to Copy and Modify DungeonRegions.cs

GateHallRegions.cs
Code:
using System;
using System.Xml;
using Server;
using Server.Mobiles;
using Server.Gumps;

namespace Server.Regions
{
    public class GateHall : BaseRegion
    {
        private Point3D m_EntranceLocation;
        private Map m_EntranceMap;


        public Point3D EntranceLocation{ get{ return m_EntranceLocation; } set{ m_EntranceLocation = value; } }
        public Map EntranceMap{ get{ return m_EntranceMap; } set{ m_EntranceMap = value; } }

        public GateHall( XmlElement xml, Map map, Region parent ) : base( xml, map, parent )
        {
            XmlElement entrEl = xml["entrance"];

            Map entrMap = map;
            ReadMap( entrEl, "map", ref entrMap, false );

            if ( ReadPoint3D( entrEl, entrMap, ref m_EntranceLocation, false ) )
                m_EntranceMap = entrMap;
        }

        public override bool AllowHousing( Mobile from, Point3D p )
        {
            return false;
        }

        public override void OnEnter( Mobile m )
        {
 
        }
        public override void OnExit( Mobile m )
        {
            //base.OnExit( m );
        }

        public override void AlterLightLevel( Mobile m, ref int global, ref int personal )
        {

            global = LightCycle.CustomLevel;

        }

        public override bool CanUseStuckMenu( Mobile m )
        {
            if ( this.Map == Map.Felucca )
                return false;

            return base.CanUseStuckMenu( m );
        }
    }
}
If you use other than CustomLevel in LightCycle.cs Change the code in red to match it.

If you want to test this with the exact code I used in Regions.xml

It covers the desert north of the lake in Malas.
__________________
I'm waiting in my cold cell when the bell begins to chime
Reflecting on my past life and it doesn't have much time.

Last edited by Mortis; 09-23-2006 at 02:20 PM.
Mortis is offline   Reply With Quote
Old 10-16-2006, 04:22 PM   #5 (permalink)
GM Hider
 
sordican's Avatar
 
Join Date: Oct 2003
Age: 29
Posts: 187
Default

This may be a bit of a bump, but thanks alot for taking the time to explain and show this guy in detail how to make a new region in 2.0, Mortis. I used your example there to convert all of my "static" regions to the new system.

It works flawless now, and it nearly drove me insane to try to figure it out on my own. Thanks a bunch!
__________________
[BondInfo - Tells a player how much time remains until a pet bonds.

[BodInfo - Tells a player how much time remains until the next BOD is ready for pickup.
sordican is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5