public void OnTarget(Mobile from, Point3D point) { BaseBoat boatFrom = BaseBoat.FindBoatAt(from.Location, this.Map); BaseBoat boatTo = BaseBoat.FindBoatAt(point, this.Map); double distance = 1000; if (boatFrom == null) { from.SendMessage("You must be onboard this ship in order to transfer its doubloons."); return; } if (boatTo != null) { distance = boatFrom.GetBoatToBoatDistance(boatFrom, boatTo); if (!(distance >= 0 && distance <= 6)) { from.SendMessage("The targeted ship is not close enough to transfer the doubloons."); return; } if (boatTo.IsOwner(from) || boatTo.IsCoOwner(from)) { if (boatTo.Hold == null) { from.SendMessage("That ship does not have a hold to transfer doubloons to."); return; } if (boatTo.Hold.Deleted) { from.SendMessage("That ship does not have a hold to transfer doubloons to."); return; } int doubloonsFrom = boatFrom.GetHoldDoubloonTotal(boatFrom); int deposited = 0; return; } else { from.SendMessage("You must be the owner or co-owner of the ship in order to transfer doubloons to that ship."); return; } } else { from.SendMessage(""); return; } }
public override void OnResponse(NetState state, RelayInfo info) { if (info.ButtonID == 2) { int doubloonsInHold = m_Boat.GetHoldDoubloonTotal(m_Boat); if (!Banker.CanDepositUniqueCurrency(m_From, typeof(Doubloon), doubloonsInHold)) { m_From.SendMessage("Your bankbox would not be able to hold all of the doubloons from your ship's hold. You must clear out some items from your bank before you may dock this ship."); } else { m_Boat.MoveHoldDoubloonsToBank(m_From, false); m_Boat.EndDryDock(m_From, doubloonsInHold); } } }