From f660f8160b70aebe6c5cfa6b06ee8abd979a8dd6 Mon Sep 17 00:00:00 2001 From: xavier Date: Sat, 9 Oct 2010 16:04:49 +0000 Subject: [PATCH] bleh whitespace/formatting cleanup. --- Scripts/Mobiles/Townfolk/BaseEscortable.cs | 1050 ++++++++--------- Scripts/Mobiles/Vendors/PlayerVendor.cs | 26 +- Scripts/Multis/Camps/BaseCamp.cs | 100 +- Scripts/Multis/Camps/BrigandCamp.cs | 110 +- Scripts/Multis/Camps/LizardmenCamp.cs | 54 +- Scripts/Multis/Camps/OrcCamp.cs | 114 +- Scripts/Multis/Camps/RatCamp.cs | 116 +- Scripts/Spells/Necromancy/MindRot.cs | 60 +- Scripts/Spells/Spellweaving/EssenceOfWind.cs | 11 +- .../Spells/Spellweaving/Items/ArcaneFocus.cs | 74 +- Scripts/Spells/Spellweaving/ReaperForm.cs | 11 +- Scripts/Spells/Spellweaving/WordOfDeath.cs | 11 +- 12 files changed, 866 insertions(+), 871 deletions(-) diff --git a/Scripts/Mobiles/Townfolk/BaseEscortable.cs b/Scripts/Mobiles/Townfolk/BaseEscortable.cs index 286f2212d..4b94463d8 100644 --- a/Scripts/Mobiles/Townfolk/BaseEscortable.cs +++ b/Scripts/Mobiles/Townfolk/BaseEscortable.cs @@ -9,24 +9,24 @@ using EDI = Server.Mobiles.EscortDestinationInfo; namespace Server.Mobiles { - public class BaseEscortable : BaseCreature - { - private EDI m_Destination; - private string m_DestinationString; + public class BaseEscortable : BaseCreature + { + private EDI m_Destination; + private string m_DestinationString; - private DateTime m_DeleteTime; - private Timer m_DeleteTimer; + private DateTime m_DeleteTime; + private Timer m_DeleteTimer; - public override bool Commandable { get { return false; } } // Our master cannot boss us around! + public override bool Commandable { get { return false; } } // Our master cannot boss us around! - [CommandProperty(AccessLevel.GameMaster)] - public string Destination - { - get { return m_Destination == null ? null : m_Destination.Name; } - set { m_DestinationString = value; m_Destination = EDI.Find(value); } - } + [CommandProperty(AccessLevel.GameMaster)] + public string Destination + { + get { return m_Destination == null ? null : m_Destination.Name; } + set { m_DestinationString = value; m_Destination = EDI.Find(value); } + } - private static string[] m_TownNames = new string[] + private static string[] m_TownNames = new string[] { "Cove", "Britain", "Jhelom", "Minoc", "Ocllo", "Trinsic", @@ -34,580 +34,580 @@ namespace Server.Mobiles "Nujel'm", "Moonglow", "Magincia" }; - private static string[] m_MLTownNames = new string[] + private static string[] m_MLTownNames = new string[] { "Cove", "Serpent's Hold", "Jhelom", //ML List "Nujel'm" }; - [Constructable] - public BaseEscortable() - : base(AIType.AI_Melee, FightMode.Aggressor, 22, 1, 0.2, 1.0) - { - InitBody(); - InitOutfit(); - } - - public virtual void InitBody() - { - SetStr(90, 100); - SetDex(90, 100); - SetInt(15, 25); - - Hue = Utility.RandomSkinHue(); - - if (Female = Utility.RandomBool()) - { - Body = 401; - Name = NameList.RandomName("female"); - } - else - { - Body = 400; - Name = NameList.RandomName("male"); - } - } - - public virtual void InitOutfit() - { - AddItem(new FancyShirt(Utility.RandomNeutralHue())); - AddItem(new ShortPants(Utility.RandomNeutralHue())); - AddItem(new Boots(Utility.RandomNeutralHue())); - - Utility.AssignRandomHair(this); - - PackGold(200, 250); - } - - public virtual bool SayDestinationTo(Mobile m) - { - EDI dest = GetDestination(); - - if (dest == null || !m.Alive) - return false; - - Mobile escorter = GetEscorter(); - - if (escorter == null) - { - Say("I am looking to go to {0}, will you take me?", (dest.Name == "Ocllo" && m.Map == Map.Trammel) ? "Haven" : dest.Name); - return true; - } - else if (escorter == m) - { - Say("Lead on! Payment will be made when we arrive in {0}.", (dest.Name == "Ocllo" && m.Map == Map.Trammel) ? "Haven" : dest.Name); - return true; - } - - return false; - } - - private static Hashtable m_EscortTable = new Hashtable(); - - public static Hashtable EscortTable - { - get { return m_EscortTable; } - } - - private static TimeSpan m_EscortDelay = TimeSpan.FromMinutes(5.0); - - public virtual bool AcceptEscorter(Mobile m) - { - EDI dest = GetDestination(); - - if (dest == null) - return false; - - Mobile escorter = GetEscorter(); - - if (escorter != null || !m.Alive) - return false; - - BaseEscortable escortable = (BaseEscortable)m_EscortTable[m]; - - if (escortable != null && !escortable.Deleted && escortable.GetEscorter() == m) - { - Say("I see you already have an escort."); - return false; - } - else if (m is PlayerMobile && (((PlayerMobile)m).LastEscortTime + m_EscortDelay) >= DateTime.Now) - { - int minutes = (int)Math.Ceiling(((((PlayerMobile)m).LastEscortTime + m_EscortDelay) - DateTime.Now).TotalMinutes); - - Say("You must rest {0} minute{1} before we set out on this journey.", minutes, minutes == 1 ? "" : "s"); - return false; - } - else if (SetControlMaster(m)) - { - m_LastSeenEscorter = DateTime.Now; - - if (m is PlayerMobile) - ((PlayerMobile)m).LastEscortTime = DateTime.Now; - - Say("Lead on! Payment will be made when we arrive in {0}.", (dest.Name == "Ocllo" && m.Map == Map.Trammel) ? "Haven" : dest.Name); - m_EscortTable[m] = this; - StartFollow(); - return true; - } - - return false; - } - - public override bool HandlesOnSpeech(Mobile from) - { - if (from.InRange(this.Location, 3)) - return true; - - return base.HandlesOnSpeech(from); - } - - public override void OnSpeech(SpeechEventArgs e) - { - base.OnSpeech(e); + [Constructable] + public BaseEscortable() + : base(AIType.AI_Melee, FightMode.Aggressor, 22, 1, 0.2, 1.0) + { + InitBody(); + InitOutfit(); + } + + public virtual void InitBody() + { + SetStr(90, 100); + SetDex(90, 100); + SetInt(15, 25); + + Hue = Utility.RandomSkinHue(); + + if (Female = Utility.RandomBool()) + { + Body = 401; + Name = NameList.RandomName("female"); + } + else + { + Body = 400; + Name = NameList.RandomName("male"); + } + } + + public virtual void InitOutfit() + { + AddItem(new FancyShirt(Utility.RandomNeutralHue())); + AddItem(new ShortPants(Utility.RandomNeutralHue())); + AddItem(new Boots(Utility.RandomNeutralHue())); + + Utility.AssignRandomHair(this); + + PackGold(200, 250); + } + + public virtual bool SayDestinationTo(Mobile m) + { + EDI dest = GetDestination(); + + if (dest == null || !m.Alive) + return false; + + Mobile escorter = GetEscorter(); + + if (escorter == null) + { + Say("I am looking to go to {0}, will you take me?", (dest.Name == "Ocllo" && m.Map == Map.Trammel) ? "Haven" : dest.Name); + return true; + } + else if (escorter == m) + { + Say("Lead on! Payment will be made when we arrive in {0}.", (dest.Name == "Ocllo" && m.Map == Map.Trammel) ? "Haven" : dest.Name); + return true; + } + + return false; + } + + private static Hashtable m_EscortTable = new Hashtable(); + + public static Hashtable EscortTable + { + get { return m_EscortTable; } + } + + private static TimeSpan m_EscortDelay = TimeSpan.FromMinutes(5.0); + + public virtual bool AcceptEscorter(Mobile m) + { + EDI dest = GetDestination(); + + if (dest == null) + return false; + + Mobile escorter = GetEscorter(); + + if (escorter != null || !m.Alive) + return false; + + BaseEscortable escortable = (BaseEscortable)m_EscortTable[m]; + + if (escortable != null && !escortable.Deleted && escortable.GetEscorter() == m) + { + Say("I see you already have an escort."); + return false; + } + else if (m is PlayerMobile && (((PlayerMobile)m).LastEscortTime + m_EscortDelay) >= DateTime.Now) + { + int minutes = (int)Math.Ceiling(((((PlayerMobile)m).LastEscortTime + m_EscortDelay) - DateTime.Now).TotalMinutes); + + Say("You must rest {0} minute{1} before we set out on this journey.", minutes, minutes == 1 ? "" : "s"); + return false; + } + else if (SetControlMaster(m)) + { + m_LastSeenEscorter = DateTime.Now; + + if (m is PlayerMobile) + ((PlayerMobile)m).LastEscortTime = DateTime.Now; + + Say("Lead on! Payment will be made when we arrive in {0}.", (dest.Name == "Ocllo" && m.Map == Map.Trammel) ? "Haven" : dest.Name); + m_EscortTable[m] = this; + StartFollow(); + return true; + } + + return false; + } + + public override bool HandlesOnSpeech(Mobile from) + { + if (from.InRange(this.Location, 3)) + return true; + + return base.HandlesOnSpeech(from); + } + + public override void OnSpeech(SpeechEventArgs e) + { + base.OnSpeech(e); - EDI dest = GetDestination(); + EDI dest = GetDestination(); - if (dest != null && !e.Handled && e.Mobile.InRange(this.Location, 3)) - { - if (e.HasKeyword(0x1D)) // *destination* - e.Handled = SayDestinationTo(e.Mobile); - else if (e.HasKeyword(0x1E)) // *i will take thee* - e.Handled = AcceptEscorter(e.Mobile); - } - } + if (dest != null && !e.Handled && e.Mobile.InRange(this.Location, 3)) + { + if (e.HasKeyword(0x1D)) // *destination* + e.Handled = SayDestinationTo(e.Mobile); + else if (e.HasKeyword(0x1E)) // *i will take thee* + e.Handled = AcceptEscorter(e.Mobile); + } + } - public override void OnAfterDelete() - { - if (m_DeleteTimer != null) - m_DeleteTimer.Stop(); - - m_DeleteTimer = null; - - base.OnAfterDelete(); - } + public override void OnAfterDelete() + { + if (m_DeleteTimer != null) + m_DeleteTimer.Stop(); + + m_DeleteTimer = null; + + base.OnAfterDelete(); + } - public override void OnThink() - { - base.OnThink(); - CheckAtDestination(); - } - - protected override bool OnMove(Direction d) - { - if (!base.OnMove(d)) - return false; + public override void OnThink() + { + base.OnThink(); + CheckAtDestination(); + } + + protected override bool OnMove(Direction d) + { + if (!base.OnMove(d)) + return false; - CheckAtDestination(); + CheckAtDestination(); - return true; - } + return true; + } - public virtual void StartFollow() - { - StartFollow(GetEscorter()); - } + public virtual void StartFollow() + { + StartFollow(GetEscorter()); + } - public virtual void StartFollow(Mobile escorter) - { - if (escorter == null) - return; + public virtual void StartFollow(Mobile escorter) + { + if (escorter == null) + return; - ActiveSpeed = 0.1; - PassiveSpeed = 0.2; + ActiveSpeed = 0.1; + PassiveSpeed = 0.2; - ControlOrder = OrderType.Follow; - ControlTarget = escorter; + ControlOrder = OrderType.Follow; + ControlTarget = escorter; - if ((IsPrisoner == true) && (CantWalk == true)) - { - CantWalk = false; - } - CurrentSpeed = 0.1; - } + if ((IsPrisoner == true) && (CantWalk == true)) + { + CantWalk = false; + } + CurrentSpeed = 0.1; + } - public virtual void StopFollow() - { - ActiveSpeed = 0.2; - PassiveSpeed = 1.0; + public virtual void StopFollow() + { + ActiveSpeed = 0.2; + PassiveSpeed = 1.0; - ControlOrder = OrderType.None; - ControlTarget = null; + ControlOrder = OrderType.None; + ControlTarget = null; - CurrentSpeed = 1.0; - } + CurrentSpeed = 1.0; + } - private DateTime m_LastSeenEscorter; + private DateTime m_LastSeenEscorter; - public virtual Mobile GetEscorter() - { - if (!Controlled) - return null; + public virtual Mobile GetEscorter() + { + if (!Controlled) + return null; - Mobile master = ControlMaster; + Mobile master = ControlMaster; - if (master == null) - return null; + if (master == null) + return null; - if (master.Deleted || master.Map != this.Map || !master.InRange(Location, 30) || !master.Alive) - { - StopFollow(); + if (master.Deleted || master.Map != this.Map || !master.InRange(Location, 30) || !master.Alive) + { + StopFollow(); - TimeSpan lastSeenDelay = DateTime.Now - m_LastSeenEscorter; + TimeSpan lastSeenDelay = DateTime.Now - m_LastSeenEscorter; - if (lastSeenDelay >= TimeSpan.FromMinutes(2.0)) - { - master.SendLocalizedMessage(1042473); // You have lost the person you were escorting. - Say(1005653); // Hmmm. I seem to have lost my master. + if (lastSeenDelay >= TimeSpan.FromMinutes(2.0)) + { + master.SendLocalizedMessage(1042473); // You have lost the person you were escorting. + Say(1005653); // Hmmm. I seem to have lost my master. - SetControlMaster(null); - m_EscortTable.Remove(master); + SetControlMaster(null); + m_EscortTable.Remove(master); - Timer.DelayCall(TimeSpan.FromSeconds(5.0), new TimerCallback(Delete)); - return null; - } - else - { - ControlOrder = OrderType.Stay; - return master; - } - } + Timer.DelayCall(TimeSpan.FromSeconds(5.0), new TimerCallback(Delete)); + return null; + } + else + { + ControlOrder = OrderType.Stay; + return master; + } + } - if (ControlOrder != OrderType.Follow) - StartFollow(master); + if (ControlOrder != OrderType.Follow) + StartFollow(master); - m_LastSeenEscorter = DateTime.Now; - return master; - } + m_LastSeenEscorter = DateTime.Now; + return master; + } - public virtual void BeginDelete() - { - if (m_DeleteTimer != null) - m_DeleteTimer.Stop(); + public virtual void BeginDelete() + { + if (m_DeleteTimer != null) + m_DeleteTimer.Stop(); - m_DeleteTime = DateTime.Now + TimeSpan.FromSeconds(30.0); + m_DeleteTime = DateTime.Now + TimeSpan.FromSeconds(30.0); - m_DeleteTimer = new DeleteTimer(this, m_DeleteTime - DateTime.Now); - m_DeleteTimer.Start(); - } + m_DeleteTimer = new DeleteTimer(this, m_DeleteTime - DateTime.Now); + m_DeleteTimer.Start(); + } - public virtual bool CheckAtDestination() - { - EDI dest = GetDestination(); + public virtual bool CheckAtDestination() + { + EDI dest = GetDestination(); - if (dest == null) - return false; + if (dest == null) + return false; - Mobile escorter = GetEscorter(); + Mobile escorter = GetEscorter(); - if (escorter == null) - return false; + if (escorter == null) + return false; - if (dest.Contains(Location)) - { - Say(1042809, escorter.Name); // We have arrived! I thank thee, ~1_PLAYER_NAME~! I have no further need of thy services. Here is thy pay. + if (dest.Contains(Location)) + { + Say(1042809, escorter.Name); // We have arrived! I thank thee, ~1_PLAYER_NAME~! I have no further need of thy services. Here is thy pay. - // not going anywhere - m_Destination = null; - m_DestinationString = null; + // not going anywhere + m_Destination = null; + m_DestinationString = null; - Container cont = escorter.Backpack; + Container cont = escorter.Backpack; - if (cont == null) - cont = escorter.BankBox; + if (cont == null) + cont = escorter.BankBox; - Gold gold = new Gold(500, 1000); + Gold gold = new Gold(500, 1000); - if (!cont.TryDropItem(escorter, gold, false)) - gold.MoveToWorld(escorter.Location, escorter.Map); + if (!cont.TryDropItem(escorter, gold, false)) + gold.MoveToWorld(escorter.Location, escorter.Map); - StopFollow(); - SetControlMaster(null); - m_EscortTable.Remove(escorter); - BeginDelete(); + StopFollow(); + SetControlMaster(null); + m_EscortTable.Remove(escorter); + BeginDelete(); - Misc.Titles.AwardFame(escorter, 10, true); + Misc.Titles.AwardFame(escorter, 10, true); - bool gainedPath = false; + bool gainedPath = false; - PlayerMobile pm = escorter as PlayerMobile; + PlayerMobile pm = escorter as PlayerMobile; - if (pm != null) - { - if (pm.CompassionGains > 0 && DateTime.Now > pm.NextCompassionDay) - { - pm.NextCompassionDay = DateTime.MinValue; - pm.CompassionGains = 0; - } + if (pm != null) + { + if (pm.CompassionGains > 0 && DateTime.Now > pm.NextCompassionDay) + { + pm.NextCompassionDay = DateTime.MinValue; + pm.CompassionGains = 0; + } - if (pm.CompassionGains >= 5) // have already gained 5 times in one day, can gain no more - { - pm.SendLocalizedMessage(1053004); // You must wait about a day before you can gain in compassion again. - } - else if (VirtueHelper.Award(pm, VirtueName.Compassion, this.IsPrisoner ? 400 : 200, ref gainedPath)) - { - if (gainedPath) - pm.SendLocalizedMessage(1053005); // You have achieved a path in compassion! - else - pm.SendLocalizedMessage(1053002); // You have gained in compassion. + if (pm.CompassionGains >= 5) // have already gained 5 times in one day, can gain no more + { + pm.SendLocalizedMessage(1053004); // You must wait about a day before you can gain in compassion again. + } + else if (VirtueHelper.Award(pm, VirtueName.Compassion, this.IsPrisoner ? 400 : 200, ref gainedPath)) + { + if (gainedPath) + pm.SendLocalizedMessage(1053005); // You have achieved a path in compassion! + else + pm.SendLocalizedMessage(1053002); // You have gained in compassion. - pm.NextCompassionDay = DateTime.Now + TimeSpan.FromDays(1.0); // in one day CompassionGains gets reset to 0 - ++pm.CompassionGains; - } - else - { - pm.SendLocalizedMessage(1053003); // You have achieved the highest path of compassion and can no longer gain any further. - } - } + pm.NextCompassionDay = DateTime.Now + TimeSpan.FromDays(1.0); // in one day CompassionGains gets reset to 0 + ++pm.CompassionGains; + } + else + { + pm.SendLocalizedMessage(1053003); // You have achieved the highest path of compassion and can no longer gain any further. + } + } - return true; - } + return true; + } - return false; - } + return false; + } - public BaseEscortable(Serial serial) - : base(serial) - { - } + public BaseEscortable(Serial serial) + : base(serial) + { + } - public override void Serialize(GenericWriter writer) - { - base.Serialize(writer); + public override void Serialize(GenericWriter writer) + { + base.Serialize(writer); - writer.Write((int)0); // version + writer.Write((int)0); // version - EDI dest = GetDestination(); + EDI dest = GetDestination(); - writer.Write(dest != null); + writer.Write(dest != null); - if (dest != null) - writer.Write(dest.Name); + if (dest != null) + writer.Write(dest.Name); - writer.Write(m_DeleteTimer != null); + writer.Write(m_DeleteTimer != null); - if (m_DeleteTimer != null) - writer.WriteDeltaTime(m_DeleteTime); - } + if (m_DeleteTimer != null) + writer.WriteDeltaTime(m_DeleteTime); + } - public override void Deserialize(GenericReader reader) - { - base.Deserialize(reader); + public override void Deserialize(GenericReader reader) + { + base.Deserialize(reader); - int version = reader.ReadInt(); + int version = reader.ReadInt(); - if (reader.ReadBool()) - m_DestinationString = reader.ReadString(); // NOTE: We cannot EDI.Find here, regions have not yet been loaded :-( + if (reader.ReadBool()) + m_DestinationString = reader.ReadString(); // NOTE: We cannot EDI.Find here, regions have not yet been loaded :-( - if (reader.ReadBool()) - { - m_DeleteTime = reader.ReadDeltaTime(); - m_DeleteTimer = new DeleteTimer(this, m_DeleteTime - DateTime.Now); - m_DeleteTimer.Start(); - } - } - - public override bool CanBeRenamedBy(Mobile from) - { - return (from.AccessLevel >= AccessLevel.GameMaster); - } - - public override void AddCustomContextEntries(Mobile from, List list) - { - EDI dest = GetDestination(); - - if (dest != null && from.Alive) - { - Mobile escorter = GetEscorter(); - - if (escorter == null || escorter == from) - list.Add(new AskDestinationEntry(this, from)); - - if (escorter == null) - list.Add(new AcceptEscortEntry(this, from)); - else if (escorter == from) - list.Add(new AbandonEscortEntry(this, from)); - } - - base.AddCustomContextEntries(from, list); - } - - public virtual string[] GetPossibleDestinations() - { - if (!Core.ML) - return m_TownNames; - else - return m_MLTownNames; - } - - public virtual string PickRandomDestination() - { - if (Map.Felucca.Regions.Count == 0 || Map == null || Map == Map.Internal || Location == Point3D.Zero) - return null; // Not yet fully initialized - - string[] possible = GetPossibleDestinations(); - string picked = null; - - while (picked == null) - { - picked = possible[Utility.Random(possible.Length)]; - EDI test = EDI.Find(picked); - - if (test != null && test.Contains(Location)) - picked = null; - } - - return picked; - } + if (reader.ReadBool()) + { + m_DeleteTime = reader.ReadDeltaTime(); + m_DeleteTimer = new DeleteTimer(this, m_DeleteTime - DateTime.Now); + m_DeleteTimer.Start(); + } + } + + public override bool CanBeRenamedBy(Mobile from) + { + return (from.AccessLevel >= AccessLevel.GameMaster); + } + + public override void AddCustomContextEntries(Mobile from, List list) + { + EDI dest = GetDestination(); + + if (dest != null && from.Alive) + { + Mobile escorter = GetEscorter(); + + if (escorter == null || escorter == from) + list.Add(new AskDestinationEntry(this, from)); + + if (escorter == null) + list.Add(new AcceptEscortEntry(this, from)); + else if (escorter == from) + list.Add(new AbandonEscortEntry(this, from)); + } + + base.AddCustomContextEntries(from, list); + } + + public virtual string[] GetPossibleDestinations() + { + if (!Core.ML) + return m_TownNames; + else + return m_MLTownNames; + } + + public virtual string PickRandomDestination() + { + if (Map.Felucca.Regions.Count == 0 || Map == null || Map == Map.Internal || Location == Point3D.Zero) + return null; // Not yet fully initialized + + string[] possible = GetPossibleDestinations(); + string picked = null; + + while (picked == null) + { + picked = possible[Utility.Random(possible.Length)]; + EDI test = EDI.Find(picked); + + if (test != null && test.Contains(Location)) + picked = null; + } + + return picked; + } - public EDI GetDestination() - { - if (m_DestinationString == null && m_DeleteTimer == null) - m_DestinationString = PickRandomDestination(); - - if (m_Destination != null && m_Destination.Name == m_DestinationString) - return m_Destination; - - if (Map.Felucca.Regions.Count > 0) - return (m_Destination = EDI.Find(m_DestinationString)); - - return (m_Destination = null); - } - - private class DeleteTimer : Timer - { - private Mobile m_Mobile; - - public DeleteTimer(Mobile m, TimeSpan delay) - : base(delay) - { - m_Mobile = m; - - Priority = TimerPriority.OneSecond; - } - - protected override void OnTick() - { - m_Mobile.Delete(); - } - } - } - - public class EscortDestinationInfo - { - private string m_Name; - private Region m_Region; - //private Rectangle2D[] m_Bounds; - - public string Name - { - get { return m_Name; } - } - - public Region Region - { - get { return m_Region; } - } - - /*public Rectangle2D[] Bounds - { - get{ return m_Bounds; } - }*/ - - public bool Contains(Point3D p) - { - return m_Region.Contains(p); - } - - public EscortDestinationInfo(string name, Region region) - { - m_Name = name; - m_Region = region; - } - - private static Hashtable m_Table; - - public static void LoadTable() - { - ICollection list = Map.Felucca.Regions.Values; - - if (list.Count == 0) - return; - - m_Table = new Hashtable(); - - foreach (Region r in list) - { - if (r.Name == null) - continue; - - if (r is Regions.DungeonRegion || r is Regions.TownRegion) - m_Table[r.Name] = new EscortDestinationInfo(r.Name, r); - } - } - - public static EDI Find(string name) - { - if (m_Table == null) - LoadTable(); - - if (name == null || m_Table == null) - return null; - - return (EscortDestinationInfo)m_Table[name]; - } - } - - public class AskDestinationEntry : ContextMenuEntry - { - private BaseEscortable m_Mobile; - private Mobile m_From; - - public AskDestinationEntry(BaseEscortable m, Mobile from) - : base(6100, 3) - { - m_Mobile = m; - m_From = from; - } - - public override void OnClick() - { - m_Mobile.SayDestinationTo(m_From); - } - } - - public class AcceptEscortEntry : ContextMenuEntry - { - private BaseEscortable m_Mobile; - private Mobile m_From; - - public AcceptEscortEntry(BaseEscortable m, Mobile from) - : base(6101, 3) - { - m_Mobile = m; - m_From = from; - } - - public override void OnClick() - { - m_Mobile.AcceptEscorter(m_From); - } - } - - public class AbandonEscortEntry : ContextMenuEntry - { - private BaseEscortable m_Mobile; - private Mobile m_From; - - public AbandonEscortEntry(BaseEscortable m, Mobile from) - : base(6102, 3) - { - m_Mobile = m; - m_From = from; - } - - public override void OnClick() - { - m_Mobile.Delete(); // OSI just seems to delete instantly - } - } + public EDI GetDestination() + { + if (m_DestinationString == null && m_DeleteTimer == null) + m_DestinationString = PickRandomDestination(); + + if (m_Destination != null && m_Destination.Name == m_DestinationString) + return m_Destination; + + if (Map.Felucca.Regions.Count > 0) + return (m_Destination = EDI.Find(m_DestinationString)); + + return (m_Destination = null); + } + + private class DeleteTimer : Timer + { + private Mobile m_Mobile; + + public DeleteTimer(Mobile m, TimeSpan delay) + : base(delay) + { + m_Mobile = m; + + Priority = TimerPriority.OneSecond; + } + + protected override void OnTick() + { + m_Mobile.Delete(); + } + } + } + + public class EscortDestinationInfo + { + private string m_Name; + private Region m_Region; + //private Rectangle2D[] m_Bounds; + + public string Name + { + get { return m_Name; } + } + + public Region Region + { + get { return m_Region; } + } + + /*public Rectangle2D[] Bounds + { + get{ return m_Bounds; } + }*/ + + public bool Contains(Point3D p) + { + return m_Region.Contains(p); + } + + public EscortDestinationInfo(string name, Region region) + { + m_Name = name; + m_Region = region; + } + + private static Hashtable m_Table; + + public static void LoadTable() + { + ICollection list = Map.Felucca.Regions.Values; + + if (list.Count == 0) + return; + + m_Table = new Hashtable(); + + foreach (Region r in list) + { + if (r.Name == null) + continue; + + if (r is Regions.DungeonRegion || r is Regions.TownRegion) + m_Table[r.Name] = new EscortDestinationInfo(r.Name, r); + } + } + + public static EDI Find(string name) + { + if (m_Table == null) + LoadTable(); + + if (name == null || m_Table == null) + return null; + + return (EscortDestinationInfo)m_Table[name]; + } + } + + public class AskDestinationEntry : ContextMenuEntry + { + private BaseEscortable m_Mobile; + private Mobile m_From; + + public AskDestinationEntry(BaseEscortable m, Mobile from) + : base(6100, 3) + { + m_Mobile = m; + m_From = from; + } + + public override void OnClick() + { + m_Mobile.SayDestinationTo(m_From); + } + } + + public class AcceptEscortEntry : ContextMenuEntry + { + private BaseEscortable m_Mobile; + private Mobile m_From; + + public AcceptEscortEntry(BaseEscortable m, Mobile from) + : base(6101, 3) + { + m_Mobile = m; + m_From = from; + } + + public override void OnClick() + { + m_Mobile.AcceptEscorter(m_From); + } + } + + public class AbandonEscortEntry : ContextMenuEntry + { + private BaseEscortable m_Mobile; + private Mobile m_From; + + public AbandonEscortEntry(BaseEscortable m, Mobile from) + : base(6102, 3) + { + m_Mobile = m; + m_From = from; + } + + public override void OnClick() + { + m_Mobile.Delete(); // OSI just seems to delete instantly + } + } } \ No newline at end of file diff --git a/Scripts/Mobiles/Vendors/PlayerVendor.cs b/Scripts/Mobiles/Vendors/PlayerVendor.cs index d27c3dcf9..51a1bc433 100644 --- a/Scripts/Mobiles/Vendors/PlayerVendor.cs +++ b/Scripts/Mobiles/Vendors/PlayerVendor.cs @@ -1468,18 +1468,18 @@ namespace Server.Mobiles int price; string description; - if ( int.TryParse( firstWord, out price ) ) - { - if ( sep >= 0 ) - description = text.Substring( sep + 1 ).Trim(); - else - description = ""; - } - else - { - price = -1; - description = text.Trim(); + if ( int.TryParse( firstWord, out price ) ) + { + if ( sep >= 0 ) + description = text.Substring( sep + 1 ).Trim(); + else + description = ""; } + else + { + price = -1; + description = text.Trim(); + } SetInfo( from, price, Utility.FixHtml( description ) ); } @@ -1560,8 +1560,8 @@ namespace Server.Mobiles int amount; - if ( !int.TryParse( text, out amount ) ) - amount = 0; + if ( !int.TryParse( text, out amount ) ) + amount = 0; GiveGold( from, amount ); } diff --git a/Scripts/Multis/Camps/BaseCamp.cs b/Scripts/Multis/Camps/BaseCamp.cs index 144bd9afe..11980ed03 100644 --- a/Scripts/Multis/Camps/BaseCamp.cs +++ b/Scripts/Multis/Camps/BaseCamp.cs @@ -13,22 +13,28 @@ namespace Server.Multis private List m_Mobiles; private DateTime m_DecayTime; private Timer m_DecayTimer; - private TimeSpan m_DecayDelay; + private TimeSpan m_DecayDelay; public virtual int EventRange{ get{ return 10; } } - public virtual TimeSpan DecayDelay { - get { return m_DecayDelay; } - set { - m_DecayDelay = value; - RefreshDecay( true ); - } - } + + public virtual TimeSpan DecayDelay + { + get + { + return m_DecayDelay; + } + set + { + m_DecayDelay = value; + RefreshDecay( true ); + } + } public BaseCamp( int multiID ) : base( multiID | 0x4000 ) { m_Items = new List(); m_Mobiles = new List(); - m_DecayDelay = TimeSpan.FromMinutes( 30.0 ); + m_DecayDelay = TimeSpan.FromMinutes( 30.0 ); RefreshDecay( true ); Timer.DelayCall( TimeSpan.Zero, new TimerCallback( CheckAddComponents ) ); @@ -38,8 +44,8 @@ namespace Server.Multis { m_Items = new List(); m_Mobiles = new List(); - m_DecayDelay = TimeSpan.FromMinutes(30.0); - RefreshDecay(true); + m_DecayDelay = TimeSpan.FromMinutes(30.0); + RefreshDecay(true); Timer.DelayCall( TimeSpan.Zero, new TimerCallback( CheckAddComponents ) ); } @@ -74,16 +80,16 @@ namespace Server.Multis { m_Items.Add( item ); - int zavg = Map.GetAverageZ(X + xOffset, Y + yOffset); + int zavg = Map.GetAverageZ(X + xOffset, Y + yOffset); item.MoveToWorld( new Point3D( X + xOffset, Y + yOffset, zavg + zOffset ), Map ); } public virtual void AddMobile( Mobile m, int wanderRange, int xOffset, int yOffset, int zOffset ) { - m_Mobiles.Add(m); + m_Mobiles.Add(m); - int zavg = Map.GetAverageZ(X + xOffset, Y + yOffset); - Point3D loc = new Point3D(X + xOffset, Y + yOffset, zavg + zOffset); + int zavg = Map.GetAverageZ(X + xOffset, Y + yOffset); + Point3D loc = new Point3D(X + xOffset, Y + yOffset, zavg + zOffset); BaseCreature bc = m as BaseCreature; if ( bc != null ) @@ -128,15 +134,15 @@ namespace Server.Multis for ( int i = 0; i < m_Items.Count; ++i ) m_Items[i].Delete(); - for ( int i = 0; i < m_Mobiles.Count; ++i ) - { - BaseCreature bc = (BaseCreature)m_Mobiles[i]; + for ( int i = 0; i < m_Mobiles.Count; ++i ) + { + BaseCreature bc = (BaseCreature)m_Mobiles[i]; - if ( bc.IsPrisoner == false ) - m_Mobiles[i].Delete(); - else if ( m_Mobiles[i].CantWalk == true ) - m_Mobiles[i].Delete(); - } + if ( bc.IsPrisoner == false ) + m_Mobiles[i].Delete(); + else if ( m_Mobiles[i].CantWalk == true ) + m_Mobiles[i].Delete(); + } m_Items.Clear(); m_Mobiles.Clear(); @@ -179,35 +185,33 @@ namespace Server.Multis } } - public class LockableBarrel : LockableContainer - { - [Constructable] - public LockableBarrel() - : base(0xE77) - { - Weight = 1.0; - } + public class LockableBarrel : LockableContainer + { + [Constructable] + public LockableBarrel() : base(0xE77) + { + Weight = 1.0; + } - public LockableBarrel(Serial serial) - : base(serial) - { - } + public LockableBarrel(Serial serial) : base(serial) + { + } - public override void Serialize(GenericWriter writer) - { - base.Serialize(writer); + public override void Serialize(GenericWriter writer) + { + base.Serialize(writer); - writer.Write((int)0); // version - } + writer.Write((int)0); // version + } - public override void Deserialize(GenericReader reader) - { - base.Deserialize(reader); + public override void Deserialize(GenericReader reader) + { + base.Deserialize(reader); - int version = reader.ReadInt(); + int version = reader.ReadInt(); - if (Weight == 8.0) - Weight = 1.0; - } - } + if (Weight == 8.0) + Weight = 1.0; + } + } } \ No newline at end of file diff --git a/Scripts/Multis/Camps/BrigandCamp.cs b/Scripts/Multis/Camps/BrigandCamp.cs index 4d4f739cf..d3b0a5f9b 100644 --- a/Scripts/Multis/Camps/BrigandCamp.cs +++ b/Scripts/Multis/Camps/BrigandCamp.cs @@ -24,11 +24,11 @@ namespace Server.Multis BaseCreature bc; //BaseEscortable be; - Visible = false; - DecayDelay = TimeSpan.FromMinutes( 5.0 ); + Visible = false; + DecayDelay = TimeSpan.FromMinutes( 5.0 ); - AddItem(new Static(0x10ee), 0, 0, 0); - AddItem(new Static(0xfac), 0, 7, 0); + AddItem(new Static(0x10ee), 0, 0, 0); + AddItem(new Static(0xfac), 0, 7, 0); switch ( Utility.Random( 3 ) ) { @@ -43,14 +43,14 @@ namespace Server.Multis AddItem( new Item( 0x1E95 ), 0, 7, 1 ); // Rabbit on a spit break; } - default: + default: { AddItem( new Item( 0x1E94 ), 0, 7, 1 ); // Chicken on a spit break; } } - AddCampChests(); + AddCampChests(); for ( int i = 0; i < 4; i ++ ) { @@ -60,7 +60,7 @@ namespace Server.Multis switch ( Utility.Random( 2 ) ) { case 0: m_Prisoner = new Noble(); break; - default: m_Prisoner = new SeekerOfAdventure(); break; + default: m_Prisoner = new SeekerOfAdventure(); break; } //be = (BaseEscortable)m_Prisoner; @@ -74,63 +74,63 @@ namespace Server.Multis AddMobile( m_Prisoner, 2, Utility.RandomMinMax( -2, 2 ), Utility.RandomMinMax( -2, 2 ), 0 ); } - private void AddCampChests() - { - LockableContainer chest = null; + private void AddCampChests() + { + LockableContainer chest = null; - switch (Utility.Random(3)) - { - case 0: chest = new MetalChest(); break; - case 1: chest = new MetalGoldenChest(); break; - default: chest = new WoodenChest(); break; - } + switch (Utility.Random(3)) + { + case 0: chest = new MetalChest(); break; + case 1: chest = new MetalGoldenChest(); break; + default: chest = new WoodenChest(); break; + } - chest.LiftOverride = true; + chest.LiftOverride = true; - TreasureMapChest.Fill(chest, 1); + TreasureMapChest.Fill(chest, 1); - AddItem(chest, -2, -2, 0); + AddItem(chest, -2, -2, 0); - LockableContainer crates = null; + LockableContainer crates = null; - switch (Utility.Random(4)) - { - case 0: crates = new SmallCrate(); break; - case 1: crates = new MediumCrate(); break; - case 2: crates = new LargeCrate(); break; - default: crates = new LockableBarrel(); break; - } + switch (Utility.Random(4)) + { + case 0: crates = new SmallCrate(); break; + case 1: crates = new MediumCrate(); break; + case 2: crates = new LargeCrate(); break; + default: crates = new LockableBarrel(); break; + } - crates.TrapType = TrapType.ExplosionTrap; - crates.TrapPower = Utility.RandomMinMax(30, 40); - crates.TrapLevel = 2; + crates.TrapType = TrapType.ExplosionTrap; + crates.TrapPower = Utility.RandomMinMax(30, 40); + crates.TrapLevel = 2; - crates.RequiredSkill = 76; - crates.LockLevel = 66; - crates.MaxLockLevel = 116; - crates.Locked = true; + crates.RequiredSkill = 76; + crates.LockLevel = 66; + crates.MaxLockLevel = 116; + crates.Locked = true; - crates.DropItem(new Gold(Utility.RandomMinMax(100, 400))); - crates.DropItem(new Arrow(10)); - crates.DropItem(new Bolt(10)); + crates.DropItem(new Gold(Utility.RandomMinMax(100, 400))); + crates.DropItem(new Arrow(10)); + crates.DropItem(new Bolt(10)); - crates.LiftOverride = true; + crates.LiftOverride = true; - if (Utility.RandomDouble() < 0.8) - { - switch (Utility.Random(4)) - { - case 0: crates.DropItem(new LesserCurePotion()); break; - case 1: crates.DropItem(new LesserExplosionPotion()); break; - case 2: crates.DropItem(new LesserHealPotion()); break; - default: crates.DropItem(new LesserPoisonPotion()); break; - } - } + if (Utility.RandomDouble() < 0.8) + { + switch (Utility.Random(4)) + { + case 0: crates.DropItem(new LesserCurePotion()); break; + case 1: crates.DropItem(new LesserExplosionPotion()); break; + case 2: crates.DropItem(new LesserHealPotion()); break; + default: crates.DropItem(new LesserPoisonPotion()); break; + } + } - AddItem(crates, 2, 2, 0); - } + AddItem(crates, 2, 2, 0); + } - // Don't refresh decay timer + // Don't refresh decay timer public override void OnEnter( Mobile m ) { if ( m.Player && m_Prisoner != null && m_Prisoner.CantWalk ) @@ -152,10 +152,10 @@ namespace Server.Multis } } - // Don't refresh decay timer - public override void OnExit(Mobile m) - { - } + // Don't refresh decay timer + public override void OnExit(Mobile m) + { + } public BrigandCamp( Serial serial ) : base( serial ) { diff --git a/Scripts/Multis/Camps/LizardmenCamp.cs b/Scripts/Multis/Camps/LizardmenCamp.cs index 480b9355b..719c55e56 100644 --- a/Scripts/Multis/Camps/LizardmenCamp.cs +++ b/Scripts/Multis/Camps/LizardmenCamp.cs @@ -5,7 +5,7 @@ using Server.Mobiles; namespace Server.Multis { - public class LizardmenCamp : BaseCamp + public class LizardmenCamp : BaseCamp { public virtual Mobile Lizardmen{ get{ return new Lizardman(); } } @@ -23,33 +23,33 @@ namespace Server.Multis BaseCreature bc; //BaseEscortable be; - Visible = false; - DecayDelay = TimeSpan.FromMinutes( 5.0 ); - AddItem(new Static(0x10ee), 0, 0, 0); - AddItem(new Static(0xfac), 0, 7, 0); + Visible = false; + DecayDelay = TimeSpan.FromMinutes( 5.0 ); + AddItem(new Static(0x10ee), 0, 0, 0); + AddItem(new Static(0xfac), 0, 7, 0); switch ( Utility.Random( 3 ) ) { case 0: { AddItem( new Item( 0xDE3 ), 0, 7, 0 ); // Campfire - AddItem( new Item( 0x974 ), 0, 7, 1); // Cauldron + AddItem( new Item( 0x974 ), 0, 7, 1); // Cauldron break; } case 1: { - AddItem( new Item( 0x1E95 ), 0, 7, 1); // Rabbit on a spit + AddItem( new Item( 0x1E95 ), 0, 7, 1); // Rabbit on a spit break; } - default: + default: { - AddItem( new Item( 0x1E94 ), 0, 7, 1); // Chicken on a spit + AddItem( new Item( 0x1E94 ), 0, 7, 1); // Chicken on a spit break; } } - AddItem(new Item(0x41F), 4, 4, 0); // Gruesome Standart South + AddItem(new Item(0x41F), 4, 4, 0); // Gruesome Standart South - AddCampChests(); + AddCampChests(); for ( int i = 0; i < 4; i ++ ) { @@ -59,7 +59,7 @@ namespace Server.Multis switch ( Utility.Random( 2 ) ) { case 0: m_Prisoner = new Noble(); break; - default: m_Prisoner = new SeekerOfAdventure(); break; + default: m_Prisoner = new SeekerOfAdventure(); break; } //be = (BaseEscortable)m_Prisoner; @@ -73,18 +73,18 @@ namespace Server.Multis AddMobile( m_Prisoner, 2, Utility.RandomMinMax( -2, 2 ), Utility.RandomMinMax( -2, 2 ), 0 ); } - private void AddCampChests() - { + private void AddCampChests() + { LockableContainer chest = null; switch ( Utility.Random( 3 ) ) { case 0: chest = new MetalChest(); break; case 1: chest = new MetalGoldenChest(); break; - default: chest = new WoodenChest(); break; + default: chest = new WoodenChest(); break; } - chest.LiftOverride = true; + chest.LiftOverride = true; TreasureMapChest.Fill( chest, 1 ); @@ -97,7 +97,7 @@ namespace Server.Multis case 0: crates = new SmallCrate(); break; case 1: crates = new MediumCrate(); break; case 2: crates = new LargeCrate(); break; - default: crates = new LockableBarrel(); break; + default: crates = new LockableBarrel(); break; } crates.TrapType = TrapType.ExplosionTrap; @@ -113,7 +113,7 @@ namespace Server.Multis crates.DropItem( new Arrow( 10 ) ); crates.DropItem( new Bolt( 10 ) ); - crates.LiftOverride = true; + crates.LiftOverride = true; if ( Utility.RandomDouble() < 0.8 ) { @@ -122,15 +122,15 @@ namespace Server.Multis case 0: crates.DropItem( new LesserCurePotion() ); break; case 1: crates.DropItem( new LesserExplosionPotion() ); break; case 2: crates.DropItem( new LesserHealPotion() ); break; - default: crates.DropItem(new LesserPoisonPotion()); break; + default: crates.DropItem(new LesserPoisonPotion()); break; } } AddItem( crates, -2, 2, 0 ); - } + } - // Don't refresh decay timer - public override void OnEnter(Mobile m) + // Don't refresh decay timer + public override void OnEnter(Mobile m) { if ( m.Player && m_Prisoner != null && m_Prisoner.CantWalk ) { @@ -145,16 +145,16 @@ namespace Server.Multis case 4: number = 502265; break; // Help! Please! case 5: number = 502266; break; // Aaah! Help me! case 6: number = 502267; break; // Go and get some help! - default: number = 502268; break; // Quickly, I beg thee! Unlock my chains! If thou dost look at me close thou canst see them. + default: number = 502268; break; // Quickly, I beg thee! Unlock my chains! If thou dost look at me close thou canst see them. } m_Prisoner.Yell( number ); } } - // Don't refresh decay timer - public override void OnExit(Mobile m) - { - } + // Don't refresh decay timer + public override void OnExit(Mobile m) + { + } public LizardmenCamp( Serial serial ) : base( serial ) { diff --git a/Scripts/Multis/Camps/OrcCamp.cs b/Scripts/Multis/Camps/OrcCamp.cs index d448d8599..da5262822 100644 --- a/Scripts/Multis/Camps/OrcCamp.cs +++ b/Scripts/Multis/Camps/OrcCamp.cs @@ -23,10 +23,10 @@ namespace Server.Multis BaseCreature bc; //BaseEscortable be; - Visible = false; - DecayDelay = TimeSpan.FromMinutes(5.0); - AddItem(new Static(0x10ee), 0, 0, 0); - AddItem(new Static(0xfac), 0, 7, 0); + Visible = false; + DecayDelay = TimeSpan.FromMinutes(5.0); + AddItem(new Static(0x10ee), 0, 0, 0); + AddItem(new Static(0xfac), 0, 7, 0); switch ( Utility.Random( 3 ) ) { @@ -41,15 +41,15 @@ namespace Server.Multis AddItem( new Item( 0x1E95 ), 0, 7, 1 ); // Rabbit on a spit break; } - default: + default: { AddItem( new Item( 0x1E94 ), 0, 7, 1 ); // Chicken on a spit break; } } - AddItem(new Item(0x428), -5, -4, 0); // Gruesome Standart West + AddItem(new Item(0x428), -5, -4, 0); // Gruesome Standart West - AddCampChests(); + AddCampChests(); for ( int i = 0; i < 3; i ++ ) { @@ -60,7 +60,7 @@ namespace Server.Multis switch ( Utility.Random( 2 ) ) { case 0: m_Prisoner = new Noble(); break; - default: m_Prisoner = new SeekerOfAdventure(); break; + default: m_Prisoner = new SeekerOfAdventure(); break; } //be = (BaseEscortable)m_Prisoner; @@ -74,64 +74,64 @@ namespace Server.Multis AddMobile( m_Prisoner, 2, Utility.RandomMinMax( -2, 2 ), Utility.RandomMinMax( -2, 2 ), 0 ); } - private void AddCampChests() - { - LockableContainer chest = null; + private void AddCampChests() + { + LockableContainer chest = null; - switch (Utility.Random(3)) - { - case 0: chest = new MetalChest(); break; - case 1: chest = new MetalGoldenChest(); break; - default: chest = new WoodenChest(); break; - } + switch (Utility.Random(3)) + { + case 0: chest = new MetalChest(); break; + case 1: chest = new MetalGoldenChest(); break; + default: chest = new WoodenChest(); break; + } - chest.LiftOverride = true; + chest.LiftOverride = true; - TreasureMapChest.Fill(chest, 1); + TreasureMapChest.Fill(chest, 1); - AddItem(chest, -2, 2, 0); + AddItem(chest, -2, 2, 0); - LockableContainer crates = null; + LockableContainer crates = null; - switch (Utility.Random(4)) - { - case 0: crates = new SmallCrate(); break; - case 1: crates = new MediumCrate(); break; - case 2: crates = new LargeCrate(); break; - default: crates = new LockableBarrel(); break; - } + switch (Utility.Random(4)) + { + case 0: crates = new SmallCrate(); break; + case 1: crates = new MediumCrate(); break; + case 2: crates = new LargeCrate(); break; + default: crates = new LockableBarrel(); break; + } - crates.TrapType = TrapType.ExplosionTrap; - crates.TrapPower = Utility.RandomMinMax(30, 40); - crates.TrapLevel = 2; + crates.TrapType = TrapType.ExplosionTrap; + crates.TrapPower = Utility.RandomMinMax(30, 40); + crates.TrapLevel = 2; - crates.RequiredSkill = 76; - crates.LockLevel = 66; - crates.MaxLockLevel = 116; - crates.Locked = true; + crates.RequiredSkill = 76; + crates.LockLevel = 66; + crates.MaxLockLevel = 116; + crates.Locked = true; - crates.DropItem(new Gold(Utility.RandomMinMax(100, 400))); - crates.DropItem(new Arrow(10)); - crates.DropItem(new Bolt(10)); + crates.DropItem(new Gold(Utility.RandomMinMax(100, 400))); + crates.DropItem(new Arrow(10)); + crates.DropItem(new Bolt(10)); - crates.LiftOverride = true; + crates.LiftOverride = true; - if (Utility.RandomDouble() < 0.8) - { - switch (Utility.Random(4)) - { - case 0: crates.DropItem(new LesserCurePotion()); break; - case 1: crates.DropItem(new LesserExplosionPotion()); break; - case 2: crates.DropItem(new LesserHealPotion()); break; - default: crates.DropItem(new LesserPoisonPotion()); break; - } - } + if (Utility.RandomDouble() < 0.8) + { + switch (Utility.Random(4)) + { + case 0: crates.DropItem(new LesserCurePotion()); break; + case 1: crates.DropItem(new LesserExplosionPotion()); break; + case 2: crates.DropItem(new LesserHealPotion()); break; + default: crates.DropItem(new LesserPoisonPotion()); break; + } + } - AddItem(crates, 2, -2, 0); - } + AddItem(crates, 2, -2, 0); + } - // Don't refresh decay timer - public override void OnEnter(Mobile m) + // Don't refresh decay timer + public override void OnEnter(Mobile m) { if ( m.Player && m_Prisoner != null && m_Prisoner.CantWalk ) { @@ -152,10 +152,10 @@ namespace Server.Multis } } - // Don't refresh decay timer - public override void OnExit(Mobile m) - { - } + // Don't refresh decay timer + public override void OnExit(Mobile m) + { + } public OrcCamp( Serial serial ) : base( serial ) { diff --git a/Scripts/Multis/Camps/RatCamp.cs b/Scripts/Multis/Camps/RatCamp.cs index 9278e4fe3..aa08169e6 100644 --- a/Scripts/Multis/Camps/RatCamp.cs +++ b/Scripts/Multis/Camps/RatCamp.cs @@ -23,10 +23,10 @@ namespace Server.Multis BaseCreature bc; //BaseEscortable be; - Visible = false; - DecayDelay = TimeSpan.FromMinutes(5.0); - AddItem(new Static(0x10ee), 0, 0, 0); - AddItem(new Static(0xfac), 0, 6, 0); + Visible = false; + DecayDelay = TimeSpan.FromMinutes(5.0); + AddItem(new Static(0x10ee), 0, 0, 0); + AddItem(new Static(0xfac), 0, 6, 0); switch ( Utility.Random( 3 ) ) { @@ -41,15 +41,15 @@ namespace Server.Multis AddItem( new Item( 0x1E95 ), 0, 6, 1 ); // Rabbit on a spit break; } - default: + default: { AddItem( new Item( 0x1E94 ), 0, 6, 1 ); // Chicken on a spit break; } } - AddItem(new Item(0x41F), 5, 5, 0); // Gruesome Standart South + AddItem(new Item(0x41F), 5, 5, 0); // Gruesome Standart South - AddCampChests(); + AddCampChests(); for ( int i = 0; i < 4; i ++ ) { @@ -59,7 +59,7 @@ namespace Server.Multis switch ( Utility.Random( 2 ) ) { case 0: m_Prisoner = new Noble(); break; - default: m_Prisoner = new SeekerOfAdventure(); break; + default: m_Prisoner = new SeekerOfAdventure(); break; } //be = (BaseEscortable)m_Prisoner; @@ -73,64 +73,64 @@ namespace Server.Multis AddMobile( m_Prisoner, 2, Utility.RandomMinMax( -2, 2 ), Utility.RandomMinMax( -2, 2 ), 0 ); } - private void AddCampChests() - { - LockableContainer chest = null; + private void AddCampChests() + { + LockableContainer chest = null; - switch (Utility.Random(3)) - { - case 0: chest = new MetalChest(); break; - case 1: chest = new MetalGoldenChest(); break; - default: chest = new WoodenChest(); break; - } + switch (Utility.Random(3)) + { + case 0: chest = new MetalChest(); break; + case 1: chest = new MetalGoldenChest(); break; + default: chest = new WoodenChest(); break; + } - chest.LiftOverride = true; + chest.LiftOverride = true; - TreasureMapChest.Fill(chest, 1); + TreasureMapChest.Fill(chest, 1); - AddItem(chest, -2, -2, 0); + AddItem(chest, -2, -2, 0); - LockableContainer crates = null; + LockableContainer crates = null; - switch (Utility.Random(4)) - { - case 0: crates = new SmallCrate(); break; - case 1: crates = new MediumCrate(); break; - case 2: crates = new LargeCrate(); break; - default: crates = new LockableBarrel(); break; - } + switch (Utility.Random(4)) + { + case 0: crates = new SmallCrate(); break; + case 1: crates = new MediumCrate(); break; + case 2: crates = new LargeCrate(); break; + default: crates = new LockableBarrel(); break; + } - crates.TrapType = TrapType.ExplosionTrap; - crates.TrapPower = Utility.RandomMinMax(30, 40); - crates.TrapLevel = 2; + crates.TrapType = TrapType.ExplosionTrap; + crates.TrapPower = Utility.RandomMinMax(30, 40); + crates.TrapLevel = 2; - crates.RequiredSkill = 76; - crates.LockLevel = 66; - crates.MaxLockLevel = 116; - crates.Locked = true; + crates.RequiredSkill = 76; + crates.LockLevel = 66; + crates.MaxLockLevel = 116; + crates.Locked = true; - crates.DropItem(new Gold(Utility.RandomMinMax(100, 400))); - crates.DropItem(new Arrow(10)); - crates.DropItem(new Bolt(10)); + crates.DropItem(new Gold(Utility.RandomMinMax(100, 400))); + crates.DropItem(new Arrow(10)); + crates.DropItem(new Bolt(10)); - crates.LiftOverride = true; + crates.LiftOverride = true; - if (Utility.RandomDouble() < 0.8) - { - switch (Utility.Random(4)) - { - case 0: crates.DropItem(new LesserCurePotion()); break; - case 1: crates.DropItem(new LesserExplosionPotion()); break; - case 2: crates.DropItem(new LesserHealPotion()); break; - default: crates.DropItem(new LesserPoisonPotion()); break; - } - } + if (Utility.RandomDouble() < 0.8) + { + switch (Utility.Random(4)) + { + case 0: crates.DropItem(new LesserCurePotion()); break; + case 1: crates.DropItem(new LesserExplosionPotion()); break; + case 2: crates.DropItem(new LesserHealPotion()); break; + default: crates.DropItem(new LesserPoisonPotion()); break; + } + } - AddItem(crates, 2, 2, 0); - } + AddItem(crates, 2, 2, 0); + } - // Don't refresh decay timer - public override void OnEnter(Mobile m) + // Don't refresh decay timer + public override void OnEnter(Mobile m) { if ( m.Player && m_Prisoner != null && m_Prisoner.CantWalk ) { @@ -145,16 +145,16 @@ namespace Server.Multis case 4: number = 502265; break; // Help! Please! case 5: number = 502266; break; // Aaah! Help me! case 6: number = 502267; break; // Go and get some help! - default: number = 502268; break; // Quickly, I beg thee! Unlock my chains! If thou dost look at me close thou canst see them. + default: number = 502268; break; // Quickly, I beg thee! Unlock my chains! If thou dost look at me close thou canst see them. } m_Prisoner.Yell( number ); } } - // Don't refresh decay timer - public override void OnExit(Mobile m) - { - } + // Don't refresh decay timer + public override void OnExit(Mobile m) + { + } public RatCamp( Serial serial ) : base( serial ) { diff --git a/Scripts/Spells/Necromancy/MindRot.cs b/Scripts/Spells/Necromancy/MindRot.cs index b2ada7a94..e8dfb5777 100644 --- a/Scripts/Spells/Necromancy/MindRot.cs +++ b/Scripts/Spells/Necromancy/MindRot.cs @@ -133,38 +133,38 @@ namespace Server.Spells.Necromancy } public class MRExpireTimer : Timer - { - private Mobile m_Caster; - private Mobile m_Target; - private DateTime m_End; - - public MRExpireTimer( Mobile caster, Mobile target, TimeSpan delay ) : base( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.0 ) ) - { - m_Caster = caster; - m_Target = target; - m_End = DateTime.Now + delay; - Priority = TimerPriority.TwoFiftyMS; - } - - public void RenewDelay(TimeSpan delay) - { - m_End = DateTime.Now + delay; - } + { + private Mobile m_Caster; + private Mobile m_Target; + private DateTime m_End; - public void Halt() - { - Stop(); - } + public MRExpireTimer( Mobile caster, Mobile target, TimeSpan delay ) : base( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.0 ) ) + { + m_Caster = caster; + m_Target = target; + m_End = DateTime.Now + delay; + Priority = TimerPriority.TwoFiftyMS; + } + + public void RenewDelay(TimeSpan delay) + { + m_End = DateTime.Now + delay; + } - protected override void OnTick() - { - if ( m_Target.Deleted || !m_Target.Alive || DateTime.Now >= m_End ) - { - MindRotSpell.ClearMindRotScalar( m_Target ); - Stop(); - } - } - } + public void Halt() + { + Stop(); + } + + protected override void OnTick() + { + if ( m_Target.Deleted || !m_Target.Alive || DateTime.Now >= m_End ) + { + MindRotSpell.ClearMindRotScalar( m_Target ); + Stop(); + } + } + } public class MRBucket { diff --git a/Scripts/Spells/Spellweaving/EssenceOfWind.cs b/Scripts/Spells/Spellweaving/EssenceOfWind.cs index 7667c41e2..feb3aa14e 100644 --- a/Scripts/Spells/Spellweaving/EssenceOfWind.cs +++ b/Scripts/Spells/Spellweaving/EssenceOfWind.cs @@ -6,17 +6,14 @@ namespace Server.Spells.Spellweaving { public class EssenceOfWindSpell : ArcanistSpell { - private static SpellInfo m_Info = new SpellInfo( - "Essence of Wind", "Anathrae", - -1 - ); + private static SpellInfo m_Info = new SpellInfo( "Essence of Wind", "Anathrae", -1 ); public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 3.0 ); } } - public override double RequiredSkill { get { return 52.0; } } - public override int RequiredMana { get { return 40; } } + public override double RequiredSkill { get { return 52.0; } } + public override int RequiredMana { get { return 40; } } - public EssenceOfWindSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info ) + public EssenceOfWindSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info ) { } diff --git a/Scripts/Spells/Spellweaving/Items/ArcaneFocus.cs b/Scripts/Spells/Spellweaving/Items/ArcaneFocus.cs index 46fafe4c2..6c1e62265 100644 --- a/Scripts/Spells/Spellweaving/Items/ArcaneFocus.cs +++ b/Scripts/Spells/Spellweaving/Items/ArcaneFocus.cs @@ -3,53 +3,53 @@ using Server; namespace Server.Items { - public class ArcaneFocus : TransientItem - { - public override int LabelNumber { get { return 1032629; } } // Arcane Focus + public class ArcaneFocus : TransientItem + { + public override int LabelNumber { get { return 1032629; } } // Arcane Focus - private int m_StrengthBonus; + private int m_StrengthBonus; - [CommandProperty( AccessLevel.GameMaster )] - public int StrengthBonus - { - get { return m_StrengthBonus; } - set { m_StrengthBonus = value; } - } + [CommandProperty( AccessLevel.GameMaster )] + public int StrengthBonus + { + get { return m_StrengthBonus; } + set { m_StrengthBonus = value; } + } - public ArcaneFocus( TimeSpan lifeSpan, int strengthBonus ) : base( 0x3155, lifeSpan ) - { - LootType = LootType.Blessed; - m_StrengthBonus = strengthBonus; - } + public ArcaneFocus( TimeSpan lifeSpan, int strengthBonus ) : base( 0x3155, lifeSpan ) + { + LootType = LootType.Blessed; + m_StrengthBonus = strengthBonus; + } - public ArcaneFocus( Serial serial ) : base( serial ) - { - } - - public override void GetProperties( ObjectPropertyList list ) - { - base.GetProperties( list ); + public ArcaneFocus( Serial serial ) : base( serial ) + { + } + + public override void GetProperties( ObjectPropertyList list ) + { + base.GetProperties( list ); - list.Add( 1060485, m_StrengthBonus.ToString() ); // strength bonus ~1_val~ - } + list.Add( 1060485, m_StrengthBonus.ToString() ); // strength bonus ~1_val~ + } public override TextDefinition InvalidTransferMessage{ get { return 1073480; } } // Your arcane focus disappears. public override bool Nontransferable { get { return true; } } - public override void Serialize( GenericWriter writer ) - { - base.Serialize( writer ); - writer.Write( (int)0 ); + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + writer.Write( (int)0 ); - writer.Write( m_StrengthBonus ); - } + writer.Write( m_StrengthBonus ); + } - public override void Deserialize( GenericReader reader ) - { - base.Deserialize( reader ); - int version = reader.ReadInt(); + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + int version = reader.ReadInt(); - m_StrengthBonus = reader.ReadInt(); - } - } + m_StrengthBonus = reader.ReadInt(); + } + } } \ No newline at end of file diff --git a/Scripts/Spells/Spellweaving/ReaperForm.cs b/Scripts/Spells/Spellweaving/ReaperForm.cs index b8a3719a1..6d4e422ab 100644 --- a/Scripts/Spells/Spellweaving/ReaperForm.cs +++ b/Scripts/Spells/Spellweaving/ReaperForm.cs @@ -5,10 +5,7 @@ namespace Server.Spells.Spellweaving { public class ReaperFormSpell : ArcaneForm { - private static SpellInfo m_Info = new SpellInfo( - "Reaper Form", "Tarisstree", - -1 - ); + private static SpellInfo m_Info = new SpellInfo( "Reaper Form", "Tarisstree", -1 ); public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 2.5 ); } } @@ -25,8 +22,8 @@ namespace Server.Spells.Spellweaving e.Mobile.Send( SpeedControl.WalkSpeed ); } - public override double RequiredSkill { get { return 24.0; } } - public override int RequiredMana { get { return 34; } } + public override double RequiredSkill { get { return 24.0; } } + public override int RequiredMana { get { return 34; } } public override int Body { get { return 0x11D; } } @@ -39,7 +36,7 @@ namespace Server.Spells.Spellweaving public virtual int SwingSpeedBonus { get { return 10 + FocusLevel; } } public virtual int SpellDamageBonus { get { return 10 + FocusLevel; } } - public ReaperFormSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info ) + public ReaperFormSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info ) { } diff --git a/Scripts/Spells/Spellweaving/WordOfDeath.cs b/Scripts/Spells/Spellweaving/WordOfDeath.cs index 85f63bdf6..1380c1951 100644 --- a/Scripts/Spells/Spellweaving/WordOfDeath.cs +++ b/Scripts/Spells/Spellweaving/WordOfDeath.cs @@ -6,17 +6,14 @@ namespace Server.Spells.Spellweaving { public class WordOfDeathSpell : ArcanistSpell { - private static SpellInfo m_Info = new SpellInfo( - "Word of Death", "Nyraxle", - -1 - ); + private static SpellInfo m_Info = new SpellInfo( "Word of Death", "Nyraxle", -1 ); public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 3.5 ); } } - public override double RequiredSkill { get { return 80.0; } } - public override int RequiredMana { get { return 50; } } + public override double RequiredSkill { get { return 80.0; } } + public override int RequiredMana { get { return 50; } } - public WordOfDeathSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info ) + public WordOfDeathSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info ) { }