Exemplo n.º 1
0
        public override void OnConfirmed(CollectionItem citem, int index)
        {
            BODCollectionItem item = citem as BODCollectionItem;

            if (item != null && GetPoints(User) >= item.Points && item.Constructor != null)
            {
                Item i = item.Constructor(item.RewardType);

                if (User.Backpack == null || !User.Backpack.TryDropItem(User, i, false))
                {
                    User.SendLocalizedMessage(1074361); // The reward could not be given.  Make sure you have room in your pack.
                    i.Delete();

                    User.SendGump(new RewardsGump(Owner, User, this.BODType, (int)Points));
                }
                else
                {
                    User.SendLocalizedMessage(1073621); // Your reward has been placed in your backpack.
                    User.PlaySound(0x5A7);

                    if (UsingBanked)
                    {
                        BulkOrderSystem.DeductPoints(User, this.BODType, item.Points);
                    }
                    else
                    {
                        BulkOrderSystem.RemovePending(User, this.BODType);
                    }
                }
            }
        }
Exemplo n.º 2
0
        private static void OnSave(Mobile m, object state)
        {
            object[] ohs = (object[])state;

            BulkOrderSystem.SetPoints(m, (BODType)ohs[2], (double)ohs[1]);
            BulkOrderSystem.RemovePending(m, (BODType)ohs[2]);

            if (m is PlayerMobile)
                m.SendGump(new RewardsGump((Mobile)ohs[3], (PlayerMobile)m, (BODType)ohs[2]));
        }