This commit is contained in:
commit
47711d616e
2644 changed files with 479454 additions and 0 deletions
1671
Scripts/Multis/Boats/BaseBoat.cs
Normal file
1671
Scripts/Multis/Boats/BaseBoat.cs
Normal file
File diff suppressed because it is too large
Load diff
183
Scripts/Multis/Boats/BaseBoatDeed.cs
Normal file
183
Scripts/Multis/Boats/BaseBoatDeed.cs
Normal file
|
|
@ -0,0 +1,183 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Regions;
|
||||
using Server.Targeting;
|
||||
using Server.Engines.CannedEvil;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public abstract class BaseBoatDeed : Item
|
||||
{
|
||||
private int m_MultiID;
|
||||
private Point3D m_Offset;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int MultiID{ get{ return m_MultiID; } set{ m_MultiID = value; } }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Point3D Offset{ get{ return m_Offset; } set{ m_Offset = value; } }
|
||||
|
||||
public BaseBoatDeed( int id, Point3D offset ) : base( 0x14F2 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
|
||||
if ( !Core.AOS )
|
||||
LootType = LootType.Newbied;
|
||||
|
||||
m_MultiID = id & 0x3FFF;
|
||||
m_Offset = offset;
|
||||
}
|
||||
|
||||
public BaseBoatDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( m_MultiID );
|
||||
writer.Write( m_Offset );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_MultiID = reader.ReadInt();
|
||||
m_Offset = reader.ReadPoint3D();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( Weight == 0.0 )
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( !IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
else if ( from.AccessLevel < AccessLevel.GameMaster && (from.Map == Map.Ilshenar || from.Map == Map.Malas) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1010567, null, 0x25 ); // You may not place a boat from this location.
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( Core.SE )
|
||||
from.SendLocalizedMessage( 502482 ); // Where do you wish to place the ship?
|
||||
else
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 502482 ); // Where do you wish to place the ship?
|
||||
|
||||
from.Target = new InternalTarget( this );
|
||||
}
|
||||
}
|
||||
|
||||
public abstract BaseBoat Boat{ get; }
|
||||
|
||||
public void OnPlacement( Mobile from, Point3D p )
|
||||
{
|
||||
if ( Deleted )
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if ( !IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
else
|
||||
{
|
||||
Map map = from.Map;
|
||||
|
||||
if ( map == null )
|
||||
return;
|
||||
|
||||
if ( from.AccessLevel < AccessLevel.GameMaster && (map == Map.Ilshenar || map == Map.Malas) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1043284 ); // A ship can not be created here.
|
||||
return;
|
||||
}
|
||||
|
||||
if ( from.Region.IsPartOf( typeof( HouseRegion ) ) || Server.Multis.BaseBoat.FindBoatAt( from, from.Map ) != null )
|
||||
{
|
||||
from.SendLocalizedMessage( 1010568, null, 0x25 ); // You may not place a ship while on another ship or inside a house.
|
||||
return;
|
||||
}
|
||||
|
||||
BaseBoat boat = Boat;
|
||||
|
||||
if ( boat == null )
|
||||
return;
|
||||
|
||||
p = new Point3D( p.X - m_Offset.X, p.Y - m_Offset.Y, p.Z - m_Offset.Z );
|
||||
|
||||
if ( BaseBoat.IsValidLocation( p, map ) && boat.CanFit( p, map, boat.ItemID ) )
|
||||
{
|
||||
Delete();
|
||||
|
||||
boat.Owner = from;
|
||||
boat.Anchored = true;
|
||||
|
||||
uint keyValue = boat.CreateKeys( from );
|
||||
|
||||
if ( boat.PPlank != null )
|
||||
boat.PPlank.KeyValue = keyValue;
|
||||
|
||||
if ( boat.SPlank != null )
|
||||
boat.SPlank.KeyValue = keyValue;
|
||||
|
||||
boat.MoveToWorld( p, map );
|
||||
}
|
||||
else
|
||||
{
|
||||
boat.Delete();
|
||||
from.SendLocalizedMessage( 1043284 ); // A ship can not be created here.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : MultiTarget
|
||||
{
|
||||
private BaseBoatDeed m_Deed;
|
||||
|
||||
public InternalTarget( BaseBoatDeed deed ) : base( deed.MultiID, deed.Offset )
|
||||
{
|
||||
m_Deed = deed;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object o )
|
||||
{
|
||||
IPoint3D ip = o as IPoint3D;
|
||||
|
||||
if ( ip != null )
|
||||
{
|
||||
if ( ip is Item )
|
||||
ip = ((Item)ip).GetWorldTop();
|
||||
|
||||
Point3D p = new Point3D( ip );
|
||||
|
||||
Region region = Region.Find( p, from.Map );
|
||||
|
||||
if ( region.IsPartOf( typeof( DungeonRegion ) ) )
|
||||
from.SendLocalizedMessage( 502488 ); // You can not place a ship inside a dungeon.
|
||||
else if ( region.IsPartOf( typeof( HouseRegion ) ) || region.IsPartOf( typeof( ChampionSpawnRegion ) ) )
|
||||
from.SendLocalizedMessage( 1042549 ); // A boat may not be placed in this area.
|
||||
else
|
||||
m_Deed.OnPlacement( from, p );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
193
Scripts/Multis/Boats/BaseDockedBoat.cs
Normal file
193
Scripts/Multis/Boats/BaseDockedBoat.cs
Normal file
|
|
@ -0,0 +1,193 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Regions;
|
||||
using Server.Targeting;
|
||||
using Server.Engines.CannedEvil;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public abstract class BaseDockedBoat : Item
|
||||
{
|
||||
private int m_MultiID;
|
||||
private Point3D m_Offset;
|
||||
private string m_ShipName;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int MultiID{ get{ return m_MultiID; } set{ m_MultiID = value; } }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Point3D Offset{ get{ return m_Offset; } set{ m_Offset = value; } }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public string ShipName{ get{ return m_ShipName; } set{ m_ShipName = value; InvalidateProperties(); } }
|
||||
|
||||
public BaseDockedBoat( int id, Point3D offset, BaseBoat boat ) : base( 0x14F4 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
m_MultiID = id & 0x3FFF;
|
||||
m_Offset = offset;
|
||||
|
||||
m_ShipName = boat.ShipName;
|
||||
}
|
||||
|
||||
public BaseDockedBoat( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 1 ); // version
|
||||
|
||||
writer.Write( m_MultiID );
|
||||
writer.Write( m_Offset );
|
||||
writer.Write( m_ShipName );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
case 0:
|
||||
{
|
||||
m_MultiID = reader.ReadInt();
|
||||
m_Offset = reader.ReadPoint3D();
|
||||
m_ShipName = reader.ReadString();
|
||||
|
||||
if ( version == 0 )
|
||||
reader.ReadUInt();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( LootType == LootType.Newbied )
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
if ( Weight == 0.0 )
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( !IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 502482 ); // Where do you wish to place the ship?
|
||||
|
||||
from.Target = new InternalTarget( this );
|
||||
}
|
||||
}
|
||||
|
||||
public abstract BaseBoat Boat{ get; }
|
||||
|
||||
public override void AddNameProperty( ObjectPropertyList list )
|
||||
{
|
||||
if ( m_ShipName != null )
|
||||
list.Add( m_ShipName );
|
||||
else
|
||||
base.AddNameProperty( list );
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
if ( m_ShipName != null )
|
||||
LabelTo( from, m_ShipName );
|
||||
else
|
||||
base.OnSingleClick( from );
|
||||
}
|
||||
|
||||
public void OnPlacement( Mobile from, Point3D p )
|
||||
{
|
||||
if ( Deleted )
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if ( !IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
else
|
||||
{
|
||||
Map map = from.Map;
|
||||
|
||||
if ( map == null )
|
||||
return;
|
||||
|
||||
BaseBoat boat = Boat;
|
||||
|
||||
if ( boat == null )
|
||||
return;
|
||||
|
||||
p = new Point3D( p.X - m_Offset.X, p.Y - m_Offset.Y, p.Z - m_Offset.Z );
|
||||
|
||||
if ( BaseBoat.IsValidLocation( p, map ) && boat.CanFit( p, map, boat.ItemID ) && map != Map.Ilshenar && map != Map.Malas )
|
||||
{
|
||||
Delete();
|
||||
|
||||
boat.Owner = from;
|
||||
boat.Anchored = true;
|
||||
boat.ShipName = m_ShipName;
|
||||
|
||||
uint keyValue = boat.CreateKeys( from );
|
||||
|
||||
if ( boat.PPlank != null )
|
||||
boat.PPlank.KeyValue = keyValue;
|
||||
|
||||
if ( boat.SPlank != null )
|
||||
boat.SPlank.KeyValue = keyValue;
|
||||
|
||||
boat.MoveToWorld( p, map );
|
||||
}
|
||||
else
|
||||
{
|
||||
boat.Delete();
|
||||
from.SendLocalizedMessage( 1043284 ); // A ship can not be created here.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : MultiTarget
|
||||
{
|
||||
private BaseDockedBoat m_Model;
|
||||
|
||||
public InternalTarget( BaseDockedBoat model ) : base( model.MultiID, model.Offset )
|
||||
{
|
||||
m_Model = model;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object o )
|
||||
{
|
||||
IPoint3D ip = o as IPoint3D;
|
||||
|
||||
if ( ip != null )
|
||||
{
|
||||
if ( ip is Item )
|
||||
ip = ((Item)ip).GetWorldTop();
|
||||
|
||||
Point3D p = new Point3D( ip );
|
||||
|
||||
Region region = Region.Find( p, from.Map );
|
||||
|
||||
if ( region.IsPartOf( typeof( DungeonRegion ) ) )
|
||||
from.SendLocalizedMessage( 502488 ); // You can not place a ship inside a dungeon.
|
||||
else if ( region.IsPartOf( typeof( HouseRegion ) ) || region.IsPartOf( typeof( ChampionSpawnRegion ) ) )
|
||||
from.SendLocalizedMessage( 1042549 ); // A boat may not be placed in this area.
|
||||
else
|
||||
m_Model.OnPlacement( from, p );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
40
Scripts/Multis/Boats/ConfirmDryDockGump.cs
Normal file
40
Scripts/Multis/Boats/ConfirmDryDockGump.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public class ConfirmDryDockGump : Gump
|
||||
{
|
||||
private Mobile m_From;
|
||||
private BaseBoat m_Boat;
|
||||
|
||||
public ConfirmDryDockGump( Mobile from, BaseBoat boat ) : base( 150, 200 )
|
||||
{
|
||||
m_From = from;
|
||||
m_Boat = boat;
|
||||
|
||||
m_From.CloseGump( typeof( ConfirmDryDockGump ) );
|
||||
|
||||
AddPage( 0 );
|
||||
|
||||
AddBackground( 0, 0, 220, 170, 5054 );
|
||||
AddBackground( 10, 10, 200, 150, 3000 );
|
||||
|
||||
AddHtmlLocalized( 20, 20, 180, 80, 1018319, true, false ); // Do you wish to dry dock this boat?
|
||||
|
||||
AddHtmlLocalized( 55, 100, 140, 25, 1011011, false, false ); // CONTINUE
|
||||
AddButton( 20, 100, 4005, 4007, 2, GumpButtonType.Reply, 0 );
|
||||
|
||||
AddHtmlLocalized( 55, 125, 140, 25, 1011012, false, false ); // CANCEL
|
||||
AddButton( 20, 125, 4005, 4007, 1, GumpButtonType.Reply, 0 );
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState state, RelayInfo info )
|
||||
{
|
||||
if ( info.ButtonID == 2 )
|
||||
m_Boat.EndDryDock( m_From );
|
||||
}
|
||||
}
|
||||
}
|
||||
125
Scripts/Multis/Boats/Hold.cs
Normal file
125
Scripts/Multis/Boats/Hold.cs
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Hold : Container
|
||||
{
|
||||
private BaseBoat m_Boat;
|
||||
|
||||
public Hold( BaseBoat boat ) : base( 0x3EAE )
|
||||
{
|
||||
m_Boat = boat;
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public Hold( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public void SetFacing( Direction dir )
|
||||
{
|
||||
switch ( dir )
|
||||
{
|
||||
case Direction.East: ItemID = 0x3E65; break;
|
||||
case Direction.West: ItemID = 0x3E93; break;
|
||||
case Direction.North: ItemID = 0x3EAE; break;
|
||||
case Direction.South: ItemID = 0x3EB9; break;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnDragDrop( Mobile from, Item item )
|
||||
{
|
||||
if ( m_Boat == null || !m_Boat.Contains( from ) || m_Boat.IsMoving )
|
||||
return false;
|
||||
|
||||
return base.OnDragDrop( from, item );
|
||||
}
|
||||
|
||||
public override bool OnDragDropInto( Mobile from, Item item, Point3D p )
|
||||
{
|
||||
if ( m_Boat == null || !m_Boat.Contains( from ) || m_Boat.IsMoving )
|
||||
return false;
|
||||
|
||||
return base.OnDragDropInto( from, item, p );
|
||||
}
|
||||
|
||||
public override bool CheckItemUse( Mobile from, Item item )
|
||||
{
|
||||
if ( item != this && (m_Boat == null || !m_Boat.Contains( from ) || m_Boat.IsMoving) )
|
||||
return false;
|
||||
|
||||
return base.CheckItemUse( from, item );
|
||||
}
|
||||
|
||||
public override bool CheckLift( Mobile from, Item item, ref LRReason reject )
|
||||
{
|
||||
if ( m_Boat == null || !m_Boat.Contains( from ) || m_Boat.IsMoving )
|
||||
return false;
|
||||
|
||||
return base.CheckLift( from, item, ref reject );
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
if ( m_Boat != null )
|
||||
m_Boat.Delete();
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_Boat == null || !m_Boat.Contains( from ) )
|
||||
{
|
||||
if ( m_Boat.TillerMan != null )
|
||||
m_Boat.TillerMan.Say( 502490 ); // You must be on the ship to open the hold.
|
||||
}
|
||||
else if ( m_Boat.IsMoving )
|
||||
{
|
||||
if ( m_Boat.TillerMan != null )
|
||||
m_Boat.TillerMan.Say( 502491 ); // I can not open the hold while the ship is moving.
|
||||
}
|
||||
else
|
||||
{
|
||||
base.OnDoubleClick( from );
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsDecoContainer
|
||||
{
|
||||
get{ return false; }
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 );
|
||||
|
||||
writer.Write( m_Boat );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_Boat = reader.ReadItem() as BaseBoat;
|
||||
|
||||
if ( m_Boat == null || Parent != null )
|
||||
Delete();
|
||||
|
||||
Movable = false;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
103
Scripts/Multis/Boats/LargeBoat.cs
Normal file
103
Scripts/Multis/Boats/LargeBoat.cs
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public class LargeBoat : BaseBoat
|
||||
{
|
||||
public override int NorthID{ get{ return 0x4010; } }
|
||||
public override int EastID{ get{ return 0x4011; } }
|
||||
public override int SouthID{ get{ return 0x4012; } }
|
||||
public override int WestID{ get{ return 0x4013; } }
|
||||
|
||||
public override int HoldDistance{ get{ return 5; } }
|
||||
public override int TillerManDistance{ get{ return -5; } }
|
||||
|
||||
public override Point2D StarboardOffset{ get{ return new Point2D( 2, -1 ); } }
|
||||
public override Point2D PortOffset{ get{ return new Point2D( -2, -1 ); } }
|
||||
|
||||
public override Point3D MarkOffset{ get{ return new Point3D( 0, 0, 3 ); } }
|
||||
|
||||
public override BaseDockedBoat DockedBoat{ get{ return new LargeDockedBoat( this ); } }
|
||||
|
||||
[Constructable]
|
||||
public LargeBoat()
|
||||
{
|
||||
}
|
||||
|
||||
public LargeBoat( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int)0 );
|
||||
}
|
||||
}
|
||||
|
||||
public class LargeBoatDeed : BaseBoatDeed
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1041209; } } // large ship deed
|
||||
public override BaseBoat Boat{ get{ return new LargeBoat(); } }
|
||||
|
||||
[Constructable]
|
||||
public LargeBoatDeed() : base( 0x4010, new Point3D( 0, -1, 0 ) )
|
||||
{
|
||||
}
|
||||
|
||||
public LargeBoatDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int)0 );
|
||||
}
|
||||
}
|
||||
|
||||
public class LargeDockedBoat : BaseDockedBoat
|
||||
{
|
||||
public override BaseBoat Boat{ get{ return new LargeBoat(); } }
|
||||
|
||||
public LargeDockedBoat( BaseBoat boat ) : base( 0x4010, new Point3D( 0, -1, 0 ), boat )
|
||||
{
|
||||
}
|
||||
|
||||
public LargeDockedBoat( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int)0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
103
Scripts/Multis/Boats/LargeDragonBoat.cs
Normal file
103
Scripts/Multis/Boats/LargeDragonBoat.cs
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public class LargeDragonBoat : BaseBoat
|
||||
{
|
||||
public override int NorthID{ get{ return 0x4014; } }
|
||||
public override int EastID{ get{ return 0x4015; } }
|
||||
public override int SouthID{ get{ return 0x4016; } }
|
||||
public override int WestID{ get{ return 0x4017; } }
|
||||
|
||||
public override int HoldDistance{ get{ return 5; } }
|
||||
public override int TillerManDistance{ get{ return -5; } }
|
||||
|
||||
public override Point2D StarboardOffset{ get{ return new Point2D( 2, -1 ); } }
|
||||
public override Point2D PortOffset{ get{ return new Point2D( -2, -1 ); } }
|
||||
|
||||
public override Point3D MarkOffset{ get{ return new Point3D( 0, 0, 3 ); } }
|
||||
|
||||
public override BaseDockedBoat DockedBoat{ get{ return new LargeDockedDragonBoat( this ); } }
|
||||
|
||||
[Constructable]
|
||||
public LargeDragonBoat()
|
||||
{
|
||||
}
|
||||
|
||||
public LargeDragonBoat( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int)0 );
|
||||
}
|
||||
}
|
||||
|
||||
public class LargeDragonBoatDeed : BaseBoatDeed
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1041210; } }// large dragon ship deed
|
||||
public override BaseBoat Boat{ get{ return new LargeDragonBoat(); } }
|
||||
|
||||
[Constructable]
|
||||
public LargeDragonBoatDeed() : base( 0x4014, new Point3D( 0, -1, 0 ) )
|
||||
{
|
||||
}
|
||||
|
||||
public LargeDragonBoatDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int)0 );
|
||||
}
|
||||
}
|
||||
|
||||
public class LargeDockedDragonBoat : BaseDockedBoat
|
||||
{
|
||||
public override BaseBoat Boat{ get{ return new LargeDragonBoat(); } }
|
||||
|
||||
public LargeDockedDragonBoat( BaseBoat boat ) : base( 0x4014, new Point3D( 0, -1, 0 ), boat )
|
||||
{
|
||||
}
|
||||
|
||||
public LargeDockedDragonBoat( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int)0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
103
Scripts/Multis/Boats/MediumBoat.cs
Normal file
103
Scripts/Multis/Boats/MediumBoat.cs
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public class MediumBoat : BaseBoat
|
||||
{
|
||||
public override int NorthID{ get{ return 0x4008; } }
|
||||
public override int EastID{ get{ return 0x4009; } }
|
||||
public override int SouthID{ get{ return 0x400A; } }
|
||||
public override int WestID{ get{ return 0x400B; } }
|
||||
|
||||
public override int HoldDistance{ get{ return 4; } }
|
||||
public override int TillerManDistance{ get{ return -5; } }
|
||||
|
||||
public override Point2D StarboardOffset{ get{ return new Point2D( 2, 0 ); } }
|
||||
public override Point2D PortOffset{ get{ return new Point2D( -2, 0 ); } }
|
||||
|
||||
public override Point3D MarkOffset{ get{ return new Point3D( 0, 1, 3 ); } }
|
||||
|
||||
public override BaseDockedBoat DockedBoat{ get{ return new MediumDockedBoat( this ); } }
|
||||
|
||||
[Constructable]
|
||||
public MediumBoat()
|
||||
{
|
||||
}
|
||||
|
||||
public MediumBoat( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int)0 );
|
||||
}
|
||||
}
|
||||
|
||||
public class MediumBoatDeed : BaseBoatDeed
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1041207; } } // medium ship deed
|
||||
public override BaseBoat Boat{ get{ return new MediumBoat(); } }
|
||||
|
||||
[Constructable]
|
||||
public MediumBoatDeed() : base( 0x4008, Point3D.Zero )
|
||||
{
|
||||
}
|
||||
|
||||
public MediumBoatDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int)0 );
|
||||
}
|
||||
}
|
||||
|
||||
public class MediumDockedBoat : BaseDockedBoat
|
||||
{
|
||||
public override BaseBoat Boat{ get{ return new MediumBoat(); } }
|
||||
|
||||
public MediumDockedBoat( BaseBoat boat ) : base( 0x4008, Point3D.Zero, boat )
|
||||
{
|
||||
}
|
||||
|
||||
public MediumDockedBoat( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int)0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
103
Scripts/Multis/Boats/MediumDragonBoat.cs
Normal file
103
Scripts/Multis/Boats/MediumDragonBoat.cs
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public class MediumDragonBoat : BaseBoat
|
||||
{
|
||||
public override int NorthID{ get{ return 0x400C; } }
|
||||
public override int EastID{ get{ return 0x400D; } }
|
||||
public override int SouthID{ get{ return 0x400E; } }
|
||||
public override int WestID{ get{ return 0x400F; } }
|
||||
|
||||
public override int HoldDistance{ get{ return 4; } }
|
||||
public override int TillerManDistance{ get{ return -5; } }
|
||||
|
||||
public override Point2D StarboardOffset{ get{ return new Point2D( 2, 0 ); } }
|
||||
public override Point2D PortOffset{ get{ return new Point2D( -2, 0 ); } }
|
||||
|
||||
public override Point3D MarkOffset{ get{ return new Point3D( 0, 1, 3 ); } }
|
||||
|
||||
public override BaseDockedBoat DockedBoat{ get{ return new MediumDockedDragonBoat( this ); } }
|
||||
|
||||
[Constructable]
|
||||
public MediumDragonBoat()
|
||||
{
|
||||
}
|
||||
|
||||
public MediumDragonBoat( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int)0 );
|
||||
}
|
||||
}
|
||||
|
||||
public class MediumDragonBoatDeed : BaseBoatDeed
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1041208; } } // medium dragon ship deed
|
||||
public override BaseBoat Boat{ get{ return new MediumDragonBoat(); } }
|
||||
|
||||
[Constructable]
|
||||
public MediumDragonBoatDeed() : base( 0x400C, Point3D.Zero )
|
||||
{
|
||||
}
|
||||
|
||||
public MediumDragonBoatDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int)0 );
|
||||
}
|
||||
}
|
||||
|
||||
public class MediumDockedDragonBoat : BaseDockedBoat
|
||||
{
|
||||
public override BaseBoat Boat{ get{ return new MediumDragonBoat(); } }
|
||||
|
||||
public MediumDockedDragonBoat( BaseBoat boat ) : base( 0x400C, Point3D.Zero, boat )
|
||||
{
|
||||
}
|
||||
|
||||
public MediumDockedDragonBoat( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int)0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
310
Scripts/Multis/Boats/Plank.cs
Normal file
310
Scripts/Multis/Boats/Plank.cs
Normal file
|
|
@ -0,0 +1,310 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Multis;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum PlankSide{ Port, Starboard }
|
||||
|
||||
public class Plank : Item, ILockable
|
||||
{
|
||||
private BaseBoat m_Boat;
|
||||
private PlankSide m_Side;
|
||||
private bool m_Locked;
|
||||
private uint m_KeyValue;
|
||||
|
||||
private Timer m_CloseTimer;
|
||||
|
||||
public Plank( BaseBoat boat, PlankSide side, uint keyValue ) : base( 0x3EB1 + (int)side )
|
||||
{
|
||||
m_Boat = boat;
|
||||
m_Side = side;
|
||||
m_KeyValue = keyValue;
|
||||
m_Locked = true;
|
||||
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public Plank( Serial serial ) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 );//version
|
||||
|
||||
writer.Write( m_Boat );
|
||||
writer.Write( (int) m_Side );
|
||||
writer.Write( m_Locked );
|
||||
writer.Write( m_KeyValue );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_Boat = reader.ReadItem() as BaseBoat;
|
||||
m_Side = (PlankSide) reader.ReadInt();
|
||||
m_Locked = reader.ReadBool();
|
||||
m_KeyValue = reader.ReadUInt();
|
||||
|
||||
if ( m_Boat == null )
|
||||
Delete();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( IsOpen )
|
||||
{
|
||||
m_CloseTimer = new CloseTimer( this );
|
||||
m_CloseTimer.Start();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public BaseBoat Boat{ get{ return m_Boat; } set{ m_Boat = value; } }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public PlankSide Side{ get{ return m_Side; } set{ m_Side = value; } }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool Locked{ get{ return m_Locked; } set{ m_Locked = value; } }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public uint KeyValue{ get{ return m_KeyValue; } set{ m_KeyValue = value; } }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsOpen{ get{ return ( ItemID == 0x3ED5 || ItemID == 0x3ED4 || ItemID == 0x3E84 || ItemID == 0x3E89 ); } }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool Starboard{ get{ return ( m_Side == PlankSide.Starboard ); } }
|
||||
|
||||
public void SetFacing( Direction dir )
|
||||
{
|
||||
if ( IsOpen )
|
||||
{
|
||||
switch ( dir )
|
||||
{
|
||||
case Direction.North: ItemID = Starboard ? 0x3ED4 : 0x3ED5; break;
|
||||
case Direction.East: ItemID = Starboard ? 0x3E84 : 0x3E89; break;
|
||||
case Direction.South: ItemID = Starboard ? 0x3ED5 : 0x3ED4; break;
|
||||
case Direction.West: ItemID = Starboard ? 0x3E89 : 0x3E84; break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch ( dir )
|
||||
{
|
||||
case Direction.North: ItemID = Starboard ? 0x3EB2 : 0x3EB1; break;
|
||||
case Direction.East: ItemID = Starboard ? 0x3E85 : 0x3E8A; break;
|
||||
case Direction.South: ItemID = Starboard ? 0x3EB1 : 0x3EB2; break;
|
||||
case Direction.West: ItemID = Starboard ? 0x3E8A : 0x3E85; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Open()
|
||||
{
|
||||
if ( IsOpen || Deleted )
|
||||
return;
|
||||
|
||||
if ( m_CloseTimer != null )
|
||||
m_CloseTimer.Stop();
|
||||
|
||||
m_CloseTimer = new CloseTimer( this );
|
||||
m_CloseTimer.Start();
|
||||
|
||||
switch ( ItemID )
|
||||
{
|
||||
case 0x3EB1: ItemID = 0x3ED5; break;
|
||||
case 0x3E8A: ItemID = 0x3E89; break;
|
||||
case 0x3EB2: ItemID = 0x3ED4; break;
|
||||
case 0x3E85: ItemID = 0x3E84; break;
|
||||
}
|
||||
|
||||
if ( m_Boat != null )
|
||||
m_Boat.Refresh();
|
||||
}
|
||||
|
||||
public override bool OnMoveOver( Mobile from )
|
||||
{
|
||||
if ( IsOpen )
|
||||
{
|
||||
if ( (from.Direction & Direction.Running) != 0 || (m_Boat != null && !m_Boat.Contains( from )) )
|
||||
return true;
|
||||
|
||||
Map map = Map;
|
||||
|
||||
if ( map == null )
|
||||
return false;
|
||||
|
||||
int rx = 0, ry = 0;
|
||||
|
||||
if ( ItemID == 0x3ED4 )
|
||||
rx = 1;
|
||||
else if ( ItemID == 0x3ED5 )
|
||||
rx = -1;
|
||||
else if ( ItemID == 0x3E84 )
|
||||
ry = 1;
|
||||
else if ( ItemID == 0x3E89 )
|
||||
ry = -1;
|
||||
|
||||
for ( int i = 1; i <= 6; ++i )
|
||||
{
|
||||
int x = X + (i*rx);
|
||||
int y = Y + (i*ry);
|
||||
int z;
|
||||
|
||||
for ( int j = -8; j <= 8; ++j )
|
||||
{
|
||||
z = from.Z + j;
|
||||
|
||||
if ( map.CanFit( x, y, z, 16, false, false ) && !Server.Spells.SpellHelper.CheckMulti( new Point3D( x, y, z ), map ) && !Region.Find( new Point3D( x, y, z ), map ).IsPartOf( typeof( Factions.StrongholdRegion ) ) )
|
||||
{
|
||||
if ( i == 1 && j >= -2 && j <= 2 )
|
||||
return true;
|
||||
|
||||
from.Location = new Point3D( x, y, z );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
z = map.GetAverageZ( x, y );
|
||||
|
||||
if ( map.CanFit( x, y, z, 16, false, false ) && !Server.Spells.SpellHelper.CheckMulti( new Point3D( x, y, z ), map ) && !Region.Find( new Point3D( x, y, z ), map ).IsPartOf( typeof( Factions.StrongholdRegion ) ) )
|
||||
{
|
||||
if ( i == 1 )
|
||||
return true;
|
||||
|
||||
from.Location = new Point3D( x, y, z );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool CanClose()
|
||||
{
|
||||
Map map = Map;
|
||||
|
||||
if ( map == null || Deleted )
|
||||
return false;
|
||||
|
||||
foreach ( object o in this.GetObjectsInRange( 0 ) )
|
||||
{
|
||||
if ( o != this )
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
if ( !IsOpen || !CanClose() || Deleted )
|
||||
return;
|
||||
|
||||
if ( m_CloseTimer != null )
|
||||
m_CloseTimer.Stop();
|
||||
|
||||
m_CloseTimer = null;
|
||||
|
||||
switch ( ItemID )
|
||||
{
|
||||
case 0x3ED5: ItemID = 0x3EB1; break;
|
||||
case 0x3E89: ItemID = 0x3E8A; break;
|
||||
case 0x3ED4: ItemID = 0x3EB2; break;
|
||||
case 0x3E84: ItemID = 0x3E85; break;
|
||||
}
|
||||
|
||||
if ( m_Boat != null )
|
||||
m_Boat.Refresh();
|
||||
}
|
||||
|
||||
public override void OnDoubleClickDead( Mobile from )
|
||||
{
|
||||
OnDoubleClick( from );
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_Boat == null )
|
||||
return;
|
||||
|
||||
if ( from.InRange( GetWorldLocation(), 8 ) )
|
||||
{
|
||||
if ( m_Boat.Contains( from ) )
|
||||
{
|
||||
if ( IsOpen )
|
||||
Close();
|
||||
else
|
||||
Open();
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !IsOpen )
|
||||
{
|
||||
if ( !Locked )
|
||||
{
|
||||
Open();
|
||||
}
|
||||
else if ( from.AccessLevel >= AccessLevel.GameMaster )
|
||||
{
|
||||
from.LocalOverheadMessage( Network.MessageType.Regular, 0x00, 502502 ); // That is locked but your godly powers allow access
|
||||
Open();
|
||||
}
|
||||
else
|
||||
{
|
||||
from.LocalOverheadMessage( Network.MessageType.Regular, 0x00, 502503 ); // That is locked.
|
||||
}
|
||||
}
|
||||
else if ( !Locked )
|
||||
{
|
||||
from.Location = new Point3D( this.X, this.Y, this.Z + 3 );
|
||||
}
|
||||
else if ( from.AccessLevel >= AccessLevel.GameMaster )
|
||||
{
|
||||
from.LocalOverheadMessage( Network.MessageType.Regular, 0x00, 502502 ); // That is locked but your godly powers allow access
|
||||
from.Location = new Point3D( this.X, this.Y, this.Z + 3 );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.LocalOverheadMessage( Network.MessageType.Regular, 0x00, 502503 ); // That is locked.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class CloseTimer : Timer
|
||||
{
|
||||
private Plank m_Plank;
|
||||
|
||||
public CloseTimer( Plank plank ) : base( TimeSpan.FromSeconds( 5.0 ), TimeSpan.FromSeconds( 5.0 ) )
|
||||
{
|
||||
m_Plank = plank;
|
||||
Priority = TimerPriority.OneSecond;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_Plank.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
21
Scripts/Multis/Boats/RenameBoatPrompt.cs
Normal file
21
Scripts/Multis/Boats/RenameBoatPrompt.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Prompts;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public class RenameBoatPrompt : Prompt
|
||||
{
|
||||
private BaseBoat m_Boat;
|
||||
|
||||
public RenameBoatPrompt( BaseBoat boat )
|
||||
{
|
||||
m_Boat = boat;
|
||||
}
|
||||
|
||||
public override void OnResponse( Mobile from, string text )
|
||||
{
|
||||
m_Boat.EndRename( from, text );
|
||||
}
|
||||
}
|
||||
}
|
||||
103
Scripts/Multis/Boats/SmallBoat.cs
Normal file
103
Scripts/Multis/Boats/SmallBoat.cs
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public class SmallBoat : BaseBoat
|
||||
{
|
||||
public override int NorthID{ get{ return 0x4000; } }
|
||||
public override int EastID{ get{ return 0x4001; } }
|
||||
public override int SouthID{ get{ return 0x4002; } }
|
||||
public override int WestID{ get{ return 0x4003; } }
|
||||
|
||||
public override int HoldDistance{ get{ return 4; } }
|
||||
public override int TillerManDistance{ get{ return -4; } }
|
||||
|
||||
public override Point2D StarboardOffset{ get{ return new Point2D( 2, 0 ); } }
|
||||
public override Point2D PortOffset{ get{ return new Point2D( -2, 0 ); } }
|
||||
|
||||
public override Point3D MarkOffset{ get{ return new Point3D( 0, 1, 3 ); } }
|
||||
|
||||
public override BaseDockedBoat DockedBoat{ get{ return new SmallDockedBoat( this ); } }
|
||||
|
||||
[Constructable]
|
||||
public SmallBoat()
|
||||
{
|
||||
}
|
||||
|
||||
public SmallBoat( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int)0 );
|
||||
}
|
||||
}
|
||||
|
||||
public class SmallBoatDeed : BaseBoatDeed
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1041205; } } // small ship deed
|
||||
public override BaseBoat Boat{ get{ return new SmallBoat(); } }
|
||||
|
||||
[Constructable]
|
||||
public SmallBoatDeed() : base( 0x4000, Point3D.Zero )
|
||||
{
|
||||
}
|
||||
|
||||
public SmallBoatDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int)0 );
|
||||
}
|
||||
}
|
||||
|
||||
public class SmallDockedBoat : BaseDockedBoat
|
||||
{
|
||||
public override BaseBoat Boat{ get{ return new SmallBoat(); } }
|
||||
|
||||
public SmallDockedBoat( BaseBoat boat ) : base( 0x4000, Point3D.Zero, boat )
|
||||
{
|
||||
}
|
||||
|
||||
public SmallDockedBoat( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int)0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
103
Scripts/Multis/Boats/SmallDragonBoat.cs
Normal file
103
Scripts/Multis/Boats/SmallDragonBoat.cs
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public class SmallDragonBoat : BaseBoat
|
||||
{
|
||||
public override int NorthID{ get{ return 0x4004; } }
|
||||
public override int EastID{ get{ return 0x4005; } }
|
||||
public override int SouthID{ get{ return 0x4006; } }
|
||||
public override int WestID{ get{ return 0x4007; } }
|
||||
|
||||
public override int HoldDistance{ get{ return 4; } }
|
||||
public override int TillerManDistance{ get{ return -4; } }
|
||||
|
||||
public override Point2D StarboardOffset{ get{ return new Point2D( 2, 0 ); } }
|
||||
public override Point2D PortOffset{ get{ return new Point2D( -2, 0 ); } }
|
||||
|
||||
public override Point3D MarkOffset{ get{ return new Point3D( 0, 1, 3 ); } }
|
||||
|
||||
public override BaseDockedBoat DockedBoat{ get{ return new SmallDockedDragonBoat( this ); } }
|
||||
|
||||
[Constructable]
|
||||
public SmallDragonBoat()
|
||||
{
|
||||
}
|
||||
|
||||
public SmallDragonBoat( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int)0 );
|
||||
}
|
||||
}
|
||||
|
||||
public class SmallDragonBoatDeed : BaseBoatDeed
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1041206; } } // small dragon ship deed
|
||||
public override BaseBoat Boat{ get{ return new SmallDragonBoat(); } }
|
||||
|
||||
[Constructable]
|
||||
public SmallDragonBoatDeed() : base( 0x4004, Point3D.Zero )
|
||||
{
|
||||
}
|
||||
|
||||
public SmallDragonBoatDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int)0 );
|
||||
}
|
||||
}
|
||||
|
||||
public class SmallDockedDragonBoat : BaseDockedBoat
|
||||
{
|
||||
public override BaseBoat Boat{ get{ return new SmallDragonBoat(); } }
|
||||
|
||||
public SmallDockedDragonBoat( BaseBoat boat ) : base( 0x4004, Point3D.Zero, boat )
|
||||
{
|
||||
}
|
||||
|
||||
public SmallDockedDragonBoat( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int)0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
182
Scripts/Multis/Boats/Strandedness.cs
Normal file
182
Scripts/Multis/Boats/Strandedness.cs
Normal file
|
|
@ -0,0 +1,182 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using Server;
|
||||
|
||||
namespace Server.Misc
|
||||
{
|
||||
public class Strandedness
|
||||
{
|
||||
private static Point2D[] m_Felucca = new Point2D[]
|
||||
{
|
||||
new Point2D( 2528, 3568 ), new Point2D( 2376, 3400 ), new Point2D( 2528, 3896 ),
|
||||
new Point2D( 2168, 3904 ), new Point2D( 1136, 3416 ), new Point2D( 1432, 3648 ),
|
||||
new Point2D( 1416, 4000 ), new Point2D( 4512, 3936 ), new Point2D( 4440, 3120 ),
|
||||
new Point2D( 4192, 3672 ), new Point2D( 4720, 3472 ), new Point2D( 3744, 2768 ),
|
||||
new Point2D( 3480, 2432 ), new Point2D( 3560, 2136 ), new Point2D( 3792, 2112 ),
|
||||
new Point2D( 2800, 2296 ), new Point2D( 2736, 2016 ), new Point2D( 4576, 1456 ),
|
||||
new Point2D( 4680, 1152 ), new Point2D( 4304, 1104 ), new Point2D( 4496, 984 ),
|
||||
new Point2D( 4248, 696 ), new Point2D( 4040, 616 ), new Point2D( 3896, 248 ),
|
||||
new Point2D( 4176, 384 ), new Point2D( 3672, 1104 ), new Point2D( 3520, 1152 ),
|
||||
new Point2D( 3720, 1360 ), new Point2D( 2184, 2152 ), new Point2D( 1952, 2088 ),
|
||||
new Point2D( 2056, 1936 ), new Point2D( 1720, 1992 ), new Point2D( 472, 2064 ),
|
||||
new Point2D( 656, 2096 ), new Point2D( 3008, 3592 ), new Point2D( 2784, 3472 ),
|
||||
new Point2D( 5456, 2400 ), new Point2D( 5976, 2424 ), new Point2D( 5328, 3112 ),
|
||||
new Point2D( 5792, 3152 ), new Point2D( 2120, 3616 ), new Point2D( 2136, 3128 ),
|
||||
new Point2D( 1632, 3528 ), new Point2D( 1328, 3160 ), new Point2D( 1072, 3136 ),
|
||||
new Point2D( 1128, 2976 ), new Point2D( 960, 2576 ), new Point2D( 752, 1832 ),
|
||||
new Point2D( 184, 1488 ), new Point2D( 592, 1440 ), new Point2D( 368, 1216 ),
|
||||
new Point2D( 232, 752 ), new Point2D( 696, 744 ), new Point2D( 304, 1000 ),
|
||||
new Point2D( 840, 376 ), new Point2D( 1192, 624 ), new Point2D( 1200, 192 ),
|
||||
new Point2D( 1512, 240 ), new Point2D( 1336, 456 ), new Point2D( 1536, 648 ),
|
||||
new Point2D( 1104, 952 ), new Point2D( 1864, 264 ), new Point2D( 2136, 200 ),
|
||||
new Point2D( 2160, 528 ), new Point2D( 1904, 512 ), new Point2D( 2240, 784 ),
|
||||
new Point2D( 2536, 776 ), new Point2D( 2488, 216 ), new Point2D( 2336, 72 ),
|
||||
new Point2D( 2648, 288 ), new Point2D( 2680, 576 ), new Point2D( 2896, 88 ),
|
||||
new Point2D( 2840, 344 ), new Point2D( 3136, 72 ), new Point2D( 2968, 520 ),
|
||||
new Point2D( 3192, 328 ), new Point2D( 3448, 208 ), new Point2D( 3432, 608 ),
|
||||
new Point2D( 3184, 752 ), new Point2D( 2800, 704 ), new Point2D( 2768, 1016 ),
|
||||
new Point2D( 2448, 1232 ), new Point2D( 2272, 920 ), new Point2D( 2072, 1080 ),
|
||||
new Point2D( 2048, 1264 ), new Point2D( 1808, 1528 ), new Point2D( 1496, 1880 ),
|
||||
new Point2D( 1656, 2168 ), new Point2D( 2096, 2320 ), new Point2D( 1816, 2528 ),
|
||||
new Point2D( 1840, 2640 ), new Point2D( 1928, 2952 ), new Point2D( 2120, 2712 )
|
||||
};
|
||||
|
||||
private static Point2D[] m_Trammel = m_Felucca;
|
||||
|
||||
private static Point2D[] m_Ilshenar = new Point2D[]
|
||||
{
|
||||
new Point2D( 1252, 1180 ), new Point2D( 1562, 1090 ), new Point2D( 1444, 1016 ),
|
||||
new Point2D( 1324, 968 ), new Point2D( 1418, 806 ), new Point2D( 1722, 874 ),
|
||||
new Point2D( 1456, 684 ), new Point2D( 1036, 866 ), new Point2D( 612, 476 ),
|
||||
new Point2D( 1476, 372 ), new Point2D( 762, 472 ), new Point2D( 812, 1162 ),
|
||||
new Point2D( 1422, 1144 ), new Point2D( 1254, 1066 ), new Point2D( 1598, 870 ),
|
||||
new Point2D( 1358, 866 ), new Point2D( 510, 302 ), new Point2D( 510, 392 )
|
||||
};
|
||||
|
||||
private static Point2D[] m_Tokuno = new Point2D[]
|
||||
{
|
||||
//Makoto-Jima
|
||||
new Point2D( 837, 1351 ), new Point2D( 941, 1241 ), new Point2D( 959, 1185 ),
|
||||
new Point2D( 923, 1091 ), new Point2D( 904, 983 ), new Point2D( 845, 944 ),
|
||||
new Point2D( 829, 896 ), new Point2D( 794, 852 ), new Point2D( 766, 821 ),
|
||||
new Point2D( 695, 814 ), new Point2D( 576, 835 ), new Point2D( 518, 840 ),
|
||||
new Point2D( 519, 902 ), new Point2D( 502, 950 ), new Point2D( 503, 1045 ),
|
||||
new Point2D( 547, 1131 ), new Point2D( 518, 1204 ), new Point2D( 506, 1243 ),
|
||||
new Point2D( 526, 1271 ), new Point2D( 562, 1295 ), new Point2D( 616, 1335 ),
|
||||
new Point2D( 789, 1347 ), new Point2D( 712, 1359 ),
|
||||
|
||||
//Homare-Jima
|
||||
new Point2D( 202, 498 ), new Point2D( 116, 600 ), new Point2D( 107, 699 ),
|
||||
new Point2D( 162, 799 ), new Point2D( 158, 889 ), new Point2D( 169, 989 ),
|
||||
new Point2D( 194, 1101 ), new Point2D( 250, 1163 ), new Point2D( 295, 1176 ),
|
||||
new Point2D( 280, 1194 ), new Point2D( 286, 1102 ), new Point2D( 250, 1000 ),
|
||||
new Point2D( 260, 906 ), new Point2D( 360, 838 ), new Point2D( 389, 763 ),
|
||||
new Point2D( 415, 662 ), new Point2D( 500, 597 ), new Point2D( 570, 572 ),
|
||||
new Point2D( 631, 577 ), new Point2D( 692, 500 ), new Point2D( 723, 445 ),
|
||||
new Point2D( 672, 379 ), new Point2D( 626, 332 ), new Point2D( 494, 291 ),
|
||||
new Point2D( 371, 336 ), new Point2D( 324, 334 ), new Point2D( 270, 362 ),
|
||||
|
||||
//Isamu-Jima
|
||||
new Point2D( 1240, 1076 ), new Point2D( 1189, 1115 ), new Point2D( 1046, 1039 ),
|
||||
new Point2D( 1025, 885 ), new Point2D( 907, 809 ), new Point2D( 840, 506 ),
|
||||
new Point2D( 799, 396 ), new Point2D( 720, 258 ), new Point2D( 744, 158 ),
|
||||
new Point2D( 904, 37 ), new Point2D( 974, 91 ), new Point2D( 1020, 187 ),
|
||||
new Point2D( 1035, 288 ), new Point2D( 1104, 395 ), new Point2D( 1215, 462 ),
|
||||
new Point2D( 1275, 488 ), new Point2D( 1348, 611 ), new Point2D( 1363, 739 ),
|
||||
new Point2D( 1364, 765 ), new Point2D( 1364, 876 ), new Point2D( 1300, 936 ),
|
||||
new Point2D( 1240, 1003 )
|
||||
|
||||
|
||||
};
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
EventSink.Login += new LoginEventHandler( EventSink_Login );
|
||||
}
|
||||
|
||||
private static bool IsStranded( Mobile from )
|
||||
{
|
||||
Map map = from.Map;
|
||||
|
||||
if ( map == null )
|
||||
return false;
|
||||
|
||||
object surface = map.GetTopSurface( from.Location );
|
||||
|
||||
if ( surface is Tile )
|
||||
{
|
||||
int id = ((Tile)surface).ID;
|
||||
|
||||
return (id >= 168 && id <= 171)
|
||||
|| (id >= 310 && id <= 311)
|
||||
|| (id >= 0x5796 && id <= 0x57B2);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void EventSink_Login( LoginEventArgs e )
|
||||
{
|
||||
Mobile from = e.Mobile;
|
||||
|
||||
if ( !IsStranded( from ) )
|
||||
return;
|
||||
|
||||
Map map = from.Map;
|
||||
|
||||
Point2D[] list;
|
||||
|
||||
if( map == Map.Felucca )
|
||||
list = m_Felucca;
|
||||
else if( map == Map.Trammel )
|
||||
list = m_Trammel;
|
||||
else if( map == Map.Ilshenar )
|
||||
list = m_Ilshenar;
|
||||
else if( map == Map.Tokuno )
|
||||
list = m_Tokuno;
|
||||
else
|
||||
return;
|
||||
|
||||
Point2D p = Point2D.Zero;
|
||||
double pdist = double.MaxValue;
|
||||
|
||||
for ( int i = 0; i < list.Length; ++i )
|
||||
{
|
||||
double dist = from.GetDistanceToSqrt( list[i] );
|
||||
|
||||
if ( dist < pdist )
|
||||
{
|
||||
p = list[i];
|
||||
pdist = dist;
|
||||
}
|
||||
}
|
||||
|
||||
int x = p.X, y = p.Y;
|
||||
int z;
|
||||
bool canFit = false;
|
||||
|
||||
z = map.GetAverageZ( x, y );
|
||||
canFit = map.CanSpawnMobile( x, y, z );
|
||||
|
||||
for ( int i = 1; !canFit && i <= 40; i += 2 )
|
||||
{
|
||||
for ( int xo = -1; !canFit && xo <= 1; ++xo )
|
||||
{
|
||||
for ( int yo = -1; !canFit && yo <= 1; ++yo )
|
||||
{
|
||||
if ( xo == 0 && yo == 0 )
|
||||
continue;
|
||||
|
||||
x = p.X + (xo * i);
|
||||
y = p.Y + (yo * i);
|
||||
z = map.GetAverageZ( x, y );
|
||||
canFit = map.CanSpawnMobile( x, y, z );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( canFit )
|
||||
from.Location = new Point3D( x, y, z );
|
||||
}
|
||||
}
|
||||
}
|
||||
119
Scripts/Multis/Boats/TillerMan.cs
Normal file
119
Scripts/Multis/Boats/TillerMan.cs
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class TillerMan : Item
|
||||
{
|
||||
private BaseBoat m_Boat;
|
||||
|
||||
public TillerMan( BaseBoat boat ) : base( 0x3E4E )
|
||||
{
|
||||
m_Boat = boat;
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public TillerMan( Serial serial ) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public void SetFacing( Direction dir )
|
||||
{
|
||||
switch ( dir )
|
||||
{
|
||||
case Direction.South: ItemID = 0x3E4B; break;
|
||||
case Direction.North: ItemID = 0x3E4E; break;
|
||||
case Direction.West: ItemID = 0x3E50; break;
|
||||
case Direction.East: ItemID = 0x3E53; break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
list.Add( m_Boat.Status );
|
||||
}
|
||||
|
||||
public void Say( int number )
|
||||
{
|
||||
PublicOverheadMessage( MessageType.Regular, 0x3B2, number );
|
||||
}
|
||||
|
||||
public void Say( int number, string args )
|
||||
{
|
||||
PublicOverheadMessage( MessageType.Regular, 0x3B2, number, args );
|
||||
}
|
||||
|
||||
public override void AddNameProperty( ObjectPropertyList list )
|
||||
{
|
||||
if ( m_Boat != null && m_Boat.ShipName != null )
|
||||
list.Add( 1042884, m_Boat.ShipName ); // the tiller man of the ~1_SHIP_NAME~
|
||||
else
|
||||
base.AddNameProperty( list );
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
if ( m_Boat != null && m_Boat.ShipName != null )
|
||||
LabelTo( from, 1042884, m_Boat.ShipName ); // the tiller man of the ~1_SHIP_NAME~
|
||||
else
|
||||
base.OnSingleClick( from );
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_Boat != null && m_Boat.Contains( from ) )
|
||||
m_Boat.BeginRename( from );
|
||||
else if ( m_Boat != null )
|
||||
m_Boat.BeginDryDock( from );
|
||||
}
|
||||
|
||||
public override bool OnDragDrop( Mobile from, Item dropped )
|
||||
{
|
||||
if ( dropped is MapItem && m_Boat != null && m_Boat.CanCommand( from ) && m_Boat.Contains( from ) )
|
||||
{
|
||||
m_Boat.AssociateMap( (MapItem) dropped );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
if ( m_Boat != null )
|
||||
m_Boat.Delete();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 );//version
|
||||
|
||||
writer.Write( m_Boat );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_Boat = reader.ReadItem() as BaseBoat;
|
||||
|
||||
if ( m_Boat == null )
|
||||
Delete();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue