jayates
Member
I made a lever when double clicked it brings out a moongate. The only problem is it puts the moongate right on top of the lever... so, I can't enter it since its right on top of the lever. Can my script be set to put it right in front of me or somewhere else in the area? Any help is much appreciated! Here's my script:
using System;
using Server;
using Server.Gumps;
using Server.Network;
using System.Collections;
using Server.Multis;
using Server.Mobiles;
namespace Server.Items
{
public class MoongateGearBoxLever : Item
{
[Constructable]
public MoongateGearBoxLever() : this( null )
{
}
[Constructable]
public MoongateGearBoxLever ( string name ) : base (4238)
{
Name = "a lever";
Movable = false;
}
public MoongateGearBoxLever ( Serial serial ) : base ( serial )
{
}
public override void OnDoubleClick( Mobile p )
{
Item a = p.Backpack.FindItemByType( typeof(LeverToken) );
if ( a != null )
{
a.Delete();
p.Say( "Step through the moongate!" );
p.SendMessage( "You open a moongate to the Cargo Hold!" );
p.PlaySound(0x1F7);
CargoHoldGate chg = new CargoHoldGate();
chg.Map = this.Map;
chg.Location = this.Location;
}
else
{
p.SendMessage( "nothing happens" );
}
}
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();
}
}
}