public override bool OnDeath(Mobile m) { try { //check if there is a DRDT region below the houses, and if so use its rules RegionControl regstone = null; CustomRegion inHouse = null; inHouse = CustomRegion.FindDRDTRegion(m); if (inHouse != null) { regstone = inHouse.GetRegionControler(); } if (regstone != null && regstone.NoMurderZone) { foreach (AggressorInfo ai in m.Aggressors) { ai.CanReportMurder = false; } } } catch (NullReferenceException e) { LogHelper.LogException(e); Console.WriteLine("{0} Caught exception.", e); } catch (Exception ex) { LogHelper.LogException(ex); } return(base.OnDeath(m)); }
public override bool OnBeginSpellCast(Mobile from, ISpell s) { try { //check if there is a DRDT region below the houses, and if so use its rules RegionControl regstone = null; CustomRegion inHouse = null; inHouse = CustomRegion.FindDRDTRegion(from); if (inHouse != null) { regstone = inHouse.GetRegionControler(); } if (regstone != null) { return(inHouse.OnBeginSpellCast(from, s)); } } catch (NullReferenceException e) { LogHelper.LogException(e); Console.WriteLine("{0} Caught exception.", e); } catch (Exception ex) { LogHelper.LogException(ex); } return(base.OnBeginSpellCast(from, s)); }
public override bool OnSkillUse(Mobile m, int skill) { try { //check if there is a DRDT region below the houses, and if so use its rules RegionControl regstone = null; CustomRegion inHouse = null; if (m != null) { inHouse = CustomRegion.FindDRDTRegion(m); } if (inHouse != null) { regstone = inHouse.GetRegionControler(); } if (m != null && regstone != null) { return(inHouse.OnSkillUse(m, skill)); } } catch (NullReferenceException e) { LogHelper.LogException(e); Console.WriteLine("{0} Caught exception.", e); } catch (Exception ex) { LogHelper.LogException(ex); } return(base.OnSkillUse(m, skill)); }
public override bool EquipItem(Mobile m, Item item) { try { //check if there is a DRDT region below the houses, and if so use its rules RegionControl regstone = null; CustomRegion inHouse = null; if (m != null) { inHouse = CustomRegion.FindDRDTRegion(m); } if (inHouse != null) { regstone = inHouse.GetRegionControler(); } if (regstone != null) { return(inHouse.EquipItem(m, item)); } } catch (NullReferenceException e) { LogHelper.LogException(e); Console.WriteLine("{0} Caught exception.", e); } catch (Exception ex) { EventSink.InvokeLogException(new LogExceptionEventArgs(ex)); } return(true); }
public static TownshipRegion GetTownshipAt(Point3D point, Map map) { CustomRegion c = CustomRegion.FindDRDTRegion(map, point); if (c is TownshipRegion) { return((TownshipRegion)c); } return(null); }
public static TownshipRegion GetTownshipAt(Mobile m) { CustomRegion c = CustomRegion.FindDRDTRegion(m); if (c is TownshipRegion) { return((TownshipRegion)c); } return(null); }
public override bool OnDoubleClick(Mobile from, object o) { try { //check if there is a DRDT region below the houses, and if so use its rules RegionControl regstone = null; CustomRegion inHouse = null; if (from != null) { inHouse = CustomRegion.FindDRDTRegion(from); } if (inHouse != null) { regstone = inHouse.GetRegionControler(); } if (regstone != null) { return(inHouse.OnDoubleClick(from, o)); } } catch (NullReferenceException e) { LogHelper.LogException(e); Console.WriteLine("{0} Caught exception.", e); } catch (Exception ex) { LogHelper.LogException(ex); } if (o is Container) { Container c = (Container)o; SecureAccessResult res = m_House.CheckSecureAccess(from, c); switch (res) { case SecureAccessResult.Insecure: break; case SecureAccessResult.Accessible: return(true); case SecureAccessResult.Inaccessible: c.SendLocalizedMessageTo(from, 1010563); return(false); } } return(true); }
public static void OnLogin(LoginEventArgs e) { // HousingRegion processing CustomRegion cr = CustomRegion.FindDRDTRegion(e.Mobile); if (cr != null) { RegionControl rc = cr.GetRegionControler(); if (rc != null) { if (rc.IsHouseRegion == true) { BaseHouse house = BaseHouse.FindHouseAt(e.Mobile); if (house != null && !house.Public && !house.IsFriend(e.Mobile)) { e.Mobile.Location = house.BanLocation; } } } } // other OnLogin processing }