コード例 #1
0
 public override void OnClick()
 {
     if (!Owner.From.InRange(m_Cannon, 3))
     {
         Owner.From.SendLocalizedMessage(500446);
     }
     else if (m_Cannon.CCom.NextShot > DateTime.Now)
     {
         Owner.From.SendMessage("You must wait for the cannon to cool down before you can crate it.");
     }
     else
     {                  //................need a timer here so its not instantaneous
         BaseCannonDeed deed = (BaseCannonDeed)Activator.CreateInstance(m_Cannon.Deed.GetType());
         m_Cannon.Delete();
         Owner.From.PlaceInBackpack(deed);
     }
     return;
 }
コード例 #2
0
 public override void OnClick()
 {
     if (!Owner.From.InRange(m_Cannon, 3))
     {
         Owner.From.SendLocalizedMessage(500446);
     }
     else if (m_Cannon.CCom.NextShot > DateTime.Now)
     {
         Owner.From.SendMessage("You must wait for the cannon to cool down before you can redeed it.");
     }
     else
     {
         BaseCannonDeed deed = (BaseCannonDeed)Activator.CreateInstance(m_Cannon.Deed.GetType());
         deed.Hits    = m_Cannon.CCom.Hits;
         deed.HitsMax = m_Cannon.CCom.HitsMax;
         m_Cannon.Delete();
         Owner.From.PlaceInBackpack(deed);
     }
 }
コード例 #3
0
ファイル: BaseGalleon.cs プロジェクト: Ravenwolfe/ServUO
        public bool TryAddCannon(Mobile from, Point3D pnt, BaseCannon cannon, ShipCannonDeed deed)
        {
            if (cannon == null)
                return false;

            if (IsValidCannonSpot(ref pnt, from))
            {
                cannon.MoveToWorld(pnt, this.Map);
                m_Cannons.Add((Item)cannon);
                UpdateCannonID(cannon);
                cannon.Position = GetCannonPosition(pnt);
                cannon.DoAreaMessage(1116074, 10, from); //~1_NAME~ deploys a ship cannon.

                if (deed != null && from.AccessLevel == AccessLevel.Player)
                    deed.Delete();

                return true;
            }
            cannon.Delete();
            return false;
        }