Example #1
0
 public void AddPickE(int xoff, int yoff, int zoff)
 {
     m_Pick1 = new PickpocketDipEastAddon();
     m_Pick1.MoveToWorld(new Point3D(xoff + this.X, yoff + this.Y, zoff + this.Z), this.Map);
 }
Example #2
0
 public void AddPickS(int xoff, int yoff, int zoff)
 {
     m_Pick2 = new PickpocketDipSouthAddon();
     m_Pick2.MoveToWorld(new Point3D(xoff + this.X, yoff + this.Y, zoff + this.Z), this.Map);
 }
Example #3
0
 public void AddMill(int xoff, int yoff, int zoff)
 {
     m_Mill = new FlourMillSouthAddon();
     m_Mill.MoveToWorld(new Point3D(xoff + this.X, yoff + this.Y, zoff + this.Z), this.Map);
 }
Example #4
0
 public void AddOven(int xoff, int yoff, int zoff)
 {
     m_Oven = new StoneOvenSouthAddon();
     m_Oven.MoveToWorld(new Point3D(xoff + this.X, yoff + this.Y, zoff + this.Z), this.Map);
 }
Example #5
0
 public void AddTrainingS(int xoff, int yoff, int zoff)
 {
     m_Training2 = new TrainingDummySouthAddon();
     m_Training2.MoveToWorld(new Point3D(xoff + this.X, yoff + this.Y, zoff + this.Z), this.Map);
 }
Example #6
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                var p   = targeted as IPoint3D;
                Map map = from.Map;

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

                if (m_Deed.IsChildOf(from.Backpack))
                {
                    BaseAddon addon = m_Deed.Addon;

                    SpellHelper.GetSurfaceTop(ref p);

                    BaseHouse house = null;

                    var res = AddonFitResult.Valid;
                    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)
                    {
                        m_Deed.Delete();
                        house.Addons.Add(addon);
                    }
                    else
                    {
                        addon.Delete();
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
                }
            }
Example #7
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                IPoint3D p   = targeted as IPoint3D;
                Map      map = from.Map;

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

                if (m_Deed.IsChildOf(from.Backpack))
                {
                    BaseAddon addon = m_Deed.Addon;

                    Server.Spells.SpellHelper.GetSurfaceTop(ref p);

                    BaseHouse   house = null;
                    BaseGalleon boat  = null;

                    AddonFitResult res = addon.CouldFit(p, map, from, ref house, ref boat);

                    if (res == AddonFitResult.Valid)
                    {
                        addon.Resource = m_Deed.Resource;

                        if (addon.RetainDeedHue)
                        {
                            addon.Hue = m_Deed.Hue;
                        }

                        addon.MoveToWorld(new Point3D(p), map);

                        if (house != null)
                        {
                            house.Addons[addon] = from;
                        }
                        else if (boat != null)
                        {
                            boat.AddAddon(addon);
                        }

                        m_Deed.DeleteDeed();
                    }
                    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)
                    {
                        addon.Delete();
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
                }
            }
Example #8
0
 public void AddSpinningWheelS(int xoff, int yoff, int zoff)
 {
     m_SpinningWheel2 = new SpinningwheelSouthAddon();
     m_SpinningWheel2.MoveToWorld(new Point3D(xoff + this.X, yoff + this.Y, zoff + this.Z), this.Map);
 }
Example #9
0
        public override void OnDoubleClick(Mobile from)
        {
            //TODO: Finish the ontaret stuff and clilocs.
            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
            }
            else
            {
                BaseHouse house = BaseHouse.FindHouseAt(from);

                if (house != null)
                {
                    base.OnDoubleClick(from);
                }
                else
                {
                    from.BeginTarget(10, true, Server.Targeting.TargetFlags.None, (m, targeted) =>
                    {
                        if (targeted is IPoint3D)
                        {
                            Point3D p = new Point3D((IPoint3D)targeted);
                            int dist  = (int)from.GetDistanceToSqrt(p);

                            if (dist < 2 || dist > 5)
                            {
                                from.SendLocalizedMessage(1152736); // You must stand between 2 and 5 tiles away from the targeted location to attempt to build this.
                            }
                            else if (!from.InLOS(p))
                            {
                                from.SendLocalizedMessage(500237); // Target cannot be seen.
                            }
                            else if (!ValidateLocation(p, from.Map))
                            {
                                from.SendLocalizedMessage(1152735); // The targeted location has at least one impassable tile adjacent to the structure.
                            }
                            else
                            {
                                BaseHouse checkHouse = BaseHouse.FindHouseAt(from);

                                if (checkHouse != null)
                                {
                                    from.SendLocalizedMessage(500269); // You cannot build that there.
                                }
                                else
                                {
                                    IPoint3D point = (IPoint3D)targeted;
                                    Server.Spells.SpellHelper.GetSurfaceTop(ref point);

                                    BaseAddon addon = this.Addon;
                                    addon.MoveToWorld(new Point3D(point), m.Map);

                                    if (addon is TemporaryForge)
                                    {
                                        ((TemporaryForge)addon).Owner = from;
                                    }

                                    this.Delete();
                                }
                            }
                        }
                    });
                }
            }
        }
            protected override void OnTarget(Mobile from, object targeted)
            {
                IPoint3D p   = targeted as IPoint3D;
                Map      map = from.Map;

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

                if (m_Deed.IsChildOf(from.Backpack))
                {
                    BaseAddon addon = m_Deed.Addon;

                    Server.Spells.SpellHelper.GetSurfaceTop(ref p);

                    BaseHouse house = null;

                    AddonFitResult res = addon.CouldFit(p, map, from, ref house);

                    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.DoorsNotClosed)
                    {
                        from.SendMessage("You must close all house doors before placing this.");
                    }
                    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)
                    {
                        #region GeNova: Mondain's Legacy
                        if (addon != null && addon.RetainDeedHue)
                        {
                            addon.Hue = m_Deed.Hue;
                        }

                        m_Deed.DeleteDeed();
                        #endregion

                        house.Addons.Add(addon);
                    }
                    else
                    {
                        addon.Delete();
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1042001);                       // That must be in your pack for you to use it.
                }
            }
