Inheritance: Server.Items.BaseMulti
Example #1
2
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 0:
				{
					m_Boat = reader.ReadItem() as BaseBoat;
					m_Side = (PlankSide) reader.ReadInt();
					m_Locked = reader.ReadBool();
					m_KeyValue = reader.ReadUInt();

					if ( m_Boat == null )
						Delete();

					break;
				}
			}

			if ( IsOpen )
			{
				m_CloseTimer = new CloseTimer( this );
				m_CloseTimer.Start();
			}
		}
Example #2
0
        public BoatMountItem(BaseBoat mount) : base(0x3E96)
        {
            Layer = Layer.Mount;

            Movable = false;
            m_Mount = mount;
        }
Example #3
0
 public ShipCrate(Mobile owner, BaseBoat boat)
 {
     LiftOverride = true;
     m_Owner = owner;
     m_Boat = boat;
     Movable = false;
 }
Example #4
0
		public ConfirmDryDockGump( Mobile from, BaseBoat boat, Mobile dockmaster ) : base( 150, 200 )
		{
			m_From = from;
            m_Dockmaster = dockmaster;
			m_Boat = boat;

			m_From.CloseGump( typeof( ConfirmDryDockGump ) );

			AddPage( 0 );

			AddBackground( 0, 0, 220, 170, 5054 );
			AddBackground( 10, 10, 200, 150, 3000 );

            bool needsWarning = boat is BaseGalleon && ((BaseGalleon)boat).HasPaint;

            //if (needsWarning)
            //    AddHtml(20, 20, 180, 80, "Do you wish to dry dock this boat?<br>WARNING: You will lose any non-permanent boat paint applied to your galleon.", true, true);
            //else
            AddHtmlLocalized(20, 20, 180, 80, 1018319, true, needsWarning); // Do you wish to dry dock this boat?

			AddHtmlLocalized( 55, 100, 140, 25, 1011011, false, false ); // CONTINUE
			AddButton( 20, 100, 4005, 4007, 2, GumpButtonType.Reply, 0 );

			AddHtmlLocalized( 55, 125, 140, 25, 1011012, false, false ); // CANCEL
			AddButton( 20, 125, 4005, 4007, 1, GumpButtonType.Reply, 0 );
		}
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
            Boat = reader.ReadItem() as BaseBoat;
		}
Example #6
0
		public Plank( BaseBoat boat, PlankSide side, uint keyValue ) : base( 0x3EB1 + (int)side )
		{
			m_Boat = boat;
			m_Side = side;
			m_KeyValue = keyValue;
			m_Locked = true;

			Movable = false;
		}
		public BaseDockedBoat( int id, Point3D offset, BaseBoat boat ) : base( 0x14F4 )
		{
			Weight = 1.0;
			LootType = LootType.Blessed;

			m_MultiID = id;
			m_Offset = offset;

			m_ShipName = boat.ShipName;
		}
Example #8
0
 public BoatRope(BaseBoat boat, Point3D offset, uint keyValue)
     : base(boat, offset, null) // direction doesn't matter
 {
     Boat = boat;
     m_KeyValue = keyValue;
     m_Locked = true;
     Offset = offset;
     
     ItemID = 0x14FA;
 }
Example #9
0
        public BaseDockedBoat( int id, Point3D offset, BaseBoat boat ) : base( 0x14F4 )
		{
			Weight = 1.0;
			LootType = LootType.Blessed;

			m_MultiID = id;
			m_Offset = offset;

            m_Direction = Direction.North;
            m_BoatItem = boat;
		}
Example #10
0
        public BaseDockedBoat(int id, Point3D offset, BaseBoat boat)
            : base(/*0x14F4*/0x14F2)
        {
            Weight = 1.0;
            //LootType = LootType.Blessed;

            m_MultiID = id;
            m_Offset = offset;
            m_Location = boat.Location;

            m_ShipName = boat.ShipName;
        }
Example #11
0
        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();
        }
Example #12
0
        public BoatEquipPacket(Mobile to, BaseBoat boat)
            : base(0x2E, 15)
        {
            Serial parentSerial = to.Serial;

            int hue = boat.Hue;

            m_Stream.Write((int)boat.Serial);
            m_Stream.Write((short)boat.ItemID);
            m_Stream.Write((byte)0);
            m_Stream.Write((byte)boat.Layer);
            m_Stream.Write((int)parentSerial);
            m_Stream.Write((short)hue);
        }
