RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

[RunUO 2.0 RC1] Cellar Addon

Tru

Knight
Cellar Addon

Simple little Addon that adds a 7x7 Cellar at -40 Z in your house. Only one Distro Mod is needed and I thank kmwill for that. It's his IsInside method in BaseHouse.cs (from his TownHouse system). If you use his system and have made this mod you obviously don't need to.

Code:
public virtual bool IsInside( Point3D p, int height )
		{
			Sector sector = Map.GetSector( p );

			/*foreach( BaseMulti m in sector.Multis )
			{
				if ( m != this
				&& m is Knives.TownHouses.TownHouse
				&& ((Knives.TownHouses.TownHouse)m).ForSaleSign is Knives.TownHouses.RentalContract
				&& ((Knives.TownHouses.TownHouse)m).IsInside( p, height ) )
					return false;
			}*/

			return Region.Contains( p );
		}

As you can see I just edited out his townhouse code. Just edit out the old Method and add the new one.

It adds a Bookcase upstairs (to doubleclick to activate) and stairs in the cellar for getting back up.

I'm also including my CellarExtension, it doesnt have the bookcase or stairs and just has a patch of carpet (upstairs to chop). For those that want a bigger cellar (Ie In Castles).

Couple checks I haven't added is whether they are trying to add it from a second floor (or higher) or whether they are trying to chop it from the basement.

Now its small enough to go into a SmallTower but you would have to put the Bookcase in the middle of the floor (or the whole addon wouldnt be in the HouseRegion and wouldnt be allowed to be set up).

Should work with any version with the BaseHouse mod.

Hope someone finds it useful (I use it as one of my new Rewards).
 

Attachments

  • CellarAddon.cs
    6.5 KB · Views: 570
  • CellarExtensionAddon.cs
    6.6 KB · Views: 508

Liacs

Sorceror
great idea!

i find this veeery useful. Even for quests in public houses. Only thing I can't figure out is how to use the extension. I fall from one niveau to the other (*ouch*) if I use the teleporter...

Lia
 
that section of my base house does not look like that at all - it has a lot more stuff in there

Are we sapposed to remove everything else from in that section?

i do not want to remove a bunch of stuff just to find out ooooops i goofed

Also does this work with knives townhouses? (his does not require a distro edit any more)

here is what i am talking about:

Code:
		public virtual bool IsInside( Point3D p, int height )
		{
			if ( Deleted )
				return false;

			MultiComponentList mcl = Components;

			int x = p.X - (X + mcl.Min.X);
			int y = p.Y - (Y + mcl.Min.Y);

			if ( x < 0 || x >= mcl.Width || y < 0 || y >= mcl.Height )
				return false;

			if ( this is HouseFoundation && y < (mcl.Height-1) && p.Z >= this.Z )
				return true;

			Tile[] tiles = mcl.Tiles[x][y];

			for ( int j = 0; j < tiles.Length; ++j )
			{
				Tile tile = tiles[j];
				int id = tile.ID & 0x3FFF;
				ItemData data = TileData.ItemTable[id];

				// Slanted roofs do not count; they overhang blocking south and east sides of the multi
				if ( (data.Flags & TileFlag.Roof) != 0 )
					continue;

				// Signs and signposts are not considered part of the multi
				if ( (id >= 0xB95 && id <= 0xC0E) || (id >= 0xC43 && id <= 0xC44) )
					continue;

				int tileZ = tile.Z + this.Z;

				if ( p.Z == tileZ || (p.Z + height) > tileZ )
					return true;
			}

			return false;
		}

like i said - a little more than just that little bit you are showing there
 

Tru

Knight
Liacs said:
i find this veeery useful. Even for quests in public houses. Only thing I can't figure out is how to use the extension. I fall from one niveau to the other (*ouch*) if I use the teleporter...

Lia
Walk 4 tiles from the bookcase in any direction and place the extension...it should line up with the original cellar.

Lord_Greywolf said:
that section of my base house does not look like that at all - it has a lot more stuff in there

Are we sapposed to remove everything else from in that section?

i do not want to remove a bunch of stuff just to find out ooooops i goofed

Also does this work with knives townhouses? (his does not require a distro edit any more)

here is what i am talking about:

Code:
		public virtual bool IsInside( Point3D p, int height )
		{
			if ( Deleted )
				return false;

			MultiComponentList mcl = Components;

			int x = p.X - (X + mcl.Min.X);
			int y = p.Y - (Y + mcl.Min.Y);

			if ( x < 0 || x >= mcl.Width || y < 0 || y >= mcl.Height )
				return false;

			if ( this is HouseFoundation && y < (mcl.Height-1) && p.Z >= this.Z )
				return true;

			Tile[] tiles = mcl.Tiles[x][y];

			for ( int j = 0; j < tiles.Length; ++j )
			{
				Tile tile = tiles[j];
				int id = tile.ID & 0x3FFF;
				ItemData data = TileData.ItemTable[id];

				// Slanted roofs do not count; they overhang blocking south and east sides of the multi
				if ( (data.Flags & TileFlag.Roof) != 0 )
					continue;

				// Signs and signposts are not considered part of the multi
				if ( (id >= 0xB95 && id <= 0xC0E) || (id >= 0xC43 && id <= 0xC44) )
					continue;

				int tileZ = tile.Z + this.Z;

				if ( p.Z == tileZ || (p.Z + height) > tileZ )
					return true;
			}

			return false;
		}

