// log non frineds marking in a house public void LogMark(Mobile m) { // log non frineds marking in a house try { ArrayList regions = Region.FindAll(m.Location, m.Map); for (int ix = 0; ix < regions.Count; ix++) { if (regions[ix] is Regions.HouseRegion == false) { continue; } Regions.HouseRegion hr = regions[ix] as Regions.HouseRegion; BaseHouse bh = hr.House; if (bh != null) { if (bh.IsFriend(m) == false) { LogHelper Logger = new LogHelper("mark.log", false, true); Logger.Log(LogType.Mobile, m); Logger.Log(LogType.Item, this); Logger.Finish(); } } } } catch (Exception ex) { LogHelper.LogException(ex); } }
public BaseHouse FindHouse() { Point3D loc; if (Open) { loc = new Point3D(X - Offset.X, Y - Offset.Y, Z - Offset.Z); } else { loc = this.Location; } BaseHouse house = BaseHouse.FindHouseAt(loc, Map, 20); if (house == null || (this.KeyValue != 0 && house.KeyValue != this.KeyValue)) { Regions.HouseRegion hr = Region.Find(loc, this.Map) as Regions.HouseRegion; if (hr != null && hr.House != null && (this.KeyValue == 0 || hr.House.KeyValue == this.KeyValue) && hr.House.IsInside(loc, 20)) { house = hr.House; } else { house = null; } } return(house); }
private void OnTarget(Mobile from, object targeted) { IPoint3D p = targeted as IPoint3D; Map map = from.Map; SpellHelper.GetSurfaceTop(ref p); Point3D to = new Point3D(p); if (Server.Misc.WeightOverloading.IsOverloaded(from)) { from.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move. } else if (map == null || !map.CanFit(p.X, p.Y, p.Z, 16)) { from.SendLocalizedMessage(501942); // That location is blocked. } else if (SpellHelper.CheckMulti(to, map)) { from.SendLocalizedMessage(501942); // That location is blocked. } else { SpellHelper.Turn(from, p); Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023); Regions.HouseRegion destRgn = Region.Find(to, from.Map) as Regions.HouseRegion; if (destRgn != null && destRgn.House != null) { if ((from.Region == destRgn && destRgn.House is Multis.LargePatioHouse) || (from.Region != destRgn && destRgn.House.IsInside(to, 15))) { from.SendLocalizedMessage(501942); // That location is blocked. return; } } from.Location = to; from.ProcessDelta(); Effects.SendLocationParticles(EffectItem.Create(to, from.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023); from.PlaySound(0x1FE); } }
public override void OnResponse(NetState state, int index) { Mobile from = state.Mobile; if (from != null && m_Timer != null && m_Timer.Running) { from.Frozen = false; m_Timer.Stop(); } if (index == 0 && from != null && !from.Alive) { if (from.Location != m_Location) { from.SendAsciiMessage("Thou hast wandered too far from the site of thy resurrection!"); return; } PlayerMobile pm = from as PlayerMobile; if (from.Map == null || !from.Map.CanFit(from.Location, 16, false, false) || m_Location != from.Location) { from.SendAsciiMessage("Thou can not be resurrected there!"); return; } /*else if ( pm != null && pm.SpiritCohesion <= 0 ) * { * from.SendAsciiMessage( "Your spirit is too weak to return to corporeal form." ); * return; * }*/ from.PlaySound(0x214); from.FixedEffect(0x376A, 10, 16); from.Resurrect(); if (m_Heal) { if (from.HitsMax > 10) { from.Hits = Utility.RandomMinMax(from.HitsMax / 4, from.HitsMax); } from.Stam = from.StamMax; } //Misc.Titles.AwardFame( from, -100, true ); // TODO: Proper fame loss if (from.Fame > 0) { int amount = from.Fame / 10; if (amount > 500) { amount = 500; } else if (amount < 100) { amount = 100; } Misc.Titles.AwardFame(from, -amount, true); } /* stat loss * if( !Core.AOS && from.ShortTermMurders >= 5 ) * { * //double loss = (100.0 - (4.0 + (from.ShortTermMurders / 5.0))) / 100.0; // 5 to 15% loss * double loss = .95; // 5% loss * int minstat = 80; * int minskill = 80; * * if( from.RawStr * loss > minskill ) * from.RawStr = (int)(from.RawStr * loss); * if( from.RawInt * loss > minskill ) * from.RawInt = (int)(from.RawInt * loss); * if( from.RawDex * loss > minskill ) * from.RawDex = (int)(from.RawDex * loss); * * for( int s = 0; s < from.Skills.Length; s++ ) * { * if( from.Skills[s].Base * loss > minstat ) * from.Skills[s].Base *= loss; * } * } * * //if( from.Alive && m_HitsScalar > 0 ) * // from.Hits = (int)(from.HitsMax * m_HitsScalar); */ Regions.HouseRegion hr = from.Region as Regions.HouseRegion; if (hr != null && hr.House != null && !hr.House.Deleted && !hr.House.IsFriend(from)) { from.Location = hr.House.BanLocation; } /*if ( pm != null ) * { * pm.SpiritCohesion --; * switch ( pm.SpiritCohesion ) * { * case 0: * from.SendAsciiMessage( "Your spirit returns to corporeal form, but is too weak to do so again for a while." ); * break; * case 1: * from.SendAsciiMessage( "Your spirit barely manages to return to corporeal form." ); * break; * case 2: * from.SendAsciiMessage( "With some effort your spirit returns to corporeal form." ); * break; * case 3: * default: * from.SendAsciiMessage( "Your spirit easily returns to corporeal form." ); * break; * } * }*/ } }