Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
78
Scripts/Items/Internal/TeleportRope.cs
Normal file
78
Scripts/Items/Internal/TeleportRope.cs
Normal file
@@ -0,0 +1,78 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class TeleportRope : Static
|
||||
{
|
||||
public virtual bool AllowDead { get { return true; } }
|
||||
|
||||
[CommandProperty(AccessLevel.Administrator)]
|
||||
public Point3D ToLocation { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.Administrator)]
|
||||
public Map ToMap { get; set; }
|
||||
|
||||
[Constructable]
|
||||
public TeleportRope()
|
||||
: base(0x14FA)
|
||||
{
|
||||
ToLocation = Point3D.Zero;
|
||||
ToMap = Map.Internal;
|
||||
}
|
||||
|
||||
public TeleportRope(Serial serial)
|
||||
: base(serial)
|
||||
{ }
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
base.OnDoubleClick(from);
|
||||
|
||||
if (ToLocation == Point3D.Zero ||
|
||||
ToMap == Map.Internal)
|
||||
return;
|
||||
|
||||
from.MoveToWorld(ToLocation, ToMap);
|
||||
}
|
||||
|
||||
public override void OnDoubleClickDead(Mobile from)
|
||||
{
|
||||
if (AllowDead)
|
||||
{
|
||||
OnDoubleClick(from);
|
||||
}
|
||||
else
|
||||
{
|
||||
base.OnDoubleClickDead(from);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // Version
|
||||
writer.Write(ToLocation);
|
||||
writer.Write(ToMap);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 0:
|
||||
ToLocation = reader.ReadPoint3D();
|
||||
ToMap = reader.ReadMap();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user