like i said - a little more than just that little bit you are showing there
The New Method replaces the whole old Method dont remove it just edit it out.
 

Rosey1

Wanderer
i checked the second floor placing and it places you -40 from where you are so you're stuck midway through and can't move.

I like this but I couldn't figure out the extension, you place the carpet (i couldn't redeed it either) and i walked on it, double clicked it and nothing.

I can't seem to lock anything down, do things decay? (i'm assuming they do)

What I would like to see is a check for only one per house.

It's an awesome idea.
 

Tru

Knight
Rosey1 said:
i checked the second floor placing and it places you -40 from where you are so you're stuck midway through and can't move.

I like this but I couldn't figure out the extension, you place the carpet (i couldn't redeed it either) and i walked on it, double clicked it and nothing.

I can't seem to lock anything down, do things decay? (i'm assuming they do)

What I would like to see is a check for only one per house.

It's an awesome idea.
The extension is only to make the original cellar bigger, the carpet is just something to chop to redeed it, that wouldnt take up space.
Were you Player Access Level when you tried to redeed it I've noticed sometimes I cant chop addons as accesslevel (but it always works as a Player...if its in thier house).
Locking stuff down works fine as long as you made the required Mod.

The check for 1 per house would null my extension Idea...
 

Rosey1

Wanderer
Ok i changed to my player and you are right, I can lock things down. I really like this. It was a little tricky like you said for the small tower but it worked.

What I would add (if i remotely knew how) is a check for the bookcase for who can access like a door.

Does the part we edit out affect the townhouses at all?
 

Tru

Knight
Rosey1 said:
Ok i changed to my player and you are right, I can lock things down. I really like this. It was a little tricky like you said for the small tower but it worked.

What I would add (if i remotely knew how) is a check for the bookcase for who can access like a door.

Does the part we edit out affect the townhouses at all?
If your using Townhouses and you made the mod for that system you wouldnt need it again.

If your using Townhouses and didnt make the edit you can remove my /* */ that edits out the Townhouse portion and it'll work fine.

If your not using Townhouses then just my Mod.
 
the new knives town houses does not use any mod to the distro files

so if i am going to use it and yours - what do i need to do in the house file then?
 

Tru

Knight
Lord_Greywolf said:
the new knives town houses does not use any mod to the distro files

so if i am going to use it and yours - what do i need to do in the house file then?
It is an Optional Mod in his system. Just remove the /* */ around the Townhouse code (or find the original Mod in the Optional Mod Folder in his system)
 
You said the bookcase must be in the middle of a small house. Why not offset this so that the cellar adds SE a few tiles from where it does now this way the bookcase may be placed along a wall. This would probably need some extra work but it would be nice to see it possible to place the book case on any north or east wall and have it line up the cellar.
 

Tru

Knight
Midnightdragon said:
You said the bookcase must be in the middle of a small house. Why not offset this so that the cellar adds SE a few tiles from where it does now this way the bookcase may be placed along a wall. This would probably need some extra work but it would be nice to see it possible to place the book case on any north or east wall and have it line up the cellar.
Never know where someones going to try and add it
 

Pyro-Tech

Knight
hey, slight "bug" but if placed along a wall, and you walk from behind the stairs, it will placed you on the back of the bookcase (this placed me outside the house where i had it, but i can see problems with other areas possibly such as an interior wall and getting stuck in the wall?)

just thought i would let you know
 

Liacs

Sorceror
hehe, I went around this problem with being stuck behind the bookcase. I just replaced the bookcase by a hole (0x1B71) and made it OnMoveOver like the stairs downstairs. :) If Tru doesn't have a problem I can put the changed script here.

Lia
 

Pyro-Tech

Knight
Liacs said:
hehe, I went around this problem with being stuck behind the bookcase. I just replaced the bookcase by a hole (0x1B71) and made it OnMoveOver like the stairs downstairs. :) If Tru doesn't have a problem I can put the changed script here.

Lia

i thought about changing it to a different hue carpet, and naming it something like "a trap door" that way they can walk over it, place stuff on it, ect. ect.

haven't looked into it

also, how the hell do you chop the stuff to get deed back?!?!

my hatchet won't do a damn thing!!:mad:
 

Liacs

Sorceror
hmm, yeah, right, I didn't think about the redeeding thing yet... but when there is a hole, there is a hole, no? *grins* perhaps we should make something like a shovel to redeed it *grins*
 

Pyro-Tech

Knight
Liacs said:
hmm, yeah, right, I didn't think about the redeeding thing yet... but when there is a hole, there is a hole, no? *grins* perhaps we should make something like a shovel to redeed it *grins*

hehe....it's ok liacs....just stick to your copy and paste :D j/k

but seriously, i can't redeed anything.....what gives? :confused:
 
if you can not redeed anything - try switching to player mode (one of tha staff stones works great for this)

like it was mentioned earlier in this thread - gms can not redeed stuff in other peoples houses (even their own) you need to be in player mode
 

Pyro-Tech

Knight
Lord_Greywolf said:
if you can not redeed anything - try switching to player mode (one of tha staff stones works great for this)

like it was mentioned earlier in this thread - gms can not redeed stuff in other peoples houses (even their own) you need to be in player mode

i think i did try this as a player already...i have the [calt command if that makes any difference.

would using a hatchet do anything??:confused:
 
Top