Example #11
0
        public void Place(IPoint3D p, Map map, Mobile from)
        {
            if (p == null || map == null || this.Deleted)
            {
                return;
            }

            if (IsChildOf(from.Backpack))
            {
                BaseAddon addon = Addon;                 // this creates an instance, don't use Addon (capital A) more than once!

                Server.Spells.SpellHelper.GetSurfaceTop(ref p);

                ArrayList houses = null;

                AddonFitResult res = addon.CouldFit(addon.BlocksDoors, p, map, from, ref houses);

                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.DoorsNotClosed)
                {
                    from.SendMessage("You must close all house doors before placing this.");
                }
                else if (res == AddonFitResult.DoorTooClose)
                {
                    from.SendLocalizedMessage(500271);                     // You cannot build near the door.
                }
                if (res == AddonFitResult.Valid)
                {
                    Delete();

                    if (houses != null)
                    {
                        foreach (Server.Multis.BaseHouse h in houses)
                        {
                            h.Addons.Add(addon);
                            addon.OnPlaced(from, h);
                        }

                        from.SendGump(new ConfirmAddonPlacementGump(from, addon));
                    }
                }
                else
                {
                    addon.Delete();
                }
            }
            else
            {
                from.SendLocalizedMessage(1042001);                 // That must be in your pack for you to use it.
            }
        }
Example #12
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                IPoint3D p   = targeted as IPoint3D;
                Map      map = from.Map;

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

                if (m_Deed.IsChildOf(from.Backpack))
                {
                    BaseAddon addon = m_Deed.Addon;

                    Spells.SpellHelper.GetSurfaceTop(ref p);

                    BaseHouse   house   = null;
                    BaseGalleon galleon = CheckGalleonPlacement(from, addon, new Point3D(p), map);

                    AddonFitResult res = galleon != null ? AddonFitResult.Valid : addon.CouldFit(p, map, from, ref house);

                    if (res == AddonFitResult.Valid)
                    {
                        addon.Resource = m_Deed.Resource;

                        if (!m_Deed.ExcludeDeedHue)
                        {
                            if (addon.RetainDeedHue || (m_Deed.Hue != 0 && CraftResources.GetHue(m_Deed.Resource) != m_Deed.Hue))
                            {
                                addon.Hue = m_Deed.Hue;
                            }
                        }

                        addon.MoveToWorld(new Point3D(p), map);

                        if (house != null)
                        {
                            house.Addons[addon] = from;
                        }

                        if (galleon != null)
                        {
                            galleon.AddAddon(addon);
                        }

                        m_Deed.DeleteDeed();
                    }
                    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.OwnerNotInHouse)
                    {
                        from.SendLocalizedMessage(1153770); // The deed is not in the same house as you.
                    }
                    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.
                    }
                    else if (res == AddonFitResult.FoundationStairs)
                    {
                        from.SendLocalizedMessage(1071262); // You can't place the multi-tile addon at the entrance!
                    }

                    if (res != AddonFitResult.Valid)
                    {
                        addon.Delete();
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
                }
            }
