#W# Move InnRoom folder to Item/Houses
This commit is contained in:
parent
eea0f9defb
commit
770b95bb64
7 changed files with 0 additions and 0 deletions
58
Scripts/Items/Houses/InnRooms/InnExitDoor.cs
Normal file
58
Scripts/Items/Houses/InnRooms/InnExitDoor.cs
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Custom.InnRooms
|
||||
{
|
||||
public class InnExitDoor : Item
|
||||
{
|
||||
[Constructable]
|
||||
public InnExitDoor() : this(0x6E5)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public InnExitDoor(int itemID) : base(itemID)
|
||||
{
|
||||
Movable = false;
|
||||
Name = "Room Exit";
|
||||
}
|
||||
|
||||
public InnExitDoor(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!from.InRange(GetWorldLocation(), 2))
|
||||
{
|
||||
from.LocalOverheadMessage(Server.Network.MessageType.Regular, 0x3B2, 1019045);
|
||||
return;
|
||||
}
|
||||
|
||||
if (from is PlayerMobile)
|
||||
{
|
||||
PlayerMobile pm = (PlayerMobile)from;
|
||||
|
||||
// Checks if they entered through the town door to get their saved location
|
||||
if (pm.LastInnMap != null && pm.LastInnMap != Map.Internal && pm.LastInnLocation != Point3D.Zero)
|
||||
{
|
||||
pm.PlaySound(0x1EA);
|
||||
pm.MoveToWorld(pm.LastInnLocation, pm.LastInnMap);
|
||||
pm.SendMessage(68, "You step out of your room and back into the inn.");
|
||||
|
||||
// Clears the return location so they can't exploit it
|
||||
pm.LastInnLocation = Point3D.Zero;
|
||||
pm.LastInnMap = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage(33, "Your return location was lost. Please use a runebook or page a GameMaster.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer) { base.Serialize(writer); writer.Write((int)0); }
|
||||
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue