Exemplo n.º 1
0
 public ShipTarget(BaseShipWeapon weapon, Mobile from, bool checklos)
     : base(30, true, TargetFlags.None)
 {
     _weapon   = weapon;
     _from     = from;
     _checklos = checklos;
 }
Exemplo n.º 2
0
        public virtual void StoreWeapon_Callback(object state)
        {
            object[] args = (object[])state;

            Mobile         from   = (Mobile)args[0];
            BaseShipWeapon weapon = (BaseShipWeapon)args[1];

            if (weapon == null || weapon.Deleted || from == null)
            {
                return;
            }

            // make sure that there is only one person nearby
            IPooledEnumerable moblist = from.Map.GetMobilesInRange(weapon.Location, MinStorageRange);
            int count = 0;

            if (moblist != null)
            {
                foreach (Mobile m in moblist)
                {
                    if (m.Player)
                    {
                        count++;
                    }
                }
            }
            if (count > 1)
            {
                from.SendMessage("Too many players nearby. Storage failed.");
                return;
            }

            // make sure that the player is still next to the weapon
            if (!from.InRange(weapon.Location, MinStorageRange) || from.Map != weapon.Map)
            {
                from.SendLocalizedMessage(500446); // That is too far away.
                from.SendMessage("{0} not stored.", weapon.Name);
                return;
            }

            // use the crate itemid while stored
            weapon.ItemID  = StoredWeaponID;
            weapon.Visible = true;
            weapon.Movable = true;
            from.AddToBackpack(weapon);

            // hide the components

            /*foreach (AddonComponent i in weapon.Components)
             *{
             *    if (i != null)
             *    {
             *        i.Internalize();
             *    }
             *}
             */

            from.SendMessage("{0} stored.", weapon.Name);
            weapon.Storing = false;
        }
Exemplo n.º 3
0
        public virtual void DamageTarget_Callback(object state)
        {
            object[] args = (object[])state;

            Mobile         from      = (Mobile)args[0];
            BaseShipWeapon weapon    = (BaseShipWeapon)args[1];
            IEntity        target    = (IEntity)args[2];
            Point3D        targetloc = (Point3D)args[3];
            Item           pitem     = (Item)args[4];

            IShipProjectile projectile = pitem as IShipProjectile;

            if (projectile != null)
            {
                projectile.OnHit(from, weapon, target, targetloc);
            }
        }
Exemplo n.º 4
0
 public ShipTarget(BaseShipWeapon weapon, Mobile from)
     : base(30, true, TargetFlags.None)
 {
     this.m_weapon = weapon;
     this.m_from   = from;
 }
Exemplo n.º 5
0
 public ShipTarget(BaseShipWeapon weapon, Mobile from)
     : base(30, true, TargetFlags.None)
 {
     this.m_weapon = weapon;
     this.m_from = from;
 }