예제 #1
0
                public override void OnResponse(RelayInfo info)
                {
                    User.EndAction(typeof(Imbuing));

                    if (m_Container == null || m_List == null)
                    {
                        return;
                    }

                    if (info.ButtonID == 0)
                    {
                        TryUnravelContainer(User, m_Container);
                        return;
                    }

                    int count = 0;

                    m_List.ForEach(x =>
                    {
                        if (Imbuing.CanUnravelItem(User, x, true) && Imbuing.UnravelItem(User, x, true))
                        {
                            count++;
                        }
                    });

                    if (count > 0)
                    {
                        User.SendLocalizedMessage(1080429); // You magically unravel the item!
                        User.SendLocalizedMessage(1072223); // An item has been placed in your backpack.
                    }

                    User.SendLocalizedMessage(1111814, String.Format("{0}\t{1}", count, m_List.Count));

                    ColUtility.Free(m_List);
                }
예제 #2
0
            protected override void OnTarget(Mobile from, object o)
            {
                if (!Imbuing.CheckSoulForge(from, 1))
                {
                    return;
                }

                if (o is Container)
                {
                    Container cont = (Container)o;

                    if (cont.IsChildOf(from.Backpack) || cont == from.Backpack)
                    {
                        int         unraveled = 0;
                        List <Item> list      = new List <Item>(cont.Items);

                        foreach (Item item in list)
                        {
                            if (item is BaseWeapon || item is BaseArmor || item is BaseJewel || item is BaseHat)
                            {
                                if (Imbuing.CanUnravelItem(from, item, false) && Imbuing.UnravelItem(from, item, false))
                                {
                                    unraveled++;
                                }
                            }
                        }

                        list.Clear();
                        list.TrimExcess();

                        if (unraveled <= 0)
                        {
                            from.SendMessage(2499, "You fail to unravel any items in the selected container.");
                            Effects.PlaySound(from.Location, from.Map, 0x3BF);
                        }
                        else
                        {
                            Effects.PlaySound(from.Location, from.Map, 0x1ED);
                            Effects.SendLocationParticles(
                                EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x373A,
                                10, 30, 0, 4, 0, 0);

                            from.SendMessage(2499, "You successfully unravel {0} items from the selected container.", unraveled);
                        }
                    }
                    else
                    {
                        from.SendMessage(2499, "The container must be in your backpack to magically unravel its contents.");
                        return;
                    }
                }
                else
                {
                    from.SendMessage(2499, "You must target a container.");
                    return;
                }
                return;
            }
예제 #3
0
            public static void TryUnravelContainer(Mobile User, Container c)
            {
                c.Items.ForEach(y =>
                {
                    Imbuing.CanUnravelItem(User, y, true);
                });

                User.SendLocalizedMessage(1111814, String.Format("{0}\t{1}", 0, c.Items.Count)); // Unraveled: ~1_COUNT~/~2_NUM~ items
            }
예제 #4
0
            protected override void OnTarget(Mobile m, object o)
            {
                m.EndAction(typeof(Imbuing));

                Item item = o as Item;

                if (item == null)
                {
                    m.SendLocalizedMessage(1080425); // You cannot magically unravel this item.
                }
                else if (m is PlayerMobile pm && Imbuing.CanUnravelItem(pm, item))
                {
                    pm.BeginAction(typeof(Imbuing));
                    SendGump(new UnravelGump(pm, item));
                }
            }
예제 #5
0
            protected override void OnTarget(Mobile from, object o)
            {
                from.EndAction(typeof(Imbuing));

                if (!(o is Item))
                {
                    from.SendLocalizedMessage(1080425); // You cannot magically unravel this item.
                    return;
                }

                if (Imbuing.CanUnravelItem(from, (Item)o))
                {
                    from.BeginAction(typeof(Imbuing));
                    from.SendGump(new UnravelGump((Item)o));
                }
            }
