Beispiel #1
0
        public static void OnHarvest(Mobile from, Item tool, HarvestSystem system, Item resource)
        {
            if (IsCaddellite(from, tool))
            {
                if (resource != null)
                {
                    resource.AttachSocket(new Caddellite());
                }

                if (0.005 > Utility.RandomDouble())
                {
                    if (from != null)
                    {
                        if (system == Fishing.System)
                        {
                            from.SendLocalizedMessage(1158664); // You discover a meteorite entangled in your line!
                        }
                        else if (system == Mining.System)
                        {
                            from.SendLocalizedMessage(1158663); // You discover a meteorite in the dirt!
                        }
                        else if (system == Lumberjacking.System)
                        {
                            from.SendLocalizedMessage(1158665); // You discover a meteorite in the tree!
                        }

                        from.AddToBackpack(new Meteorite());
                    }
                }
            }
        }
        public static void OnLoad()
        {
            Persistence.Deserialize(
                FilePath,
                reader =>
            {
                int version = reader.ReadInt();

                if (version == 0)
                {
                    int count = reader.ReadInt();

                    for (int i = 0; i < count; i++)
                    {
                        Item item   = reader.ReadItem();
                        Container c = reader.ReadItem() as Container;

                        if (item != null && c != null)
                        {
                            item.AttachSocket(new EnchantedHotItemSocket(c));
                        }
                    }
                }
            });
        }
        public void SpawnLoot()
        {
            List <Item> list = new List <Item>(Items);

            for (var index = 0; index < list.Count; index++)
            {
                Item item = list[index];

                item.Delete();
            }

            ColUtility.Free(list);

            int toSpawn = Utility.RandomMinMax(2, 4);

            for (int i = 0; i < toSpawn; i++)
            {
                Item item;

                if (i == 0)
                {
                    item = Loot.RandomScroll(0, Loot.MageryScrollTypes.Length, SpellbookType.Regular);
                }
                else
                {
                    item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(false, false, true);

                    if (item is BaseWeapon weapon && 0.01 > Utility.RandomDouble())
                    {
                        weapon.ExtendedWeaponAttributes.AssassinHoned = 1;
                    }

                    int min = 400;
                    int max = 1400;

                    RunicReforging.GenerateRandomItem(item, 0, min, max, Map);

                    item.Hue = 1258;
                    item.AttachSocket(new EnchantedHotItemSocket(this));
                    //EnchantedHotItem.AddItem(item, this);
                }

                DropItem(item);
            }
        }
Beispiel #4
0
        public override void OnDoubleClick(Mobile m)
        {
            if (IsChildOf(m.Backpack))
            {
                m.SendLocalizedMessage(1155613); // Target the weapon, spellbook, or instrument you wish to apply this to...
                m.BeginTarget(-1, false, Server.Targeting.TargetFlags.None, (from, targeted) =>
                {
                    if (targeted is Item && targeted is ISlayer)
                    {
                        Item item      = (Item)targeted;
                        ISlayer slayer = (ISlayer)targeted;

                        SlayerSocket socket = item.GetSocket <SlayerSocket>();

                        if (socket == null || socket.Slayer != SlayerName.Silver)
                        {
                            if (slayer.Slayer != SlayerName.None && slayer.Slayer2 != SlayerName.None)
                            {
                                from.SendLocalizedMessage(1155680); // You cannot apply Tincture of Silver to items that are already slayers!
                            }
                            else
                            {
                                item.AttachSocket(new SlayerSocket(SlayerName.Silver, TimeSpan.FromHours(1)));

                                Delete();

                                from.SendLocalizedMessage(1155616); // You carefully apply Tincture of Silver to the item.  The effects will fade in one hour.
                            }
                        }
                        else
                        {
                            from.SendLocalizedMessage(1155614); // This item is already treated with Tincture of Silver!
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(1155615); // You cannot apply Tincture of Silver to this item.
                    }
                });
            }
        }
Beispiel #5
0
        public static void TryInfuse(Mobile from, Item item, CraftSystem system)
        {
            Rectangle2D rec;

            if (system == DefCooking.CraftSystem || system == DefAlchemy.CraftSystem)
            {
                rec = _CookingRec;
            }
            else if (system == DefInscription.CraftSystem)
            {
                rec = _ScribeRec;
            }
            else
            {
                rec = _CraftRec;
            }

            if (rec.Contains(from))
            {
                item.AttachSocket(new Caddellite());
            }
        }
Beispiel #6
0
        public virtual bool TryCreateBoards(Mobile from, double skill, Item item)
        {
            if (Deleted || !from.CanSee(this))
            {
                item.Delete();
                return(false);
            }
            if (from.Skills.Carpentry.Value < skill && from.Skills.Lumberjacking.Value < skill)
            {
                item.Delete();
                from.SendLocalizedMessage(1072652); // You cannot work this strange and unusual wood.
                return(false);
            }

            if (HasSocket <Caddellite>())
            {
                item.AttachSocket(new Caddellite());
            }

            base.ScissorHelper(from, item, 1, false);
            return(true);
        }