Значения свои ставьте, какие нужны+можете поставить сейв-зону вокруг стоуна+задержну на рекол (по дефолту стоит 0s)
using System;
using Server;
using Server.Gumps;
using Server.Items;
using Server.Network;
using Server.Mobiles;
using Server.Commands;
namespace Server.Gumps
{
public class TravelStoneGump : Gump
{
public static readonly int StepsAway = 2; // how many steps away you can be to access stone
public static readonly int texthue = 1152; // the hue of the text from the stone
public static readonly int stonehue = 1150; // the hue of the Town Stone
private Mobile m;
private static Item m_TravelStone;
private Point3D m_loc;
private static Map m_Map;
private Point3D cur_loc;//= new Point3D(m.X,m.Y,m.Z);
public static void Initialize()
{
CommandSystem.Register( "Travel", AccessLevel.GameMaster, new CommandEventHandler( Travel_OnCommand ) );
}
[Usage( "Travel" )]
[Description( "Command for Travel for in-Game testing." )]
public static void Travel_OnCommand( CommandEventArgs e )
{
e.Mobile.SendGump(new TravelStoneGump( e.Mobile, m_TravelStone, m_Map ) );
}
public TravelStoneGump(Mobile m_Mobile, Item m_TStone, Map map) : base( 0, 0 )
{
m = m_Mobile;
m_TravelStone = m_TStone;
m_Map = map;
//////////////////////////////Main Menu////////////////////////////
this.Closable=true;
this.Disposable=true;
this.Dragable=true;
this.Resizable=false;
this.AddPage(0);
this.AddBackground(187, 47, 296, 479, 9200);
// Towns
this.AddLabel(233, 117, 0, @"Britain");
this.AddButton(209, 118, 1210, 1209, 1, GumpButtonType.Reply, 0);
this.AddLabel(233, 157, 0, @"Moonglow");
this.AddButton(209, 158, 1210, 1209, 2, GumpButtonType.Reply, 0);
this.AddLabel(233, 198, 0, @"Jhelom");
this.AddButton(209, 198, 1210, 1209, 3, GumpButtonType.Reply, 0);
this.AddLabel(233, 278, 0, @"Minoc");
this.AddButton(209, 278, 1210, 1209, 4, GumpButtonType.Reply, 0);
this.AddLabel(233, 318, 0, @"Trinsic");
this.AddButton(209, 318, 1210, 1209, 5, GumpButtonType.Reply, 0);
this.AddLabel(233, 358, 0, @"Skara Brae");
this.AddButton(208, 358, 1210, 1209, 6, GumpButtonType.Reply, 0);
this.AddLabel(233, 398, 0, @"Magincia");
this.AddButton(209, 398, 1210, 1209, 7, GumpButtonType.Reply, 0);
this.AddLabel(233, 438, 0, @"Buccaneer's Den");
this.AddButton(209, 438, 1210, 1209, 8, GumpButtonType.Reply, 0);
this.AddLabel(233, 238, 0, @"Yew");
this.AddButton(209, 238, 1210, 1209, 9, GumpButtonType.Reply, 0);
// Dungeons
this.AddLabel(401, 117, 0, @"Covetous");
this.AddButton(377, 118, 1210, 1209, 10, GumpButtonType.Reply, 0);
this.AddLabel(401, 158, 0, @"Deceit");
this.AddButton(378, 159, 1210, 1209, 11, GumpButtonType.Reply, 0);
this.AddLabel(401, 197, 0, @"Despise");
this.AddButton(378, 199, 1210, 1209, 12, GumpButtonType.Reply, 0);
this.AddLabel(401, 237, 0, @"Destard");
this.AddButton(377, 238, 1210, 1209, 13, GumpButtonType.Reply, 0);
this.AddLabel(401, 278, 0, @"Hythloth");
this.AddButton(378, 278, 1210, 1209, 14, GumpButtonType.Reply, 0);
this.AddLabel(402, 318, 0, @"Shame");
this.AddButton(378, 318, 1210, 1209, 15, GumpButtonType.Reply, 0);
this.AddLabel(401, 357, 0, @"Wrong");
this.AddButton(378, 359, 1210, 1209, 16, GumpButtonType.Reply, 0);
this.AddLabel(401, 397, 0, @"Fire");
this.AddButton(378, 399, 1210, 1209, 17, GumpButtonType.Reply, 0);
this.AddLabel(401, 438, 0, @"Ice");
this.AddButton(377, 439, 1210, 1209, 18, GumpButtonType.Reply, 0);
this.AddLabel(300, 55, 43, @"Travel Stone");
this.AddLabel(209, 496, 43, @"Created By: Equanox & RoadMaster");//272,496,43
this.AddLabel(275, 80, 43, @"Felucca");
this.AddButton(250, 83, 1210, 1209, 19, GumpButtonType.Reply, 0);//Felucca
this.AddLabel(375, 80, 43, @"Trammel");
this.AddButton(350, 83, 1210, 1209, 20, GumpButtonType.Reply, 0);//Trammel
this.AddImage(137, 14, 10400);
this.AddImage(137, 160, 10401);
this.AddImage(137, 462, 10402);
this.AddImage(451, 14, 10410);
this.AddImage(450, 162, 10411);
this.AddImage(451, 461, 10412);
this.AddImage(137, 309, 10401);
this.AddImage(450, 311, 10411);
}
public override void OnResponse( NetState state, RelayInfo info )
{
Mobile from = state.Mobile;
Point3D cur_loc = new Point3D(m.X,m.Y,m.Z);
switch (info.ButtonID)
{
case 1: //Britain
{ m_loc = new Point3D(1418,1695,0); MapCheck(from); break; }
case 2: //Moonglow
{ m_loc = new Point3D(4452,1168,0); MapCheck(from); break; }
case 3: //Jhelom
{ m_loc = new Point3D(1418,3824,0); MapCheck(from); break; }
case 4: //Minoc
{ m_loc = new Point3D(2521,586,0); MapCheck(from); break; }
case 5: //Trinsic
{ m_loc = new Point3D(1933,2782,0); MapCheck(from); break; }
case 6: //Skara Brae
{ m_loc = new Point3D(789,2244,0); MapCheck(from); break; }
case 7: //Magincia
{ m_loc = new Point3D(3731,2164,20); MapCheck(from); break; }
case 8: //Buccaneer's Den
{ m_loc = new Point3D(2682,2126,0); MapCheck(from); break; }
case 9: //Yew
{ m_loc = new Point3D(537,993,0); MapCheck(from); break; }
case 10: //Covetous
{ m_loc = new Point3D(2498,923,0); MapCheck(from); break; }
case 11: //Deceit
{ m_loc = new Point3D(4110,435,5); MapCheck(from); break; }
case 12: //Despise
{ m_loc = new Point3D(1302,1080,0); MapCheck(from); break; }
case 13: //Destard
{ m_loc = new Point3D(1175,2640,2); MapCheck(from); break; }
case 14: //Hythloth
{ m_loc = new Point3D(4723,3825,0); MapCheck(from); break; }
case 15: //Shame
{ m_loc = new Point3D(511,1566,0); MapCheck(from); break; }
case 16: //Wrong
{ m_loc = new Point3D(2041,242,10); MapCheck(from); break; }
case 17: //Fire
{ m_loc = new Point3D(5757,2880,14); MapCheck(from); break; }
case 18: //Ice
{ m_loc = new Point3D(5214,2319,33); MapCheck(from); break; }
case 19:
{
if(info.ButtonID == 19)
{
from.SendMessage( 22, "You have chosen Felucca");
m_Map = null;
m_Map = Map.Felucca;
from.SendGump(new TravelStoneGump( from, m_TravelStone, m_Map ) );
}
break;
}
case 20:
{
if(info.ButtonID == 20)
{
from.SendMessage( 22, "You have chosen Trammel");
m_Map = null;
m_Map = Map.Trammel;
from.SendGump(new TravelStoneGump( from, m_TravelStone, m_Map ) );
}
break;
}
}
}
public void MapCheck(Mobile m)
{
if(m_Map != null)
RangeCheck(m);
else
{
m.SendGump(new TravelStoneGump( m, m_TravelStone, m_Map ) );
if(m.HasGump( typeof( MapGump ) ) )
{
m.SendMessage("You need to choose a Map first!");
m.CloseGump(typeof( MapGump ));
}
m.SendGump(new MapGump() );
}
}
public void RangeCheck(Mobile m)
{
if (m.InRange(m_loc, 2))
{
if(m.Map == m_Map)
{
m.SendMessage( texthue, "You are already there, Would you like to try again?" );
m.SendGump(new TravelStoneGump( m, m_TravelStone, m_Map ) );
return;
}
else
teleport(m);
}
else
teleport(m);
}
public void teleport(Mobile m)
{
Effects.SendLocationParticles( EffectItem.Create( cur_loc , m.Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 2023 );
Effects.PlaySound( cur_loc, m.Map, 0x1FE );
//m.MoveToWorld( m_loc, m_Map);
// edited for b36 by KillerBeeZ @ www.CTlinx.com
m.Location = m_loc;
m.Map = m_Map;
// end edited
m.SendMessage( 22, "Welcome To {0} in [{1}]",m.Region, m_Map);
BaseCreature.TeleportPets( m, m_loc, m.Map );
Effects.SendLocationParticles( EffectItem.Create( m_loc , m.Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 2023 );
Effects.PlaySound( m_loc, m.Map, 0x1FE );
}
}
public class MapGump : Gump
{
public MapGump() : base( 0, 0 )
{
this.Closable=true;
this.Disposable=true;
this.Dragable=true;
this.Resizable=false;
this.AddPage(0);
this.AddBackground(220, 200, 222, 60, 9200);
this.AddLabel(234, 220, 22, @"You Must Choose a Map first!");
}
}
public class TravelStone : Item
{
[Constructable]
public TravelStone() : base( 0xED4 )
{
Movable = false;
Hue = TravelStoneGump.stonehue;
Name = "a Travel stone";
}
public override void OnDoubleClick( Mobile from )
{
if ( from.InRange( this.GetWorldLocation(), TravelStoneGump.StepsAway ))
{
from.CloseGump( typeof( TravelStoneGump ) );
from.SendGump( new TravelStoneGump(from, this, null) );
}
else
{
from.SendMessage( TravelStoneGump.texthue, "You must be closer to the stone." );
}
}
public TravelStone( Serial serial ) : base( serial )
{
}
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();
}
}
}