public PParty_Decline(Mobile req) : base(0xbf, "Party Join Decline") { base.m_Stream.Write((short) 6); base.m_Stream.Write((byte) 9); base.m_Stream.Write(req.Serial); }
public PEquipItem(Item toEquip, Mobile target) : base(0x13, "Equip Item", 10) { base.m_Stream.Write(toEquip.Serial); base.m_Stream.Write(Map.GetQuality(toEquip.ID & 0x3fff)); base.m_Stream.Write(target.Serial); }
public GDamageLabel(int damage, Mobile m) : base(damage.ToString(), Engine.DefaultFont, Hues.Load(m.Flags[MobileFlag.Poisoned] ? 0x3f : 0x26), m.ScreenX, m.ScreenY - 30) { this.m_Mobile = m; this.m_Sync = new TimeSync(0.75); this.UpdatePosition(); }
public PParty_Accept(Mobile req) : base(0xbf, "Party Join Accept") { base.m_Stream.Write((short) 6); base.m_Stream.Write((byte) 8); base.m_Stream.Write(req.Serial); }
public GPaperdollItem(int X, int Y, int GumpID, int Serial, IHue Hue, int Layer, Mobile owner, bool canDrag) : base(X, Y) { this.m_fAlpha = 1f; this.m_GumpID = GumpID; this.m_Serial = Serial; this.m_Hue = Hue; this.m_Layer = Layer; this.m_Item = World.FindItem(this.m_Serial); if ((this.m_Item != null) && Engine.Features.AOS) { base.Tooltip = new ItemTooltip(this.m_Item); } this.m_Image = this.m_Hue.GetGump(this.m_GumpID); if ((this.m_Image != null) && !this.m_Image.IsEmpty()) { this.m_Width = this.m_Image.Width; this.m_Height = this.m_Image.Height; this.m_Draw = this.m_Item != null; } else { this.m_Width = 0; this.m_Height = 0; this.m_Draw = false; } base.m_ITranslucent = true; this.m_ValidDrag = (((canDrag && (this.m_Layer >= 1)) && ((this.m_Layer <= 0x18) && (this.m_Layer != 11))) && (this.m_Layer != 0x10)) && (this.m_Layer != 0x15); base.m_CanDrag = true; base.m_QuickDrag = (((this.m_Layer < 1) || (this.m_Layer > 0x18)) || (this.m_Layer == 11)) || (this.m_Layer == 0x10); }
public GProfileScroll(Mobile m) : base(0x7d2, 0x18, 0xc3) { this.m_Mobile = m; base.m_Tooltip = new Tooltip(Strings.GetString("Tooltips.ProfileScroll")); base.m_CanDrag = true; base.m_QuickDrag = false; }
public PParty_PrivateMessage(Mobile who, string text) : base(0xbf, "Private Party Message") { base.m_Stream.Write((short) 6); base.m_Stream.Write((byte) 3); base.m_Stream.Write(who.Serial); base.m_Stream.WriteUnicode(text); base.m_Stream.Write((short) 0); }
public PVirtueTrigger(Mobile m) : base(0xb1, "Virtue Trigger") { base.m_Stream.Write(World.Serial); base.m_Stream.Write(0x1cd); base.m_Stream.Write(1); base.m_Stream.Write(1); base.m_Stream.Write(m.Serial); }
public static string GetMobilePath(Mobile mob) { string serverName = Engine.m_ServerName; if (serverName == null) { serverName = ""; } int num = serverName.GetHashCode() ^ mob.Serial; return num.ToString("X8"); }
public static MobileCell Instantiate(Mobile m) { if (m_InstancePool.Count > 0) { MobileCell cell = (MobileCell) m_InstancePool.Dequeue(); cell.m_Mobile = m; cell.m_Z = (sbyte) m.Z; return cell; } return new MobileCell(m); }
public GPartyHealthBar(Mobile m, int x, int y) : base(x, y) { base.m_CanDrag = true; base.m_QuickDrag = true; base.m_CanDrop = true; this.m_Mobile = m; this.m_Name = new GLabel("", Engine.GetUniFont(0), m.Visible ? Hues.GetNotoriety(m.Notoriety) : Hues.Grayscale, 4, 4); this.SetName(m.Name); base.m_Children.Add(this.m_Name); }
public GCharacterProfile(Mobile owner, string header, string body, string footer) : base(0x13c2, 100, 100, 0x19, 0x19, true) { string gUID = string.Format("Profile-{0}", owner.Serial); Gump g = Gumps.FindGumpByGUID(gUID); if (g != null) { base.m_IsDragging = g.m_IsDragging; base.m_OffsetX = g.m_OffsetX; base.m_OffsetY = g.m_OffsetY; if (Gumps.Drag == g) { Gumps.Drag = this; } if (Gumps.LastOver == g) { Gumps.LastOver = this; } if (Gumps.Focus == g) { Gumps.Focus = this; } base.m_X = g.X; base.m_Y = g.Y; Gumps.Destroy(g); } base.m_GUID = gUID; base.m_CanDrag = true; base.m_QuickDrag = true; base.CanClose = true; Gump toAdd = this.CreateLabel(header, false); Gump gump3 = this.CreateLabel(body, true); Gump gump4 = this.CreateLabel(footer, false); toAdd.X = base.OffsetX; toAdd.Y = base.OffsetY; gump3.X = toAdd.X; gump3.Y = toAdd.Y + toAdd.Height; gump4.X = gump3.X; gump4.Y = gump3.Y + gump3.Height; this.Height = (((this.Height - base.UseHeight) + toAdd.Height) + gump3.Height) + gump4.Height; this.Width = toAdd.Width; if (gump3.Width > this.Width) { this.Width = gump3.Width; } if (gump4.Width > this.Width) { this.Width = gump4.Width; } this.Width += this.Width - base.UseWidth; base.m_Children.Add(toAdd); base.m_Children.Add(gump3); base.m_Children.Add(gump4); }
public GHealthBar(Mobile m, int X, int Y) : base(m.Player ? (m.Flags[MobileFlag.Warmode] ? 0x807 : 0x803) : 0x804, X, Y) { this.m_xName = ""; this.m_Mobile = m; base.m_CanDrop = true; base.m_QuickDrag = false; this.m_Player = m.Player; if (!this.m_Player) { base.Hue = Hues.GetNotoriety(m.Notoriety); } if (Engine.Features.AOS) { base.Tooltip = new MobileTooltip(m); } if (this.m_Player) { this.m_HP = new GImageClip(this.GetHealthGumpID(m.Flags), 0x22, 12, m.HPCur, m.HPMax); this.m_Mana = new GImageClip(0x806, 0x22, 0x19, m.ManaCur, m.ManaMax); this.m_Stam = new GImageClip(0x806, 0x22, 0x26, m.StamCur, m.StamMax); base.m_Children.Add(new GImage(0x805, 0x22, 12)); base.m_Children.Add(new GImage(0x805, 0x22, 0x19)); base.m_Children.Add(new GImage(0x805, 0x22, 0x26)); base.m_Children.Add(this.m_HP); base.m_Children.Add(this.m_Mana); base.m_Children.Add(this.m_Stam); this.m_xHPCur = m.HPCur; this.m_xHPMax = m.HPMax; this.m_xStamCur = m.StamCur; this.m_xStamMax = m.StamMax; this.m_xManaCur = m.ManaCur; this.m_xManaMax = m.ManaMax; this.m_xFlags = m.Flags.Clone(); } else { this.m_Name = new GLabel(m.Name, Engine.GetFont(1), Hues.Load(0x455), 0x10, 0); this.m_Name.Y = 11 + ((0x18 - this.m_Name.Height) / 2); this.m_Name.Scissor(0, 0, 0x7a, this.m_Name.Height); this.m_HP = new GImageClip(this.GetHealthGumpID(m.Flags), 0x22, 0x26, m.HPCur, m.HPMax); base.m_Children.Add(new GImage(0x805, 0x22, 0x26)); base.m_Children.Add(this.m_Name); base.m_Children.Add(this.m_HP); this.m_xName = m.Name; this.m_xHPCur = m.HPCur; this.m_xHPMax = m.HPMax; this.m_xFlags = m.Flags.Clone(); } }
public static MiniHealthEntry PoolInstance(int x, int y, Mobile m) { if (m_Pool == null) { m_Pool = new Queue(); } if (m_Pool.Count > 0) { MiniHealthEntry entry = (MiniHealthEntry) m_Pool.Dequeue(); entry.m_X = x; entry.m_Y = y; entry.m_Mobile = m; return entry; } return new MiniHealthEntry(x, y, m); }
public GRadar() : base(0x19, 0x19) { m_Open = true; this.m_Width = 260; this.m_Height = 260; base.m_Children.Add(new GVResizer(this)); base.m_Children.Add(new GHResizer(this)); base.m_Children.Add(new GLResizer(this)); base.m_Children.Add(new GTResizer(this)); base.m_Children.Add(new GHVResizer(this)); base.m_Children.Add(new GLTResizer(this)); base.m_Children.Add(new GHTResizer(this)); base.m_Children.Add(new GLVResizer(this)); base.m_CanDrag = true; base.m_QuickDrag = false; m_FocusMob = null; }
public GCriminalAttackQuery(Mobile m) : base("This may flag\nyou criminal!", true, null) { this.m_Mobile = m; }
public GPaperdoll(Mobile m, int ID, int X, int Y) : base(ID, X, Y) { this.m_Mobile = m; base.m_CanDrop = true; }
public LightningEffect(Mobile Source, IHue Hue) : this(Hue) { base.SetSource(Source); }
public static void AddTarget(Mobile who, TargetAction action) { m_AutoTarget.Add(new AutoTargetSession(who, action)); }
public static void ShowAcctLogin() { Cursor.Gold = false; m_LastAttacker = null; Renderer.AlwaysHighlight = 0; World.CharData.Save(); World.CharData = null; m_WalkStack = new Stack(); m_WalkStack.Push(-1163005939); m_WalkStack.Push(-1163005939); m_WalkStack.Push(-1163005939); m_WalkStack.Push(-1163005939); m_WalkStack.Push(-1163005939); m_GMPrivs = false; SaveJournal(); m_Journal.Clear(); Renderer.DrawFPS = false; m_Ingame = false; m_WalkAck = 0; m_WalkReq = 0; Macros.StopAll(); World.Clear(); Cursor.Hourglass = false; m_QuickLogin = false; m_TargetHandler = null; Gumps.Desktop.Children.Clear(); Benchmark benchmark = new Benchmark(7); benchmark.Start(); xGumps.Display("AccountLogin"); benchmark.StopNoLog(); Debug.Trace("Display( \"AccountLogin\" ) -> {0}", Benchmark.Format(benchmark.Elapsed)); benchmark.Start(); Gump child = BuildSmartLoginMenu(); xGumps.AddGumpTo("AccountLogin", child); xGumps.AddGumpTo("AccountLogin", new GQuickLogin()); benchmark.StopNoLog(); Debug.Trace("AddGumpTo( \"AccountLogin\" ) -> {0}", Benchmark.Format(benchmark.Elapsed)); if (!m_FirstAcctLogin) { PlayRandomMidi(); } while ((child != null) && (child != Gumps.Desktop)) { child.m_NonRestrictivePicking = true; child = child.Parent; } m_FirstAcctLogin = false; }
public int ConvertAction(int BodyID, int Serial, int X, int Y, int Direction, GenericAction g, Mobile m) { this.Translate(ref BodyID); BodyType bodyType = this.GetBodyType(BodyID); this.m_SA_Body = BodyID; this.m_SA_Dir = Direction; if (bodyType == BodyType.Monster) { switch (g) { case GenericAction.Die: return this.SafeAction(2 + ((Direction >> 7) & 1), 2, 3); case GenericAction.MountedWalk: return 0; case GenericAction.MountedRun: return 0; case GenericAction.Walk: return 0; case GenericAction.Run: return 0; case GenericAction.MountedStand: return 1; case GenericAction.Stand: return 1; } } else if ((bodyType == BodyType.Animal) || (bodyType == BodyType.Sea)) { switch (g) { case GenericAction.Die: return this.SafeAction(8 + (((Direction >> 7) & 1) * 4), 8, 12); case GenericAction.MountedWalk: return 0; case GenericAction.MountedRun: return this.SafeAction(1, 0); case GenericAction.Walk: return 0; case GenericAction.Run: return this.SafeAction(1, 0); case GenericAction.MountedStand: return 2; case GenericAction.Stand: return 2; } } else { switch (bodyType) { case BodyType.Human: case BodyType.Equipment: switch (g) { case GenericAction.Die: return this.SafeAction(0x15 + ((Direction >> 7) & 1), 0x15, 0x16); case GenericAction.MountedWalk: return 0x17; case GenericAction.MountedRun: return 0x18; case GenericAction.Walk: if ((m == null) || !m.Warmode) { if (m.UsingTwoHandedWeapon()) { return this.SafeAction(1, 0); } return this.SafeAction(0, 1, 15); } return this.SafeAction(15, m.UsingTwoHandedWeapon() ? 1 : 0, 0); case GenericAction.Run: if ((m == null) || !m.UsingTwoHandedWeapon()) { return this.SafeAction(2, 3); } return this.SafeAction(3, 2); case GenericAction.MountedStand: return 0x19; case GenericAction.Stand: if ((m == null) || !m.Warmode) { return this.SafeAction(4, 7, 8); } if (!m.UsingTwoHandedWeapon()) { return this.SafeAction(7, 8, 4); } return this.SafeAction(8, 7, 4); } break; } } return 0; }
public static void Main(string[] Args) { int num3; m_IniPath = Path.Combine(Application.StartupPath, "Data/Config/Client.ini"); ParseArgs(Args); m_FileManager = new Client.FileManager(); if (m_FileManager.Error) { m_FileManager = null; GC.Collect(); } else { AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(Engine.Exception_Unhandled); long frequency = 0L; QueryPerformanceFrequency(ref frequency); double num2 = frequency; m_QPF = num2 / 1000.0; WantDirectory("Data/Config/"); Debug.Trace("Entered Main()"); Debug.Block("Environment"); Debug.Trace("Operating System = '{0}'", Environment.OSVersion); Debug.Trace(".NET Framework = '{0}'", Environment.Version); Debug.Trace("Base Directory = '{0}'", m_FileManager.BasePath("")); Debug.Trace("Data Directory = '{0}'", m_FileManager.ResolveMUL("")); Debug.EndBlock(); Debug.Try("Setting up interop communications"); Interop.Comm = new ExposerInterop(); Debug.EndTry(); Debug.Try("Initializing Strings"); Strings.Initialize(); Debug.EndTry(); Benchmark benchmark = new Benchmark(6); Debug.Trace("Benchmarks: {0} resolution", "low"); benchmark = null; m_Timers = new ArrayList(); m_Plugins = new ArrayList(); m_WalkTimeout = new ArrayList(); m_Journal = new ArrayList(); m_Doors = new ArrayList(); m_Pings = new Queue(); m_LoadQueue = new Queue(); m_MapLoadQueue = new Queue(); WantDirectory("Data/Logs/"); Debug.Block("Main()"); if (m_OverrideServHost != null) { NewConfig.ServerHost = m_OverrideServHost; } if (m_OverrideServPort != -1) { NewConfig.ServerPort = m_OverrideServPort; } switch (NewConfig.GameSize.ToLower().Trim()) { case "320x240": GameWidth = 320; GameHeight = 240; num3 = 3; goto Label_02E0; case "640x480": GameWidth = 640; GameHeight = 480; num3 = 5; goto Label_02E0; case "800x600": GameWidth = 800; GameHeight = 600; num3 = 7; goto Label_02E0; case "1024x768": GameWidth = 0x400; GameHeight = 0x300; num3 = 7; goto Label_02E0; case "1280x1024": GameWidth = 0x500; GameHeight = 0x400; num3 = 9; goto Label_02E0; case "1600x1200": GameWidth = 0x640; GameHeight = 0x4b0; num3 = 11; goto Label_02E0; } MessageBox.Show(string.Format("A invalid game size of '{0}' was specified in Client.cfg. Valid sizes are: '320x240' '640x480' '800x600' '1024x768' '1280x1024' '1600x1200'", NewConfig.GameSize)); } return; Label_02E0:; string[] strArray = NewConfig.ScreenSize.ToLower().Trim().Split(new char[] { 'x' }); int num4 = -1; int num5 = -1; if (strArray.Length == 2) { num4 = num5 = 0; try { num4 = int.Parse(strArray[0]); num5 = int.Parse(strArray[1]); } catch { } } if ((num4 >= 320) && (num5 >= 240)) { ScreenWidth = num4; ScreenHeight = num5; } else { MessageBox.Show(string.Format("A invalid screen size of '{0}' was specified in Client.cfg. Make sure the value is formatted correctly ('<Width>x<Height>'), and that it is 320x240 or higher.", NewConfig.ScreenSize)); } GameX = (ScreenWidth - GameWidth) / 2; GameY = (ScreenHeight - GameHeight) / 2; Renderer.blockWidth = num3; Renderer.blockHeight = num3; Renderer.cellWidth = num3 << 3; Renderer.cellHeight = num3 << 3; m_ClickTimer = new Timer(new OnTick(Engine.ClickTimer_OnTick), SystemInformation.DoubleClickTime); Debug.Try("Initializing Display"); m_Display = new Display(); if (NewConfig.FullScreen) { m_Display.FormBorderStyle = FormBorderStyle.None; m_Display.WindowState = FormWindowState.Maximized; } m_Display.ClientSize = new Size(ScreenWidth, ScreenHeight); m_Display.KeyPreview = true; m_Display.Show(); Debug.EndTry(); Application.DoEvents(); Debug.Block("Initializing DirectX"); InitDX(); Debug.EndBlock(); m_Loading = true; m_Ingame = false; DrawNow(); Benchmark benchmark2 = new Benchmark(7); benchmark2.Start(); Debug.TimeBlock("Initializing Animations"); m_Animations = new Animations(); Debug.EndBlock(); m_Font = new Font[10]; m_UniFont = new UnicodeFont[3]; Debug.TimeBlock("Initializing Gumps"); m_Gumps = new Gumps(); Debug.EndBlock(); m_DefaultFont = GetUniFont(3); m_DefaultHue = Hues.Load(0x3b2); Renderer.SetText(""); Debug.TimeBlock("Initializing Plugins"); FindPlugins(); Debug.EndBlock(); Macros.Load(); LoadParticles(); Renderer.SetAlphaEnable(true); Renderer.SetFilterEnable(false); Renderer.AlphaTestEnable = true; Renderer.SetTexture(m_Halo); try { m_Device.ValidateDevice(); } catch (Exception exception) { m_Halo.Dispose(); m_Halo = Hues.Default.GetGump(0x71); m_Rain.Dispose(); m_Rain = Texture.Empty; m_SkillUp.Dispose(); m_SkillUp = Hues.Default.GetGump(0x983); m_SkillDown.Dispose(); m_SkillDown = Hues.Default.GetGump(0x985); m_SkillLocked.Dispose(); m_SkillLocked = Hues.Default.GetGump(0x82c); m_Slider.Dispose(); m_Slider = Hues.Default.GetGump(0x845); for (int i = 0; i < m_Snow.Length; i++) { m_Snow[i].Dispose(); m_Snow[i] = Texture.Empty; } for (int j = 0; j < m_Edge.Length; j++) { m_Edge[j].Dispose(); m_Edge[j] = Texture.Empty; } Debug.Trace("ValidateDevice() failed on 32-bit textures"); Debug.Error(exception); } Renderer.SetTexture(null); Renderer.SetAlphaEnable(false); m_Effects = new Client.Effects(); m_Loading = false; Point point = m_Display.PointToClient(Cursor.Position); m_EventOk = true; MouseMove(m_Display, new MouseEventArgs(Control.MouseButtons, 0, point.X, point.Y, 0)); Network.CheckCache(); ShowAcctLogin(); MouseMoveQueue(); m_EventOk = false; DrawNow(); benchmark2.StopNoLog(); Debug.Trace("Total -> {0}", Benchmark.Format(benchmark2.Elapsed)); m_MoveDelay = new TimeDelay(0f); m_LastOverCheck = new TimeDelay(0.1f); m_NewFrame = new TimeDelay(0.05f); m_SleepMode = new TimeDelay(7.5f); m_EventOk = true; PlayRandomMidi(); bool flag = false; new Timer(new OnTick(Engine.Evict_OnTick), 0x9c4).Start(false); Animations.StartLoading(); Unlock(); DateTime now = DateTime.Now; int num10 = Ticks + 0x1388; bool extendProtocol = NewConfig.ExtendProtocol; while (!exiting) { m_SetTicks = false; int ticks = Ticks; Macros.Slice(); if (Gumps.Invalidated) { if (m_LastMouseArgs != null) { MouseMove(m_Display, m_LastMouseArgs); } Gumps.Invalidated = false; } if (m_MouseMoved) { MouseMoveQueue(); } if (m_NewFrame.ElapsedReset()) { Renderer.m_Frames++; m_Redraw = false; Renderer.Draw(); } else if ((m_Redraw || m_PumpFPS) || (m_Quake || (amMoving && IsMoving()))) { m_Redraw = false; Renderer.Draw(); } if ((extendProtocol && m_Ingame) && ((Party.State == PartyState.Joined) && (DateTime.Now >= now))) { now = DateTime.Now + TimeSpan.FromSeconds(0.5); for (int k = 0; k < Party.Members.Length; k++) { Mobile mobile = Party.Members[k]; if (((mobile != null) && !mobile.Player) && !mobile.Visible) { Network.Send(new PPE_QueryPartyLocs()); break; } } } Thread.Sleep(1); if (GetQueueStatus(0xff) != 0) { Application.DoEvents(); } UOAM.Slice(); if (!Network.Slice()) { flag = true; break; } Network.Flush(); TickTimers(); if (amMoving && m_Ingame) { DoWalk(movingDir, false); } if (m_LoadQueue.Count > 0) { for (int m = 0; (m_LoadQueue.Count > 0) && (m < 6); m++) { ((ILoader) m_LoadQueue.Dequeue()).Load(); } } if (m_MapLoadQueue.Count > 0) { Preload((Worker) m_MapLoadQueue.Dequeue()); } } NewConfig.Save(); SaveJournal(); Thread.Sleep(5); if ((m_Display != null) && !m_Display.IsDisposed) { m_Display.Hide(); } Thread.Sleep(5); Application.DoEvents(); Thread.Sleep(5); Application.DoEvents(); m_Animations.Dispose(); if (m_ItemArt != null) { m_ItemArt.Dispose(); } if (m_LandArt != null) { m_LandArt.Dispose(); } if (m_TextureArt != null) { m_TextureArt.Dispose(); } m_Gumps.Dispose(); if (m_Sounds != null) { m_Sounds.Dispose(); } if (m_Multis != null) { m_Multis.Dispose(); } m_FileManager.Dispose(); Cursor.Dispose(); Music.Dispose(); Hues.Dispose(); GRadar.Dispose(); if (m_Plugins != null) { m_Plugins.Clear(); m_Plugins = null; } if (m_Rain != null) { m_Rain.Dispose(); m_Rain = null; } if (m_Slider != null) { m_Slider.Dispose(); m_Slider = null; } if (m_SkillUp != null) { m_SkillUp.Dispose(); m_SkillUp = null; } if (m_SkillDown != null) { m_SkillDown.Dispose(); m_SkillDown = null; } if (m_SkillLocked != null) { m_SkillLocked.Dispose(); m_SkillLocked = null; } if (m_Snow != null) { for (int n = 0; n < 12; n++) { if (m_Snow[n] != null) { m_Snow[n].Dispose(); m_Snow[n] = null; } } m_Snow = null; } if (m_Edge != null) { for (int num13 = 0; num13 < 8; num13++) { if (m_Edge[num13] != null) { m_Edge[num13].Dispose(); m_Edge[num13] = null; } } m_Edge = null; } if (m_WinScrolls != null) { for (int num14 = 0; num14 < m_WinScrolls.Length; num14++) { if (m_WinScrolls[num14] != null) { m_WinScrolls[num14].Dispose(); m_WinScrolls[num14] = null; } } m_WinScrolls = null; } if (m_Halo != null) { m_Halo.Dispose(); m_Halo = null; } if (m_Friend != null) { m_Friend.Dispose(); m_Friend = null; } if (m_FormX != null) { m_FormX.Dispose(); m_FormX = null; } if (m_TargetImage != null) { m_TargetImage.Dispose(); m_TargetImage = null; } if (m_TargetCursorImage != null) { m_TargetCursorImage.Dispose(); m_TargetCursorImage = null; } if (m_Font != null) { for (int num15 = 0; num15 < 10; num15++) { if (m_Font[num15] != null) { m_Font[num15].Dispose(); m_Font[num15] = null; } } m_Font = null; } if (m_UniFont != null) { int length = m_UniFont.Length; for (int num17 = 0; num17 < length; num17++) { if (m_UniFont[num17] != null) { m_UniFont[num17].Dispose(); m_UniFont[num17] = null; } } m_UniFont = null; } if (m_MidiTable != null) { m_MidiTable.Dispose(); m_MidiTable = null; } if (m_ContainerBoundsTable != null) { m_ContainerBoundsTable.Dispose(); m_ContainerBoundsTable = null; } Texture.DisposeAll(); Debug.EndBlock(); if (flag) { Debug.Trace("Network error caused termination"); } Network.DumpBuffer(); Network.Close(); Debug.Dispose(); Strings.Dispose(); m_LoadQueue = null; m_MapLoadQueue = null; m_DefaultFont = null; m_DefaultHue = null; m_Display = null; m_Encoder = null; m_Effects = null; m_Skills = null; m_Features = null; m_Animations = null; m_LandArt = null; m_TextureArt = null; m_ItemArt = null; m_Gumps = null; m_Sounds = null; m_Multis = null; m_FileManager = null; m_Display = null; m_Font = null; m_UniFont = null; m_Device = null; m_CharacterNames = null; m_MoveDelay = null; m_Text = null; m_Font = null; m_UniFont = null; m_NewFrame = null; m_SleepMode = null; m_Timers = null; m_Plugins = null; m_SkillsGump = null; m_JournalGump = null; m_Journal = null; m_FileManager = null; m_Encoder = null; m_DefaultFont = null; m_DefaultHue = null; m_LastTarget = null; m_Random = null; m_WalkStack = null; m_Prompt = null; m_IniPath = null; m_Pings = null; m_PingTimer = null; m_MultiList = null; m_WalkTimeout = null; m_Servers = null; m_AllNames = null; m_Doors = null; m_LastOverCheck = null; m_LastMouseArgs = null; m_LastAttacker = null; Renderer.m_VertexPool = null; try { Process currentProcess = Process.GetCurrentProcess(); currentProcess.Kill(); currentProcess.WaitForExit(); } catch { } }
public static void EquipSort(Mobile m, int newDir) { if ((m != null) && ((m.Direction & 7) != (newDir & 7))) { ArrayList equip = m.Equip; if (equip != null) { equip.Sort(LayerComparer.FromDirection(newDir)); } } }
public static void DeathAnim_OnAnimationEnd(Animation a, Mobile m) { if (m != null) { Item item = World.FindItem(m.CorpseSerial); m.Visible = false; m.CorpseSerial = 0; m.Update(); if (item != null) { item.CorpseSerial = 0; item.Direction = m.Direction; item.Visible = true; item.Update(); } } }
public static void commandEntered(string cmd) { if ((cmd.Length > 0) && !m_SayMacro) { m_LastCommand = cmd; } if (m_Prompt != null) { m_Prompt.OnReturn(cmd); m_Prompt = null; } else { cmd = cmd.Trim(); if (cmd.Length > 0) { int count = m_Plugins.Count; for (int i = 0; i < count; i++) { Plugin plugin = (Plugin) m_Plugins[i]; if (plugin.OnCommandEntered(cmd)) { return; } } if (cmd.StartsWith("--") && UOAM.Connected) { UOAM.Chat(cmd.Substring(2)); } else if (!cmd.StartsWith("/")) { if (!cmd.StartsWith(". ")) { Network.Send(new PUnicodeSpeech(cmd)); } else { object obj2; string[] strArray = cmd.Substring(". ".Length).Split(new char[] { ' ' }); if (((strArray.Length > 0) && ((obj2 = strArray[0].ToLower()) != null)) && ((obj2 = <PrivateImplementationDetails>.$$method0x60008d2-1[obj2]) != null)) { switch (((int) obj2)) { case 0: { Gump g = Gumps.FindGumpByGUID("Volume"); if (g != null) { Gumps.Destroy(g); break; } Gumps.Desktop.Children.Add(new GVolumeControl()); break; } case 1: { int num4 = 0; try { if (strArray.Length > 1) { num4 = Convert.ToInt32(strArray[1]); } } catch { num4 = 0; } if (num4 < 1) { AddTextMessage("Usage: DefaultRegs <amount>"); } else { World.CharData.DefaultRegs = num4; AddTextMessage(string.Format("Default reagent amount changed to {0}.", num4)); } break; } case 2: { bool flag = !World.CharData.AlwaysRun; if ((strArray.Length <= 1) || !(strArray[0].ToLower() == "on")) { if ((strArray.Length > 1) && (strArray[0].ToLower() == "off")) { flag = false; } } else { flag = true; } World.CharData.AlwaysRun = flag; return; } case 3: TargetHandler = new SetRegBagTargetHandler(); AddTextMessage("Target your destination reagent container."); break; case 4: TargetHandler = new SetRegStockTargetHandler(); AddTextMessage("Target your source reagent container."); break; case 5: { int num5 = 0; foreach (Mobile mobile2 in World.Mobiles.Values) { if ((World.InRange(mobile2) && mobile2.Visible) && mobile2.m_IsFactionGuard) { mobile2.QueryStats(); mobile2.OpenStatus(false); if (mobile2.StatusBar != null) { mobile2.StatusBar.Gump.X = (GameX + 10) + ((num5 / 6) * (mobile2.StatusBar.Gump.Width + 10)); mobile2.StatusBar.Gump.Y = (GameY + 10) + ((num5 % 6) * (mobile2.StatusBar.Gump.Height + 10)); num5++; } } } break; } case 6: { Mobile player = World.Player; if (player != null) { for (int j = 0; j < Multis.Items.Count; j++) { Item item = (Item) Multis.Items[j]; if (item.InWorld && item.IsMulti) { CustomMultiEntry customMulti = CustomMultiLoader.GetCustomMulti(item.Serial, item.Revision); Multi m = null; if (customMulti != null) { m = customMulti.Multi; } if (m == null) { m = item.Multi; } if ((m != null) && Multis.IsInMulti(item, m, player.X, player.Y, player.Z)) { ArrayList dataStore = GetDataStore(); foreach (Mobile mobile4 in World.Mobiles.Values) { switch (mobile4.Notoriety) { case Notoriety.Attackable: case Notoriety.Criminal: case Notoriety.Enemy: case Notoriety.Murderer: if ((((mobile4 != player) && !mobile4.Flags[MobileFlag.YellowHits]) && (!mobile4.m_IsFriend && mobile4.Visible)) && World.InRange(mobile4)) { int xReal = mobile4.XReal; int yReal = mobile4.YReal; int zReal = mobile4.ZReal; if (Multis.RunUO_IsInside(item, m, xReal, yReal, zReal)) { dataStore.Add(mobile4); } } break; } } if (dataStore.Count > 0) { dataStore.Sort(TargetSorter.Comparer); Mobile mobile5 = (Mobile) dataStore[0]; Network.Send(new PUnicodeSpeech("; i ban thee")); Network.Send(new PTarget_Spoof(0, -559038737, ServerTargetFlags.None, mobile5.Serial, mobile5.X, mobile5.Y, mobile5.Z, mobile5.Body)); PacketHandlers.m_CancelTarget = true; } ReleaseDataStore(dataStore); break; } } } break; } break; } case 7: { if (strArray.Length != 2) { break; } int level = m_Multis.m_Level; switch (strArray[1].ToLower()) { case "0": case "5": case "off": level = 5; break; case "1": level = 1; break; case "2": level = 2; break; case "3": level = 3; break; case "4": level = 4; break; case "up": level++; break; case "down": level--; break; } if (level > 5) { level = 5; } else if (level < 1) { level = 1; } if (m_Multis.m_Level != level) { m_Multis.m_Level = level; Map.Invalidate(); } return; } case 8: { int defaultRegs = World.CharData.DefaultRegs; try { if (strArray.Length > 1) { defaultRegs = Convert.ToInt32(strArray[1]); } } catch { defaultRegs = World.CharData.DefaultRegs; } Item stock = World.CharData.Stock; Item regBag = World.CharData.RegBag; if ((stock != null) && (regBag != null)) { MakeRegsTargetHandler.Transfer(stock, regBag, defaultRegs); } else { TargetHandler = new MakeRegsTargetHandler(defaultRegs, stock, regBag); if (stock == null) { AddTextMessage("Target your source reagent container."); } else { AddTextMessage("Target your destination reagent container."); } } break; } case 9: if (m_QamList.Count <= 0) { AddTextMessage("There are no item movements currently queued."); break; } m_QamList.Clear(); if (m_QamTimer != null) { m_QamTimer.Stop(); } m_QamTimer = null; AddTextMessage("The item movement queue has been cleared."); break; case 10: TargetHandler = new FriendTargetHandler(); AddTextMessage("Target the player to toggle friendship status.", DefaultFont, Hues.Load(0x59)); break; case 11: World.CharData.AutoPickup = !World.CharData.AutoPickup; AddTextMessage(World.CharData.AutoPickup ? "You like good stuff." : "You hate things."); break; case 12: World.CharData.Archery = !World.CharData.Archery; AddTextMessage(World.CharData.Archery ? "You are an archer." : "You aren't an archer."); break; case 13: World.CharData.LootGold = !World.CharData.LootGold; AddTextMessage(World.CharData.LootGold ? "You like gold." : "You hate gold."); break; case 14: { Mobile mob = World.Player; if (mob != null) { string mobilePath = Macros.GetMobilePath(mob); string path = FileManager.BasePath(string.Format("Data/Plugins/Macros/{0}.txt", mobilePath)); string str8 = "Macros"; string str9 = FileManager.BasePath(string.Format("Data/Plugins/Macros/{0}.txt", str8)); if (GMacroEditorForm.IsOpen) { AddTextMessage("Close the macro editor before running this command."); } else if (File.Exists(path)) { AddTextMessage("Macro definitions unique to your character were already found."); } else if (!File.Exists(str9)) { AddTextMessage("No default macro definnitions were found."); } else { File.Copy(str9, path); Macros.Load(); AddTextMessage("Default macro definitions have been copied. Any macro changes you make will now be unique to this character."); } break; } break; } case 15: TargetHandler = new NullTargetHandler(); break; case 0x10: { Mobile p = World.Player; if (p != null) { bool flag2 = false; foreach (Mobile mobile8 in World.Mobiles.Values) { if (mobile8.InSquareRange(p, 8) && ((mobile8.Body == 400) || (mobile8.Body == 0x191))) { Item item4 = mobile8.FindEquip(Layer.Shoes); if (((item4 != null) && (item4.Hue == 0)) && (((item4.ID == 0x1711) || (item4.ID == 0x170b)) || (item4.ID == 0x170c))) { item4 = mobile8.FindEquip(Layer.TwoHanded); if (((item4 != null) && (item4.Hue == 0)) && (((item4.ID == 0xe89) || (item4.ID == 0xe8a)) || ((item4.ID == 0xe81) || (item4.ID == 0xe82)))) { m_ContextQueue = 0x17d7; m_BuyHorse = mobile8; Network.Send(new PPopupRequest(mobile8)); mobile8.AddTextMessage("Vendor", "Buying horse.", DefaultFont, Hues.Load(0x59), false); flag2 = true; break; } } } } if (!flag2) { AddTextMessage("Vendor not found.", DefaultFont, Hues.Load(0x26)); } return; } break; } case 0x11: { Item item5 = World.FindItem(new PlayerDistanceValidator(new ItemIDValidator(new int[] { 0xf6c }), 1)); if (item5 != null) { item5.Use(); item5.AddTextMessage("Moongate", "Using.", DefaultFont, Hues.Load(0x59), false); break; } AddTextMessage("Moongate not found.", DefaultFont, Hues.Load(0x26)); break; } case 0x12: { Gump drag = Gumps.Drag; if (!(drag is GDraggedItem)) { m_LeapFrog = null; AddTextMessage("You are not holding an item. Leapfrog cleared."); break; } m_LeapFrog = ((GDraggedItem) drag).Item; AddTextMessage("Item set."); break; } case 0x13: { IItemValidator check = new PlayerDistanceValidator(new ItemIDValidator(new int[] { 0x2006 }), 2); Item[] itemArray = World.FindItems(check); ArrayList list2 = new ArrayList(); AosAppraiser instance = LootAppraiser.Instance; for (int k = 0; k < itemArray.Length; k++) { Item item6 = itemArray[k]; if ((item6.LastTextHue == null) || ((item6.LastTextHue.HueID() & 0x7fff) != 0x59)) { AosAppraiser.m_BlueCorpse = false; ArrayList items = item6.Items; for (int n = 0; n < items.Count; n++) { Item item7 = (Item) items[n]; Appraisal appraisal = instance.Appraise(item7); if (appraisal != null) { list2.Add(appraisal); } } } } if (list2.Count > 0) { list2.Sort(); Appraisal appraisal2 = (Appraisal) list2[0]; Item item8 = appraisal2.Item; ObjectPropertyList propertyList = item8.PropertyList; string text = null; if (propertyList.Properties.Length > 0) { text = propertyList.Properties[0].Text; } if ((text == null) || (text == "")) { text = Localization.GetString(0xf9060 + (item8.ID & 0x3fff)); } string str11 = string.Format("Looting {0}.", text); if (list2.Count > 1) { str11 = string.Format("{0} There are {1} other valued item{2} to loot.", str11, list2.Count - 1, (list2.Count == 2) ? "" : "s"); } AddTextMessage(str11, DefaultFont, Hues.Load(0x35)); Mobile mobile9 = World.Player; if (mobile9 != null) { Network.Send(new PPickupItem(item8, item8.Amount)); Network.Send(new PDropItem(item8.Serial, -1, -1, 0, mobile9.Serial)); } } else { AddTextMessage("Nothing was found to loot.", DefaultFont, Hues.Load(0x22)); } break; } case 20: { IItemValidator validator2 = new PlayerDistanceValidator(new ItemIDValidator(new int[] { 0x2006 }), 2); Item[] itemArray2 = World.FindItems(validator2); ArrayList list5 = new ArrayList(); AosAppraiser appraiser2 = LootAppraiser.Instance; for (int num14 = 0; num14 < itemArray2.Length; num14++) { Item item9 = itemArray2[num14]; if ((item9.LastTextHue != null) && ((item9.LastTextHue.HueID() & 0x7fff) == 0x59)) { AosAppraiser.m_BlueCorpse = true; } else { AosAppraiser.m_BlueCorpse = false; } ArrayList list6 = item9.Items; for (int num15 = 0; num15 < list6.Count; num15++) { Item item10 = (Item) list6[num15]; Appraisal appraisal3 = appraiser2.Appraise(item10); if ((appraisal3 != null) && !appraisal3.IsWorthless) { list5.Add(appraisal3); } } } if (list5.Count > 0) { list5.Sort(); Appraisal appraisal4 = (Appraisal) list5[0]; Item item11 = appraisal4.Item; ObjectPropertyList list7 = item11.PropertyList; string str12 = null; if (list7.Properties.Length > 0) { str12 = list7.Properties[0].Text; } if ((str12 == null) || (str12 == "")) { str12 = Localization.GetString(0xf9060 + (item11.ID & 0x3fff)); } string str13 = string.Format("Looting {0}.", str12); if (list5.Count > 1) { str13 = string.Format("{0} There are {1} other valued item{2} to loot.", str13, list5.Count - 1, (list5.Count == 2) ? "" : "s"); } AddTextMessage(str13, DefaultFont, Hues.Load(0x35)); Mobile mobile10 = World.Player; if (mobile10 != null) { Network.Send(new PPickupItem(item11, item11.Amount)); Network.Send(new PDropItem(item11.Serial, -1, -1, 0, mobile10.Serial)); } } else { AddTextMessage("Nothing was found to loot.", DefaultFont, Hues.Load(0x22)); } break; } case 0x15: { IPAddress address; int num16; if (strArray.Length != 5) { AddTextMessage("Usage: uoam <name> <password> <address> <port>"); break; } string username = strArray[1]; string password = strArray[2]; try { address = IPAddress.Parse(strArray[3]); num16 = Convert.ToInt32(strArray[4]); } catch { AddTextMessage("Usage: uoam <name> <password> <address> <port>"); break; } UOAM.Connect(username, password, address, num16); break; } case 0x16: { MapPackage cache = Map.GetCache(); if (cache.cells != null) { Mobile mobile11 = World.Player; if (mobile11 != null) { int num17 = mobile11.X - cache.CellX; int num18 = mobile11.Y - cache.CellY; if (((num17 >= 0) && (num17 < cache.cells.GetLength(0))) && ((num18 >= 0) && (num18 < cache.cells.GetLength(1)))) { ArrayList list8 = cache.cells[num17, num18]; if (list8 != null) { if (list8.Count <= 0) { AddTextMessage("Nothing there."); break; } ICell cell = (ICell) list8[list8.Count - 1]; if (!(cell is MobileCell)) { if (cell is DynamicItem) { Target(((DynamicItem) cell).m_Item); } else if (cell is StaticItem) { Target(new StaticTarget(mobile11.X, mobile11.Y, ((StaticItem) cell).m_Z, ((StaticItem) cell).m_RealID, ((StaticItem) cell).m_RealID, ((StaticItem) cell).m_Hue)); } else if (cell is LandTile) { Target(new LandTarget(mobile11.X, mobile11.Y, ((LandTile) cell).m_Z)); } break; } Target(((MobileCell) cell).m_Mobile); } } } } break; } case 0x17: m_AlternateFont = !m_AlternateFont; AddTextMessage(string.Format("Alternate font is now {0}.", m_AlternateFont ? "on" : "off")); break; case 0x18: { bool flag3 = !m_Sounds.Enabled; try { flag3 = strArray[1].ToLower() != "off"; } catch { flag3 = !m_Sounds.Enabled; } m_Sounds.Enabled = flag3; AddTextMessage(string.Format("Sounds are now {0}.", flag3 ? "on" : "off")); break; } case 0x19: { bool flag4 = !World.CharData.QueueTargets; try { flag4 = strArray[1].ToLower() != "off"; } catch { flag4 = !World.CharData.QueueTargets; } World.CharData.QueueTargets = flag4; AddTextMessage(string.Format("Target queueing is now {0}.", flag4 ? "on" : "off")); break; } case 0x1a: { IEnumerator enumerator = World.Mobiles.Values.GetEnumerator(); int num19 = 0; while (enumerator.MoveNext()) { Mobile current = (Mobile) enumerator.Current; if (((current.Visible && (current.Notoriety == Notoriety.Murderer)) && (!current.Human && !current.Ghost)) && World.InRange(current)) { Timer timer = new Timer(new OnTick(Engine.DelayedPackets_OnTick), num19++ * 0x4e2, 1); timer.SetTag("Packets", new Packet[] { new PAttackRequest(current) }); timer.Start(false); } } break; } case 0x1b: TargetHandler = new MoveTargetHandler(); AddTextMessage("Target one of the items to move."); break; case 0x1c: TargetHandler = new OverrideHueTargetHandler(0x489, "Inflame request canceled."); AddTextMessage("Target an item."); break; case 0x1d: TargetHandler = new OverrideHueTargetHandler(-1, "Douse request canceled."); AddTextMessage("Target an item."); break; case 30: { NotoQueryType on = (NotoQueryType) ((1 + World.CharData.NotoQuery) % 3); try { switch (strArray[1].ToLower()) { case "on": on = NotoQueryType.On; break; case "off": on = NotoQueryType.Off; break; case "smart": on = NotoQueryType.Smart; break; } } catch { } World.CharData.NotoQuery = on; AddTextMessage(string.Format("Notoriety query is now {0}.", on.ToString().ToLower())); break; } case 0x1f: Network.Send(new PWrestleDisarm()); break; case 0x20: Network.Send(new PWrestleStun()); break; case 0x21: { bool flag5 = !GFader.Fade; try { flag5 = strArray[1].ToLower() != "off"; } catch { flag5 = !GFader.Fade; } GFader.Fade = flag5; AddTextMessage(string.Format("Interface fading is now {0}.", flag5 ? "on" : "off")); break; } case 0x22: TargetHandler = new DragToBagTargetHandler(false); AddTextMessage("Target one of the items to move."); break; case 0x23: TargetHandler = new DragToBagTargetHandler(true); AddTextMessage("Target one of the items to click and move."); break; case 0x24: { int xOffset = 0; int yOffset = 0; if ((strArray.Length == 3) || (strArray.Length == 1)) { if (strArray.Length == 3) { try { xOffset = Convert.ToInt32(strArray[1]); } catch { } try { yOffset = Convert.ToInt32(strArray[2]); } catch { } } TargetHandler = new BringToTargetHandler(xOffset, yOffset); AddTextMessage("Target the destination item."); } else { AddTextMessage("Format: bringto [x y]"); } break; } case 0x25: Ignore(); break; case 0x26: TargetHandler = new RemoveTargetHandler(); AddTextMessage("Remove what?"); break; case 0x27: TargetHandler = new StackTargetHandler(); AddTextMessage("Target the destination item."); break; case 40: TargetHandler = new RegDropTargetHandler(); AddTextMessage("Target the destination container."); break; case 0x29: TargetHandler = new TurnTargetHandler(); AddTextMessage("Turn to where?"); break; case 0x2a: { bool flag6 = !NewConfig.SmoothWalk; try { flag6 = strArray[1].ToLower() != "off"; } catch { flag6 = !NewConfig.SmoothWalk; } NewConfig.SmoothWalk = flag6; AddTextMessage(string.Format("Smooth walking is now {0}.", flag6 ? "on" : "off")); break; } case 0x2b: { int num22 = 100; try { num22 = Convert.ToInt32(cmd.Split(new char[] { ' ' })[1]); } catch { num22 = 100; } Timer timer2 = new Timer(new OnTick(Engine.TimeRefresh_OnTick), 1, 1); timer2.SetTag("Frames", num22); timer2.Start(false); break; } case 0x2c: { string str16 = null; try { str16 = strArray[1]; } catch { AddTextMessage("Format: music <on | off | stop>"); break; } switch (str16.ToLower()) { case "on": NewConfig.PlayMusic = true; return; case "off": NewConfig.PlayMusic = false; Music.Stop(); return; case "stop": Music.Stop(); return; } AddTextMessage("Format: music <on | off | stop>"); break; } case 0x2d: TargetHandler = new TraceTargetHandler(); AddTextMessage("Target the dynamic item or mobile to trace."); break; case 0x2e: TargetHandler = new ExportTargetHandler(); AddTextMessage("Target the first location of a bounding box."); break; case 0x2f: { if (!GMPrivs) { AddTextMessage("You do not have access to this command."); break; } string str17 = null; try { str17 = strArray[1]; } catch { AddTextMessage("Format: ack <number>"); break; } try { m_WalkAckSync = Convert.ToInt32(str17); } catch { AddTextMessage("Format: ack <number>"); break; } AddTextMessage(string.Format("Maximum outstanding walk requests: {0}", m_WalkAckSync)); break; } case 0x30: { if (!GMPrivs) { AddTextMessage("You do not have access to this command."); break; } string str18 = null; try { str18 = strArray[1]; } catch { AddTextMessage("Format: runspeed <number>"); break; } try { m_RunSpeed = ((float) Convert.ToInt32(str18)) / 1000f; } catch { AddTextMessage("Format: runspeed <number>"); break; } AddTextMessage(string.Format("Run speed set to: {0} seconds", m_RunSpeed)); break; } case 0x31: { if (!GMPrivs) { AddTextMessage("You do not have access to this command."); break; } string str19 = null; try { str19 = strArray[1]; } catch { AddTextMessage("Format: walkspeed <number>"); break; } try { m_WalkSpeed = ((float) Convert.ToInt32(str19)) / 1000f; } catch { AddTextMessage("Format: walkspeed <number>"); break; } AddTextMessage(string.Format("Walk speed set to: {0} seconds", m_WalkSpeed)); break; } case 50: { if (!GMPrivs) { AddTextMessage("You do not have access to this command."); break; } string str20 = null; try { str20 = strArray[1]; } catch { } if (str20 == "on") { m_Weather = true; AddTextMessage("Weather turned on."); } else if (str20 == "off") { m_Weather = false; PacketHandlers.ClearWeather(); AddTextMessage("Weather turned off."); } else { m_Weather = !m_Weather; if (!m_Weather) { PacketHandlers.ClearWeather(); } AddTextMessage(string.Format("Weather turned {0}.", m_Weather ? "on" : "off")); } break; } } } } } else { switch (Party.State) { case PartyState.Alone: if (!cmd.ToLower().StartsWith("/add")) { AddTextMessage(string.Format("Note to self: {0}", cmd.Substring(1)), DefaultFont, Hues.Load(0x3b2)); break; } Network.Send(new PParty_AddMember()); break; case PartyState.Joining: { string str2 = cmd.ToLower(); if (!str2.StartsWith("/accept")) { if (str2.StartsWith("/decline")) { Network.Send(new PParty_Decline(Party.Leader)); } else { AddTextMessage("Use '/accept' or '/decline'.", DefaultFont, Hues.Load(0x3b2)); } break; } Network.Send(new PParty_Accept(Party.Leader)); break; } case PartyState.Joined: { string str3 = cmd.ToLower(); if (!Party.IsLeader || !str3.StartsWith("/add")) { if (Party.IsLeader && str3.StartsWith("/rem")) { Network.Send(new PParty_RemoveMember()); } else if (str3.StartsWith("/quit")) { Network.Send(new PParty_Quit()); } else if (str3.StartsWith("/loot on")) { Network.Send(new PParty_SetCanLoot(true)); } else if (str3.StartsWith("/loot off")) { Network.Send(new PParty_SetCanLoot(false)); } else if (str3.StartsWith("/loot")) { AddTextMessage("Use '/loot on' or '/loot off'."); } else if (Party.Members.Length > 1) { if ((cmd.Length >= 2) && char.IsDigit(cmd, 1)) { try { int index = Convert.ToInt32(cmd.Substring(1, 1)) - 1; if ((index >= 0) && (index < Party.Members.Length)) { if (index == Party.Index) { AddTextMessage(string.Format("Note to self: {0}", cmd.Substring(2)), DefaultFont, Hues.Load(0x3b2)); } else { string str4; Mobile mobile = World.Player; if (((mobile == null) || ((str4 = mobile.Name) == null)) || ((str4 = str4.Trim()).Length <= 0)) { str4 = "You"; } AddTextMessage(string.Format("<{0}> {1}", str4, cmd.Substring(2)), DefaultFont, Hues.Load(World.CharData.WhisperHue)); Network.Send(new PParty_PrivateMessage(Party.Members[index], cmd.Substring(2))); } break; } } catch { } } Network.Send(new PParty_PublicMessage(cmd.Substring(1))); } else { AddTextMessage(string.Format("Note to self: {0}", cmd.Substring(1)), DefaultFont, Hues.Load(0x3b2)); } break; } Network.Send(new PParty_AddMember()); break; } } } } } }
public PAttackRequest(Mobile Target) : this(Target.Serial) { }
public static void Save(Mobile who, string filename) { if (m_List != null) { Engine.WantDirectory("Data/Plugins/Macros"); using (StreamWriter writer = new StreamWriter(Engine.FileManager.BasePath(string.Format("Data/Plugins/Macros/{0}.txt", filename)))) { if (who == null) { writer.WriteLine("; Default macro definitions file"); } else { writer.WriteLine("; Macro definition file for {0} on {1}", who.Name, Engine.m_ServerName); } writer.WriteLine("; Format:"); writer.WriteLine("; Control Alt Shift"); writer.WriteLine("; Key"); writer.WriteLine("; [list]"); writer.WriteLine("; <name> [param]"); writer.WriteLine("; #####"); writer.WriteLine(); Cleanup(); for (int i = 0; i < m_List.Count; i++) { Macro macro = (Macro) m_List[i]; writer.WriteLine("{0} {1} {2}", macro.Control ? "1" : "0", macro.Alt ? "1" : "0", macro.Shift ? "1" : "0"); switch (macro.Key) { case 0x11000: writer.WriteLine("Wheel Up"); break; case 0x11001: writer.WriteLine("Wheel Down"); break; case 0x11002: writer.WriteLine("Wheel Press"); break; default: writer.WriteLine(macro.Key); break; } for (int j = 0; j < macro.Actions.Length; j++) { Action action = macro.Actions[j]; if (action.Handler == null) { writer.WriteLine(action.Line); } else if (action.Param.Length > 0) { writer.WriteLine("{0} {1}", action.Handler.Action, action.Param); } else { writer.WriteLine(action.Handler.Action); } } if (i == (m_List.Count - 1)) { writer.Write("#####"); } else { writer.WriteLine("#####"); } } } } }
public static void Resurrect_OnAnimationEnd(Animation a, Mobile m) { if (m != null) { m.Visible = false; m.Update(); } }
public MobileTooltip(Mobile mob) { this.m_Mobile = mob; }
public GDynamicMessage(bool unremovable, Mobile m, string text, IFont font, IHue hue) : this(unremovable, m, text, font, hue, Engine.MobileDuration) { }