public void AddPole()
       {
           if(m_Galleon == null)
               return;
 
            int dist = m_Galleon.CaptiveOffset;
			int xOffset = 0; 
			int yOffset = 0;
			m_Pole = new BindingPole(this);
 
            switch (m_Galleon.Facing)
			{
				case Direction.North:
					xOffset = 0;
					yOffset = dist * -1;
                    break;
				case Direction.South:
					xOffset = 0;
					yOffset = dist * 1;
                    break;
				case Direction.East:
					yOffset = 0;
					xOffset = dist * 1;
                    break;
				case Direction.West:
					xOffset = dist * -1;
					yOffset = 0;
                    break;
			}	
 
            m_Pole.MoveToWorld(new Point3D(m_Galleon.X + xOffset, m_Galleon.Y + yOffset, m_Galleon.ZSurface), m_Galleon.Map);
            m_Galleon.Pole = m_Pole;
       }
       public override void Deserialize( GenericReader reader )
       {
			base.Deserialize(reader);
			int version = reader.ReadEncodedInt();

			m_Pole = reader.ReadItem() as BindingPole;
			m_Rope = reader.ReadItem() as BindingRope;
			m_Captain = reader.ReadMobile();
			m_Galleon = reader.ReadItem() as BaseGalleon;
		 
			int count = reader.ReadInt();
			for (int i = 0; i < count; i++)
			{
				Mobile mob = reader.ReadMobile();
				if (mob != null)
					m_Helpers.Add(mob);
			}
 
            if(m_Rope != null)
               m_Rope.Quest = this;
 
            if (m_Pole != null)
                m_Pole.Quest = this;
            else
                AddPole();
 
            AddReward(new BaseReward(1116712)); //The gold listed on the bulletin board and a special reward from the officer if captured alive.
       }
Beispiel #3
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            switch (version)
            {
                case 3:
                case 2:
                    m_Pole = reader.ReadItem() as BindingPole;
                    m_CapturedCaptain = reader.ReadMobile();
                    goto case 1;
                case 1:
                    m_BaseBoatHue = reader.ReadInt();
                    goto case 0;
                case 0:
                    m_GalleonPilot = reader.ReadMobile();
                    m_Hits = reader.ReadInt();
                    m_Wheel = reader.ReadItem() as ShipWheel;
                    m_GalleonHold = reader.ReadItem() as GalleonHold;

                    if (version < 3)
                    {
                        reader.ReadItem();
                        reader.ReadItem();
                    }

                    m_DamageTaken = (DamageLevel)reader.ReadInt();

                    m_BasePaintHue = reader.ReadInt();
                    m_PaintCoats = reader.ReadInt();
                    m_NextPaintDecay = reader.ReadDateTime();

                    m_SecurityEntry = new SecurityEntry(this, reader);

                    int count = reader.ReadInt();
                    for (int i = 0; i < count; i++)
                    {
                        Static tile = reader.ReadItem() as Static;
                        if (tile != null && !tile.Deleted)
                            AddCannonTile(tile);
                    }

                    count = reader.ReadInt();
                    for (int i = 0; i < count; i++)
                    {
                        Item cannon = reader.ReadItem();
                        if (cannon != null && !cannon.Deleted)
                            m_Cannons.Add(cannon);
                    }

                    count = reader.ReadInt();
                    for (int i = 0; i < count; i++)
                    {
                        Static filler = reader.ReadItem() as Static;
                        if (filler != null && !filler.Deleted)
                            AddFillerTile(filler);
                    }

                    count = reader.ReadInt();
                    for (int i = 0; i < count; i++)
                    {
                        MooringLine line = reader.ReadItem() as MooringLine;
                        if (line != null && !line.Deleted)
                            AddMooringLine(line);
                    }

                    count = reader.ReadInt();
                    for (int i = 0; i < count; i++)
                    {
                        HoldItem hItem = reader.ReadItem() as HoldItem;
                        if (hItem != null && !hItem.Deleted)
                            AddHoldTile(hItem);
                    }

                    count = reader.ReadInt();
                    for (int i = 0; i < count; i++)
                    {
                        Item addon = reader.ReadItem();
                        if (addon != null && !addon.Deleted)
                            AddAddon(addon);
                    }

                    count = reader.ReadInt();
                    for (int i = 0; i < count; i++)
                    {
                        Static atile = reader.ReadItem() as Static;
                        if (atile != null && !atile.Deleted)
                            AddAddonTile(atile);
                    }

                    break;
            }

            if (m_Pole != null)
                m_Pole.Galleon = this;
        }