예제 #6
0
                public override void OnResponse(RelayInfo info)
                {
                    User.EndAction(typeof(Imbuing));

                    if (info.ButtonID == 0 || m_Item.Deleted)
                    {
                        return;
                    }

                    if (Imbuing.CanUnravelItem(User, m_Item) && Imbuing.UnravelItem(User, m_Item))
                    {
                        Effects.SendPacket(User, User.Map, new GraphicalEffect(EffectType.FixedFrom, User.Serial, Server.Serial.Zero, 0x375A, User.Location, User.Location, 1, 17, true, false));
                        User.PlaySound(0x1EB);

                        User.SendLocalizedMessage(1080429); // You magically unravel the item!
                        User.SendLocalizedMessage(1072223); // An item has been placed in your backpack.
                    }
                }
예제 #7
0
                public override void OnResponse(NetState sender, RelayInfo info)
                {
                    Mobile from = sender.Mobile;

                    from.EndAction(typeof(Imbuing));

                    if (m_Container == null || m_List == null)
                    {
                        return;
                    }

                    if (info.ButtonID == 0)
                    {
                        TryUnravelContainer(from, m_Container);
                        return;
                    }

                    int count = 0;

                    m_List.ForEach(x =>
                    {
                        if (Imbuing.CanUnravelItem(from, x, true) && Imbuing.UnravelItem(from, x, true))
                        {
                            count++;
                        }
                    });

                    if (count > 0)
                    {
                        from.SendLocalizedMessage(1080429); // You magically unravel the item!
                        from.SendLocalizedMessage(1072223); // An item has been placed in your backpack.
                    }

                    from.SendLocalizedMessage(1111814, String.Format("{0}\t{1}", count, m_List.Count));

                    m_List.Clear();
                    m_List.TrimExcess();
                }
예제 #8
0
            protected override void OnTarget(Mobile from, object o)
            {
                from.EndAction(typeof(Imbuing));

                if (!(o is Container))
                {
                    from.SendLocalizedMessage(1080425); // You cannot magically unravel this item.
                    return;
                }

                Container cont = o as Container;

                if (!cont.IsChildOf(from.Backpack))
                {
                    from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
                    from.EndAction(typeof(Imbuing));
                }
                else if (cont == null)
                {
                    from.SendLocalizedMessage(1111814, "0\t0"); // Unraveled: ~1_COUNT~/~2_NUM~ items
                    from.EndAction(typeof(Imbuing));
                }
                else
                {
                    bool unraveled = cont.Items.FirstOrDefault(x => Imbuing.CanUnravelItem(from, x, false)) != null;

                    if (unraveled)
                    {
                        from.BeginAction(typeof(Imbuing));
                        from.SendGump(new UnravelContainerGump(cont));
                    }
                    else
                    {
                        TryUnravelContainer(from, cont);
                        from.EndAction(typeof(Imbuing));
                    }
                }
            }
예제 #9
0
            protected override void OnTarget(Mobile from, object o)
            {
                if (!Imbuing.CheckSoulForge(from, 1))
                {
                    return;
                }

                if (o is BaseWeapon || o is BaseArmor || o is BaseJewel || o is BaseHat)
                {
                    if (Imbuing.CanUnravelItem(from, (Item)o) && Imbuing.UnravelItem(from, (Item)o))
                    {
                        Effects.PlaySound(from.Location, from.Map, 0x1ED);
                        Effects.SendLocationParticles(
                            EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x373A,
                            10, 30, 0, 4, 0, 0);
                        from.SendLocalizedMessage(1080429); // Unravelled :P
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1080425); // You cannot magically unravel this item.
                    return;
                }
            }
예제 #10
0
            protected override void OnTarget(Mobile m, object o)
            {
                m.EndAction(typeof(Imbuing));
                Container cont = o as Container;

                if (cont == null)
                {
                    return;
                }

                if (!cont.IsChildOf(m.Backpack))
                {
                    m.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
                    m.EndAction(typeof(Imbuing));
                }
                else if (cont == null || (cont is LockableContainer && ((LockableContainer)cont).Locked))
                {
                    m.SendLocalizedMessage(1111814, "0\t0"); // Unraveled: ~1_COUNT~/~2_NUM~ items
                    m.EndAction(typeof(Imbuing));
                }
                else if (m is PlayerMobile)
                {
                    bool unraveled = cont.Items.FirstOrDefault(x => Imbuing.CanUnravelItem(m, x, false)) != null;

                    if (unraveled)
                    {
                        m.BeginAction(typeof(Imbuing));
                        BaseGump.SendGump(new UnravelContainerGump((PlayerMobile)m, cont));
                    }
                    else
                    {
                        TryUnravelContainer(m, cont);
                        m.EndAction(typeof(Imbuing));
                    }
                }
            }
