public RegionControlGump( RegionControl r ) : base(25, 50) { m_Controller = r; Closable=true; Dragable=true; Resizable=false; AddPage(0); //x, y, width, high AddBackground(23, 32, 412, 186, 9270); AddAlphaRegion(19, 29, 418, 193); AddLabel(55, 60, 1152, "CUSTOM REGIONS IN A BOX"); AddLabel(75, 90, 1152, "Add Region Area"); AddButton(55, 92, 0x845, 0x846, 3, GumpButtonType.Reply, 0); AddLabel(75, 110, 1152, "Edit Restricted Spells"); AddButton(55, 112, 0x845, 0x846, 1, GumpButtonType.Reply, 0); AddLabel(75, 130, 1152, "Edit Restricted Skills"); AddButton(55, 132, 0x845, 0x846, 2, GumpButtonType.Reply, 0); AddLabel(75, 150, 1152, "Edit Other Properties"); AddButton(55, 152, 0x845, 0x846, 4, GumpButtonType.Reply, 0); AddLabel(75, 170, 1152, "See Region Bounds"); AddButton(55, 172, 0x845, 0x846, 5, GumpButtonType.Reply, 0); AddImage(353, 54, 3953); AddImage(353, 180, 3955); }
public bool CheckLooting(Mobile from) { try { if (from.AccessLevel == AccessLevel.Player) { RegionControl regstone = null; CustomRegion reg = null; if (this.Deleted == false) { reg = CustomRegion.FindDRDTRegion(this); } if (reg != null) { regstone = reg.GetRegionControler(); } // if this region does not allow looting, fail if (regstone != null && regstone.BlockLooting == true) { return(false); } } } catch (Exception ex) { Server.Commands.LogHelper.LogException(ex); } return(true); }
public AreaGump(RegionControl b) : base( 25, 300 ) { r = (RegionControl)b; Closable=true; Dragable=true; Resizable=false; AddPage(0); AddBackground(23, 32, 412, 256, 9270); AddAlphaRegion(19, 29, 418, 263); AddLabel(116, 50, 1152, "Enter Corridanates for new region"); AddTextEntry( 140, 77 +25 , 1152, 20, 0xFA5, 0, "0" ); AddTextEntry( 140, 77 +50 , 1152, 20, 0xFA5, 1, "0" ); AddTextEntry( 140, 77 +75 , 1152, 20, 0xFA5, 2, "0" ); AddTextEntry( 140, 77 +100 , 1152, 20, 0xFA5, 3, "0" ); AddLabel(105, 77 +25, 1152, "X1:"); AddLabel(105, 77 +50, 1152, "Y1:"); AddLabel(105, 77 +75, 1152, "X2:"); AddLabel(105, 77 +100, 1152, "Y2:"); AddButton( 105, 77+125, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 140, 77+125, 90, 80, 1046362, false, false ); // Yes }
public CustomRegion(RegionControl control) : base(control.RegionName, control.Map, control.RegionPriority, control.RegionArea) { Disabled = !control.IsGuarded; Music = control.Music; m_Controller = control; }
public CustomRegion( RegionControl m, Map map ) : base("", "Custom Region", map, typeof( WarriorGuard )) { LoadFromXml = false; m_Controller = m; }
public CustomRegion(RegionControl control): base(control.RegionName, control.Map, control.RegionPriority, control.RegionArea) { Disabled = !control.IsGuarded; Music = control.Music; m_Controller = control; EventSink.Disconnected += OnPlayerDisconnected; EventSink.Login += OnPlayerLogin; }
private static void DoChooseArea(Mobile from, Map map, Point3D start, Point3D end, object control) { RegionControl r = (RegionControl)control; Rectangle2D rect = new Rectangle2D(start.X, start.Y, end.X - start.X + 1, end.Y - start.Y + 1); r.m_Coords.Add(rect); r.UpdateRegion(); }
protected static void DoChooseArea(Mobile from, Map map, Point3D start, Point3D end, object control, bool inn) { RegionControl r = (RegionControl)control; if (inn == false) { Rectangle2D rect = new Rectangle2D(start.X, start.Y, end.X - start.X + 1, end.Y - start.Y + 1); r.m_Coords.Add(rect); } if (inn) { Rectangle2D rect = new Rectangle2D(start.X, start.Y, end.X - start.X + 1, end.Y - start.Y + 1); r.m_InnBounds.Add(rect); } r.UpdateRegion(); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); int count; count = reader.ReadInt(); for (int i = 0; i < count; i++) m_WallCoordinates.Add(reader.ReadPoint3D()); count = reader.ReadInt(); for (int i = 0; i < count; i++) m_StartLocations.Add(reader.ReadPoint3D()); m_GameTime = reader.ReadTimeSpan(); m_RegionControl = reader.ReadItem() as BMregion; m_ExitLosers = reader.ReadPoint3D(); if (version >= 1) { m_LinkBombs = reader.ReadBool(); m_ChanceForUpgrade = reader.ReadInt(); if (version >= 2) { m_DanageWhileFS = reader.ReadBool(); if (version >= 3) m_WriteScoreboard = reader.ReadBool(); { if (version >= 4) { m_ExitWinner = reader.ReadPoint3D(); m_ExitOnDraw = reader.ReadPoint3D(); m_AutoStart = reader.ReadBool(); m_KeepOpenJoin = reader.ReadBool(); } } } } m_Running = false; m_OpenJoin = false; }
private void DupeCustomBits(Region r) { //pla: replicate custom region if (r is CustomRegion) { RegionControl rc = (r as CustomRegion).GetRegionControler(); if (rc != null) { //copy all the flags and restricted stuff this.m_Flags = rc.m_Flags; this.m_RestrictedSpells = new BitArray(rc.m_RestrictedSpells); this.m_RestrictedSkills = new BitArray(rc.m_RestrictedSkills); this.m_RestrictedMagicMsg = rc.m_RestrictedMagicMsg; this.m_InnLogoutDelay = rc.InnLogoutDelay; this.m_IOBAlignment = rc.IOBAlign; this.m_MaxFollowers = rc.MaxFollowerSlots; this.m_Music = r.Music; this.SetFlag(RegionFlag.Music, (r.Music != MusicName.Invalid)); if (rc.LightLevel > 0) { this.m_LightLevel = rc.LightLevel; } this.m_Types.Clear(); if (rc.m_Types != null && rc.m_Types.Count > 0) { ArrayList t = rc.m_Types; for (int i = 0; i < rc.m_Types.Count; ++i) { if (t[i] is string) { this.m_Types.Add((string)t[i]); } } } } else { this.SendMessage(String.Format("Region controller for custom region '" + r.Name + "' could not be found.\n\rCustom properties and flags have not been cloned successfully")); } } }
private static void DoChooseArea(Mobile from, Map map, Point3D start, Point3D end, object control) { try { RegionControl r = (RegionControl)control; Rectangle2D rect = new Rectangle2D(start.X, start.Y, end.X - start.X + 1, end.Y - start.Y + 1); // Hopefully this line fixes it... if not, it'll get caught in Try/Catch. if (r.m_Coords == null) { r.m_Coords = new ArrayList(); } r.m_Coords.Add(rect); r.UpdateRegion(); } catch { from.SendMessage("Caught a crash while trying to set a static housing region. Tell Valik or Rook."); Console.WriteLine("Still crashing in DoChooseArea..."); } }
public RegionControlGump( RegionControl r ) : base( 25, 25 ) { m_Controller = r; Closable=true; Dragable=true; Resizable=false; AddPage(0); AddBackground(23, 32, 412, 256, 9270); AddAlphaRegion(19, 29, 418, 263); AddButton(55, 46, 5569, 5570, (int)Buttons.SpellButton, GumpButtonType.Reply, 0); AddButton(55, 128, 5581, 5582, (int)Buttons.SkillButton, GumpButtonType.Reply, 0); AddButton(50, 205, 7006, 7006, (int)Buttons.AreaButton, GumpButtonType.Reply, 0); AddLabel(152, 70, 1152, "Edit Restricted Spells"); AddLabel(152, 153, 1152, "Edit Restricted Skills"); AddLabel(152, 234, 1152, "Add Region Area"); AddImage(353, 54, 3953); AddImage(353, 180, 3955); }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); switch (version) { case 2: { int itemCount = reader.ReadInt32(); m_spawners = new ArrayList(itemCount); for (int i = 0; i < itemCount; ++i) { Item item = reader.ReadItem(); if (item != null) m_spawners.Add(item); } goto case 1; } case 1: { m_KinRansomChest = reader.ReadItem() as KinRansomChest; m_RegStone = reader.ReadItem() as RegionControl; m_OldGuardMode = reader.ReadBool(); m_OldCountMode = reader.ReadBool(); m_RegionName = reader.ReadString(); m_IOBAlignment = (IOBAlignment)reader.ReadInt(); m_ChestOpenTime = reader.ReadDateTime(); m_bChestOpenInit = reader.ReadBool(); m_PreEventTime = reader.ReadDateTime(); m_bPreEventInit = reader.ReadBool(); goto case 0; } case 0: { // all done break; } } }
public virtual CustomRegion CreateRegion(RegionControl rc, Map map) { return(new CustomRegion(rc, map)); }
public RemoveAreaGump( RegionControl r ) : base( 25, 300 ) { m_Control = r; Closable = true; Dragable = true; Resizable = false; AddPage( 0 ); AddBackground( 23, 32, 412, 256, 9270 ); AddAlphaRegion( 19, 29, 418, 263 ); AddLabel( 186, 45, 1152, "Remove Area" ); //+25 between 'em. int itemsThisPage = 0; int nextPageNumber = 1; if( r.RegionArea != null ) { for( int i = 0; i < r.RegionArea.Length; i++ ) { Rectangle3D rect = ((Rectangle3D)r.RegionArea[i]); if( itemsThisPage >= 8 || itemsThisPage == 0 ) { itemsThisPage = 0; if( nextPageNumber != 1 ) { AddButton( 393, 45, 4007, 4009, 0, GumpButtonType.Page, nextPageNumber ); //Forward button -> #0 } AddPage( nextPageNumber++ ); if( nextPageNumber != 2 ) { AddButton( 35, 45, 4014, 4016, 1, GumpButtonType.Page, nextPageNumber - 2 ); //Back Button -> #1 } } AddButton( 70, 75 + 25 * itemsThisPage, 4017, 4019, 100 + i, GumpButtonType.Reply, 0 ); //Button is 100 + i //AddLabel(116, 77 + 25*i, 0, "(1234, 5678)"); AddLabel( 116, 77 + 25 * itemsThisPage, 1152, String.Format( "({0}, {1}, {2})", rect.Start.X, rect.Start.Y, rect.Start.Z ) ); AddLabel( 232, 78 + 25 * itemsThisPage, 1152, "<-->" ); //AddLabel(294, 77 + 25*i, 0, "(9876, 5432)"); AddLabel( 294, 77 + 25 * itemsThisPage, 1152, String.Format( "({0}, {1}, {2})", rect.End.X, rect.End.Y, rect.End.Z ) ); itemsThisPage++; } } }
public RegionControlGump( RegionControl r ) : base( 25, 25 ) { m_Controller = r; Closable=true; Dragable=true; Resizable=false; AddPage(0); AddBackground(23, 32, 590, 270, 9270); AddAlphaRegion(19, 29, 590, 280); AddButton(55, 46, 5569, 5570, (int)Buttons.SpellButton, GumpButtonType.Reply, 0); AddButton(345, 46, 5581, 5582, (int)Buttons.SkillButton, GumpButtonType.Reply, 0); AddButton(50, 128, 7006, 7006, (int)Buttons.AreaButton, GumpButtonType.Reply, 0); AddButton(50, 205, 7006, 7006, (int)Buttons.EnterAreaButton, GumpButtonType.Reply, 0); AddButton(340, 128, 7006, 7006, (int)Buttons.AreaInnButton, GumpButtonType.Reply, 0); AddButton(340, 205, 7006, 7006, (int)Buttons.EnterInnAreaButton, GumpButtonType.Reply, 0); AddLabel(152, 70, 1152, "Edit Restricted Spells"); AddLabel(452, 70, 1152, "Edit Restricted Skills"); AddLabel(152, 157, 1152, "Add Region Area"); AddLabel(152, 235, 1152, "Enter New Region X/Y"); AddLabel(452, 157, 1152, "Add Inn Area"); AddLabel(452, 235, 1152, "Enter New Inn X/Y"); AddImage(353, 54, 3953); AddImage(353, 180, 3955); }
public override CustomRegion CreateRegion(Server.Items.RegionControl rc, Map map) { return(new KinCityRegion(rc, map)); }
public static void DoCommand(CommandEventArgs e) { string output = string.Empty; List<Region> regions = Region.CreateCacheFromXML(ref output); List<RegionControl> controllers = new List<RegionControl>(); if (regions == null || regions.Count == 0) { e.Mobile.SendMessage("Regions failed to load!"); return; } foreach (Region r in regions) { //See if a DRDT region already exists for this one? Region temp = Region.GetByName(r.Name, r.Map); if (temp == null && (temp is CustomRegion)) { e.Mobile.SendMessage("Region {0} does not exist or is already a DRDT region", r.Name); continue; } RegionControl rc = null; //create new region controller if (TestCenter.Enabled && (r.Name == "Skara Brae" || new List<String>(Enum.GetNames(typeof(KinFactionCities))).Find(delegate(string s) { return s.Equals(r.Name); }) != null)) { rc = new Server.Engines.IOBSystem.KinCityRegionStone(); e.Mobile.SendMessage("Kin Faction Region {0} created", r.Name); } else { rc = new RegionControl(); e.Mobile.SendMessage("Region Control {0} created", r.Name); } rc.Name = r.Name; controllers.Add(rc); //upgrade this region to DRDT rc.CloneFromRegionObject(r, true); } //Now sort them alphabetically and move them to the world in rows of 7 from the mobile controllers.Sort(delegate(RegionControl rcA, RegionControl rcB) { return rcA.Name.CompareTo(rcB.Name); }); int x = 0; int y = 0; foreach (RegionControl rc in controllers) { Point3D current = e.Mobile.Location; current.X += x; current.Y += y; rc.MoveToWorld(current, e.Mobile.Map); x++; if (x > 7) { x = 0; y++; } } e.Mobile.SendMessage("done"); }
public AngelIsland(RegionControl rc, Map map) : base( rc, map ) { }
public override CustomRegion CreateRegion(Server.Items.RegionControl rc, Map map) { return(new AngelIsland(rc, map)); }
/// <summary> /// Initializes a new instance of the <see cref="KinCityRegion"/> class. /// </summary> /// <param name="rc">The rc.</param> /// <param name="map">The map.</param> public KinCityRegion(RegionControl rc, Map map) : base(rc, map) { Setup(); }
public static void ADDREGIONCONTROLAREA( TriggerObject trigObject, RegionControl control, IPoint2D start, IPoint2D end) { if (control == null || start == null || end == null) { return; } Rectangle2D newrect = new Rectangle2D(start, end); Rectangle3D rect3D = Region.ConvertTo3D(newrect); control.DoChooseArea(null, control.Map, rect3D.Start, rect3D.End, control); }
public LogoutMove(Mobile m_Mobile, RegionControl controller, TimeSpan delay) : base(delay) { Priority = TimerPriority.OneSecond; m = m_Mobile; m_Controller = controller; ((PlayerMobile)m).CurrentLogoutMoveTimer = this; }
public TownshipRegion(RegionControl rc, Map map) : base(rc, map) { Setup(); }
/// <summary> /// Get and save all the all the quest variables. /// We will use this information for the pre event announcements, and the event setup /// when the event starts. /// </summary> public void OnPreEventInit() { // find the ransom chests ArrayList list = new ArrayList(); foreach (Item ix in World.Items.Values) if (ix is KinRansomChest) list.Add(ix); // process the list of chests if (list.Count > 0) { // select a chest at random m_KinRansomChest = list[Utility.Random(list.Count)] as KinRansomChest; if ( m_KinRansomChest != null ) { // save the alignment m_IOBAlignment = m_KinRansomChest.IOBAlignment; // turn off alignment changing during event (and 24 hour warning) CoreAI.SetDynamicFeature( CoreAI.FeatureBits.GuildKinChangeDisabled ); // turn off guards from this custom regions CustomRegion reg = Region.Find( m_KinRansomChest.Location, m_KinRansomChest.Map ) as CustomRegion; if( reg != null ) { try { // if a custom region does exsist find its controller m_RegStone = reg.GetRegionControler(); if (m_RegStone != null ) { m_RegionName = m_RegStone.RegionName; } } catch(NullReferenceException e) { LogHelper.LogException(e); Console.WriteLine("Caught exception: {0} ", e.Message); } catch(Exception ex) { LogHelper.LogException(ex); Console.WriteLine("Caught exception:", ex.Message); } } // 11/21/06 Pla: Add the chest region to the no camp zones! Rectangle2D rect = GetChestArea(); if (rect.X != 0 && rect.Y != 0 ) CampHelper.AddRestrictedArea(rect); } } else { Console.WriteLine("KinRansomAES: No Ransom chests found, aborting event.."); // tell our base class to stop processing. // the base will also begin cleanup ValidState = false; } Console.WriteLine("KinRansomAES: Pre Event setup."); }
public RemoveInnGump( RegionControl r ) : base( 25, 300 ) { m_Control = r; Closable=true; Dragable=true; Resizable=false; AddPage(0); AddBackground(23, 32, 412, 256, 9270); AddAlphaRegion(19, 29, 418, 263); AddLabel(186, 45, 1152, "Remove Inn"); //+25 between 'em. int itemsThisPage = 0; int nextPageNumber = 1; for( int i = 0; i < r.InnBounds.Count; i++ ) { Rectangle2D rect; if( r.InnBounds[i] is Rectangle2D ) rect = (Rectangle2D)r.InnBounds[i]; else continue; if( itemsThisPage >= 8 || itemsThisPage == 0) { itemsThisPage = 0; if( nextPageNumber != 1) { AddButton(393, 45, 4007, 4009, 0, GumpButtonType.Page, nextPageNumber); //Forward button -> #0 } AddPage( nextPageNumber++ ); if( nextPageNumber != 2) { AddButton(35, 45, 4014, 4016, 1, GumpButtonType.Page, nextPageNumber-2 ); //Back Button -> #1 } } AddButton(70, 75 + 25 * itemsThisPage, 4017, 4019, 100 + i, GumpButtonType.Reply, 0); //Button is 100 + i //AddLabel(116, 77 + 25*i, 0, "(1234, 5678)"); AddLabel(116, 77 + 25 * itemsThisPage, 1152, String.Format("({0}, {1})", rect.X, rect.Y ) ); AddLabel(232, 78 + 25 * itemsThisPage, 1152, "<-->"); //AddLabel(294, 77 + 25*i, 0, "(9876, 5432)"); AddLabel(294, 77 + 25 * itemsThisPage, 1152, String.Format("({0}, {1})", rect.X + rect.Width, rect.Y + rect.Height )); itemsThisPage++; } }
public MovePlayerTimer(Mobile m_Mobile, RegionControl controller) : base(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0)) { Priority = TimerPriority.FiftyMS; m = m_Mobile; m_Controller = controller; }
public virtual CustomRegion CreateRegion(RegionControl rc, Map map) { return new CustomRegion(rc, map); }