Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
1848
Scripts/Services/Expansions/High Seas/Multis/BaseGalleon.cs
Normal file
1848
Scripts/Services/Expansions/High Seas/Multis/BaseGalleon.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,49 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public class BoatMountItem : Item, IMountItem
|
||||
{
|
||||
private BaseBoat m_Mount;
|
||||
public IMount Mount { get { return m_Mount; } }
|
||||
|
||||
public BoatMountItem(BaseBoat mount) : base(0x3E96)
|
||||
{
|
||||
Layer = Layer.Mount;
|
||||
|
||||
Movable = false;
|
||||
m_Mount = mount;
|
||||
}
|
||||
|
||||
public BoatMountItem(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
|
||||
writer.Write((Item)m_Mount);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Mount = reader.ReadItem() as BaseBoat;
|
||||
|
||||
if (m_Mount == null)
|
||||
Delete();
|
||||
else
|
||||
Internalize();
|
||||
}
|
||||
}
|
||||
}
|
||||
364
Scripts/Services/Expansions/High Seas/Multis/BritannianShip.cs
Normal file
364
Scripts/Services/Expansions/High Seas/Multis/BritannianShip.cs
Normal file
@@ -0,0 +1,364 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public class BritannianShip : BaseGalleon
|
||||
{
|
||||
public override int NorthID { get { return 0x40 + (DamageValue * 4); } }
|
||||
public override int EastID { get { return 0x41 + (DamageValue * 4); } }
|
||||
public override int SouthID { get { return 0x42 + (DamageValue * 4); } }
|
||||
public override int WestID { get { return 0x43 + (DamageValue * 4); } }
|
||||
|
||||
public override int HoldDistance { get { return 9; } }
|
||||
public override int TillerManDistance { get { return 7; } }
|
||||
public override int RuneOffset { get { return -5; } }
|
||||
public override int MaxAddons { get { return 2; } }
|
||||
|
||||
public override int WheelDistance { get { return 3; } }
|
||||
public override int CaptiveOffset { get { return 5; } }
|
||||
public override int MaxCannons { get { return 9; } }
|
||||
public override int MaxHits { get { return 200000; } }
|
||||
|
||||
public override double TurnDelay { get { return 3; } }
|
||||
public override TimeSpan BoatDecayDelay { get { return TimeSpan.FromDays(30); } }
|
||||
public override int ZSurface { get { return 18; } }
|
||||
|
||||
public override BaseDockedBoat DockedBoat { get { return new DockedBritannianShip(this); } }
|
||||
|
||||
public override int DamageValue
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (DamageTaken)
|
||||
{
|
||||
default:
|
||||
case DamageLevel.Pristine:
|
||||
case DamageLevel.Slightly:
|
||||
case DamageLevel.Moderately: return 0;
|
||||
case DamageLevel.Heavily:
|
||||
case DamageLevel.Severely: return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BritannianShip() : this(Direction.North) { }
|
||||
|
||||
[Constructable]
|
||||
public BritannianShip(Direction facing)
|
||||
: base(facing)
|
||||
{
|
||||
}
|
||||
|
||||
public override int[][] CannonTileIDs { get { return m_CannonTileIDs; } }
|
||||
private int[][] m_CannonTileIDs = new int[][]
|
||||
{
|
||||
new int[] { 23612, 23631, 23630, 23632, 23634, 23639, 23637, 23643, 23641 }, //SOUTH
|
||||
new int[] { 23666, 23684, 23685, 23686, 23688, 23691, 23693, 23695, 23697 }, //WEST
|
||||
new int[] { 23558, 23576, 23577, 23580, 23578, 23583, 23585, 23587, 23589 }, //NORTH
|
||||
new int[] { 23504, 23522, 23523, 23526, 23524, 23529, 23531, 23533, 23535 }, //EAST
|
||||
|
||||
new int[] { 23612, 23631, 23630, 23632, 23634, 23639, 23637, 23643, 23641 }, //SOUTH
|
||||
new int[] { 23666, 23684, 23685, 23686, 23688, 23691, 23693, 23695, 23697 }, //WEST
|
||||
new int[] { 23558, 23576, 23577, 23580, 23578, 23583, 23585, 23587, 23589 }, //NORTH
|
||||
new int[] { 23504, 23522, 23523, 23526, 23524, 23529, 23531, 23533, 23535 }, //EAST
|
||||
};
|
||||
|
||||
public override int[][] FillerIDs { get { return m_FillerIDs; } }
|
||||
private int[][] m_FillerIDs = new int[][]
|
||||
{
|
||||
// fsail faddn baddn
|
||||
new int[] { 23833, 23664, 23665 }, //SOUTH
|
||||
new int[] { 23887, 23718, 23719 }, //WEST
|
||||
new int[] { 23779, 23610, 23611 }, //NORTH
|
||||
new int[] { 23725, 23556, 23557 }, //EAST
|
||||
|
||||
new int[] { 23833, 23664, 23665 }, //SOUTH
|
||||
new int[] { 23887, 23718, 23719 }, //WEST
|
||||
new int[] { 23779, 23610, 23611 }, //NORTH
|
||||
new int[] { 23725, 23556, 23557 }, //EAST
|
||||
};
|
||||
|
||||
public override int[][] HoldIDs { get { return m_HoldIDs; } }
|
||||
private int[][] m_HoldIDs = new int[][]
|
||||
{
|
||||
new int[] { 23649, 23650, 23652, 23653, 23654, 23655, 23656, 23651}, //SOUTH
|
||||
new int[] { 23703, 23704, 23706, 23707, 23708, 23709, 23710, 23705}, //WEST
|
||||
new int[] { 23595, 23596, 23598, 23599, 23600, 23601, 23602, 23597}, //NORTH
|
||||
new int[] { 23541, 23542, 23544, 23545, 23546, 23547, 23548, 23543}, //EAST
|
||||
|
||||
new int[] { 23649, 23650, 23652, 23653, 23654, 23655, 23656, 23651}, //SOUTH
|
||||
new int[] { 23703, 23704, 23706, 23707, 23708, 23709, 23710, 23705}, //WEST
|
||||
new int[] { 23595, 23596, 23598, 23599, 23600, 23601, 23602, 23597}, //NORTH
|
||||
new int[] { 23541, 23542, 23544, 23545, 23546, 23547, 23548, 23543}, //EAST
|
||||
};
|
||||
|
||||
public override int[][] HoldItemIDs { get { return m_HoldItemIDs; } }
|
||||
private int[][] m_HoldItemIDs = new int[][]
|
||||
{
|
||||
new int[] { 23648 },
|
||||
new int[] { 23702 },
|
||||
new int[] { 23594 },
|
||||
new int[] { 23540 },
|
||||
|
||||
new int[] { 23648 },
|
||||
new int[] { 23702 },
|
||||
new int[] { 23594 },
|
||||
new int[] { 23540 },
|
||||
};
|
||||
|
||||
public override int[][] WheelItemIDs { get { return m_WheelItemIDs; } }
|
||||
private int[][] m_WheelItemIDs = new int[][]
|
||||
{
|
||||
|
||||
new int[] { 23618 },
|
||||
new int[] { 23618 },
|
||||
new int[] { 23618 },
|
||||
new int[] { 23618 },
|
||||
};
|
||||
|
||||
public override ShipPosition GetCannonPosition(Point3D pnt)
|
||||
{
|
||||
int x = pnt.X; int y = pnt.Y;
|
||||
|
||||
switch (Facing)
|
||||
{
|
||||
default:
|
||||
case Direction.North:
|
||||
if (x == this.X && y < this.Y)
|
||||
return ShipPosition.Bow;
|
||||
else if (x > this.X && y + 5 == this.Y)
|
||||
return ShipPosition.BowStarboard;
|
||||
else if (x < this.X && y + 5 == this.Y)
|
||||
return ShipPosition.BowPort;
|
||||
else if (x > this.X && y + 1 == this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x < this.X && y + 1 == this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x > this.X && y - 3 == this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x < this.X && y - 3 == this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x > this.X && y - 3 > this.Y)
|
||||
return ShipPosition.AftStarboard;
|
||||
else
|
||||
return ShipPosition.AftPort;
|
||||
case Direction.West:
|
||||
if (x < this.X && y == this.Y)
|
||||
return ShipPosition.Bow;
|
||||
else if (x + 5 == this.X && y < this.Y)
|
||||
return ShipPosition.BowStarboard;
|
||||
else if (x + 5 == this.X && y > this.Y)
|
||||
return ShipPosition.BowPort;
|
||||
else if (x + 1 == this.X && y < this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x + 1 == this.X && y > this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x - 3 == this.X && y < this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x - 3 == this.X && y > this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x - 3 > this.X && y < this.Y)
|
||||
return ShipPosition.AftStarboard;
|
||||
else
|
||||
return ShipPosition.AftPort;
|
||||
case Direction.South:
|
||||
if (x == this.X && y > this.Y)
|
||||
return ShipPosition.Bow;
|
||||
else if (x < this.X && y - 5 == this.Y)
|
||||
return ShipPosition.BowStarboard;
|
||||
else if (x > this.X && y - 5 == this.Y)
|
||||
return ShipPosition.BowPort;
|
||||
else if (x < this.X && y - 1 == this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x > this.X && y - 1 == this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x < this.X && y + 3 == this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x > this.X && y + 3 == this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x < this.X && y + 3 < this.Y)
|
||||
return ShipPosition.AftStarboard;
|
||||
else
|
||||
return ShipPosition.AftPort;
|
||||
case Direction.East:
|
||||
if (x > this.X && y == this.Y)
|
||||
return ShipPosition.Bow;
|
||||
else if (x - 5 == this.X && y > this.Y)
|
||||
return ShipPosition.BowStarboard;
|
||||
else if (x - 5 == this.X && y < this.Y)
|
||||
return ShipPosition.BowPort;
|
||||
else if (x - 1 == this.X && y > this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x - 1 == this.X && y < this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x + 3 == this.X && y > this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x + 3 == this.X && y < this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x + 3 < this.X && y > this.Y)
|
||||
return ShipPosition.AftStarboard;
|
||||
else
|
||||
return ShipPosition.AftPort;
|
||||
}
|
||||
}
|
||||
|
||||
private readonly int PortAndStarboardOffset = 4;
|
||||
private readonly int AftOffset = 18;
|
||||
private readonly int BowOffset = 17;
|
||||
|
||||
public override bool Contains(int x, int y)
|
||||
{
|
||||
bool contains = base.Contains(x, y);
|
||||
|
||||
if (contains)
|
||||
{
|
||||
int boatX = this.X;
|
||||
int boatY = this.Y;
|
||||
|
||||
switch (Facing)
|
||||
{
|
||||
case Direction.North:
|
||||
if (x > boatX + PortAndStarboardOffset || x < boatX - PortAndStarboardOffset)
|
||||
return false;
|
||||
if (y > boatY + AftOffset || y < boatY - BowOffset)
|
||||
return false;
|
||||
return true;
|
||||
case Direction.South:
|
||||
if (x > boatX + PortAndStarboardOffset || x < boatX - PortAndStarboardOffset)
|
||||
return false;
|
||||
if (y > boatY + BowOffset || y < boatY - AftOffset)
|
||||
return false;
|
||||
return true;
|
||||
case Direction.East:
|
||||
if (x > boatX + BowOffset || x < boatX - AftOffset)
|
||||
return false;
|
||||
if (y > boatY + PortAndStarboardOffset || y < boatY - PortAndStarboardOffset)
|
||||
return false;
|
||||
return true;
|
||||
case Direction.West:
|
||||
if (x > boatX + AftOffset || x < boatX - BowOffset)
|
||||
return false;
|
||||
if (y > boatY + PortAndStarboardOffset || y < boatY - PortAndStarboardOffset)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return contains;
|
||||
}
|
||||
|
||||
public override bool ExemptOverheadComponent(Point3D newPnt, int itemID, int x, int y, int height)
|
||||
{
|
||||
//if (height > this.Z + 16) //TODO: Get height of mast
|
||||
// return false;
|
||||
|
||||
switch (itemID)
|
||||
{
|
||||
case 0x18: //North/South ID's
|
||||
case 0x1A:
|
||||
case 0x1C:
|
||||
case 0x1E:
|
||||
case 0x20:
|
||||
case 0x22:
|
||||
if (x > newPnt.X + PortAndStarboardOffset || x < newPnt.X - PortAndStarboardOffset)
|
||||
return true;
|
||||
break;
|
||||
case 0x19: //East/West ID's
|
||||
case 0x1B:
|
||||
case 0x1D:
|
||||
case 0x1F:
|
||||
case 0x21:
|
||||
case 0x23:
|
||||
if (y > newPnt.Y + PortAndStarboardOffset || y < newPnt.Y - PortAndStarboardOffset)
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
|
||||
return base.ExemptOverheadComponent(newPnt, itemID, x, y, height);
|
||||
}
|
||||
|
||||
public BritannianShip(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public class BritannianShipDeed : BaseBoatDeed
|
||||
{
|
||||
public override int LabelNumber { get { return 1150017; } }
|
||||
public override BaseBoat Boat { get { return new BritannianShip(this.BoatDirection); } }
|
||||
|
||||
[Constructable]
|
||||
public BritannianShipDeed()
|
||||
: base(0x40, Point3D.Zero)
|
||||
{
|
||||
}
|
||||
|
||||
public BritannianShipDeed(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 DockedBritannianShip : BaseDockedBoat
|
||||
{
|
||||
public override int LabelNumber { get { return 1150100; } } //Britannian Ship
|
||||
public override BaseBoat Boat { get { return new BritannianShip(this.BoatDirection); } }
|
||||
|
||||
public DockedBritannianShip(BaseBoat boat)
|
||||
: base(0x40, Point3D.Zero, boat)
|
||||
{
|
||||
}
|
||||
|
||||
public DockedBritannianShip(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);
|
||||
}
|
||||
}
|
||||
}
|
||||
164
Scripts/Services/Expansions/High Seas/Multis/GalleonContainer.cs
Normal file
164
Scripts/Services/Expansions/High Seas/Multis/GalleonContainer.cs
Normal file
@@ -0,0 +1,164 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Multis;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using Server.ContextMenus;
|
||||
using Server.Targeting;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class GalleonContainer : WoodenChest, IChopable
|
||||
{
|
||||
private BaseGalleon m_Galleon;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public BaseGalleon Galleon { get { return m_Galleon; } }
|
||||
|
||||
public override bool IsDecoContainer { get { return false; } }
|
||||
|
||||
public override string DefaultName { get { return "Ship Container"; } }
|
||||
|
||||
public override int DefaultMaxWeight { get { return 1250; } }
|
||||
|
||||
public GalleonContainer(BaseGalleon galleon)
|
||||
{
|
||||
m_Galleon = galleon;
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
list.Add(new RelocateContainerEntry(this, m_Galleon));
|
||||
}
|
||||
|
||||
private class RelocateContainerEntry : ContextMenuEntry
|
||||
{
|
||||
private GalleonContainer m_Container;
|
||||
private BaseGalleon m_Galleon;
|
||||
|
||||
public RelocateContainerEntry(GalleonContainer container, BaseGalleon galleon)
|
||||
: base(1061829, 3)
|
||||
{
|
||||
m_Galleon = galleon;
|
||||
m_Container = container;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
Owner.From.Target = new RelocateTarget(m_Container, m_Galleon);
|
||||
Owner.From.SendMessage("Where do you wish to relocate the ship container?");
|
||||
}
|
||||
}
|
||||
|
||||
private class RelocateTarget : Target
|
||||
{
|
||||
private GalleonContainer m_Container;
|
||||
private BaseGalleon m_Galleon;
|
||||
|
||||
public RelocateTarget(GalleonContainer container, BaseGalleon galleon)
|
||||
: base(12, false, TargetFlags.None)
|
||||
{
|
||||
m_Container = container;
|
||||
m_Galleon = galleon;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (targeted is IPoint3D && from.Map != null)
|
||||
{
|
||||
IPoint3D pnt = (IPoint3D)targeted;
|
||||
|
||||
BaseBoat boat = BaseBoat.FindBoatAt(pnt, from.Map);
|
||||
|
||||
if (boat != null && boat == m_Galleon && IsSurface(pnt))
|
||||
{
|
||||
IPooledEnumerable eable = from.Map.GetObjectsInRange(new Point3D(pnt), 0);
|
||||
|
||||
foreach (object o in eable)
|
||||
{
|
||||
if (o is Mobile || o is Item)
|
||||
{
|
||||
from.SendMessage("You cannot place the ship container there, try again.");
|
||||
from.Target = new RelocateTarget(m_Container, m_Galleon);
|
||||
eable.Free();
|
||||
return;
|
||||
}
|
||||
}
|
||||
eable.Free();
|
||||
|
||||
StaticTarget st = (StaticTarget)pnt;
|
||||
int z = m_Galleon.ZSurface;
|
||||
|
||||
if (st != null)
|
||||
z = st.Z;
|
||||
|
||||
m_Container.MoveToWorld(new Point3D(pnt.X, pnt.Y, z), from.Map);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("You cannot place the ship container there, try again.");
|
||||
from.Target = new RelocateTarget(m_Container, m_Galleon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsSurface(IPoint3D pnt)
|
||||
{
|
||||
if (pnt is StaticTarget)
|
||||
{
|
||||
StaticTarget st = (StaticTarget)pnt;
|
||||
|
||||
if ((st.Flags & TileFlag.Surface) > 0)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (m_Galleon == null || from.AccessLevel > AccessLevel.Player)
|
||||
base.OnDoubleClick(from);
|
||||
else if (!m_Galleon.Contains(from))
|
||||
{
|
||||
if(m_Galleon.TillerMan != null)
|
||||
m_Galleon.TillerManSay("You must be on the ship to open the container.");
|
||||
}
|
||||
else if (m_Galleon.Owner is PlayerMobile && !m_Galleon.Scuttled && m_Galleon.GetSecurityLevel(from) < SecurityLevel.Crewman)
|
||||
from.SendMessage("You must be at least a crewman to access the ship container.");
|
||||
else
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public void OnChop(Mobile from)
|
||||
{
|
||||
if (m_Galleon != null && m_Galleon.Owner == from)
|
||||
{
|
||||
Effects.PlaySound(Location, Map, 0x3B3);
|
||||
from.SendLocalizedMessage(500461); // You destroy the item.
|
||||
Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
public GalleonContainer(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
writer.Write(m_Galleon);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Galleon = reader.ReadItem() as BaseGalleon;
|
||||
}
|
||||
}
|
||||
}
|
||||
141
Scripts/Services/Expansions/High Seas/Multis/GalleonHold.cs
Normal file
141
Scripts/Services/Expansions/High Seas/Multis/GalleonHold.cs
Normal file
@@ -0,0 +1,141 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Multis;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class GalleonHold : Container, IGalleonFixture
|
||||
{
|
||||
public override int LabelNumber { get { return 1149699; } } // cargo hold
|
||||
public override bool ForceShowProperties { get { return true; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public BaseGalleon Galleon { get; set; }
|
||||
|
||||
public override int DefaultMaxWeight
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Galleon is BritannianShip)
|
||||
return 28000;
|
||||
else if (Galleon is GargishGalleon)
|
||||
return 12000;
|
||||
else if (Galleon is OrcishGalleon)
|
||||
return 14000;
|
||||
else
|
||||
return 16000;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsDecoContainer { get { return false; } }
|
||||
|
||||
public override Rectangle2D Bounds { get { return new Rectangle2D(46, 74, 150, 110); } }
|
||||
public override int DefaultGumpID { get { return 0x4C; } }
|
||||
public override int DefaultDropSound { get { return 0x42; } }
|
||||
|
||||
public GalleonHold(BaseGalleon galleon, int itemID) : base(itemID)
|
||||
{
|
||||
Galleon = galleon;
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (Galleon == null || from.AccessLevel > AccessLevel.Player)
|
||||
{
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
else if (!Galleon.Contains(from))
|
||||
{
|
||||
if (Galleon.TillerMan != null)
|
||||
Galleon.TillerManSay(502490); // You must be on the ship to open the hold.
|
||||
}
|
||||
else if (Galleon.Owner is PlayerMobile && !Galleon.Scuttled && Galleon.GetSecurityLevel(from) < SecurityLevel.Officer)
|
||||
{
|
||||
from.Say(1010436); // You do not have permission to do this.
|
||||
}
|
||||
else
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public GalleonHold(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (version == 0)
|
||||
{
|
||||
reader.ReadItem();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class HoldItem : Item, IGalleonFixture
|
||||
{
|
||||
public override int LabelNumber { get { return 1149699; } } // cargo hold
|
||||
public override bool ForceShowProperties { get { return true; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public BaseGalleon Galleon { get; set; }
|
||||
|
||||
public HoldItem(BaseGalleon g, int itemid)
|
||||
: base(itemid)
|
||||
{
|
||||
Galleon = g;
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (Galleon == null || Galleon.GalleonHold == null || !from.InRange(Location, 2))
|
||||
return;
|
||||
|
||||
Galleon.GalleonHold.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (Galleon != null && Galleon.GalleonHold != null)
|
||||
{
|
||||
var hold = Galleon.GalleonHold;
|
||||
list.Add(1072241, String.Format("{0}\t{1}\t{2}\t{3}", hold.TotalItems, hold.MaxItems, hold.TotalWeight, hold.MaxWeight)); // Contents: ~1_COUNT~/~2_MAXCOUNT~ items, ~3_WEIGHT~/~4_MAXWEIGHT~ stones
|
||||
}
|
||||
}
|
||||
|
||||
public HoldItem(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (version == 0)
|
||||
{
|
||||
reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
63
Scripts/Services/Expansions/High Seas/Multis/GalleonItem.cs
Normal file
63
Scripts/Services/Expansions/High Seas/Multis/GalleonItem.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Multis;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class DeckItem : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1035994; } } // deck
|
||||
|
||||
public DeckItem(int itemID)
|
||||
: base(itemID)
|
||||
{
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public DeckItem(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class WeaponPad : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1102376; } } // weapon pad
|
||||
|
||||
public WeaponPad(int itemID)
|
||||
: base(itemID)
|
||||
{
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public WeaponPad(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
531
Scripts/Services/Expansions/High Seas/Multis/GalleonPilot.cs
Normal file
531
Scripts/Services/Expansions/High Seas/Multis/GalleonPilot.cs
Normal file
@@ -0,0 +1,531 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Multis;
|
||||
using Server.ContextMenus;
|
||||
using System.Collections.Generic;
|
||||
using Server.Gumps;
|
||||
using Server.Targeting;
|
||||
using Server.Items;
|
||||
using System.Linq;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class GalleonPilot : BaseCreature
|
||||
{
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public BaseGalleon Galleon { get; private set; }
|
||||
|
||||
public List<Item> OriginalItems { get; private set; }
|
||||
|
||||
public GalleonPilot(BaseGalleon galleon)
|
||||
: base(AIType.AI_Vendor, FightMode.None, 2, 1, 0.5, 2)
|
||||
{
|
||||
Body = 0x190;
|
||||
CantWalk = true;
|
||||
Galleon = galleon;
|
||||
Blessed = true;
|
||||
|
||||
InitBody();
|
||||
InitOutfit();
|
||||
|
||||
OriginalItems = new List<Item>();
|
||||
|
||||
foreach (Item item in Items)
|
||||
OriginalItems.Add(item);
|
||||
|
||||
SetSkill(SkillName.Cartography, 100.0);
|
||||
}
|
||||
|
||||
public virtual void InitBody()
|
||||
{
|
||||
InitStats(100, 100, 25);
|
||||
|
||||
SpeechHue = Utility.RandomDyedHue();
|
||||
Hue = Utility.RandomSkinHue();
|
||||
|
||||
if (Blessed && !Core.AOS)
|
||||
NameHue = 0x35;
|
||||
|
||||
if (Female = GetGender())
|
||||
{
|
||||
Body = 0x191;
|
||||
Name = NameList.RandomName("female");
|
||||
}
|
||||
else
|
||||
{
|
||||
Body = 0x190;
|
||||
Name = NameList.RandomName("male");
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool GetGender()
|
||||
{
|
||||
return Utility.RandomBool();
|
||||
}
|
||||
|
||||
public virtual int GetHairHue()
|
||||
{
|
||||
return Utility.RandomHairHue();
|
||||
}
|
||||
|
||||
public virtual int GetShoeHue()
|
||||
{
|
||||
if (0.1 > Utility.RandomDouble())
|
||||
return 0;
|
||||
|
||||
return Utility.RandomNeutralHue();
|
||||
}
|
||||
|
||||
public virtual void InitOutfit()
|
||||
{
|
||||
if (Core.SE && this.Map == Map.Tokuno)
|
||||
{
|
||||
|
||||
if (Utility.Random(2) == 0)
|
||||
SetWearable(new Kasa(GetRandomHue()));
|
||||
if (Utility.Random(2) == 0)
|
||||
SetWearable(new Obi(GetRandomHue()));
|
||||
if (Utility.RandomDouble() < 0.25)
|
||||
{
|
||||
if (Female)
|
||||
SetWearable(new FemaleKimono(GetRandomHue()));
|
||||
else
|
||||
{
|
||||
if (Utility.Random(2) == 0)
|
||||
SetWearable(new MaleKimono(GetRandomHue()));
|
||||
else
|
||||
SetWearable(new Kamishimo(GetRandomHue()));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (Utility.Random(2))
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
SetWearable(new FancyShirt(GetRandomHue()));
|
||||
SetWearable(new JinBaori(GetRandomHue())); break;
|
||||
}
|
||||
case 1: SetWearable(new HakamaShita(GetRandomHue())); break;
|
||||
|
||||
}
|
||||
switch (Utility.Random(2))
|
||||
{
|
||||
case 0: SetWearable(new Hakama(GetRandomHue())); break;
|
||||
case 1: SetWearable(new TattsukeHakama(GetRandomHue())); break;
|
||||
|
||||
}
|
||||
}
|
||||
switch (Utility.Random(2))
|
||||
{
|
||||
case 0: SetWearable(new Sandals(GetShoeHue())); break;
|
||||
case 1: SetWearable(new Waraji(GetShoeHue())); break;
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (Utility.Random(3))
|
||||
{
|
||||
case 0: SetWearable(new FancyShirt(GetRandomHue())); break;
|
||||
case 1: SetWearable(new Doublet(GetRandomHue())); break;
|
||||
case 2: SetWearable(new Shirt(GetRandomHue())); break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
switch (Utility.Random(4))
|
||||
{
|
||||
case 0: SetWearable(new Shoes(GetShoeHue())); break;
|
||||
case 1: SetWearable(new Boots(GetShoeHue())); break;
|
||||
case 2: SetWearable(new Sandals(GetShoeHue())); break;
|
||||
case 3: SetWearable(new ThighBoots(GetShoeHue())); break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (Female)
|
||||
{
|
||||
switch (Utility.Random(6))
|
||||
{
|
||||
case 0: SetWearable(new ShortPants(GetRandomHue())); break;
|
||||
case 1:
|
||||
case 2: SetWearable(new Kilt(GetRandomHue())); break;
|
||||
case 3:
|
||||
case 4:
|
||||
case 5: SetWearable(new Skirt(GetRandomHue())); break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (Utility.Random(2))
|
||||
{
|
||||
case 0: SetWearable(new LongPants(GetRandomHue())); break;
|
||||
case 1: SetWearable(new ShortPants(GetRandomHue())); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
int hairHue = GetHairHue();
|
||||
|
||||
Utility.AssignRandomHair(this, hairHue);
|
||||
Utility.AssignRandomFacialHair(this, hairHue);
|
||||
}
|
||||
|
||||
public virtual int GetRandomHue()
|
||||
{
|
||||
switch (Utility.Random(5))
|
||||
{
|
||||
default:
|
||||
case 0: return Utility.RandomBlueHue();
|
||||
case 1: return Utility.RandomGreenHue();
|
||||
case 2: return Utility.RandomRedHue();
|
||||
case 3: return Utility.RandomYellowHue();
|
||||
case 4: return Utility.RandomNeutralHue();
|
||||
}
|
||||
}
|
||||
|
||||
public void SetFacing(Direction dir)
|
||||
{
|
||||
Direction = dir;
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (Galleon != null)
|
||||
{
|
||||
list.Add(Galleon.Status);
|
||||
list.Add(1116580 + (int)Galleon.DamageTaken); //State: Prisine
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (Galleon == null || !Galleon.IsOwner(from))
|
||||
base.OnDoubleClick(from);
|
||||
else if (Galleon != null && Galleon.Contains(from))
|
||||
Galleon.BeginRename(from);
|
||||
else if (Galleon != null)
|
||||
Galleon.BeginDryDock(from);
|
||||
}
|
||||
|
||||
public override bool OnDragDrop(Mobile from, Item dropped)
|
||||
{
|
||||
if (dropped is MapItem && Galleon != null && Galleon.CanCommand(from) && Galleon.Contains(from))
|
||||
{
|
||||
Galleon.AssociateMap((MapItem)dropped);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CheckNonlocalLift(Mobile from, Item item)
|
||||
{
|
||||
if (Galleon == null || from == null)
|
||||
return false;
|
||||
|
||||
if (Galleon.GetSecurityLevel(from) >= SecurityLevel.Captain)
|
||||
return true;
|
||||
|
||||
return base.CheckNonlocalLift(from, item);
|
||||
}
|
||||
|
||||
public override bool AllowEquipFrom(Mobile from)
|
||||
{
|
||||
if (Galleon == null || from == null)
|
||||
return false;
|
||||
|
||||
if (Galleon.GetSecurityLevel(from) >= SecurityLevel.Captain)
|
||||
return true;
|
||||
|
||||
return base.AllowEquipFrom(from);
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
if (Galleon != null)
|
||||
{
|
||||
if (Galleon.Contains(from))
|
||||
{
|
||||
SecurityLevel level = Galleon.GetSecurityLevel(from);
|
||||
|
||||
if (level >= SecurityLevel.Crewman)
|
||||
{
|
||||
list.Add(new EmergencyRepairEntry(this, from));
|
||||
list.Add(new ShipRepairEntry(this, from));
|
||||
}
|
||||
|
||||
if (level == SecurityLevel.Captain)
|
||||
{
|
||||
list.Add(new RenameShipEntry(Galleon, from));
|
||||
list.Add(new MoveTillermanEntry(this, from));
|
||||
list.Add(new SecuritySettingsEntry(this, from));
|
||||
list.Add(new ResetSecuritySettings(this, from));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
list.Add(new DryDockEntry(Galleon, from));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class EmergencyRepairEntry : ContextMenuEntry
|
||||
{
|
||||
private GalleonPilot m_Pilot;
|
||||
private Mobile m_From;
|
||||
|
||||
public EmergencyRepairEntry(GalleonPilot pilot, Mobile from)
|
||||
: base(1116589, 5) // Emergency Repairs
|
||||
{
|
||||
m_Pilot = pilot;
|
||||
m_From = from;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (m_Pilot != null && m_Pilot.Galleon != null)
|
||||
{
|
||||
BaseGalleon g = m_Pilot.Galleon;
|
||||
|
||||
if (!g.Scuttled)
|
||||
m_From.SendLocalizedMessage(1116595); // Your ship is not in need of emergency repairs in order to sail.
|
||||
else if (g.IsUnderEmergencyRepairs())
|
||||
{
|
||||
TimeSpan left = g.GetEndEmergencyRepairs();
|
||||
m_From.SendLocalizedMessage(1116592, left != TimeSpan.Zero ? left.TotalMinutes.ToString() : "0"); // Your ship is underway with emergency repairs holding for an estimated ~1_TIME~ more minutes.
|
||||
}
|
||||
else if (!g.TryEmergencyRepair(m_From))
|
||||
m_From.SendLocalizedMessage(1116591, string.Format("{0}\t{1}", BaseBoat.EmergencyRepairClothCost.ToString(), BaseBoat.EmergencyRepairWoodCost)); //You need a minimum of ~1_CLOTH~ yards of cloth and ~2_WOOD~ pieces of lumber to effect emergency repairs.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class ShipRepairEntry : ContextMenuEntry
|
||||
{
|
||||
private GalleonPilot m_Pilot;
|
||||
private Mobile m_From;
|
||||
|
||||
public ShipRepairEntry(GalleonPilot pilot, Mobile from)
|
||||
: base(1116590, 5) // Permanent Repairs
|
||||
{
|
||||
m_Pilot = pilot;
|
||||
m_From = from;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (m_Pilot != null && m_Pilot.Galleon != null)
|
||||
{
|
||||
if (!BaseGalleon.IsNearLandOrDocks(m_Pilot.Galleon))
|
||||
m_From.SendLocalizedMessage(1116594); // Your ship must be near shore or a sea market in order to effect permanent repairs.
|
||||
else if (m_Pilot.Galleon.DamageTaken == DamageLevel.Pristine)
|
||||
m_From.SendLocalizedMessage(1116596); // Your ship is in pristine condition and does not need repairs.
|
||||
else
|
||||
m_Pilot.Galleon.TryRepairs(m_From);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class MoveTillermanEntry : ContextMenuEntry
|
||||
{
|
||||
private GalleonPilot m_Pilot;
|
||||
private Mobile m_From;
|
||||
|
||||
public MoveTillermanEntry(GalleonPilot pilot, Mobile from)
|
||||
: base(1116729, 5) // Move Tillerman
|
||||
{
|
||||
m_Pilot = pilot;
|
||||
m_From = from;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
m_From.Target = new RelocateTarget(m_Pilot, m_Pilot.Galleon);
|
||||
m_From.SendLocalizedMessage(1116736); // Where do you wish to station the pilot?
|
||||
}
|
||||
}
|
||||
|
||||
private class RelocateTarget : Target
|
||||
{
|
||||
private GalleonPilot m_Pilot;
|
||||
private BaseGalleon m_Galleon;
|
||||
|
||||
public RelocateTarget(GalleonPilot pilot, BaseGalleon galleon)
|
||||
: base(12, false, TargetFlags.None)
|
||||
{
|
||||
m_Pilot = pilot;
|
||||
m_Galleon = galleon;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (targeted is IPoint3D && from.Map != null)
|
||||
{
|
||||
IPoint3D pnt = (IPoint3D)targeted;
|
||||
|
||||
BaseBoat boat = BaseBoat.FindBoatAt(pnt, from.Map);
|
||||
|
||||
if (boat != null && boat == m_Galleon && IsSurface(pnt))
|
||||
{
|
||||
IPooledEnumerable eable = m_Pilot.Map.GetObjectsInRange(new Point3D(pnt), 0);
|
||||
|
||||
foreach (object o in eable)
|
||||
{
|
||||
if (o is Mobile || o is Item)
|
||||
{
|
||||
from.SendLocalizedMessage(1011577); // This is an invalid location.
|
||||
from.Target = new RelocateTarget(m_Pilot, m_Galleon);
|
||||
eable.Free();
|
||||
return;
|
||||
}
|
||||
}
|
||||
eable.Free();
|
||||
|
||||
StaticTarget st = (StaticTarget)pnt;
|
||||
int z = m_Galleon.ZSurface;
|
||||
|
||||
if (st != null)
|
||||
z = st.Z;
|
||||
|
||||
m_Pilot.MoveToWorld(new Point3D(pnt.X, pnt.Y, z), from.Map);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1011577); // This is an invalid location.
|
||||
from.Target = new RelocateTarget(m_Pilot, m_Galleon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsSurface(IPoint3D pnt)
|
||||
{
|
||||
if (pnt is StaticTarget)
|
||||
{
|
||||
StaticTarget st = (StaticTarget)pnt;
|
||||
|
||||
if ((st.Flags & TileFlag.Surface) > 0)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private class SecuritySettingsEntry : ContextMenuEntry
|
||||
{
|
||||
private GalleonPilot m_Pilot;
|
||||
private Mobile m_From;
|
||||
|
||||
public SecuritySettingsEntry(GalleonPilot pilot, Mobile from)
|
||||
: base(1149786, 5) // Security Settings
|
||||
{
|
||||
m_Pilot = pilot;
|
||||
m_From = from;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (m_Pilot != null && m_Pilot.Galleon != null && !m_From.HasGump(typeof(ShipSecurityGump)))
|
||||
m_From.SendGump(new ShipSecurityGump(m_From, m_Pilot.Galleon));
|
||||
}
|
||||
}
|
||||
|
||||
private class ResetSecuritySettings : ContextMenuEntry
|
||||
{
|
||||
private GalleonPilot m_Pilot;
|
||||
private Mobile m_From;
|
||||
|
||||
public ResetSecuritySettings(GalleonPilot pilot, Mobile from)
|
||||
: base(1060700, 5) // Reset Security
|
||||
{
|
||||
m_Pilot = pilot;
|
||||
m_From = from;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (m_Pilot != null && m_Pilot.Galleon != null)
|
||||
{
|
||||
m_From.SendGump(new BasicConfirmGump<BaseGalleon>(new TextDefinition(1116618), (m, boat) => // Are you sure you wish to clear your ship's access list?
|
||||
{
|
||||
boat.SecurityEntry.Manifest.Keys.Where(x => !boat.IsOwner(x)).ToList().ForEach(y =>
|
||||
{
|
||||
boat.SecurityEntry.RemoveFromAccessList(y);
|
||||
});
|
||||
|
||||
}, m_Pilot.Galleon));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
if (Galleon != null)
|
||||
Galleon.Delete();
|
||||
}
|
||||
|
||||
public override void AddNameProperties(ObjectPropertyList list)
|
||||
{
|
||||
if (Galleon != null)
|
||||
{
|
||||
string nameStr;
|
||||
|
||||
if (Galleon.ShipName == null || Galleon.ShipName.Length == 0)
|
||||
nameStr = "an unnamed ship";
|
||||
else
|
||||
nameStr = string.Format("the {0}", Galleon.ShipName);
|
||||
|
||||
list.Add(string.Format("{0} the Pilot of {1}", Name, nameStr));
|
||||
}
|
||||
else
|
||||
base.AddNameProperties(list);
|
||||
}
|
||||
|
||||
public GalleonPilot(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1);
|
||||
|
||||
writer.Write(OriginalItems.Count);
|
||||
foreach (Item item in OriginalItems)
|
||||
writer.Write(item);
|
||||
|
||||
writer.Write(Galleon);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
OriginalItems = new List<Item>();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
int count = reader.ReadInt();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
Item item = reader.ReadItem();
|
||||
if (item != null && !item.Deleted)
|
||||
OriginalItems.Add(item);
|
||||
}
|
||||
goto case 0;
|
||||
case 0:
|
||||
Galleon = (BaseGalleon)reader.ReadItem();
|
||||
break;
|
||||
}
|
||||
|
||||
if (Galleon == null)
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
295
Scripts/Services/Expansions/High Seas/Multis/GargishGalleon.cs
Normal file
295
Scripts/Services/Expansions/High Seas/Multis/GargishGalleon.cs
Normal file
@@ -0,0 +1,295 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public class GargishGalleon : BaseGalleon
|
||||
{
|
||||
public override int NorthID { get { return 0x24 + (DamageValue * 4); } }
|
||||
public override int EastID { get { return 0x25 + (DamageValue * 4); } }
|
||||
public override int SouthID { get { return 0x26 + (DamageValue * 4); } }
|
||||
public override int WestID { get { return 0x27 + (DamageValue * 4); } }
|
||||
|
||||
public override int HoldDistance { get { return 6; } }
|
||||
public override int TillerManDistance { get { return 1; } }
|
||||
public override int RuneOffset { get { return 3; } }
|
||||
|
||||
public override int WheelDistance { get { return 2; } }
|
||||
public override int CaptiveOffset { get { return 3; } }
|
||||
public override int MaxCannons { get { return 7; } }
|
||||
|
||||
public override double TurnDelay { get { return 1; } }
|
||||
public override int MaxHits { get { return 140000; } }
|
||||
|
||||
public override int ZSurface { get { return 16; } }
|
||||
|
||||
public override BaseDockedBoat DockedBoat { get { return new DockedGargishGalleon(this); } }
|
||||
|
||||
[Constructable]
|
||||
public GargishGalleon() : this(Direction.North) { }
|
||||
|
||||
[Constructable]
|
||||
public GargishGalleon(Direction facing)
|
||||
: base(facing)
|
||||
{
|
||||
}
|
||||
|
||||
public override int[][] CannonTileIDs { get { return m_CannonTileIDs; } }
|
||||
private int[][] m_CannonTileIDs = new int[][]
|
||||
{
|
||||
new int[] { 33463, 33440, 33438, 33327, 33322, 33357, 33355 }, //SOUTH
|
||||
new int[] { 33768, 33745, 33743, 33632, 33627, 33662, 33660 }, //WEST
|
||||
new int[] { 34070, 34047, 34045, 33934, 33929, 33964, 33962 }, //NORTH
|
||||
new int[] { 34373, 34350, 34348, 34237, 34232, 34267, 34265 }, //EAST
|
||||
|
||||
new int[] { 19059, 19042, 19040, 18958, 18956, 18979, 18977 }, //SOUTH D1
|
||||
new int[] { 35582, 35559, 35557, 35446, 35441, 35476, 35474 }, //WEST D1
|
||||
new int[] { 34978, 34955, 34953, 34842, 34837, 34872, 34870 }, //NORTH D1
|
||||
new int[] { 34674, 34651, 34649, 34538, 34533, 34568, 34566 }, //EAST D1
|
||||
|
||||
new int[] { 36442, 36425, 36423, 36341, 36339, 36362, 36360 }, //SOUTH D2
|
||||
new int[] { 36744, 36727, 36725, 36733, 36641, 36664, 36662 }, //WEST D2
|
||||
new int[] { 36140, 36123, 36121, 36039, 36037, 36060, 36058 }, //NORTH D2
|
||||
new int[] { 35156, 35139, 35137, 35055, 35053, 35076, 35074 }, //EAST D2
|
||||
};
|
||||
|
||||
public override int[][] FillerIDs { get { return m_FillerIDs; } }
|
||||
private int[][] m_FillerIDs = new int[][]
|
||||
{
|
||||
// 110 103 96 89 87 88 93 91 98 105 112
|
||||
|
||||
// BL ML1 ML2 FL F1 F2 F3 FR MR2 MR1 BR
|
||||
new int[] { 33410, 33403, 33396, 33389, 33388, 33393, 33391, 33398, 33405, 33412}, //SOUTH
|
||||
new int[] { 33715, 33708, 33701, 33694, 33693, 33698, 33696, 33703, 33710, 33717 }, //WEST
|
||||
new int[] { 34017, 34010, 34003, 33996, 33995, 34000, 33998, 34005, 34012, 34019 }, //NORTH
|
||||
new int[] { 34320, 34313, 34306, 34299, 34298, 34303, 34301, 34308, 34315, 34322 }, //EAST
|
||||
|
||||
// 110 103 96 89 87 88 93 91 98 105 112
|
||||
//35419
|
||||
new int[] { 19026, 19019, 19012, 19005, 19004, 19009, 19007, 19014, 19021, 19028 }, //SOUTH D1
|
||||
new int[] { 35529, 35522, 35515, 35508, 35507, 35512, 35510, 35517, 35524, 35531 }, //WEST D1
|
||||
new int[] { 34925, 34918, 34911, 34904, 34903, 34908, 34906, 34913, 34920, 34927 }, //NORTH D1
|
||||
new int[] { 34621, 34614, 34607, 34600, 34599, 34604, 34602, 34609, 34616, 34623 }, //EAST D1
|
||||
|
||||
// +86 -7 -7 -7 -2 +1 +5 -2 +7 +7 +7
|
||||
// 110 103 96 89 87 88 93 91 98 105 112
|
||||
new int[] { 36409, 36402, 36395, 36388, 36387, 36392, 36390, 36397, 36404, 36411 }, //SOUTH D2
|
||||
new int[] { 36711, 36704, 36697, 36690, 36689, 36694, 36692, 36699, 36706, 36713 }, //WEST D2
|
||||
new int[] { 36107, 36100, 36093, 36086, 36085, 36090, 36088, 36095, 36102, 36109 }, //NORTH D2
|
||||
new int[] { 35123, 35116, 35109, 35102, 35101, 35106, 35104, 35111, 35118, 35125 }, //EAST D2
|
||||
};
|
||||
|
||||
public override int[][] HoldIDs { get { return m_HoldIDs; } }
|
||||
private int[][] m_HoldIDs = new int[][]
|
||||
{
|
||||
// 108 109 114 94 95 100 101 102
|
||||
// BL BM BR MR MM ML FL FR
|
||||
new int[] { 33408, 33409, 33414, 33394, 33395, 33400, 33401, 33402, 33407,
|
||||
33410, 33403, 33396, 33389, 33388, 33393, 33391, 33398, 33405, 33412 }, //SOUTH
|
||||
new int[] { 33713, 33714, 33719, 33699, 33700, 33705, 33706, 33707, 33712,
|
||||
33715, 33708, 33701, 33694, 33693, 33698, 33696, 33703, 33710, 33717}, //WEST
|
||||
new int[] { 34015, 34016, 34021, 34001, 34002, 34007, 34008, 34009, 34007,
|
||||
34017, 34010, 34003, 33996, 33995, 34000, 33998, 34005, 34012, 34019 }, //NORTH
|
||||
new int[] { 34318, 34319, 34324, 34304, 34305, 34310, 34311, 34312, 34317,
|
||||
34320, 34313, 34306, 34299, 34298, 34303, 34301, 34308, 34315, 34322 }, //EAST
|
||||
//18940
|
||||
// +85 +1 +1 -15 +1 +1 +1 +1
|
||||
new int[] { 19025, 19024, 19025, 19010, 19011, 19016, 19017, 19018, 33407,
|
||||
19026, 19019, 19012, 19005, 19004, 19009, 19007, 19014, 19021, 19028 }, //SOUTH D1
|
||||
new int[] { 35506, 35507, 35512, 35513, 35514, 35519, 35520, 35521, 33712,
|
||||
35529, 35522, 35515, 35508, 35507, 35512, 35510, 35517, 35524, 35531 }, //WEST D1
|
||||
new int[] { 34902, 34903, 34908, 34909, 34910, 34915, 34916, 34917, 34007,
|
||||
34925, 34918, 34911, 34904, 34903, 34908, 34906, 34913, 34920, 34927 }, //NORTH D1
|
||||
new int[] { 34598, 34599, 34604, 34605, 34606, 34611, 34612, 34613, 34317,
|
||||
34621, 34614, 34607, 34600, 34599, 34604, 34602, 34609, 34616, 34623 }, //EAST D1
|
||||
|
||||
new int[] { 36386, 36387, 36392, 36393, 36394, 36399, 36400, 36401, 33407,
|
||||
36409, 36402, 36395, 36388, 36387, 36392, 36390, 36397, 36404, 36411 }, //SOUTH D2
|
||||
new int[] { 36688, 36689, 36694, 36695, 36696, 36701, 36702, 36703, 33712,
|
||||
36711, 36704, 36697, 36690, 36689, 36694, 36692, 36699, 36706, 36713 }, //WEST D2
|
||||
new int[] { 36084, 36085, 36090, 36091, 36092, 36097, 36098, 36099, 34007,
|
||||
36107, 36100, 36093, 36086, 36085, 36090, 36088, 36095, 36102, 36109 }, //NORTH D2
|
||||
new int[] { 35121, 35122, 35127, 35107, 35108, 35113, 35114, 35115, 34317,
|
||||
35123, 35116, 35109, 35102, 35101, 35106, 35104, 35111, 35118, 35125}, //EAST D1
|
||||
};
|
||||
|
||||
public override int[][] HoldItemIDs { get { return m_HoldItemIDs; } }
|
||||
private int[][] m_HoldItemIDs = new int[][]
|
||||
{
|
||||
new int[] { 33387 },
|
||||
new int[] { 33692 },
|
||||
new int[] { 33994 },
|
||||
new int[] { 34297 },
|
||||
|
||||
new int[] { 19003 },
|
||||
new int[] { 35506 },
|
||||
new int[] { 34902 },
|
||||
new int[] { 34598 },
|
||||
|
||||
new int[] { 36386 },
|
||||
new int[] { 36688 },
|
||||
new int[] { 36084 },
|
||||
new int[] { 35100 },
|
||||
};
|
||||
|
||||
public override int[][] WheelItemIDs { get { return m_WheelItemIDs; } }
|
||||
private int[][] m_WheelItemIDs = new int[][]
|
||||
{
|
||||
|
||||
new int[] { 33604 },
|
||||
new int[] { 33906 },
|
||||
new int[] { 34208 },
|
||||
new int[] { 34510 },
|
||||
};
|
||||
|
||||
public override ShipPosition GetCannonPosition(Point3D pnt)
|
||||
{
|
||||
int x = pnt.X; int y = pnt.Y;
|
||||
|
||||
switch (Facing)
|
||||
{
|
||||
default:
|
||||
case Direction.North:
|
||||
if (x == this.X && y < this.Y)
|
||||
return ShipPosition.Bow;
|
||||
if (x > this.X && y < this.Y)
|
||||
return ShipPosition.BowStarboard;
|
||||
if (x < this.X && y < this.Y)
|
||||
return ShipPosition.BowPort;
|
||||
if (x > this.X && y - 2 == this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x < this.X && y - 2 == this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x > this.X && y > this.Y)
|
||||
return ShipPosition.AftStarboard;
|
||||
else
|
||||
return ShipPosition.AftPort;
|
||||
case Direction.West:
|
||||
if (x < this.X && y == this.Y)
|
||||
return ShipPosition.Bow;
|
||||
else if (x < this.X && y < this.Y)
|
||||
return ShipPosition.BowStarboard;
|
||||
else if (x < this.X && y > this.Y)
|
||||
return ShipPosition.BowPort;
|
||||
else if (x - 2 == this.X && y < this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x - 2 == this.X && y > this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x > this.X && y < this.Y)
|
||||
return ShipPosition.AftStarboard;
|
||||
else
|
||||
return ShipPosition.AftPort;
|
||||
case Direction.South:
|
||||
if (x == this.X && y > this.Y)
|
||||
return ShipPosition.Bow;
|
||||
else if (x < this.X && y > this.Y)
|
||||
return ShipPosition.BowStarboard;
|
||||
else if (x > this.X && y > this.Y)
|
||||
return ShipPosition.BowPort;
|
||||
else if (x < this.X && y + 2 == this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x > this.X && y + 2 == this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x < this.X && y < this.Y)
|
||||
return ShipPosition.AftStarboard;
|
||||
else
|
||||
return ShipPosition.AftPort;
|
||||
case Direction.East:
|
||||
if (x > this.X && y == this.Y)
|
||||
return ShipPosition.Bow;
|
||||
else if (x > this.X && y > this.Y)
|
||||
return ShipPosition.BowStarboard;
|
||||
else if (x > this.X && y < this.Y)
|
||||
return ShipPosition.BowPort;
|
||||
else if (x + 2 == this.X && y > this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x + 2 == this.X && y < this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x < this.X && y > this.Y)
|
||||
return ShipPosition.AftStarboard;
|
||||
else
|
||||
return ShipPosition.AftPort;
|
||||
}
|
||||
}
|
||||
|
||||
public GargishGalleon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class GargishGalleonDeed : BaseBoatDeed
|
||||
{
|
||||
public override int LabelNumber { get { return 1116739; } }
|
||||
public override BaseBoat Boat { get { return new GargishGalleon(this.BoatDirection); } }
|
||||
|
||||
[Constructable]
|
||||
public GargishGalleonDeed()
|
||||
: base(0x24, Point3D.Zero)
|
||||
{
|
||||
}
|
||||
|
||||
public GargishGalleonDeed(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 DockedGargishGalleon : BaseDockedBoat
|
||||
{
|
||||
public override int LabelNumber { get { return 1116748; } } //Gargoyle Ship
|
||||
public override BaseBoat Boat { get { return new GargishGalleon(this.BoatDirection); } }
|
||||
|
||||
public DockedGargishGalleon(BaseBoat boat)
|
||||
: base(0x24, Point3D.Zero, boat)
|
||||
{
|
||||
}
|
||||
|
||||
public DockedGargishGalleon(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);
|
||||
}
|
||||
}
|
||||
}
|
||||
217
Scripts/Services/Expansions/High Seas/Multis/MooringLine.cs
Normal file
217
Scripts/Services/Expansions/High Seas/Multis/MooringLine.cs
Normal file
@@ -0,0 +1,217 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Multis;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
using Server.ContextMenus;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class MooringLine : Item
|
||||
{
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public BaseBoat Boat { get; private set; }
|
||||
|
||||
public override int LabelNumber => Boat == null || Boat.IsRowBoat ? 1020935 : 1149697; // rope || mooring line
|
||||
|
||||
public MooringLine(BaseBoat boat)
|
||||
: base(5368)
|
||||
{
|
||||
Boat = boat;
|
||||
Movable = false;
|
||||
Weight = 0;
|
||||
}
|
||||
|
||||
public override void OnDoubleClickDead(Mobile m)
|
||||
{
|
||||
OnDoubleClick(m);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (Boat == null || from == null)
|
||||
return;
|
||||
|
||||
BaseBoat boat = BaseBoat.FindBoatAt(from, from.Map);
|
||||
|
||||
int range = boat != null && boat == Boat ? 3 : 8;
|
||||
bool canMove = false;
|
||||
|
||||
if (!Boat.IsRowBoat)
|
||||
Boat.Refresh(from);
|
||||
|
||||
if (!from.InRange(Location, range))
|
||||
from.SendLocalizedMessage(500295); //You are too far away to do that.
|
||||
else if (!from.InLOS(Location))
|
||||
from.SendLocalizedMessage(500950); //You cannot see that.
|
||||
else if (Boat.IsMoving || Boat.IsTurning)
|
||||
from.SendLocalizedMessage(1116611); //You can't use that while the ship is moving!
|
||||
else if (BaseBoat.IsDriving(from))
|
||||
from.SendLocalizedMessage(1116610); //You can't do that while piloting a ship!
|
||||
else if (BaseHouse.FindHouseAt(from) != null)
|
||||
from.SendLocalizedMessage(1149795); //You may not dock a ship while on another ship or inside a house.
|
||||
else if (Boat == boat && !MoveToNearestDockOrLand(from))
|
||||
from.SendLocalizedMessage(1149796); //You can not dock a ship this far out to sea. You must be near land or shallow water.
|
||||
else if (boat == null || boat != null && Boat != boat)
|
||||
{
|
||||
if (Boat.HasAccess(from))
|
||||
canMove = true;
|
||||
else
|
||||
from.SendLocalizedMessage(1116617); //You do not have permission to board this ship.
|
||||
}
|
||||
|
||||
if (canMove)
|
||||
{
|
||||
BaseCreature.TeleportPets(from, Location, Map);
|
||||
from.MoveToWorld(Location, Map);
|
||||
|
||||
Boat.SendContainerPacket();
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
if (Boat != null && Boat.IsRowBoat && from.Alive && !Boat.Contains(from))
|
||||
{
|
||||
list.Add(new DryDockEntry(Boat, from));
|
||||
}
|
||||
}
|
||||
|
||||
public bool MoveToNearestDockOrLand(Mobile from)
|
||||
{
|
||||
if ((Boat != null && !Boat.Contains(from)) || !ValidateDockOrLand())
|
||||
return false;
|
||||
|
||||
Map map = Map;
|
||||
|
||||
if (map == null)
|
||||
return false;
|
||||
|
||||
Rectangle2D rec;
|
||||
Point3D nearest = Point3D.Zero;
|
||||
Point3D p = Point3D.Zero;
|
||||
|
||||
if (Boat.IsRowBoat)
|
||||
rec = new Rectangle2D(Boat.X - 8, Boat.Y - 8, 16, 16);
|
||||
else
|
||||
{
|
||||
switch (Boat.Facing)
|
||||
{
|
||||
default:
|
||||
case Direction.North:
|
||||
case Direction.South:
|
||||
if (X < Boat.X)
|
||||
{
|
||||
rec = new Rectangle2D(X - 8, Y - 8, 8, 16);
|
||||
}
|
||||
else
|
||||
{
|
||||
rec = new Rectangle2D(X, Y - 8, 8, 16);
|
||||
}
|
||||
break;
|
||||
case Direction.West:
|
||||
case Direction.East:
|
||||
if (Y < Boat.Y)
|
||||
{
|
||||
rec = new Rectangle2D(X - 8, Y - 8, 16, 8);
|
||||
}
|
||||
else
|
||||
{
|
||||
rec = new Rectangle2D(X - 8, Y, 16, 8);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (int x = rec.X; x <= rec.X + rec.Width; x++)
|
||||
{
|
||||
for (int y = rec.Y; y <= rec.Y + rec.Height; y++)
|
||||
{
|
||||
p = new Point3D(x, y, map.GetAverageZ(x, y));
|
||||
|
||||
if (ValidateTile(from, ref p))
|
||||
{
|
||||
if (nearest == Point3D.Zero || from.GetDistanceToSqrt(p) < from.GetDistanceToSqrt(nearest))
|
||||
nearest = p;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (nearest != Point3D.Zero)
|
||||
{
|
||||
BaseCreature.TeleportPets(from, nearest, Map);
|
||||
from.MoveToWorld(nearest, Map);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool ValidateTile(Mobile from, ref Point3D p)
|
||||
{
|
||||
int x = p.X;
|
||||
int y = p.Y;
|
||||
int z = p.Z;
|
||||
|
||||
Map map = from.Map;
|
||||
|
||||
if (Spells.SpellHelper.CheckMulti(p, map) || Region.Find(p, map).IsPartOf<Factions.StrongholdRegion>())
|
||||
return false;
|
||||
|
||||
StaticTile[] staticTiles = map.Tiles.GetStaticTiles(x, y, true);
|
||||
object highest = null;
|
||||
|
||||
//Gets highest tile, which will be used to determine if we can walk on it.
|
||||
foreach (StaticTile tile in staticTiles)
|
||||
{
|
||||
if (highest == null || (highest is StaticTile && tile.Z + tile.Height > ((StaticTile)highest).Z + ((StaticTile)highest).Height))
|
||||
highest = tile;
|
||||
}
|
||||
|
||||
if (highest != null && highest is StaticTile)
|
||||
{
|
||||
StaticTile st = (StaticTile)highest;
|
||||
|
||||
ItemData id = TileData.ItemTable[st.ID & TileData.MaxItemValue];
|
||||
|
||||
if (id.Surface && !id.Impassable)
|
||||
{
|
||||
p.Z = st.Z + st.Height;
|
||||
return from.InLOS(p);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return map.CanFit(x, y, z, 16, false, false);
|
||||
}
|
||||
|
||||
public bool ValidateDockOrLand()
|
||||
{
|
||||
return BaseGalleon.IsNearLandOrDocks(Boat);
|
||||
}
|
||||
|
||||
public MooringLine(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
|
||||
writer.Write(Boat);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
Boat = reader.ReadItem() as BaseBoat;
|
||||
}
|
||||
}
|
||||
}
|
||||
347
Scripts/Services/Expansions/High Seas/Multis/OrcishGalleon.cs
Normal file
347
Scripts/Services/Expansions/High Seas/Multis/OrcishGalleon.cs
Normal file
@@ -0,0 +1,347 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public class OrcishGalleon : BaseGalleon
|
||||
{
|
||||
public override int NorthID { get { return 0x18 + (DamageValue * 4); } }
|
||||
public override int EastID { get { return 0x19 + (DamageValue * 4); } }
|
||||
public override int SouthID { get { return 0x1A + (DamageValue * 4); } }
|
||||
public override int WestID { get { return 0x1B + (DamageValue * 4); } }
|
||||
|
||||
public override int HoldDistance { get { return 9; } }
|
||||
public override int TillerManDistance { get { return 6; } }
|
||||
public override int RuneOffset { get { return -3; } }
|
||||
|
||||
public override int WheelDistance { get { return 7; } }
|
||||
public override int CaptiveOffset { get { return 4; } }
|
||||
public override int MaxCannons { get { return 7; } }
|
||||
public override double CannonDamageMod { get { return 1.3; } }
|
||||
|
||||
public override double TurnDelay { get { return 2; } }
|
||||
public override int MaxHits { get { return 100000; } }
|
||||
|
||||
public override int ZSurface { get { return 14; } }
|
||||
|
||||
public override BaseDockedBoat DockedBoat { get { return new DockedOrcishGalleon(this); } }
|
||||
|
||||
[Constructable]
|
||||
public OrcishGalleon() : this(Direction.North) { }
|
||||
|
||||
[Constructable]
|
||||
public OrcishGalleon(Direction facing) : base(facing)
|
||||
{
|
||||
}
|
||||
|
||||
public override int[][] CannonTileIDs { get { return m_CannonTileIDs; } }
|
||||
private int[][] m_CannonTileIDs = new int[][]
|
||||
{
|
||||
|
||||
new int[] { 30012, 30037, 30041, 30065, 30069, 30093, 30097 }, //SOUTH
|
||||
new int[] { 30512, 30537, 30541, 30565, 30569, 30593, 30597 }, //WEST
|
||||
new int[] { 31012, 31037, 31041, 31065, 31069, 31093, 31097 }, //NORTH
|
||||
new int[] { 31512, 31537, 31541, 31565, 31569, 31593, 31597 }, //EAST
|
||||
|
||||
new int[] { 31712, 31737, 31741, 31765, 31769, 31793, 31797 }, //SOUTH D1
|
||||
new int[] { 31913, 31938, 31942, 31966, 31970, 31994, 31998 }, //WEST D1
|
||||
new int[] { 32112, 32137, 32141, 32165, 32169, 32193, 32197 }, //NORTH D1
|
||||
new int[] { 32312, 32337, 32341, 32365, 32369, 32393, 32397 }, //EAST D1
|
||||
|
||||
new int[] { 32512, 32537, 32541, 32565, 32569, 32593, 32597 }, //NORTH D2
|
||||
new int[] { 32712, 32737, 32741, 32765, 32769, 32793, 32797 }, //WEST D2
|
||||
new int[] { 32912, 32937, 32941, 32965, 32969, 32993, 32997 }, //NORTH D2
|
||||
new int[] { 33112, 33137, 33141, 33165, 33169, 33193, 33197 }, //NORTH D2
|
||||
};
|
||||
|
||||
public override int[][] FillerIDs { get { return m_FillerIDs; } }
|
||||
private int[][] m_FillerIDs = new int[][]
|
||||
{
|
||||
new int[] { 30030, 30034, 30048, 30044, 30090, 30086 }, //SOUTH
|
||||
new int[] { 30530, 30534, 30548, 30544, 30590, 30586 }, //WEST
|
||||
new int[] { 31030, 31034, 31048, 31044, 31090, 31086 }, //NORTH
|
||||
new int[] { 31530, 31534, 31548, 31544, 31590, 31586 }, //EAST
|
||||
|
||||
new int[] { 31730, 31734, 31748, 31744, 31790, 31786 }, //SOUTH D1
|
||||
new int[] { 31931, 31935, 31949, 31945, 31991, 31987 }, //WEST D1
|
||||
new int[] { 32130, 32134, 32148, 32144, 32190, 32186 }, //NORTH D1
|
||||
new int[] { 32330, 32334, 32348, 32344, 32390, 32386 }, //EAST D1
|
||||
|
||||
new int[] { 32530, 32534, 32548, 32544, 32590, 32586 }, //SOUTH D2
|
||||
new int[] { 32730, 32734, 32748, 32744, 32790, 32786 }, //WEST D2
|
||||
new int[] { 32930, 32934, 32948, 32944, 32990, 32986 }, //NORTH D2
|
||||
new int[] { 33130, 33134, 33148, 33144, 33190, 33186 }, //EAST D2
|
||||
};
|
||||
|
||||
public override int[][] HoldIDs { get { return m_HoldIDs; } }
|
||||
private int[][] m_HoldIDs = new int[][]
|
||||
{
|
||||
new int[] { 30127, 30124, 30122, 30115, 30120 }, //SOUTH
|
||||
new int[] { 30627, 30624, 30622, 30615, 30620 }, //WEST
|
||||
new int[] { 31127, 31124, 31122, 31115, 31120 }, //NORTH
|
||||
new int[] { 31627, 31624, 31622, 31615, 31620 }, //EAST
|
||||
|
||||
new int[] { 31827, 31824, 31822, 31815, 31820 }, //SOUTH D1
|
||||
new int[] { 32028, 32025, 32023, 32016, 32021 }, //WEST D1
|
||||
new int[] { 32227, 32224, 32222, 32215, 32220 }, //NORTH D1
|
||||
new int[] { 32427, 32424, 32422, 32415, 32420 }, //EAST D1
|
||||
|
||||
new int[] { 32627, 32624, 32622, 32615, 32620 }, //SOUTH D2
|
||||
new int[] { 32827, 32824, 32822, 32815, 32820 }, //WEST D2
|
||||
new int[] { 33027, 33024, 33022, 33015, 33020 }, //NORTH D2
|
||||
new int[] { 33227, 33224, 33222, 33215, 33220 }, //EAST D1
|
||||
};
|
||||
|
||||
public override int[][] HoldItemIDs { get { return m_HoldItemIDs; } }
|
||||
private int[][] m_HoldItemIDs = new int[][]
|
||||
{
|
||||
new int[] { 30117 },
|
||||
new int[] { 30617 },
|
||||
new int[] { 31117 },
|
||||
new int[] { 31617 },
|
||||
|
||||
new int[] { 31817 },
|
||||
new int[] { 32018 },
|
||||
new int[] { 32217 },
|
||||
new int[] { 32417 },
|
||||
|
||||
new int[] { 32617 },
|
||||
new int[] { 32817 },
|
||||
new int[] { 33017 },
|
||||
new int[] { 33217 },
|
||||
};
|
||||
|
||||
public override int[][] WheelItemIDs { get { return m_WheelItemIDs; } }
|
||||
private int[][] m_WheelItemIDs = new int[][]
|
||||
{
|
||||
new int[] { 30141 },
|
||||
new int[] { 30641 },
|
||||
new int[] { 31141 },
|
||||
new int[] { 31642 },
|
||||
};
|
||||
|
||||
public override ShipPosition GetCannonPosition(Point3D pnt)
|
||||
{
|
||||
int x = pnt.X; int y = pnt.Y;
|
||||
|
||||
switch (Facing)
|
||||
{
|
||||
default:
|
||||
case Direction.North:
|
||||
if (x == this.X && y < this.Y)
|
||||
return ShipPosition.Bow;
|
||||
if (x > this.X && y < this.Y)
|
||||
return ShipPosition.BowStarboard;
|
||||
if (x < this.X && y < this.Y)
|
||||
return ShipPosition.BowPort;
|
||||
if (x > this.X && y + 2 == this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if(x < this.X && y + 2 == this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x > this.X && y > this.Y)
|
||||
return ShipPosition.AftStarboard;
|
||||
else
|
||||
return ShipPosition.AftPort;
|
||||
case Direction.West:
|
||||
if (x < this.X && y == this.Y)
|
||||
return ShipPosition.Bow;
|
||||
else if (x < this.X && y < this.Y)
|
||||
return ShipPosition.BowStarboard;
|
||||
else if (x < this.X && y > this.Y)
|
||||
return ShipPosition.BowPort;
|
||||
else if(x + 2 == this.X && y < this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x + 2 == this.X && y > this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x > this.X && y < this.Y)
|
||||
return ShipPosition.AftStarboard;
|
||||
else
|
||||
return ShipPosition.AftPort;
|
||||
case Direction.South:
|
||||
if (x == this.X && y > this.Y)
|
||||
return ShipPosition.Bow;
|
||||
else if (x < this.X && y > this.Y)
|
||||
return ShipPosition.BowStarboard;
|
||||
else if (x > this.X && y > this.Y)
|
||||
return ShipPosition.BowPort;
|
||||
else if (x < this.X && y - 2 == this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x > this.X && y - 2 == this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x < this.X && y < this.Y)
|
||||
return ShipPosition.AftStarboard;
|
||||
else
|
||||
return ShipPosition.AftPort;
|
||||
case Direction.East:
|
||||
if (x > this.X && y == this.Y)
|
||||
return ShipPosition.Bow;
|
||||
else if (x > this.X && y > this.Y)
|
||||
return ShipPosition.BowStarboard;
|
||||
else if (x > this.X && y < this.Y)
|
||||
return ShipPosition.BowPort;
|
||||
else if(x - 2 == this.X && y > this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x - 2 == this.X && y < this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x < this.X && y > this.Y)
|
||||
return ShipPosition.AftStarboard;
|
||||
else
|
||||
return ShipPosition.AftPort;
|
||||
}
|
||||
}
|
||||
|
||||
private readonly int PortAndStarboardOffset = 3;
|
||||
private readonly int AftOffset = 12; //TODO: Get this
|
||||
private readonly int BowOffset = 9;
|
||||
|
||||
public override bool Contains(int x, int y)
|
||||
{
|
||||
bool contains = base.Contains(x, y);
|
||||
|
||||
if (contains)
|
||||
{
|
||||
int boatX = this.X;
|
||||
int boatY = this.Y;
|
||||
|
||||
switch (Facing)
|
||||
{
|
||||
case Direction.North:
|
||||
if (x > boatX + PortAndStarboardOffset || x < boatX - PortAndStarboardOffset)
|
||||
return false;
|
||||
if (y > boatY + AftOffset || y < boatY - BowOffset)
|
||||
return false;
|
||||
return true;
|
||||
case Direction.South:
|
||||
if (x > boatX + PortAndStarboardOffset || x < boatX - PortAndStarboardOffset)
|
||||
return false;
|
||||
if (y > boatY + BowOffset || y < boatY - AftOffset)
|
||||
return false;
|
||||
return true;
|
||||
case Direction.East:
|
||||
if (x > boatX + BowOffset || x < boatX - AftOffset)
|
||||
return false;
|
||||
if (y > boatY + PortAndStarboardOffset || y < boatY - PortAndStarboardOffset)
|
||||
return false;
|
||||
return true;
|
||||
case Direction.West:
|
||||
if (x > boatX + AftOffset || x < boatX - BowOffset)
|
||||
return false;
|
||||
if (y > boatY + PortAndStarboardOffset || y < boatY - PortAndStarboardOffset)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return contains;
|
||||
}
|
||||
|
||||
public override bool ExemptOverheadComponent(Point3D newPnt, int itemID, int x , int y, int height)
|
||||
{
|
||||
//if(height > this.Z + 16) //TODO: Get height of mast
|
||||
// return false;
|
||||
|
||||
switch(itemID)
|
||||
{
|
||||
case 0x18: //North/South ID's
|
||||
case 0x1A:
|
||||
case 0x1C:
|
||||
case 0x1E:
|
||||
case 0x20:
|
||||
case 0x22:
|
||||
if(x > newPnt.X + PortAndStarboardOffset || x < newPnt.X - PortAndStarboardOffset)
|
||||
return true;
|
||||
break;
|
||||
case 0x19: //East/West ID's
|
||||
case 0x1B:
|
||||
case 0x1D:
|
||||
case 0x1F:
|
||||
case 0x21:
|
||||
case 0x23:
|
||||
if(y > newPnt.Y + PortAndStarboardOffset || y < newPnt.Y - PortAndStarboardOffset)
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
|
||||
return base.ExemptOverheadComponent(newPnt, itemID, x, y, height);
|
||||
}
|
||||
|
||||
public OrcishGalleon(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public class OrcishGalleonDeed : BaseBoatDeed
|
||||
{
|
||||
public override int LabelNumber { get { return 1116738; } } // small dragon ship deed
|
||||
public override BaseBoat Boat { get { return new OrcishGalleon(this.BoatDirection); } }
|
||||
|
||||
[Constructable]
|
||||
public OrcishGalleonDeed()
|
||||
: base(0x18, Point3D.Zero)
|
||||
{
|
||||
}
|
||||
|
||||
public OrcishGalleonDeed(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 DockedOrcishGalleon : BaseDockedBoat
|
||||
{
|
||||
public override int LabelNumber { get { return 1116747; } } //Orc Ship
|
||||
public override BaseBoat Boat { get { return new OrcishGalleon(this.BoatDirection); } }
|
||||
|
||||
public DockedOrcishGalleon(BaseBoat boat)
|
||||
: base(0x18, Point3D.Zero, boat)
|
||||
{
|
||||
}
|
||||
|
||||
public DockedOrcishGalleon(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);
|
||||
}
|
||||
}
|
||||
}
|
||||
404
Scripts/Services/Expansions/High Seas/Multis/Rowboat.cs
Normal file
404
Scripts/Services/Expansions/High Seas/Multis/Rowboat.cs
Normal file
@@ -0,0 +1,404 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Engines.PartySystem;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public class RowBoat : BaseBoat
|
||||
{
|
||||
public override int NorthID { get { return 0x3C; } }
|
||||
public override int EastID { get { return 0x3D; } }
|
||||
public override int SouthID { get { return 0x3E; } }
|
||||
public override int WestID { get { return 0x3F; } }
|
||||
|
||||
public override int HoldDistance { get { return -1; } }
|
||||
public override int TillerManDistance { get { return -4; } }
|
||||
|
||||
public override Point3D MarkOffset { get { return new Point3D(0, 1, 3); } }
|
||||
|
||||
public override BaseDockedBoat DockedBoat { get { return new DockedRowBoat(this); } }
|
||||
|
||||
public override bool IsClassicBoat { get { return false; } }
|
||||
public override bool IsRowBoat { get { return true; } }
|
||||
public override bool CanLinkToLighthouse { get { return false; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public MooringLine Line { get; private set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Rudder Rudder { get; private set; }
|
||||
|
||||
[Constructable]
|
||||
public RowBoat(Direction d)
|
||||
: base(d, false)
|
||||
{
|
||||
Rudder = new Rudder(this, d);
|
||||
TillerMan = Rudder;
|
||||
Line = new MooringLine(this);
|
||||
|
||||
switch (d)
|
||||
{
|
||||
default:
|
||||
case Direction.North:
|
||||
Rudder.Location = new Point3D(X, Y - TillerManDistance, Z);
|
||||
Line.Location = new Point3D(X, Y - 2, Z + 5);
|
||||
break;
|
||||
case Direction.South:
|
||||
Rudder.Location = new Point3D(X, Y + TillerManDistance, Z);
|
||||
Line.Location = new Point3D(X, Y + 2, Z + 5);
|
||||
break;
|
||||
case Direction.East:
|
||||
Rudder.Location = new Point3D(X + TillerManDistance, Y, Z);
|
||||
Line.Location = new Point3D(X + 2, Y, Z + 5);
|
||||
break;
|
||||
case Direction.West:
|
||||
Rudder.Location = new Point3D(X - TillerManDistance, Y, Z);
|
||||
Line.Location = new Point3D(X - 2, Y, Z + 5);
|
||||
break;
|
||||
}
|
||||
|
||||
Rudder.Handle = new RudderHandle(Rudder, d);
|
||||
}
|
||||
|
||||
public override void Delete()
|
||||
{
|
||||
if (Line != null)
|
||||
Line.Delete();
|
||||
|
||||
if (Rudder != null && Rudder.Handle != null)
|
||||
Rudder.Handle.Delete();
|
||||
|
||||
base.Delete();
|
||||
}
|
||||
|
||||
public override void SetFacingComponents(Direction facing, Direction old, bool ignore)
|
||||
{
|
||||
if (Rudder == null || Rudder.Handle == null)
|
||||
return;
|
||||
|
||||
if (Rudder != null && facing == Direction.North)
|
||||
Rudder.X--;
|
||||
|
||||
Rudder.Handle.SetFacing(facing);
|
||||
}
|
||||
|
||||
public override void OnLocationChange(Point3D old)
|
||||
{
|
||||
base.OnLocationChange(old);
|
||||
|
||||
if (Line != null)
|
||||
Line.Location = new Point3D(X + (Line.X - old.X), Y + (Line.Y - old.Y), Z + (Line.Z - old.Z));
|
||||
|
||||
if(Rudder != null && Rudder.Handle != null)
|
||||
Rudder.Handle.Location = new Point3D(X + (Rudder.Handle.X - old.X), Y + (Rudder.Handle.Y - old.Y), Z + (Rudder.Handle.Z - old.Z));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This must be overriden due to the tillerman not being in the MCL bounds
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override IEnumerable<IEntity> GetEntitiesOnBoard()
|
||||
{
|
||||
Map map = Map;
|
||||
|
||||
if (map == null || map == Map.Internal)
|
||||
yield break;
|
||||
|
||||
MultiComponentList mcl = Components;
|
||||
IPooledEnumerable eable = map.GetObjectsInBounds(new Rectangle2D(X + mcl.Min.X, Y + mcl.Min.Y, mcl.Width, mcl.Height));
|
||||
|
||||
foreach (IEntity ent in eable)
|
||||
{
|
||||
if (Contains(ent) && CheckOnBoard(ent))
|
||||
{
|
||||
yield return ent;
|
||||
}
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
yield return Rudder;
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
base.OnMapChange();
|
||||
|
||||
if (Line != null)
|
||||
Line.Map = Map;
|
||||
}
|
||||
|
||||
public override void OnPlacement(Mobile from)
|
||||
{
|
||||
base.OnPlacement(from);
|
||||
|
||||
if (Line == null)
|
||||
return;
|
||||
|
||||
switch (Facing)
|
||||
{
|
||||
default:
|
||||
case Direction.North:
|
||||
Line.Location = new Point3D(X, Y - 2, Z + 5);
|
||||
break;
|
||||
case Direction.South:
|
||||
Line.Location = new Point3D(X, Y + 2, Z + 5);
|
||||
break;
|
||||
case Direction.East:
|
||||
Line.Location = new Point3D(X + 2, Y, Z + 5);
|
||||
break;
|
||||
case Direction.West:
|
||||
Line.Location = new Point3D(X - 2, Y, Z + 5);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsComponentItem(IEntity item)
|
||||
{
|
||||
return item == this || item == Line || item == Rudder || (Rudder != null && item == Rudder.Handle);
|
||||
}
|
||||
|
||||
public override bool HasAccess(Mobile from)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public RowBoat(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
|
||||
writer.Write(Rudder);
|
||||
writer.Write(Line);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
Rudder = reader.ReadItem() as Rudder;
|
||||
Line = reader.ReadItem() as MooringLine;
|
||||
|
||||
TillerMan = Rudder;
|
||||
}
|
||||
}
|
||||
|
||||
public class Rudder : TillerMan
|
||||
{
|
||||
public override int LabelNumber { get { return 1149698; } } // wheel
|
||||
|
||||
public override bool ForceShowProperties { get { return true; } }
|
||||
|
||||
public override bool Babbles { get { return false; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public RudderHandle Handle { get; set; }
|
||||
|
||||
public Rudder(BaseBoat boat, Direction d)
|
||||
: base(boat)
|
||||
{
|
||||
SetFacing(d);
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
base.OnMapChange();
|
||||
|
||||
if (Handle != null)
|
||||
Handle.Map = Map;
|
||||
}
|
||||
|
||||
public override void Delete()
|
||||
{
|
||||
if (Handle != null)
|
||||
Handle.Delete();
|
||||
|
||||
base.Delete();
|
||||
}
|
||||
|
||||
public override void SetFacing(Direction dir)
|
||||
{
|
||||
switch (dir)
|
||||
{
|
||||
case Direction.South:
|
||||
ItemID = 16068;
|
||||
break;
|
||||
case Direction.North:
|
||||
ItemID = 16062;
|
||||
X--;
|
||||
break;
|
||||
case Direction.West:
|
||||
ItemID = 15990;
|
||||
break;
|
||||
case Direction.East:
|
||||
ItemID = 15971;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Say(int number)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Say(int number, string args)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool OnDragDrop(Mobile from, Item dropped)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public Rudder(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
|
||||
writer.Write(Handle);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
Handle = reader.ReadItem() as RudderHandle;
|
||||
|
||||
if (ItemID == 16062)
|
||||
X--;
|
||||
}
|
||||
}
|
||||
|
||||
public class RudderHandle : Static
|
||||
{
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Rudder Rudder { get; set; }
|
||||
|
||||
public RudderHandle(Rudder rudder, Direction d)
|
||||
{
|
||||
Rudder = rudder;
|
||||
SetFacing(d);
|
||||
}
|
||||
|
||||
public virtual void SetFacing(Direction dir)
|
||||
{
|
||||
if (Rudder == null)
|
||||
Delete();
|
||||
else
|
||||
{
|
||||
switch (dir)
|
||||
{
|
||||
default:
|
||||
case Direction.South:
|
||||
ItemID = 16067;
|
||||
MoveToWorld(new Point3D(Rudder.X, Rudder.Y + 1, Rudder.Z), Map);
|
||||
break;
|
||||
case Direction.North:
|
||||
ItemID = 16063;
|
||||
MoveToWorld(new Point3D(Rudder.X + 1, Rudder.Y - 1, Rudder.Z), Map);
|
||||
break;
|
||||
case Direction.West:
|
||||
ItemID = 15991;
|
||||
MoveToWorld(new Point3D(Rudder.X -1, Rudder.Y + 1, Rudder.Z), Map);
|
||||
break;
|
||||
case Direction.East:
|
||||
ItemID = 15970;
|
||||
MoveToWorld(new Point3D(Rudder.X + 1, Rudder.Y, Rudder.Z), Map);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (Rudder != null)
|
||||
Rudder.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public RudderHandle(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
writer.Write(Rudder);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
Rudder = reader.ReadItem() as Rudder;
|
||||
}
|
||||
}
|
||||
|
||||
public class RowBoatDeed : BaseBoatDeed
|
||||
{
|
||||
public override int LabelNumber { get { return 1116491; } }
|
||||
public override BaseBoat Boat { get { return new RowBoat(BoatDirection); } }
|
||||
|
||||
[Constructable]
|
||||
public RowBoatDeed()
|
||||
: base(0x3C, Point3D.Zero)
|
||||
{
|
||||
}
|
||||
|
||||
public RowBoatDeed(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 DockedRowBoat : BaseDockedBoat
|
||||
{
|
||||
public override BaseBoat Boat { get { return new RowBoat(BoatDirection); } }
|
||||
|
||||
public DockedRowBoat(BaseBoat boat)
|
||||
: base(0x3C, Point3D.Zero, boat)
|
||||
{
|
||||
}
|
||||
|
||||
public DockedRowBoat(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);
|
||||
}
|
||||
}
|
||||
}
|
||||
101
Scripts/Services/Expansions/High Seas/Multis/ShipRune.cs
Normal file
101
Scripts/Services/Expansions/High Seas/Multis/ShipRune.cs
Normal file
@@ -0,0 +1,101 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Multis;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
// This item is no longer used.
|
||||
[FlipableAttribute(0x1f14, 0x1f15, 0x1f16, 0x1f17)]
|
||||
public class ShipRune : Item
|
||||
{
|
||||
private BaseGalleon m_Galleon;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public BaseGalleon Galleon { get { return m_Galleon; } set { m_Galleon = value; } }
|
||||
|
||||
public BaseDockedBoat DockedBoat
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_Galleon != null)
|
||||
return m_Galleon.BoatItem;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public override int LabelNumber { get { return 1149570; } } //A Ship Rune
|
||||
|
||||
[Constructable]
|
||||
public ShipRune() : this(null)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ShipRune(BaseGalleon galleon) : base(0x1F14)
|
||||
{
|
||||
m_Galleon = galleon;
|
||||
Hue = 0x47F;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Galleon != null)
|
||||
{
|
||||
RecallRune rune = new RecallRune();
|
||||
rune.SetGalleon(Galleon);
|
||||
from.AddToBackpack(rune);
|
||||
}
|
||||
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (m_Galleon != null)
|
||||
{
|
||||
list.Add(1149571, m_Galleon.Owner != null ? m_Galleon.Owner.Name : "Nobody"); //Owner: ~1_NAME~
|
||||
|
||||
if (m_Galleon.ShipName != null)
|
||||
list.Add(1149572, m_Galleon.ShipName); //Name: the ~1_NAME~
|
||||
else list.Add(1149573); //Name: the Unnamed Ship
|
||||
|
||||
if (m_Galleon.Map != Map.Internal)
|
||||
list.Add(1149574, m_Galleon.Map != null ? m_Galleon.Map.ToString() : "Unknown"); //Location: ~1_FACET~
|
||||
else
|
||||
{
|
||||
string name = m_Galleon.ShipName != null && m_Galleon.ShipName != "" ? m_Galleon.ShipName : "Unnamed Ship";
|
||||
list.Add(1041644, name); //The ~1_VAL~ (Dry Docked)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public ShipRune(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1);
|
||||
writer.Write(m_Galleon);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
m_Galleon = reader.ReadItem() as BaseGalleon;
|
||||
if (version == 0)
|
||||
reader.ReadItem();
|
||||
}
|
||||
}
|
||||
}
|
||||
249
Scripts/Services/Expansions/High Seas/Multis/ShipTracking.cs
Normal file
249
Scripts/Services/Expansions/High Seas/Multis/ShipTracking.cs
Normal file
@@ -0,0 +1,249 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public class ShipTrackingContext
|
||||
{
|
||||
private static Dictionary<Mobile, ShipTrackingContext> m_Table = new Dictionary<Mobile, ShipTrackingContext>();
|
||||
|
||||
private Mobile m_Mobile;
|
||||
|
||||
public List<BoatTrackingArrow> Arrows { get { return m_Arrows; } }
|
||||
private List<BoatTrackingArrow> m_Arrows = new List<BoatTrackingArrow>();
|
||||
|
||||
public ShipTrackingContext(Mobile mobile, List<BoatTrackingArrow> arrows)
|
||||
{
|
||||
m_Mobile = mobile;
|
||||
m_Arrows = arrows;
|
||||
|
||||
m_Table.Add(mobile, this);
|
||||
}
|
||||
|
||||
public static bool RemoveContext(Mobile from)
|
||||
{
|
||||
if(!m_Table.ContainsKey(from))
|
||||
return false;
|
||||
|
||||
m_Table.Remove(from);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool CanAddContext(Mobile from)
|
||||
{
|
||||
if(!m_Table.ContainsKey(from))
|
||||
return true;
|
||||
|
||||
if(m_Table[from] != null && m_Table[from].Arrows.Count > 5)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public static ShipTrackingContext GetContext(Mobile from)
|
||||
{
|
||||
if(!m_Table.ContainsKey(from))
|
||||
return null;
|
||||
|
||||
return m_Table[from];
|
||||
}
|
||||
|
||||
public bool IsTrackingBoat(Item item)
|
||||
{
|
||||
if (item is BaseBoat || item is PlunderBeaconAddon)
|
||||
{
|
||||
foreach (BoatTrackingArrow arrow in m_Arrows)
|
||||
{
|
||||
if (arrow.Boat == item)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void AddArrow(BoatTrackingArrow arrow)
|
||||
{
|
||||
m_Arrows.Add(arrow);
|
||||
}
|
||||
|
||||
public void RemoveArrow(BoatTrackingArrow arrow)
|
||||
{
|
||||
if (m_Arrows.Contains(arrow))
|
||||
m_Arrows.Remove(arrow);
|
||||
|
||||
if(m_Mobile == null)
|
||||
return;
|
||||
|
||||
if (m_Arrows.Count == 0)
|
||||
{
|
||||
m_Mobile.QuestArrow = null;
|
||||
RemoveContext(m_Mobile);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_Mobile.QuestArrow == arrow)
|
||||
m_Mobile.QuestArrow = null;
|
||||
|
||||
if (m_Arrows.Count > 0)
|
||||
m_Mobile.QuestArrow = m_Arrows[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class BoatTrackingArrow : QuestArrow
|
||||
{
|
||||
public static readonly int MaxRange = 200;
|
||||
public static readonly int MaxBoats = 5;
|
||||
|
||||
private Mobile m_From;
|
||||
private Timer m_Timer;
|
||||
private Item m_Boat;
|
||||
|
||||
public Mobile From { get { return m_From; } }
|
||||
public Timer Timer { get { return m_Timer; } }
|
||||
public Item Boat { get { return m_Boat; } }
|
||||
|
||||
public BoatTrackingArrow(Mobile from, Item boat, int range) : base(from, boat)
|
||||
{
|
||||
m_Boat = boat;
|
||||
m_From = from;
|
||||
m_Timer = new BoatTrackingTimer(from, boat, range, this);
|
||||
m_Timer.Start();
|
||||
}
|
||||
|
||||
public override void OnClick(bool rightClick)
|
||||
{
|
||||
if (rightClick && m_From != null)
|
||||
{
|
||||
ShipTrackingContext st = ShipTrackingContext.GetContext(m_From);
|
||||
|
||||
if (st != null)
|
||||
st.RemoveArrow(this);
|
||||
|
||||
m_From = null;
|
||||
Stop();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnStop()
|
||||
{
|
||||
if(m_Timer != null)
|
||||
m_Timer.Stop();
|
||||
|
||||
if(m_From != null)
|
||||
m_From.SendLocalizedMessage(503177); // You have lost your quarry.
|
||||
}
|
||||
|
||||
public static void StopTracking(Mobile from)
|
||||
{
|
||||
ShipTrackingContext st = ShipTrackingContext.GetContext(from);
|
||||
|
||||
if (st != null)
|
||||
{
|
||||
for (int i = 0; i < st.Arrows.Count; i++)
|
||||
st.Arrows[i].Stop();
|
||||
|
||||
ShipTrackingContext.RemoveContext(from);
|
||||
}
|
||||
|
||||
from.QuestArrow = null;
|
||||
}
|
||||
|
||||
public static void StartTracking(Mobile from)
|
||||
{
|
||||
if(!ShipTrackingContext.CanAddContext(from))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var targets = new List<Item>();
|
||||
Map map = from.Map;
|
||||
|
||||
if(map == null || map == Map.Internal)
|
||||
return;
|
||||
|
||||
BaseBoat fromBoat = BaseBoat.FindBoatAt(from, map);
|
||||
ShipTrackingContext context = ShipTrackingContext.GetContext(from);
|
||||
|
||||
if(fromBoat == null)
|
||||
{
|
||||
from.SendMessage("You must be on your boat to use this command.");
|
||||
}
|
||||
|
||||
IPooledEnumerable eable = map.GetItemsInRange(from.Location, MaxRange);
|
||||
|
||||
foreach(Item item in eable)
|
||||
{
|
||||
if(context != null && context.IsTrackingBoat(item))
|
||||
continue;
|
||||
if(!targets.Contains(item) && ((item is BaseBoat && (BaseBoat)item != fromBoat) || item is PlunderBeaconAddon))
|
||||
targets.Add(item);
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
|
||||
List<BoatTrackingArrow> arrows = new List<BoatTrackingArrow>();
|
||||
|
||||
for(int i = 0; i < targets.Count; i++)
|
||||
{
|
||||
if(i >= MaxBoats)
|
||||
break;
|
||||
|
||||
BoatTrackingArrow arrow = new BoatTrackingArrow(from, targets[i], MaxRange);
|
||||
|
||||
if(context == null)
|
||||
arrows.Add(arrow);
|
||||
else
|
||||
context.AddArrow(arrow);
|
||||
}
|
||||
|
||||
if (from.QuestArrow == null && arrows.Count > 0)
|
||||
from.QuestArrow = arrows[0];
|
||||
|
||||
if(context == null)
|
||||
new ShipTrackingContext(from, arrows);
|
||||
}
|
||||
}
|
||||
|
||||
public class BoatTrackingTimer : Timer
|
||||
{
|
||||
private Mobile m_From;
|
||||
private Item m_Target;
|
||||
private int m_Range;
|
||||
private int m_LastX, m_LastY;
|
||||
private QuestArrow m_Arrow;
|
||||
|
||||
public BoatTrackingTimer(Mobile from, Item target, int range, QuestArrow arrow) : base( TimeSpan.FromSeconds( 0.25 ), TimeSpan.FromSeconds( 2.5 ) )
|
||||
{
|
||||
m_From = from;
|
||||
m_Target = target;
|
||||
m_Range = range;
|
||||
m_Arrow = arrow;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if(!m_Arrow.Running)
|
||||
{
|
||||
this.Stop();
|
||||
return;
|
||||
}
|
||||
else if (m_From.NetState == null || m_From.Deleted || m_Target.Deleted || m_From.Map != m_Target.Map || !m_From.InRange(m_Target, m_Range))
|
||||
{
|
||||
m_Arrow.Stop();
|
||||
this.Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
if(m_LastX != m_Target.X || m_LastY != m_Target.Y)
|
||||
{
|
||||
m_LastX = m_Target.X;
|
||||
m_LastY = m_Target.Y;
|
||||
|
||||
m_Arrow.Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
98
Scripts/Services/Expansions/High Seas/Multis/ShipWheel.cs
Normal file
98
Scripts/Services/Expansions/High Seas/Multis/ShipWheel.cs
Normal file
@@ -0,0 +1,98 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Multis;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ShipWheel : Item, IGalleonFixture
|
||||
{
|
||||
public override int LabelNumber { get { return 1149698; } } // wheel
|
||||
|
||||
public BaseGalleon Galleon { get; set; }
|
||||
|
||||
public Mobile Pilot { get { return Galleon != null ? Galleon.Pilot : null; } }
|
||||
|
||||
public ShipWheel(BaseGalleon galleon, int id)
|
||||
: base(id)
|
||||
{
|
||||
Galleon = galleon;
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public override void OnDoubleClickDead(Mobile m)
|
||||
{
|
||||
OnDoubleClick(m);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
from.RevealingAction();
|
||||
|
||||
BaseBoat boat = BaseBoat.FindBoatAt(from, from.Map);
|
||||
Item mount = from.FindItemOnLayer(Layer.Mount);
|
||||
|
||||
if (boat == null || Galleon == null || boat != Galleon)
|
||||
{
|
||||
from.SendLocalizedMessage(1116724); // You cannot pilot a ship unless you are aboard it!
|
||||
}
|
||||
else if (Galleon.GetSecurityLevel(from) < SecurityLevel.Crewman)
|
||||
{
|
||||
from.SendLocalizedMessage(1116726); // This is not your ship!
|
||||
}
|
||||
else if (Pilot != null && Pilot != from && (Galleon.GetSecurityLevel(from) < Galleon.GetSecurityLevel(Pilot) || Pilot == Galleon.Owner))
|
||||
{
|
||||
from.SendLocalizedMessage(502221); // Someone else is already using this item.
|
||||
}
|
||||
else if (from.Flying)
|
||||
{
|
||||
from.SendLocalizedMessage(1116615); // You cannot pilot a ship while flying!
|
||||
}
|
||||
else if (from.Mounted && !(mount is BoatMountItem))
|
||||
{
|
||||
from.SendLocalizedMessage(1010097); // You cannot use this while mounted or flying.
|
||||
}
|
||||
else if (Pilot == null && Galleon.Scuttled)
|
||||
{
|
||||
from.SendLocalizedMessage(1116725); // This ship is too damaged to sail!
|
||||
}
|
||||
else if (Pilot != null)
|
||||
{
|
||||
if (from != Pilot) // High authorized player takes control of the ship
|
||||
{
|
||||
boat.RemovePilot(from);
|
||||
boat.LockPilot(from);
|
||||
}
|
||||
else
|
||||
{
|
||||
boat.RemovePilot(from);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
boat.LockPilot(from);
|
||||
}
|
||||
}
|
||||
|
||||
public ShipWheel(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (version == 0)
|
||||
{
|
||||
reader.ReadItem();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
264
Scripts/Services/Expansions/High Seas/Multis/TokunoGalleon.cs
Normal file
264
Scripts/Services/Expansions/High Seas/Multis/TokunoGalleon.cs
Normal file
@@ -0,0 +1,264 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public class TokunoGalleon : BaseGalleon
|
||||
{
|
||||
public override int NorthID { get { return 0x30 + (DamageValue * 4); } }
|
||||
public override int EastID { get { return 0x31 + (DamageValue * 4); } }
|
||||
public override int SouthID { get { return 0x32 + (DamageValue * 4); } }
|
||||
public override int WestID { get { return 0x33 + (DamageValue * 4); } }
|
||||
|
||||
public override int HoldDistance { get { return -5; } }
|
||||
public override int CaptiveOffset { get { return 2; } }
|
||||
public override int TillerManDistance { get { return -1; } }
|
||||
public override int RuneOffset { get { return -3; } }
|
||||
|
||||
public override int WheelDistance { get { return 7; } }
|
||||
public override int MaxCannons { get { return 5; } }
|
||||
|
||||
public override double TurnDelay { get { return 3; } }
|
||||
public override int MaxHits { get { return 100000; } }
|
||||
|
||||
public override int ZSurface { get { return 7; } }
|
||||
|
||||
public override BaseDockedBoat DockedBoat { get { return new DockedTokunoGalleon(this); } }
|
||||
|
||||
[Constructable]
|
||||
public TokunoGalleon() : this(Direction.North) { }
|
||||
|
||||
[Constructable]
|
||||
public TokunoGalleon(Direction facing)
|
||||
: base(facing)
|
||||
{
|
||||
}
|
||||
|
||||
public override int[][] CannonTileIDs { get { return m_CannonTileIDs; } }
|
||||
private int[][] m_CannonTileIDs = new int[][]
|
||||
{
|
||||
// -34 -4 -31 -4
|
||||
new int[] { 37054, 37020, 37016, 36985, 36981 }, //SOUTH
|
||||
new int[] { 37189, 37155, 37151, 37120, 37116 }, //WEST
|
||||
new int[] { 37324, 37290, 37286, 37255, 37251 }, //NORTH
|
||||
new int[] { 37459, 37425, 37421, 37390, 37386 }, //EAST
|
||||
|
||||
new int[] { 37786, 37752, 37748, 37717, 37713 }, //SOUTH D1
|
||||
new int[] { 37921, 37887, 37883, 37852, 37848 }, //WEST D1
|
||||
new int[] { 38056, 38022, 38018, 37987, 37983 }, //NORTH D1
|
||||
new int[] { 38191, 38157, 38153, 38122, 38118}, //EAST D1
|
||||
|
||||
new int[] { 38794, 38760, 38756, 38725, 38721 }, //SOUTH D2
|
||||
new int[] { 38934, 38900, 38896, 38865, 38861 }, //WEST D2
|
||||
new int[] { 38654, 38620, 38616, 38585, 38581 }, //NORTH D2
|
||||
new int[] { 38519, 38485, 38481, 38450, 38446 }, //EAST D2
|
||||
};
|
||||
|
||||
public override int[][] FillerIDs { get { return m_FillerIDs; } }
|
||||
private int[][] m_FillerIDs = new int[][]
|
||||
{
|
||||
/*// BL ML1 ML2 FL F1 F2 F3 FR MR2 MR1 BR
|
||||
new int[] { 33410, 33403, 33396, 33389, 33387, 33388, 33393, 33391, 33398, 33405, 33412}, //SOUTH
|
||||
new int[] { 33715, 33708, 33701, 33694, 33692, 33693, 33698, 33696, 33703, 33710, 33717 }, //WEST
|
||||
new int[] { 34017, 34010, 34003, 33996, 33994, 33995, 34000, 33998, 34005, 34012, 34019 }, //NORTH
|
||||
new int[] { 34320, 34313, 34306, 34299, 34297, 34298, 34303, 34301, 34308, 34315, 34322 }, //EAST
|
||||
|
||||
// 110 103 96 89 87 88 93 91 98 105 112
|
||||
//35419
|
||||
new int[] { 19026, 19019, 19012, 19005, 19003, 19004, 19009, 19007, 19014, 19021, 19028 }, //SOUTH D1
|
||||
new int[] { 35529, 35522, 35515, 35508, 35506, 35507, 35512, 35510, 35517, 35524, 35531 }, //WEST D1
|
||||
new int[] { 34925, 34918, 34911, 34904, 34902, 34903, 34908, 34906, 34913, 34920, 34927 }, //NORTH D1
|
||||
new int[] { 34621, 34614, 34607, 34600, 34598, 34599, 34604, 34602, 34609, 34616, 34623 }, //EAST D1
|
||||
|
||||
// +86 -7 -7 -7 -2 +1 +5 -2 +7 +7 +7
|
||||
// 110 103 96 89 87 88 93 91 98 105 112
|
||||
new int[] { 36409, 36402, 36395, 36388, 36386, 36387, 36392, 36390, 36397, 36404, 36411 }, //SOUTH D2
|
||||
new int[] { 36711, 36704, 36697, 36690, 36688, 36689, 36694, 36692, 36699, 36706, 36713 }, //WEST D2
|
||||
new int[] { 36107, 36100, 36093, 36086, 36084, 36085, 36090, 36088, 36095, 36102, 36109 }, //NORTH D2
|
||||
new int[] { 35123, 35116, 35109, 35102, 35100, 35101, 35106, 35104, 35111, 35118, 35125 }, //EAST D2*/
|
||||
};
|
||||
|
||||
public override int[][] HoldIDs { get { return m_HoldIDs; } }
|
||||
private int[][] m_HoldIDs = new int[][]
|
||||
{
|
||||
// BL +7 FL -1 FM -1 FR -7 BR +1
|
||||
new int[] { 36963, 36970, 36968, 36961, 37964 }, //SOUTH
|
||||
new int[] { 37098, 37105, 37103, 37096, 37097 }, //WEST
|
||||
new int[] { 37233, 37240, 37238, 37231, 37232 }, //NORTH
|
||||
new int[] { 37368, 37375, 37373, 37366, 37367 }, //EAST
|
||||
|
||||
new int[] { 37695, 37702, 37700, 37693, 37964 }, //SOUTH D1
|
||||
new int[] { 37830, 37837, 37835, 37828, 37097 }, //WEST D1
|
||||
new int[] { 37965, 37972, 37970, 37963, 37232 }, //NORTH D1
|
||||
new int[] { 38100, 38107, 38105, 38098, 37367 }, //EAST D1
|
||||
|
||||
new int[] { 38703, 38710, 38708, 38701, 37964 }, //SOUTH D2
|
||||
new int[] { 38843, 38850, 38848, 38841, 37097 }, //WEST D2
|
||||
new int[] { 38563, 38570, 38568, 38561, 37232 }, //NORTH D2
|
||||
new int[] { 38428, 38435, 38433, 38426, 37367 }, //EAST D1
|
||||
};
|
||||
|
||||
public override int[][] HoldItemIDs { get { return m_HoldItemIDs; } }
|
||||
private int[][] m_HoldItemIDs = new int[][]
|
||||
{
|
||||
new int[] { 36969 },
|
||||
new int[] { 37104 },
|
||||
new int[] { 37239 },
|
||||
new int[] { 37374 },
|
||||
|
||||
new int[] { 37701 },
|
||||
new int[] { 37836 },
|
||||
new int[] { 37971 },
|
||||
new int[] { 38106 },
|
||||
|
||||
new int[] { 38709 },
|
||||
new int[] { 38849 },
|
||||
new int[] { 38569 },
|
||||
new int[] { 38434 },
|
||||
};
|
||||
|
||||
public override int[][] WheelItemIDs { get { return m_WheelItemIDs; } }
|
||||
private int[][] m_WheelItemIDs = new int[][]
|
||||
{
|
||||
|
||||
new int[] { 37650 },
|
||||
new int[] { 37652 },
|
||||
new int[] { 37654 },
|
||||
new int[] { 37656 },
|
||||
};
|
||||
|
||||
public override ShipPosition GetCannonPosition(Point3D pnt)
|
||||
{
|
||||
int x = pnt.X; int y = pnt.Y;
|
||||
|
||||
switch (Facing)
|
||||
{
|
||||
default:
|
||||
case Direction.North:
|
||||
if (x == this.X && y < this.Y)
|
||||
return ShipPosition.Bow;
|
||||
if (x > this.X && y < this.Y)
|
||||
return ShipPosition.BowStarboard;
|
||||
if (x < this.X && y < this.Y)
|
||||
return ShipPosition.BowPort;
|
||||
else if (x > this.X && y > this.Y)
|
||||
return ShipPosition.AftStarboard;
|
||||
else
|
||||
return ShipPosition.AftPort;
|
||||
case Direction.West:
|
||||
if (x < this.X && y == this.Y)
|
||||
return ShipPosition.Bow;
|
||||
else if (x < this.X && y < this.Y)
|
||||
return ShipPosition.BowStarboard;
|
||||
else if (x < this.X && y > this.Y)
|
||||
return ShipPosition.BowPort;
|
||||
else if (x > this.X && y < this.Y)
|
||||
return ShipPosition.AftStarboard;
|
||||
else
|
||||
return ShipPosition.AftPort;
|
||||
case Direction.South:
|
||||
if (x == this.X && y > this.Y)
|
||||
return ShipPosition.Bow;
|
||||
else if (x < this.X && y > this.Y)
|
||||
return ShipPosition.BowStarboard;
|
||||
else if (x > this.X && y > this.Y)
|
||||
return ShipPosition.BowPort;
|
||||
else if (x < this.X && y < this.Y)
|
||||
return ShipPosition.AftStarboard;
|
||||
else
|
||||
return ShipPosition.AftPort;
|
||||
case Direction.East:
|
||||
if (x > this.X && y == this.Y)
|
||||
return ShipPosition.Bow;
|
||||
else if (x > this.X && y > this.Y)
|
||||
return ShipPosition.BowStarboard;
|
||||
else if (x > this.X && y < this.Y)
|
||||
return ShipPosition.BowPort;
|
||||
else if (x < this.X && y > this.Y)
|
||||
return ShipPosition.AftStarboard;
|
||||
else
|
||||
return ShipPosition.AftPort;
|
||||
}
|
||||
}
|
||||
|
||||
public TokunoGalleon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public class TokunoGalleonDeed : BaseBoatDeed
|
||||
{
|
||||
public override int LabelNumber { get { return 1116740; } }
|
||||
public override BaseBoat Boat { get { return new TokunoGalleon(this.BoatDirection); } }
|
||||
|
||||
[Constructable]
|
||||
public TokunoGalleonDeed()
|
||||
: base(0x30, Point3D.Zero)
|
||||
{
|
||||
}
|
||||
|
||||
public TokunoGalleonDeed(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 DockedTokunoGalleon : BaseDockedBoat
|
||||
{
|
||||
public override int LabelNumber { get { return 1116749; } } //Tokuno Ship
|
||||
public override BaseBoat Boat { get { return new TokunoGalleon(this.BoatDirection); } }
|
||||
|
||||
public DockedTokunoGalleon(BaseBoat boat)
|
||||
: base(0x30, Point3D.Zero, boat)
|
||||
{
|
||||
}
|
||||
|
||||
public DockedTokunoGalleon(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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user