예제 #11
0
            protected override void OnTarget(Mobile from, object o)
            {
                Item   item = o as Item;
                Mobile m    = o as Mobile;

                if (item == null && m == null)
                {
                    from.SendLocalizedMessage(500353); // You are not certain...
                    return;
                }

                if (!from.CheckTargetSkill(SkillName.ItemID, o, 0, 100))
                {
                    from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, 1041352, from.NetState); // You have no idea how much it might be worth.
                    return;
                }

                if (m != null)
                {
                    from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, 1041349, AffixType.Append, "  " + m.Name, "", from.NetState); // It appears to be:
                    return;
                }

                if (item.Name != null)
                {
                    from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, false, item.Name, from.NetState);
                    item.PrivateOverheadMessage(MessageType.Label, 0x3B2, false, item.Name, from.NetState);
                }
                else
                {
                    from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, item.LabelNumber, from.NetState);
                    item.PrivateOverheadMessage(MessageType.Label, 0x3B2, item.LabelNumber, from.NetState);
                }

                if (item is Meteorite)
                {
                    if (((Meteorite)item).Polished)
                    {
                        from.SendLocalizedMessage(1158697); // The brilliance of the meteorite shimmers in the light as you rotate it in your hands! Brightly hued veins of exotic minerals reflect against the polished surface. You think to yourself you have never seen anything so full of splendor!
                    }
                    else
                    {
                        from.SendLocalizedMessage(1158696); // The rock seems to be otherwordly. Judging by the pitting and charring, it appears to have crash landed here from the sky! The rock feels surprisingly dense given its size. Perhaps if you polished it with an oil cloth you may discover what is inside...
                    }

                    return;
                }

                from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, 1041351, AffixType.Append, "  " + GetPriceFor(item).ToString(), "", from.NetState); // You guess the value of that item at:

                if (item is BaseWeapon || item is BaseArmor || item is BaseJewel || item is BaseHat)
                {
                    if (Imbuing.TimesImbued(item) > 0)
                    {
                        from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, 1111877, from.NetState); // You conclude that item cannot be magically unraveled. The magic in that item has been weakened due to either low durability or the imbuing process.
                    }
                    else
                    {
                        int    weight    = Imbuing.GetTotalWeight(item, -1, false, true);
                        string imbIngred = null;
                        double skill     = from.Skills[SkillName.Imbuing].Base;
                        bool   badSkill  = false;

                        if (!Imbuing.CanUnravelItem(from, item, false))
                        {
                            weight = 0;
                        }

                        if (weight > 0 && weight <= 200)
                        {
                            imbIngred = "Magical Residue";
                        }
                        else if (weight > 200 && weight < 480)
                        {
                            imbIngred = "Enchanted Essence";

                            if (skill < 45.0)
                            {
                                badSkill = true;
                            }
                        }
                        else if (weight >= 480)
                        {
                            imbIngred = "Relic Fragment";

                            if (skill < 95.0)
                            {
                                badSkill = true;
                            }
                        }

                        if (imbIngred != null)
                        {
                            if (badSkill)
                            {
                                from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, 1111875, from.NetState); // Your Imbuing skill is not high enough to identify the imbuing ingredient.
                            }
                            else
                            {
                                from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, 1111874, imbIngred, from.NetState); //You conclude that item will magically unravel into: ~1_ingredient~
                            }
                        }
                        else  // Cannot be Unravelled
                        {
                            from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, 1111876, from.NetState); //You conclude that item cannot be magically unraveled. It appears to possess little to no magic.
                        }
                    }
                }
                else
                {
                    from.LocalOverheadMessage(MessageType.Emote, 0x3B2, 1111878); //You conclude that item cannot be magically unraveled.
                }
            }