Example #13
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                IPoint3D p   = targeted as IPoint3D;
                Map      map = from.Map;

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

                if (m_Deed.IsChildOf(from.Backpack))
                {
                    BaseAddon addon = m_Deed.Addon;

                    Server.Spells.SpellHelper.GetSurfaceTop(ref p);

                    List <BaseHouse> houses = new List <BaseHouse>();

                    PlayerMobile pm      = (PlayerMobile)from;                //NEW Added for player city
                    bool         ismayor = false;
                    if (pm.City != null && pm.City.Mayor == pm && PlayerGovernmentSystem.IsAtCity(from))
                    {
                        ismayor = true;
                    }

                    AddonFitResult res = addon.CouldFit(p, map, from, ref houses);


                    if (res == AddonFitResult.Valid)
                    {
                        addon.MoveToWorld(new Point3D(p), map);
                    }
                    else if (ismayor)
                    {
                        CityManagementStone stone = pm.City;
                        addon.MoveToWorld(new Point3D(p), map);
                        stone.AddOns.Add(addon);
                    }
                    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.DoorsNotClosed)
                    {
                        from.SendMessage("You must close all house doors before placing this.");
                    }
                    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)
                    {
                        m_Deed.Delete();

                        foreach (BaseHouse h in houses)
                        {
                            h.Addons.Add(addon);
                        }
                    }

                    else if (ismayor)
                    {
                        m_Deed.Delete();
                    }

                    else
                    {
                        addon.Delete();
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1042001);                       // That must be in your pack for you to use it.
                }
            }
Example #14
0
 public void AddSmallForge(int xoff, int yoff, int zoff)
 {
     m_SmallForge = new SmallForgeAddon();
     m_SmallForge.MoveToWorld(new Point3D(xoff + this.X, yoff + this.Y, zoff + this.Z), this.Map);
 }
Example #15
0
 public void AddFireplace(int xoff, int yoff, int zoff)
 {
     m_Fireplace = new GrayBrickFireplaceSouthAddon();
     m_Fireplace.MoveToWorld(new Point3D(xoff + this.X, yoff + this.Y, zoff + this.Z), this.Map);
 }
Example #16
0
 public void AddSpinningWheelE(int xoff, int yoff, int zoff)
 {
     m_SpinningWheel1 = new SpinningwheelEastAddon();
     m_SpinningWheel1.MoveToWorld(new Point3D(xoff + this.X, yoff + this.Y, zoff + this.Z), this.Map);
 }
Example #17
0
 public void AddLargeForge(int xoff, int yoff, int zoff)
 {
     m_LargeForge = new LargeForgeSouthHouseAddon();
     m_LargeForge.MoveToWorld(new Point3D(xoff + this.X, yoff + this.Y, zoff + this.Z), this.Map);
 }
Example #18
0
 public void AddTrainingE(int xoff, int yoff, int zoff)
 {
     m_Training1 = new TrainingDummyEastAddon();
     m_Training1.MoveToWorld(new Point3D(xoff + this.X, yoff + this.Y, zoff + this.Z), this.Map);
 }
Example #19
0
 public void AddLoom(int xoff, int yoff, int zoff)
 {
     m_Loom = new LoomSouthAddon();
     m_Loom.MoveToWorld(new Point3D(xoff + this.X, yoff + this.Y, zoff + this.Z), this.Map);
 }
Example #20
0
 public void AddAnvil(int xoff, int yoff, int zoff)
 {
     m_Anvil = new AnvilEastAddon();
     m_Anvil.MoveToWorld(new Point3D(xoff + this.X, yoff + this.Y, zoff + this.Z), this.Map);
 }
            protected override void OnTarget(Mobile from, object targeted)
            {
                IPoint3D p   = targeted as IPoint3D;
                Map      map = from.Map;

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

                if (m_Deed.IsChildOf(from.Backpack))
                {
                    BaseAddon addon = m_Deed.Addon;

                    Server.Spells.SpellHelper.GetSurfaceTop(ref p);

                    ArrayList houses = null;

                    AddonFitResult res = addon.CouldFit(p, map, from, ref houses);

                    if (res == AddonFitResult.Valid)
                    {
                        addon.MoveToWorld(new Point3D(p), map);
                        if (from is TeiravonMobile)
                        {
                            TeiravonMobile player = (TeiravonMobile)from;

                            if (addon is BallistaEastAddon)
                            {
                                BallistaEastAddon m_ballista = (BallistaEastAddon)addon;
                                if (player.Backpack != null)
                                {
                                    DwarvenBallista wep = new DwarvenBallista();
                                    wep.Ballista = addon;
                                    player.AddToBackpack(wep);
                                    m_ballista.Controller = wep;
                                }
                            }

                            if (addon is OrcCombatBridgeAddon)
                            {
                                OrcCombatBridgeAddon bridge = (OrcCombatBridgeAddon)addon;
                                bridge.Z = player.Z;
                            }
                        }
                    }
                    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.DoorsNotClosed)
                    {
                        from.SendMessage("You must close all house doors before placing this.");
                    }
                    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)
                    {
                        m_Deed.Delete();

                        if (houses != null)
                        {
                            foreach (Server.Multis.BaseHouse h in houses)
                            {
                                h.Addons.Add(addon);
                            }
                        }
                    }
                    else
                    {
                        addon.Delete();
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1042001);                       // That must be in your pack for you to use it.
                }
            }