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 1.0 Final/2.0 RC1] Sleepable Beds

smeghead

Wanderer
koluch said:
#1 - Had a player recall while sleeping, leaving his snoring body on the bed.
#2 - THEN he customized his house with his other player, leaving the one he recalled out of bed with stuck - body on bed and on login , his player was of course unable to move.

Had to delete the sleeping body and set him to CanWalk, but I'm sure this is an easy thing to avoid, I just dont have the time to work on that right now and figured someone elase might want to post a fix :]



Yeah you can cast spells while sleeping, putting you outside your house then if you recall to your house (normally outside) you cant see the bed to click it
Anyway to make it so they can cast any spells while sleeping?
How about chaning cantwalk to frozen?
 

smeghead

Wanderer
Yes that seems to work :D
GO through each bed and change where it says

cantwalk=true
and later on cantwalk=false

to

Frozen=true
and later on Frozen=false
 

smeghead

Wanderer
ok so something else.........

If you are killed while hidden (with your sleeping self on the bed)

Then you can walk away as a ghost and go get ressed, then when you are ressed you can walk around with your sleeping self still sleeping there snooring away.
Theoretically you can repeat this process and fill your house with sleeping selves while you go and play.

Maybe make yourself immortal while you sleep?
 

Enziet

Sorceror
Mo Khan said:
this is such a cool script...however, I wanted to use them in my Inns, so I modded the two small elven sleepers to be used outside of a house. I am including them here for anyone who may desire this "public" application on their shard. All Credit goes to the original scripter. Thanks for this one!

heh I did that too, added sleeper beds to all the inns, then allowed Fast Logout only in the inns ;)
 

smeghead

Wanderer
Ive added a little (in bold and red) to each of the beds to make the player immortal, frozen and speech squelched so they cant reveal or do anything while asleep.

m_Player.Hidden = true;
m_Player.Frozen = true;
m_Player.Blessed = true;
m_Player.Squelched = true;

m_Sleeping = true;
m_SleeperBedBody = new SleeperBedBody( m_Player, false, false );
Point3D m_Location = new Point3D(this.Location.X+1, this.Location.Y, this.Location.Z+6);
m_SleeperBedBody.Direction=Direction.East;
m_SleeperBedBody.MoveToWorld( m_Location, this.Map );

Of course dont forget to add the same with = false in the wakeup section following this one

The only wierd thing is they can still eject themselves from the house, and then they wont be able to see the bed to click on it wake up.
 

smeghead

Wanderer
Bah im about to give up on this.
I had to re-add cantwalk to keep you from walking because after a server restart you become unfrozen and can cast spells, and can recall away then you cant reach your bed.

Nice idea but theres just too many ways to f** with it
 
antilogic said:
I change it a lot, but don't know how upload.
my msg: [email protected]
May some one help me?
You would have to be the original author of the script to upload it in the first post, you may upload any fixes you have made via forum attachments, but I would ask the author first.
 

Brutus5000

Sorceror
A partial fix suggestion for the problems after server-restart:
Put your lines into Deserialization-function.


public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();

m_SleeperBedBody = (SleeperBedBody)reader.ReadItem();
m_Player = reader.ReadMobile();
m_Active = reader.ReadBool();
m_Location = reader.ReadPoint3D();
m_Sleeping = reader.ReadBool();
m_Owner = reader.ReadMobile();

m_Player.Frozen = true;
m_Player.Blessed = true;
m_Player.Squelched = true;

m_Debug = false;
}
 

Dreadfull

Sorceror
alright first question. about that fix which file would I put it into? my second question would be how to make the deeds for these beds buyable. since I tried and it kept saying the items don't exsist.
 

Brutus5000

Sorceror
The changes need to be made in SleeperNS.cs and SleeperEW.cs as far as these files contain the base classes for all sleepable beds.

edit:

Sorry, you must make this changes in all scripts. There is no base class for sleepable beds. My fault
 

TalRave

Wanderer
Code:
Errors:
 + Customs/sleepablebeds/SleeperBedBody.cs:
    CS0506: Line 168: 'Server.Items.SleeperBedBody.SendInfoTo(Server.Network.Net
State)': cannot override inherited member 'Server.Item.SendInfoTo(Server.Network
.NetState)' because it is not marked virtual, abstract, or override
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

Any clue??
 

koluch

Sorceror
TalRave;629985 said:
Code:
Errors:
 + Customs/sleepablebeds/SleeperBedBody.cs:
    CS0506: Line 168: 'Server.Items.SleeperBedBody.SendInfoTo(Server.Network.Net
State)': cannot override inherited member 'Server.Item.SendInfoTo(Server.Network
.NetState)' because it is not marked virtual, abstract, or override
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

Any clue??
When RunUO changed the some packet scripts, it also changed what you need to have in that portion.
We have changed our, but i am NOT sure if it is the correct way it should be written( now when you get on the bed, you have no armor or anything showing, eh which is fine on that part, who sleeps with clothes on!< hehe )
I will post is here, BUT I would wait for someone to either ok it or post the correct way to put this in the script.