Example #13
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 0:
                {
                    m_Boat = reader.ReadItem() as BaseBoat;

                    if ( m_Boat == null )
                        Delete();

                    break;
                }
            }
        }
		public ConfirmDryDockGump( Mobile from, BaseBoat boat ) : base( 150, 200 )
		{
			m_From = from;
			m_Boat = boat;

			m_From.CloseGump( typeof( ConfirmDryDockGump ) );

			AddPage( 0 );

			AddBackground( 0, 0, 220, 170, 5054 );
			AddBackground( 10, 10, 200, 150, 3000 );

			AddHtmlLocalized( 20, 20, 180, 80, 1018319, true, false ); // Do you wish to dry dock this boat?

			AddHtmlLocalized( 55, 100, 140, 25, 1011011, false, false ); // CONTINUE
			AddButton( 20, 100, 4005, 4007, 2, GumpButtonType.Reply, 0 );

			AddHtmlLocalized( 55, 125, 140, 25, 1011012, false, false ); // CANCEL
			AddButton( 20, 125, 4005, 4007, 1, GumpButtonType.Reply, 0 );
		}
Example #15
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch ( version )
            {
                case 0:
                    {
                        this.m_Boat = reader.ReadItem() as BaseBoat;

                        if (this.m_Boat == null || this.Parent != null)
                            this.Delete();

                        this.Movable = false;

                        break;
                    }
            }
        }
        public ProfessionalFisherQuest(Mobile from, FishMonger monger, FishMonger quester, BaseBoat boat)
        {
            PlayerFishingEntry entry = PlayerFishingEntry.GetEntry(from, true);

            int lines;

            if (boat.IsClassicBoat)
                lines = 1;
            else
                lines = entry.CalculateLines();

            m_TurnIn = monger;
            m_Boat = boat;

            int index = 0;
            int amount = 10;
            Type type = null;

            List<int> hasChosen = new List<int>();
            Dictionary<Type, int> types = new Dictionary<Type, int>();

            for (int i = 0; i < lines; i++)
            {
                entry.GetRandomFish(ref index, ref amount, hasChosen);
                hasChosen.Add(index);
                type = FishQuestHelper.GetTypeFromIndex(index);
                if (amount < 5) amount = 5;
                if (amount > 20) amount = 20;

                types[type] = amount;
            }

            AddObjective(new FishQuestObjective(types));
            AddReward(new BaseReward(1116510)); //A rare reward from the Order of the Dragonfish.

            hasChosen.Clear();

            m_Title = GetTitle(quester);
        }
Example #17
0
        private static Rectangle3D[] GetArea(BaseBoat boat)
        {
            int x = boat.X;
            int y = boat.Y;
            int z = boat.Z;

            Rectangle2D[] houseArea;

            if (boat.Facing == Direction.North || boat.Facing == Direction.South)
                houseArea = boat.AreaNorth;
            else
                houseArea = boat.AreaEast;

            Rectangle3D[] area = new Rectangle3D[houseArea.Length];

            for (int i = 0; i < area.Length; i++)
            {
                Rectangle2D rect = houseArea[i];
                area[i] = Region.ConvertTo3D(new Rectangle2D(x + rect.Start.X, y + rect.Start.Y, rect.Width, rect.Height));
            }

            return area;
        }
 public SmallDockedDragonBoat( BaseBoat boat )
     : base(0x4004, Point3D.Zero, boat)
 {
 }
Example #19
0
		public MediumDockedBoat( BaseBoat boat ) : base( 0x4008, Point3D.Zero, boat )
		{
		}
Example #20
0
			public DecayTimer( BaseBoat boat ) : base( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 5.0 ) )
			{
				m_Boat = boat;

				Priority = TimerPriority.TwoFiftyMS;
			}
		public LargeDockedDragonBoat( BaseBoat boat ) : base( 0x14, new Point3D( 0, -1, 0 ), boat )
		{
		}
Example #22
0
			public TurnTimer( BaseBoat boat, int offset ) : base( TimeSpan.FromSeconds( 0.5 ) )
			{
				m_Boat = boat;
				m_Offset = offset;

				Priority = TimerPriority.TenMS;
			}
Example #23
0
			public MoveTimer( BaseBoat boat, TimeSpan interval, bool single ) : base( interval, interval, single ? 1 : 0 )
			{
				m_Boat = boat;
				Priority = TimerPriority.TwentyFiveMS;
			}
Example #24
0
			public SinkTimer( BaseBoat boat, Mobile m ) : base( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 4.0 ) )
			{
				m_Boat = boat;
				m_mobile = m;

				Priority = TimerPriority.TwoFiftyMS;
			}
 public DryDockableDockedBoat( BaseBoat boat )
     : base(0x4014, new Point3D( 0, -1, 0 ), boat)
 {
 }
