Пример #1
0
            public RechargeEntry(Mobile mobile, HouseTeleporterTile item)
                : base(1076197, 2)
            {
                Mobile = mobile;
                Item   = item;

                BaseHouse house = BaseHouse.FindHouseAt(item);

                Enabled = Item.IsLockedDown && house != null && house.IsOwner(Mobile);
            }
Пример #2
0
        public HouseTeleporterTileBag(bool reward)
        {
            Hue = 1336;

            var tele1 = new HouseTeleporterTile(reward);
            var tele2 = new HouseTeleporterTile(reward);

            tele1.Link = tele2;
            tele2.Link = tele1;

            DropItem(tele1);
            DropItem(tele2);
            DropItem(new HouseTeleporterInstructions(reward));
        }
Пример #3
0
 public InternalTarget(HouseTeleporterTile item)
     : base(2, false, TargetFlags.None)
 {
     Item = item;
 }
Пример #4
0
        public override void OnDoubleClick(Mobile m)
        {
            if (IsChildOf(m.Backpack))
            {
                m.SendLocalizedMessage(1114918); // Select a House Teleporter to link to.
                m.BeginTarget(-1, false, Server.Targeting.TargetFlags.None, (from, targeted) =>
                {
                    if (targeted is HouseTeleporterTile)
                    {
                        HouseTeleporterTile tile = targeted as HouseTeleporterTile;

                        if (tile.IsChildOf(m.Backpack))
                        {
                            tile.Link = this;
                            Link      = tile;

                            if (UsesCharges && tile.UsesCharges)    //TODO:  Can you link non-charged with charged?
                            {
                                from.SendLocalizedMessage(1115119); // The two House Teleporters are now linked and the charges remaining have been rebalanced.

                                if (!UsesCharges)
                                {
                                    UsesCharges = true;
                                }

                                if (!tile.UsesCharges)
                                {
                                    tile.UsesCharges = true;
                                }

                                int charges  = _Charges + tile.Charges;
                                Charges      = charges / 2;
                                tile.Charges = charges / 2;
                            }
                            else if (!UsesCharges && !tile.UsesCharges)
                            {
                                from.SendLocalizedMessage(1114919); // The two House Teleporters are now linked.
                            }
                            else
                            {
                                from.SendMessage("Those cannot be linked."); // TODO: Message?
                            }
                        }
                        else
                        {
                            from.SendLocalizedMessage(1114917); // This must be in your backpack to link it.
                        }
                    }
                });
            }
            else if (!IsMoveOver)
            {
                if (Target != null && !Target.Deleted && InRange(m, 1))
                {
                    if (CheckAccess(m))
                    {
                        if (!m.Hidden || m.IsPlayer())
                        {
                            new EffectTimer(m.Location, m.Map, 2023, 0x1F0, TimeSpan.FromSeconds(0.4)).Start();
                        }

                        new DelayTimer(this, m).Start();
                    }
                }
            }
            else
            {
                m.SendLocalizedMessage(1114917); // This must be in your backpack to link it.
            }
        }