public override bool OnDragDrop(Mobile from, Item dropped)
        {
            if (ViceVsVirtueSystem.IsVvV(from))
            {
                if (!(dropped is IOwnerRestricted) || ((IOwnerRestricted)dropped).Owner == from)
                {
                    if (dropped is IVvVItem && from.Race == Race.Gargoyle)
                    {
                        foreach (var t in _Table)
                        {
                            if (dropped.GetType() == t[0])
                            {
                                IDurability dur = dropped as IDurability;

                                if (dur != null && dur.MaxHitPoints == 255 && dur.HitPoints == 255)
                                {
                                    var item = Loot.Construct(t[1]);

                                    if (item != null)
                                    {
                                        VvVRewards.OnRewardItemCreated(from, item);

                                        if (item is GargishCrimsonCincture)
                                        {
                                            ((GargishCrimsonCincture)item).Attributes.BonusDex = 10;
                                        }

                                        from.AddToBackpack(item);
                                        dropped.Delete();

                                        return(true);
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        return(false);
                    }
                }
            }

            SayTo(from, 1157365); // I'm sorry, I cannot accept this item.
            return(false);
        }
示例#2
0
        public override void OnConfirmed(CollectionItem citem, int index)
        {
            Item item;

            if (citem.Type == typeof(VvVPotionKeg))
            {
                PotionType type;

                switch (index)
                {
                default:
                case 0: type = PotionType.GreaterStamina; break;

                case 1: type = PotionType.Supernova; break;

                case 2: type = PotionType.StatLossRemoval; break;

                case 3: type = PotionType.AntiParalysis; break;
                }

                item = new VvVPotionKeg(type);
            }
            else if (citem.Type == typeof(VvVSteedStatuette))
            {
                SteedType type = index == 5 || index == 6 ? SteedType.WarHorse : SteedType.Ostard;

                item = new VvVSteedStatuette(type, citem.Hue);
            }
            else if (citem.Type == typeof(VvVTrapKit))
            {
                VvVTrapType type;

                switch (index - 11)
                {
                default:
                case 0: type = VvVTrapType.Poison; break;

                case 1: type = VvVTrapType.Cold; break;

                case 2: type = VvVTrapType.Energy; break;

                case 3: type = VvVTrapType.Blade; break;

                case 4: type = VvVTrapType.Explosion; break;
                }

                item = new VvVTrapKit(type);
            }
            else if (citem.Type == typeof(VvVRobe) || citem.Type == typeof(VvVHairDye))
            {
                item = Activator.CreateInstance(citem.Type, citem.Hue) as Item;
            }
            else if (citem.Type == typeof(ScrollOfTranscendence))
            {
                item = ScrollOfTranscendence.CreateRandom(10, 10);
            }
            else
            {
                item = Activator.CreateInstance(citem.Type) as Item;
            }

            if (item != null)
            {
                VvVRewards.OnRewardItemCreated(User, item);

                if (User.Backpack == null || !User.Backpack.TryDropItem(User, item, false))
                {
                    User.SendLocalizedMessage(1074361); // The reward could not be given.  Make sure you have room in your pack.
                    item.Delete();
                }
                else
                {
                    if (User.AccessLevel == AccessLevel.Player)
                    {
                        PointsSystem.ViceVsVirtue.DeductPoints(User, citem.Points);
                    }

                    User.SendLocalizedMessage(1073621); // Your reward has been placed in your backpack.
                    User.PlaySound(0x5A7);
                }
            }
        }
示例#3
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            if (dropped.GetSocket <HonestyItemSocket>() != null)
            {
                return(base.OnDragDrop(from, dropped));
            }

            if (ViceVsVirtueSystem.IsVvV(from))
            {
                if (!(dropped is IOwnerRestricted) || ((IOwnerRestricted)dropped).Owner == from)
                {
                    if (dropped is IVvVItem && from.Race == Race.Gargoyle)
                    {
                        foreach (Type[] t in _Table)
                        {
                            if (dropped.GetType() == t[0])
                            {
                                IDurability dur = dropped as IDurability;

                                if (dur != null && dur.MaxHitPoints == 255 && dur.HitPoints == 255)
                                {
                                    Item item = Loot.Construct(t[1]);

                                    if (item != null)
                                    {
                                        VvVRewards.OnRewardItemCreated(from, item);

                                        if (item is GargishCrimsonCincture)
                                        {
                                            ((GargishCrimsonCincture)item).Attributes.BonusDex = 10;
                                        }

                                        if (item is GargishMaceAndShieldGlasses)
                                        {
                                            ((GargishMaceAndShieldGlasses)item).Attributes.WeaponDamage = 10;
                                        }

                                        if (item is GargishFoldedSteelGlasses)
                                        {
                                            ((GargishFoldedSteelGlasses)item).Attributes.DefendChance = 25;
                                        }

                                        if (item is GargishWizardsCrystalGlasses)
                                        {
                                            ((GargishWizardsCrystalGlasses)item).PhysicalBonus = 5;
                                            ((GargishWizardsCrystalGlasses)item).FireBonus     = 5;
                                            ((GargishWizardsCrystalGlasses)item).ColdBonus     = 5;
                                            ((GargishWizardsCrystalGlasses)item).PoisonBonus   = 5;
                                            ((GargishWizardsCrystalGlasses)item).EnergyBonus   = 5;
                                        }

                                        from.AddToBackpack(item);
                                        dropped.Delete();

                                        return(true);
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        return(false);
                    }
                }
            }

            SayTo(from, 1157365); // I'm sorry, I cannot accept this item.
            return(false);
        }