Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
50
Scripts/SubSystem/Cyrddin's_HouseGates/GateHueTicket.cs
Normal file
50
Scripts/SubSystem/Cyrddin's_HouseGates/GateHueTicket.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class GateHueTicket : Item
|
||||
{
|
||||
[Constructable]
|
||||
public GateHueTicket()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public GateHueTicket(int amount)
|
||||
: base(0x14F0)
|
||||
{
|
||||
this.Name = "Gate Hue Ticket";
|
||||
this.Weight = 1.0;
|
||||
this.Amount = amount;
|
||||
this.Hue = 73;
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public GateHueTicket(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1027199;
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
470
Scripts/SubSystem/Cyrddin's_HouseGates/HouseGate.cs
Normal file
470
Scripts/SubSystem/Cyrddin's_HouseGates/HouseGate.cs
Normal file
@@ -0,0 +1,470 @@
|
||||
#region References
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using Server.Accounting;
|
||||
using Server.ContextMenus;
|
||||
using Server.Multis;
|
||||
|
||||
using VitaNex.SuperGumps.UI;
|
||||
#endregion
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class HouseGate : Moongate
|
||||
{
|
||||
public static List<HouseGate> Instances { get; private set; }
|
||||
|
||||
static HouseGate()
|
||||
{
|
||||
Instances = new List<HouseGate>();
|
||||
}
|
||||
|
||||
public static int CountGatesFor(Mobile m)
|
||||
{
|
||||
return CountGatesFor(m.Account);
|
||||
}
|
||||
|
||||
public static int CountGatesFor(IAccount a)
|
||||
{
|
||||
return Instances.Count(g => g._House != null && g._House.Owner != null && g._House.Owner.Account == a);
|
||||
}
|
||||
|
||||
private BaseHouse _House;
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor, true)]
|
||||
public BaseHouse House
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_House != null && _House.Deleted)
|
||||
{
|
||||
_House = null;
|
||||
|
||||
Timer.DelayCall(Delete);
|
||||
}
|
||||
|
||||
return _House;
|
||||
}
|
||||
private set { _House = value; }
|
||||
}
|
||||
|
||||
private HouseGateTile _Tile;
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor, AccessLevel.GameMaster)]
|
||||
public HouseGateTile Tile
|
||||
{
|
||||
get { return _Tile; }
|
||||
set
|
||||
{
|
||||
if (_Tile == value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var old = _Tile;
|
||||
|
||||
_Tile = value;
|
||||
|
||||
if (old != null && old.Gate == this)
|
||||
{
|
||||
old.Gate = null;
|
||||
}
|
||||
|
||||
if (_Tile != null && _Tile.Gate != this)
|
||||
{
|
||||
_Tile.Gate = this;
|
||||
}
|
||||
|
||||
if (_Tile != null)
|
||||
{
|
||||
Target = _Tile.GetWorldLocation();
|
||||
TargetMap = _Tile.Map;
|
||||
|
||||
Hue = _Tile.Hue;
|
||||
}
|
||||
else
|
||||
{
|
||||
Target = Point3D.Zero;
|
||||
TargetMap = null;
|
||||
|
||||
Hue = 0;
|
||||
Name = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor, AccessLevel.GameMaster)]
|
||||
public override int Hue
|
||||
{
|
||||
get { return base.Hue; }
|
||||
set
|
||||
{
|
||||
base.Hue = value;
|
||||
|
||||
if (_Tile != null && !_Tile.Deleted && _Tile.Gate == this && _Tile.Hue != value)
|
||||
{
|
||||
_Tile.Hue = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override double DefaultWeight { get { return 0; } }
|
||||
|
||||
public override string DefaultName
|
||||
{
|
||||
get
|
||||
{
|
||||
var h = House;
|
||||
|
||||
if (h != null && h.Owner != null)
|
||||
{
|
||||
return h.Owner.Name;
|
||||
}
|
||||
|
||||
return "House Gate";
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ForceShowProperties { get { return true; } }
|
||||
|
||||
public override bool ShowFeluccaWarning { get { return false; } }
|
||||
|
||||
public HouseGate(BaseHouse house)
|
||||
: base(false)
|
||||
{
|
||||
_House = house;
|
||||
|
||||
ItemID = 3948;
|
||||
|
||||
Movable = false;
|
||||
Light = LightType.Circle300;
|
||||
|
||||
Instances.Add(this);
|
||||
}
|
||||
|
||||
public HouseGate(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
Instances.Add(this);
|
||||
}
|
||||
|
||||
public override bool ValidateUse(Mobile m, bool message)
|
||||
{
|
||||
return this.CheckDoubleClick(m, message);
|
||||
}
|
||||
|
||||
public override void BeginConfirmation(Mobile m)
|
||||
{
|
||||
EndConfirmation(m);
|
||||
}
|
||||
|
||||
public override void CheckGate(Mobile m, int range)
|
||||
{
|
||||
range = 18;
|
||||
|
||||
base.CheckGate(m, range);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (this.CheckDoubleClick(m))
|
||||
{
|
||||
CheckGate(m, 18);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnLocationChange(Point3D oldLocation)
|
||||
{
|
||||
base.OnLocationChange(oldLocation);
|
||||
|
||||
if (Tile != null && !Tile.Deleted && Tile.Gate == this)
|
||||
{
|
||||
Tile.Target = GetWorldLocation();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
base.OnMapChange();
|
||||
|
||||
if (Tile != null && !Tile.Deleted && Tile.Gate == this)
|
||||
{
|
||||
Tile.TargetMap = Map;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDelete()
|
||||
{
|
||||
base.OnDelete();
|
||||
|
||||
if (_Tile != null && _Tile.Gate == this)
|
||||
{
|
||||
_Tile.Hue = 0;
|
||||
_Tile.Name = null;
|
||||
}
|
||||
|
||||
Tile = null;
|
||||
House = null;
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
Instances.Remove(this);
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile m, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(m, list);
|
||||
|
||||
if (!IsOwner(m))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Movement: 1078235
|
||||
list.Add(new CustomContextEntry(1078235, BeginReposition));
|
||||
|
||||
// Set Hue: 1151720
|
||||
list.Add(new CustomContextEntry(1151720, BeginRecolor));
|
||||
|
||||
// Rename: 1111680
|
||||
list.Add(new CustomContextEntry(1111680, BeginRename));
|
||||
|
||||
// Remove: 1011403
|
||||
list.Add(new CustomContextEntry(1011403, BeginRemove));
|
||||
}
|
||||
|
||||
public bool IsOwner(Mobile m)
|
||||
{
|
||||
var h = House;
|
||||
|
||||
if (!Deleted && h != null)
|
||||
{
|
||||
return h.IsOwner(m);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void BeginRecolor(Mobile m)
|
||||
{
|
||||
if (!IsOwner(m))
|
||||
{
|
||||
m.SendMessage("You do not own this gate.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m.HasItem<GateHueTicket>())
|
||||
{
|
||||
m.SendMessage(0x22, "A Gate Hue Ticket is required to recolor this gate.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
m.SendMessage(0x55, "Enter the new color for the gate (1-2999)...");
|
||||
m.BeginPrompt(EndRecolor, false);
|
||||
}
|
||||
|
||||
private void EndRecolor(Mobile m, string color)
|
||||
{
|
||||
if (!IsOwner(m))
|
||||
{
|
||||
m.SendMessage("You do not own this gate.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
int hue;
|
||||
|
||||
if (!Int32.TryParse(color, out hue) || hue <= 0 || hue >= 3000)
|
||||
{
|
||||
m.SendMessage(0x22, "You must pick a color between 1 and 2999 inclusive.");
|
||||
|
||||
BeginRecolor(m);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var ticket = m.FindItemByType<GateHueTicket>();
|
||||
|
||||
if (ticket == null)
|
||||
{
|
||||
m.SendMessage(0x22, "A Gate Hue Ticket is required to recolor this gate.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
ticket.Consume();
|
||||
|
||||
Hue = hue;
|
||||
|
||||
m.SendMessage(0x55, "The color of the gate has been changed.");
|
||||
}
|
||||
|
||||
public void BeginRename(Mobile m)
|
||||
{
|
||||
if (!IsOwner(m))
|
||||
{
|
||||
m.SendMessage("You do not own this gate.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
m.SendMessage(0x55, "Enter a new name for the gate...");
|
||||
m.BeginPrompt(EndRename, false);
|
||||
}
|
||||
|
||||
private void EndRename(Mobile m, string name)
|
||||
{
|
||||
if (!IsOwner(m))
|
||||
{
|
||||
m.SendMessage("You do not own this gate.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (String.IsNullOrWhiteSpace(name))
|
||||
{
|
||||
name = null;
|
||||
}
|
||||
|
||||
Name = name;
|
||||
|
||||
if (_Tile != null && _Tile.Gate == this && _Tile.Name != Name)
|
||||
{
|
||||
_Tile.Name = Name;
|
||||
}
|
||||
|
||||
m.SendMessage(0x55, "The name of the gate has been changed.");
|
||||
}
|
||||
|
||||
public void BeginReposition(Mobile m)
|
||||
{
|
||||
if (!IsOwner(m))
|
||||
{
|
||||
m.SendMessage("You do not own this gate.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
m.SendMessage(0x55, "Target a location to move the gate to...");
|
||||
m.BeginTarget<IPoint3D>(EndReposition, CancelReposition, -1, true);
|
||||
}
|
||||
|
||||
private void EndReposition(Mobile m, IPoint3D p)
|
||||
{
|
||||
if (!IsOwner(m))
|
||||
{
|
||||
m.SendMessage("You do not own this gate.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (_House == null || _House.Map == null || _House.Region == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var o = p.GetWorldTop(_House.Map);
|
||||
|
||||
var area = _House.Region.Area.Highest(b => b.End.Y);
|
||||
|
||||
var bounds = new Rectangle2D(area.Start.X, area.End.Y, area.Width, 5);
|
||||
|
||||
if (!bounds.Contains(o))
|
||||
{
|
||||
m.SendMessage(0x22, "The gate can only be moved within 5 tiles of the front of your house.");
|
||||
|
||||
BeginReposition(m);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_House.Map.CanFit(o, 20, true, false))
|
||||
{
|
||||
m.SendMessage(0x22, "The gate would not fit there.");
|
||||
|
||||
BeginReposition(m);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
MoveToWorld(o, m.Map);
|
||||
}
|
||||
|
||||
private void CancelReposition(Mobile m)
|
||||
{
|
||||
if (IsOwner(m))
|
||||
{
|
||||
m.SendMessage(0x22, "You decide not to place the gate.");
|
||||
}
|
||||
}
|
||||
|
||||
public void BeginRemove(Mobile m)
|
||||
{
|
||||
if (!IsOwner(m))
|
||||
{
|
||||
m.SendMessage("You do not own this gate.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
new ConfirmDialogGump(m)
|
||||
{
|
||||
Title = "Remove House Gate?",
|
||||
Html =
|
||||
"Are you sure you wish to remove this house gate?\n" +
|
||||
"This action can not be undone!\n\nClick OK to remove the gate...",
|
||||
AcceptHandler = b => EndRemove(m),
|
||||
CancelHandler = b => CancelRemove(m)
|
||||
}.Send();
|
||||
}
|
||||
|
||||
private void EndRemove(Mobile m)
|
||||
{
|
||||
if (!IsOwner(m))
|
||||
{
|
||||
m.SendMessage("You do not own this gate.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
m.SendMessage(0x22, "You remove the gate.");
|
||||
|
||||
Delete();
|
||||
}
|
||||
|
||||
private void CancelRemove(Mobile m)
|
||||
{
|
||||
if (IsOwner(m))
|
||||
{
|
||||
m.SendMessage(0x22, "You decide not to remove the gate.");
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.SetVersion(0);
|
||||
|
||||
writer.Write(_House);
|
||||
writer.Write(_Tile);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
reader.GetVersion();
|
||||
|
||||
_House = reader.ReadItem<BaseHouse>();
|
||||
_Tile = reader.ReadItem<HouseGateTile>();
|
||||
}
|
||||
}
|
||||
}
|
||||
108
Scripts/SubSystem/Cyrddin's_HouseGates/HouseGateConfirm.cs
Normal file
108
Scripts/SubSystem/Cyrddin's_HouseGates/HouseGateConfirm.cs
Normal file
@@ -0,0 +1,108 @@
|
||||
#region References
|
||||
using System;
|
||||
|
||||
using Server.Gumps;
|
||||
using Server.Mobiles;
|
||||
using Server.Regions;
|
||||
|
||||
using VitaNex.SuperGumps.UI;
|
||||
#endregion
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class HouseGateConfirm : ConfirmDialogGump
|
||||
{
|
||||
private const string _Info =
|
||||
"Your house gate has now been placed. " +
|
||||
"You can edit its settings by single-clicking the gate at your house and selecting an option from the menu. " +
|
||||
"To dye the gate, Have a Hue Room Tickets in your backpack, then select *set hue* in the settings.\n\n" +
|
||||
"IMPORTANT: You must make sure that the gate can be used from both sides by any player. " +
|
||||
"Placing obstacles that would trap players on any side of the gate is not allowed. " +
|
||||
"Any such gate will be removed without warning or refund.";
|
||||
|
||||
private readonly HouseGateTile _Tile;
|
||||
|
||||
public HouseGateConfirm(Mobile user, HouseGateTile tile)
|
||||
: base(user)
|
||||
{
|
||||
_Tile = tile;
|
||||
|
||||
Title = "Place House Gate";
|
||||
|
||||
Html =
|
||||
String.Format(
|
||||
"You are about to place a house gate at the cost of {0:#,0} gold. " +
|
||||
"Go to your house. Once you are in your house, click OK and the gate will be summoned!",
|
||||
_Tile.Price);
|
||||
|
||||
Modal = false;
|
||||
|
||||
CanMove = true;
|
||||
CanClose = true;
|
||||
CanDispose = true;
|
||||
}
|
||||
|
||||
protected override void OnAccept(GumpButton button)
|
||||
{
|
||||
base.OnAccept(button);
|
||||
|
||||
if (_Tile == null || _Tile.Deleted)
|
||||
{
|
||||
User.SendMessage(0x22, "The house teleporter you selected is no longer available.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (_Tile.Gate != null && !_Tile.Gate.Deleted && _Tile.Gate.House != null && !_Tile.Gate.House.Deleted)
|
||||
{
|
||||
User.SendMessage(0x22, "The house teleporter you selected is no longer available.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (HouseGate.CountGatesFor(User) > 0)
|
||||
{
|
||||
User.SendMessage(0x22, "You already own too many house gates.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var hr = User.GetRegion<HouseRegion>();
|
||||
|
||||
if (hr == null || hr.House == null)
|
||||
{
|
||||
User.SendMessage(0x22, "You must be in your house to place a gate.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (hr.House.Owner != User)
|
||||
{
|
||||
User.SendMessage(0x22, "You must be in a house that you own to place a gate.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Banker.Withdraw(User, _Tile.Price))
|
||||
{
|
||||
User.SendMessage(0x22, "You do not have the required gold to place a gate.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
new HouseGate(hr.House)
|
||||
{
|
||||
Tile = _Tile,
|
||||
Hue = Utility.RandomBrightHue()
|
||||
}.MoveToWorld(hr.House.BanLocation, hr.House.Map);
|
||||
|
||||
new NoticeDialogGump(User)
|
||||
{
|
||||
Title = "House Gate Information",
|
||||
Html = _Info,
|
||||
Width = 600,
|
||||
Height = 400
|
||||
}.Send();
|
||||
}
|
||||
}
|
||||
}
|
||||
229
Scripts/SubSystem/Cyrddin's_HouseGates/HouseGateTile.cs
Normal file
229
Scripts/SubSystem/Cyrddin's_HouseGates/HouseGateTile.cs
Normal file
@@ -0,0 +1,229 @@
|
||||
#region Header
|
||||
// Vorspire _,-'/-'/ ItemRelic.cs
|
||||
// . __,-; ,'( '/
|
||||
// \. `-.__`-._`:_,-._ _ , . ``
|
||||
// `:-._,------' ` _,`--` -: `_ , ` ,' :
|
||||
// `---..__,,--' (C) 2016 ` -'. -'
|
||||
// # Vita-Nex [http://core.vita-nex.com] #
|
||||
// {o)xxx|===============- # -===============|xxx(o}
|
||||
// # The MIT License (MIT) #
|
||||
#endregion
|
||||
|
||||
#region References
|
||||
using System;
|
||||
|
||||
using Server.Gumps;
|
||||
using Server.Mobiles;
|
||||
#endregion
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class HouseGateTile : Moongate
|
||||
{
|
||||
private HouseGate _Gate;
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor, AccessLevel.GameMaster)]
|
||||
public HouseGate Gate
|
||||
{
|
||||
get { return _Gate; }
|
||||
set
|
||||
{
|
||||
if (_Gate == value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var old = _Gate;
|
||||
|
||||
_Gate = value;
|
||||
|
||||
if (old != null && old.Tile == this)
|
||||
{
|
||||
old.Tile = null;
|
||||
}
|
||||
|
||||
if (_Gate != null && _Gate.Tile != this)
|
||||
{
|
||||
_Gate.Tile = this;
|
||||
}
|
||||
|
||||
if (_Gate != null)
|
||||
{
|
||||
Target = _Gate.GetWorldLocation();
|
||||
TargetMap = _Gate.Map;
|
||||
|
||||
Hue = _Gate.Hue;
|
||||
}
|
||||
else
|
||||
{
|
||||
Target = Point3D.Zero;
|
||||
TargetMap = null;
|
||||
|
||||
Hue = 0;
|
||||
Name = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor, AccessLevel.GameMaster)]
|
||||
public int Price { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor, AccessLevel.GameMaster)]
|
||||
public override int Hue
|
||||
{
|
||||
get { return base.Hue; }
|
||||
set
|
||||
{
|
||||
base.Hue = value;
|
||||
|
||||
if (_Gate != null && !_Gate.Deleted && _Gate.Tile == this && _Gate.Hue != value)
|
||||
{
|
||||
_Gate.Hue = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual int DefaultPrice { get { return 200000; } }
|
||||
|
||||
public override double DefaultWeight { get { return 0; } }
|
||||
|
||||
public override string DefaultName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Gate == null || Gate.Deleted)
|
||||
{
|
||||
return "Vacant House Gate";
|
||||
}
|
||||
|
||||
var h = Gate.House;
|
||||
|
||||
if (h == null || h.Deleted)
|
||||
{
|
||||
return "Vacant House Gate";
|
||||
}
|
||||
|
||||
if (h.Owner != null)
|
||||
{
|
||||
return h.Owner.Name;
|
||||
}
|
||||
|
||||
return "House Gate";
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ForceShowProperties { get { return true; } }
|
||||
|
||||
public override bool ShowFeluccaWarning { get { return false; } }
|
||||
|
||||
[Constructable]
|
||||
public HouseGateTile()
|
||||
: base(false)
|
||||
{
|
||||
Price = DefaultPrice;
|
||||
|
||||
ItemID = 6178;
|
||||
|
||||
Movable = false;
|
||||
Light = LightType.Circle300;
|
||||
}
|
||||
|
||||
public HouseGateTile(Serial serial)
|
||||
: base(serial)
|
||||
{ }
|
||||
|
||||
public override bool ValidateUse(Mobile m, bool message)
|
||||
{
|
||||
return this.CheckDoubleClick(m, message);
|
||||
}
|
||||
|
||||
public override void BeginConfirmation(Mobile m)
|
||||
{
|
||||
EndConfirmation(m);
|
||||
}
|
||||
|
||||
public override void CheckGate(Mobile m, int range)
|
||||
{
|
||||
range = 18;
|
||||
|
||||
base.CheckGate(m, range);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (!this.CheckDoubleClick(m))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (Gate != null && !Gate.Deleted && Gate.House != null && !Gate.House.Deleted)
|
||||
{
|
||||
CheckGate(m, 18);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (HouseGate.CountGatesFor(m) > 0)
|
||||
{
|
||||
m.SendMessage(0x22, "You already own too many house gates.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
new HouseGateConfirm(m, this).Send();
|
||||
}
|
||||
|
||||
public override void OnLocationChange(Point3D oldLocation)
|
||||
{
|
||||
base.OnLocationChange(oldLocation);
|
||||
|
||||
if (Gate != null && !Gate.Deleted && Gate.Tile == this)
|
||||
{
|
||||
Gate.Target = GetWorldLocation();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
base.OnMapChange();
|
||||
|
||||
if (Gate != null && !Gate.Deleted && Gate.Tile == this)
|
||||
{
|
||||
Gate.TargetMap = Map;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDelete()
|
||||
{
|
||||
base.OnDelete();
|
||||
|
||||
if (Gate != null)
|
||||
{
|
||||
Gate.Delete();
|
||||
Gate = null;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.SetVersion(0);
|
||||
|
||||
writer.Write(Price);
|
||||
|
||||
writer.Write(_Gate);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
reader.GetVersion();
|
||||
|
||||
Price = reader.ReadInt();
|
||||
|
||||
_Gate = reader.ReadItem<HouseGate>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user