예제 #12
0
            protected override void OnTarget(Mobile from, object o)
            {
                Item   item = o as Item;
                Mobile m    = o as Mobile;

                if (item == null && m == null)
                {
                    from.SendLocalizedMessage(500353); // You are not certain...
                    return;
                }

                if (!from.CheckTargetSkill(SkillName.ItemID, o, 0, 100))
                {
                    from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, 1041352, from.NetState); // You have no idea how much it might be worth.
                    return;
                }

                if (m != null)
                {
                    from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, 1041349, AffixType.Append, "  " + m.Name, "", from.NetState); // It appears to be:
                    return;
                }

                if (item.Name != null)
                {
                    from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, false, item.Name, from.NetState);
                    item.PrivateOverheadMessage(MessageType.Label, 0x3B2, false, item.Name, from.NetState);
                }
                else
                {
                    from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, item.LabelNumber, from.NetState);
                    item.PrivateOverheadMessage(MessageType.Label, 0x3B2, item.LabelNumber, from.NetState);
                }

                if (Core.AOS)
                {
                    from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, 1041351, AffixType.Append, "  " + GetPriceFor(item).ToString(), "", from.NetState); // You guess the value of that item at:

                    if (item is BaseWeapon || item is BaseArmor || item is BaseJewel || item is BaseHat)
                    {
                        if (Imbuing.TimesImbued(item) > 0)
                        {
                            from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, 1111877, from.NetState); // You conclude that item cannot be magically unraveled. The magic in that item has been weakened due to either low durability or the imbuing process.
                        }
                        else
                        {
                            int    weight    = Imbuing.GetTotalWeight(item);
                            string imbIngred = null;
                            double skill     = from.Skills[SkillName.Imbuing].Base;
                            bool   badSkill  = false;

                            if (!Imbuing.CanUnravelItem(from, item, false))
                            {
                                weight = 0;
                            }

                            if (weight > 0 && weight <= 200)
                            {
                                imbIngred = "Magical Residue";
                            }
                            else if (weight > 200 && weight < 480)
                            {
                                imbIngred = "Enchanted Essence";

                                if (skill < 45.0)
                                {
                                    badSkill = true;
                                }
                            }
                            else if (weight >= 480)
                            {
                                imbIngred = "Relic Fragment";

                                if (skill < 95.0)
                                {
                                    badSkill = true;
                                }
                            }

                            if (imbIngred != null)
                            {
                                if (badSkill)
                                {
                                    from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, 1111875, from.NetState); // Your Imbuing skill is not high enough to identify the imbuing ingredient.
                                }
                                else
                                {
                                    from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, 1111874, imbIngred, from.NetState); //You conclude that item will magically unravel into: ~1_ingredient~
                                }
                            }
                            else  // Cannot be Unravelled
                            {
                                from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, 1111876, from.NetState); //You conclude that item cannot be magically unraveled. It appears to possess little to no magic.
                            }
                        }
                    }
                    else
                    {
                        from.LocalOverheadMessage(MessageType.Emote, 0x3B2, 1111878); //You conclude that item cannot be magically unraveled.
                    }
                }
                else if (o is Item)
                {
                    if (from.CheckTargetSkill(SkillName.ItemID, o, 0, 100))
                    {
                        if (o is BaseWeapon)
                        {
                            ((BaseWeapon)o).Identified = true;
                        }
                        else if (o is BaseArmor)
                        {
                            ((BaseArmor)o).Identified = true;
                        }

                        if (!Core.AOS)
                        {
                            ((Item)o).OnSingleClick(from);
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(500353); // You are not certain...
                    }
                }
                else if (o is Mobile)
                {
                    ((Mobile)o).OnSingleClick(from);
                }
                else
                {
                    from.SendLocalizedMessage(500353); // You are not certain...
                }

                Server.Engines.XmlSpawner2.XmlAttach.RevealAttachments(from, o);
            }