Ejemplo n.º 1
0
        public override void LoadWeapon(Mobile from, Item projectile)
        {
            if (projectile == null)
            {
                return;
            }

            // restrict allowed projectiles
            if (!CheckAllowedProjectile(projectile))
            {
                from.SendMessage("That cannot be loaded into this weapon");
                return;
            }

            if (Projectile != null && !Projectile.Deleted)
            {
                from.SendMessage("{0} unloaded", Projectile.Name);
                from.AddToBackpack(Projectile);
            }

            // allow stacked projectiles to be loaded
            Projectile = projectile;

            if (Projectile != null)
            {
                Projectile.Internalize();

                from.SendMessage("{0} loaded", Projectile.Name);
            }
        }
Ejemplo n.º 2
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            if (dropped.LootType == LootType.Blessed || dropped.LootType == LootType.Newbied || dropped is Gold || dropped is TrTokens || dropped is BoardingVoucher || dropped is ChaosCoin || dropped is OrderCoin || dropped is GauntletToken || dropped is StarWarToken || dropped is BankCheck || dropped is ImagineNickel || dropped is ShrinkItem || dropped is Key || dropped is Container && TotalItems >= 1)
            {
                from.SendMessage(38, "You can not trash that for a reward!");
                return(false);
            }

            int prize      = GetSellPriceFor(dropped);
            int totalPrize = prize;

            while (prize > 65000)
            {
                from.AddToBackpack(new TrTokens(65000));
                prize -= 65000;
            }

            from.AddToBackpack(new TrTokens(prize));
            from.SendMessage(53, "You got {0} silver coins for your trash!", totalPrize);
            dropped.Internalize();
            if (m_TrashedItem != null)
            {
                m_TrashedItem.Delete();
            }
            m_TrashedItem = dropped;
            trashedReward = totalPrize;
            return(true);
        }
Ejemplo n.º 3
0
        public bool SetCommodity(Item item)
        {
            InvalidateProperties();

            if (Commodity == null && item is ICommodity commodity && commodity.IsDeedable)
            {
                Commodity = item;
                Commodity.Internalize();
                InvalidateProperties();

                return(true);
            }
Ejemplo n.º 4
0
        public bool SetTreasure(Item item)
        {
            InvalidateProperties();

            if (item != null && item.Movable)
            {
                m_TreasureItem = item;
                item.Internalize();
                InvalidateProperties();

                return(true);
            }
            return(false);
        }
Ejemplo n.º 5
0
        public bool SetCommodity(Item item)
        {
            InvalidateProperties();

            if (Commodity == null && (item as ICommodity)?.IsDeedable == true)
            {
                Commodity = item;
                Commodity.Internalize();
                InvalidateProperties();

                return(true);
            }

            return(false);
        }
Ejemplo n.º 6
0
        public bool SetCommodity(Item item)
        {
            InvalidateProperties();

            if (m_Commodity == null && item is ICommodity)
            {
                m_Commodity = item;
                m_Commodity.Internalize();
                InvalidateProperties();

                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 7
0
        public bool SetCommodity(Item item)
        {
            InvalidateProperties();

            if (Commodity == null && item is ICommodity iItem && iItem.IsDeedable)
            {
                Commodity = item;
                Commodity.Internalize();
                Hue = 0x592;

                InvalidateProperties();

                return(true);
            }

            return(false);
        }
Ejemplo n.º 8
0
        public virtual void LoadWeapon(Mobile from, Item projectile)
        {
            if (projectile == null)
            {
                return;
            }

            // can't load destroyed weapons
            if (Hits == 0)
            {
                return;
            }

            // restrict allowed projectiles
            if (!CheckAllowedProjectile(projectile))
            {
                from.SendMessage("That cannot be loaded into this weapon");
                return;
            }

            if (m_Projectile != null && !m_Projectile.Deleted)
            {
                from.SendMessage("{0} unloaded", m_Projectile.Name);
                from.AddToBackpack(m_Projectile);
            }

            if (projectile.Amount > 1)
            {
                //projectile.Amount--;
                //Projectile = projectile.Dupe(1);
                Projectile = Mobile.LiftItemDupe(projectile, projectile.Amount - 1);
            }
            else
            {
                Projectile = projectile;
            }

            if (m_Projectile != null)
            {
                m_Projectile.Internalize();

                from.SendMessage("{0} loaded", m_Projectile.Name);
            }
        }
Ejemplo n.º 9
0
        public bool SetCommodity(Item item)
        {
            InvalidateProperties();

            if (m_Commodity == null && item is ICommodity && ((ICommodity)item).IsDeedable)
            {
                m_Commodity = item;
                m_Commodity.Internalize();
                Hue = 0x592;

                InvalidateProperties();

                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 10
0
            protected override void OnTick()
            {
                m_Item.Internalize();

                m_Free.Add(m_Item);
            }
Ejemplo n.º 11
0
        public bool SetTreasure(Item item)
        {
            InvalidateProperties();

            if (item != null && item.Movable)
            {
                m_TreasureItem = item;
                item.Internalize();
                InvalidateProperties();

                return true;
            }
                return false;
        }