Code:
[SIZE=2][COLOR=#008000]// public override void SendInfoTo( NetState state )
[/COLOR][/SIZE][B][SIZE=2][COLOR=#0000ff]protected [/B][/COLOR][/SIZE][SIZE=2][COLOR=#a52a2a]override [/COLOR][/SIZE][SIZE=2]Packet [/SIZE][B][SIZE=2][COLOR=#191970]GetWorldPacketFor[/B][/COLOR][/SIZE][SIZE=2][COLOR=#006400]( [/COLOR][/SIZE][SIZE=2]NetState state [/SIZE][SIZE=2][COLOR=#006400])
{
[/COLOR][/SIZE][SIZE=2]Mobile mob [/SIZE][SIZE=2][COLOR=#006400]= [/COLOR][/SIZE][SIZE=2]state[/SIZE][SIZE=2][COLOR=#006400].[/COLOR][/SIZE][SIZE=2]Mobile[/SIZE][SIZE=2][COLOR=#006400];
[/COLOR][/SIZE][SIZE=2][COLOR=#008000]// base.SendInfoTo( state );
[/COLOR][/SIZE][SIZE=2][COLOR=#000080]return [/COLOR][/SIZE][B][SIZE=2]base[/B][/SIZE][SIZE=2][COLOR=#006400].[/COLOR][/SIZE][B][SIZE=2][COLOR=#191970]GetWorldPacketFor[/B][/COLOR][/SIZE][SIZE=2][COLOR=#006400]( [/COLOR][/SIZE][SIZE=2]state [/SIZE][SIZE=2][COLOR=#006400]);
[/COLOR][/SIZE][B][SIZE=2][COLOR=#0000ff]if [/B][/COLOR][/SIZE][SIZE=2][COLOR=#006400]( [/COLOR][/SIZE][SIZE=2]ItemID [/SIZE][SIZE=2][COLOR=#006400]== [/COLOR][/SIZE][SIZE=2][COLOR=#00008b]0x2006 [/COLOR][/SIZE][SIZE=2][COLOR=#006400])
{
[/COLOR][/SIZE][SIZE=2]state[/SIZE][SIZE=2][COLOR=#006400].[/COLOR][/SIZE][B][SIZE=2][COLOR=#191970]Send[/B][/COLOR][/SIZE][SIZE=2][COLOR=#006400]( [/COLOR][/SIZE][B][SIZE=2][COLOR=#008b8b]new [/COLOR][/SIZE][SIZE=2][COLOR=#191970]SleeperBedBodyContent[/B][/COLOR][/SIZE][SIZE=2][COLOR=#006400]( [/COLOR][/SIZE][SIZE=2]state[/SIZE][SIZE=2][COLOR=#006400].[/COLOR][/SIZE][SIZE=2]Mobile[/SIZE][SIZE=2][COLOR=#006400], [/COLOR][/SIZE][B][SIZE=2]this [/B][/SIZE][SIZE=2][COLOR=#006400]) );
[/COLOR][/SIZE][SIZE=2]state[/SIZE][SIZE=2][COLOR=#006400].[/COLOR][/SIZE][B][SIZE=2][COLOR=#191970]Send[/B][/COLOR][/SIZE][SIZE=2][COLOR=#006400]( [/COLOR][/SIZE][B][SIZE=2][COLOR=#008b8b]new [/COLOR][/SIZE][SIZE=2][COLOR=#191970]SleeperBedBodyEquip[/B][/COLOR][/SIZE][SIZE=2][COLOR=#006400]( [/COLOR][/SIZE][SIZE=2]state[/SIZE][SIZE=2][COLOR=#006400].[/COLOR][/SIZE][SIZE=2]Mobile[/SIZE][SIZE=2][COLOR=#006400], [/COLOR][/SIZE][B][SIZE=2]this [/B][/SIZE][SIZE=2][COLOR=#006400]) );
}
}
[/COLOR][/SIZE]

I posted this on a previous thread and never got a replay.
( again, please see if someone confirms this or posts the better way to correct this )

koluch
 

TalRave

Wanderer
Actually I just removed the chunk that was throwing the error for the time being and it works perfectly. *laughs*

The ol' hit it and see if it fixes it trick.
 

Solinari555

Wanderer
Nice job!

I'm working on releasing a heavy RP server, thanks for this!
By the way, I modified it to start regenerating 10% of the user's HP when deep sleep is entered. I also changed the time it takes to enter it, randomized it between 30 seconds, 10 minute, and 2 minutes.

Thanks again, loving it.
 

Irian

Page
There's a much simpler modification to make it work, btw. Simple edit the SendInfoTo method to this:

Code:
public override void SendInfoTo( NetState state, bool sendOplPacket ) {
base.SendInfoTo( state, sendOplPacket );
...

The reason is, that SendInfoTo(Netstate) is not virtual, but SendInfoTo(Netstate,bool) is :) SendInfoTo(Netstate) only calls the 2nd one, so this change will make it work...
 
Top