Example #1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                var targ = targeted as LegendaryHammer;

                if (_Hammer.Deleted || _Hammer.Quantity >= Completed || targ == null)
                {
                    return;
                }

                if (_Hammer.IsChildOf(from.Backpack) && targ.IsChildOf(from.Backpack) && targ != _Hammer)
                {
                    LegendaryHammer targShard = targ;

                    if (targShard.Quantity < Completed)
                    {
                        if (targShard.Quantity + _Hammer.Quantity <= Completed)
                        {
                            targShard.Quantity += _Hammer.Quantity;
                            _Hammer.Delete();
                        }
                        else
                        {
                            int delta = Completed - targShard.Quantity;
                            targShard.Quantity += delta;
                            _Hammer.Quantity   -= delta;
                        }

                        from.Send(
                            new AsciiMessage(
                                targShard.Serial,
                                targShard.ItemID,
                                MessageType.Regular,
                                0x59,
                                3,
                                _Hammer.Name,
                                "the partially reconstructed hammer and the ancient smithing hammer piece meld together."));

                        return;
                    }
                }

                // Nothing Happens.
                from.Send(
                    new MessageLocalized(_Hammer.Serial, _Hammer.ItemID, MessageType.Regular, 0x2C, 3, 500309,
                                         _Hammer.Name, ""));
            }
Example #2
0
            public override void OnClick()
            {
                Mobile from = Owner.From;

                if (_Hammer.Deleted || _Hammer.Quantity < Partial || _Hammer.Quantity >= Completed ||
                    !_Hammer.IsChildOf(from.Backpack) || !from.CheckAlive())
                {
                    return;
                }

                for (int i = 0; i < _Hammer.Quantity - 1; i++)
                {
                    from.AddToBackpack(new LegendaryHammer());
                }

                _Hammer.Quantity = 1;
            }
Example #3
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                var p   = targeted as IPoint3D;
                Map map = from.Map;

                if (p == null || map == null || Hammer.Deleted)
                {
                    return;
                }

                if (Hammer.IsChildOf(from.Backpack) && Book.IsChildOf(from.Backpack))
                {
                    BaseAddon addon = new SoulForgeAddon();

                    SpellHelper.GetSurfaceTop(ref p);

                    BaseHouse house = null;

                    var res = AddonFitResult.Valid;
                    if (from.AccessLevel < AccessLevel.GameMaster)
                    {
                        res = addon.CouldFit(p, map, from, ref house);
                    }
                    else
                    {
                        house = BaseHouse.FindHouseAt(new Point3D(p), map, p.Z);
                        if (house == null)
                        {
                            res = AddonFitResult.NotInHouse;
                        }
                    }

                    if (res == AddonFitResult.Valid)
                    {
                        addon.MoveToWorld(new Point3D(p), map);
                    }
                    else if (res == AddonFitResult.Blocked)
                    {
                        from.SendLocalizedMessage(500269); // You cannot build that there.
                    }
                    else if (res == AddonFitResult.NotInHouse)
                    {
                        from.SendLocalizedMessage(500274); // You can only place this in a house that you own!
                    }
                    else if (res == AddonFitResult.DoorTooClose)
                    {
                        from.SendLocalizedMessage(500271); // You cannot build near the door.
                    }
                    else if (res == AddonFitResult.NoWall)
                    {
                        from.SendLocalizedMessage(500268); // This object needs to be mounted on something.
                    }

                    if (res == AddonFitResult.Valid && house != null && TryConsumeSfMaterials(from))
                    {
                        Conquests.Conquests.CheckProgress <ItemConquest>(from as PlayerMobile, this);
                        from.PrivateOverheadMessage(MessageType.Label, 2049, true,
                                                    "*You begin crafting the Soulforge*",
                                                    from.NetState);
                        Timer.DelayCall(TimeSpan.FromSeconds(1), SFCreate_Callback, Tuple.Create(0, from, p));
                        from.Frozen = true;
                        Hammer.Delete();
                        Book.Delete();
                        house.Addons.Add(addon);
                    }
                    else
                    {
                        addon.Delete();
                        from.SendMessage(54, "You did not have the required materials to create the Soulforge.");
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
                }
            }