Example #26
0
 public SmallDockedBoat( BaseBoat boat )
     : base(0x4000, Point3D.Zero, boat)
 {
 }
Example #27
0
		public Hold( BaseBoat boat ) : base( 0x3EAE )
		{
			m_Boat = boat;
			Movable = false;
		}
Example #28
0
		public TillerMan( BaseBoat boat ) : base( 0x3E4E )
		{
			m_Boat = boat;
			Movable = false;
		}
Example #29
0
 public MediumDockedDragonBoat( BaseBoat boat )
     : base(0x400C, Point3D.Zero, boat)
 {
 }
Example #30
0
		public override void OnThink()
		{

        #region Pirate Can Say Random Phrases From A [.txt] File

        if (DateTime.Now >= nextAbilityTime && Combatant == null && active == true)
        {
            nextAbilityTime = DateTime.Now + TimeSpan.FromSeconds(Utility.RandomMinMax(4, 6));

            if (text == null)
            {
                try
            {
                text = new StreamReader(path, System.Text.Encoding.Default, false);
            }
                catch { }
            }
                Talk();
                Emote();
            }

        #endregion Pirate Can Say Random Phrases From A [.txt] File

  		if(boatspawn == false)
  		{
			Map map = this.Map;
  			if ( map == null )
  				return;			
			this.Z = 0;
            m_PirateShip_Boat = new PirateShip_Boat();
  			Point3D loc = this.Location;
  			Point3D loccrew = this.Location;

			loc = new Point3D( this.X, this.Y-1, this.Z-5 );
			loccrew = new Point3D( this.X, this.Y-1, this.Z+1 );

            m_PirateShip_Boat.MoveToWorld(loc, map);
            boatspawn = true;
        
			for(int i = 0; i < 5; ++i)
			{
                PirateCrew m_PirateCrew = new PirateCrew();
                m_PirateCrew.MoveToWorld(loccrew, map); 
			}
		}
		
		base.OnThink();
		if ( DateTime.Now < m_NextPickup )
			return;

        if (m_PirateShip_Boat == null)
		{
			return;
		} 

		m_NextPickup = DateTime.Now + TimeSpan.FromSeconds( Utility.RandomMinMax( 1, 2 ) );

        enemydirection = Direction.North;
		foreach ( Item enemy in this.GetItemsInRange( 200 ) )
		{
            if (enemy is BaseBoat && enemy != m_PirateShip_Boat && !(enemy is PirateShip_Boat))
			{
				List<Mobile> targets = new List<Mobile>();
				IPooledEnumerable eable = enemy.GetMobilesInRange( 16 );

				foreach ( Mobile m in eable )
				{
					if ( m is PlayerMobile )
						targets.Add( m );
				}
				eable.Free();
				if ( targets.Count > 0 )
				{
                    m_enemyboat = enemy as BaseBoat;
                    enemydirection = this.GetDirectionTo(m_enemyboat);
					break;
				}
			} 
		}
        if (m_enemyboat == null)
		{
			return;
		}

        if (m_PirateShip_Boat != null && m_enemyboat != null)
		{
            if (m_PirateShip_Boat != null && (enemydirection == Direction.North) && m_PirateShip_Boat.Facing != Direction.North)
			{
                m_PirateShip_Boat.Facing = Direction.North;
			}
            else if (m_PirateShip_Boat != null && (enemydirection == Direction.South) && m_PirateShip_Boat.Facing != Direction.South)
			{
                m_PirateShip_Boat.Facing = Direction.South;
			}
            else if (m_PirateShip_Boat != null && (enemydirection == Direction.East || enemydirection == Direction.Right || enemydirection == Direction.Down) && m_PirateShip_Boat.Facing != Direction.East)
			{
                m_PirateShip_Boat.Facing = Direction.East;
			}
            else if (m_PirateShip_Boat != null && (enemydirection == Direction.West || enemydirection == Direction.Left || enemydirection == Direction.Up) && m_PirateShip_Boat.Facing != Direction.West)   
			{
                m_PirateShip_Boat.Facing = Direction.West;
			}
            m_PirateShip_Boat.StartMove(Direction.North, true);

            if (m_PirateShip_Boat != null && this.InRange(m_enemyboat, 10) && m_PirateShip_Boat.IsMoving == true)
			{
                m_PirateShip_Boat.StopMove(false);
			}
		}
		else
		{
            if (m_PirateShip_Boat != null && m_PirateShip_Boat.IsMoving == true)
			{
                m_PirateShip_Boat.StopMove(false);
			}
		}
		}