public override void OnClick() { Entry entry = new Entry { AccountName = this.m_Character.Shard.Account.Username, Password = this.m_Character.Shard.Account.Password, CharID = this.m_Character.Index, CharName = this.m_Character.Name, ServerID = this.m_Character.Shard.Index, ServerName = this.m_Character.Shard.Name, CharProfile = this.m_Character }; Engine.m_QuickLogin = true; Engine.m_QuickEntry = entry; Cursor.Hourglass = true; Gumps.Desktop.Children.Clear(); xGumps.Display("Connecting"); Engine.DrawNow(); string serverHost = NewConfig.ServerHost; int serverPort = NewConfig.ServerPort; NewConfig.ServerHost = this.m_Character.Shard.Account.Server.Address; NewConfig.ServerPort = this.m_Character.Shard.Account.Server.Port; if (Network.Connect()) { NewConfig.ServerHost = serverHost; NewConfig.ServerPort = serverPort; Gumps.Desktop.Children.Clear(); xGumps.Display("AccountVerify"); } else { NewConfig.ServerHost = serverHost; NewConfig.ServerPort = serverPort; Gumps.Desktop.Children.Clear(); xGumps.SetVariable("FailMessage", "Couldn't connect to the login server. Either the server is down, or you've entered an invalid host / port. Check Client.cfg."); xGumps.Display("ConnectionFailed"); Cursor.Hourglass = false; Engine.m_QuickLogin = false; return; } Network.Send(new PLoginSeed()); Network.Send(new PAccount(entry.AccountName, entry.Password)); }
protected override void OnClicked() { switch (this.m_Type) { case 0: this.m_Owner.Page = this.m_Param; break; case 1: case 4: if (this.m_RelayID != 0) { GServerGump.SetCachedLocation(this.m_Owner.DialogID, this.m_Owner.X, this.m_Owner.Y); } PacketHandlers.m_GumpTime = DateTime.Now; Network.Send(new PGumpButton(this.m_Owner, this.m_RelayID)); Gumps.Destroy(base.m_Parent); break; } }
private void Okay_Clicked(object sender, EventArgs e) { try { int amount = Convert.ToInt32(this.m_TextBox.String); if (amount <= 0) { Gumps.Destroy(this); } else { if (amount > this.m_Amount) { amount = this.m_Amount; } base.m_IsDragging = false; Network.Send(new PPickupItem(this.m_Item, (short)((ushort)amount))); this.m_Item.Amount = (short)((ushort)amount); Gumps.Desktop.Children.Add(new GDraggedItem(this.m_Item)); if (this.m_ToDestroy is Gump) { if (((Gump)this.m_ToDestroy).Parent is GContainer) { ((GContainer)((Gump)this.m_ToDestroy).Parent).m_Hash[this.m_Item] = null; } Gumps.Destroy((Gump)this.m_ToDestroy); } else if (this.m_ToDestroy is Client.Item) { Client.Item toDestroy = (Client.Item) this.m_ToDestroy; toDestroy.RestoreInfo = new RestoreInfo(toDestroy); World.Remove(toDestroy); } Gumps.Destroy(this); } } catch { } }
protected internal override void OnDragDrop(Client.Gump g) { if (!this.m_HitTest) { base.m_Parent.OnDragDrop(g); } else if ((g != null) && (g.GetType() == typeof(GDraggedItem))) { GDraggedItem item = (GDraggedItem)g; Point point = this.Clip(item.Image, item.Double, base.PointToClient(new Point(Engine.m_xMouse - g.m_OffsetX, Engine.m_yMouse - g.m_OffsetY)), g.m_OffsetX, g.m_OffsetY); int num = item.Item.ID & 0x3fff; if ((num >= 0x3585) && (num <= 0x358a)) { point.Y += 20; } else if ((num >= 0x358c) && (num <= 0x3591)) { point.Y += 20; } Gumps.Destroy(item); Network.Send(new PDropItem(item.Item.Serial, (short)point.X, (short)point.Y, 0, this.m_Item.Serial)); } }
public static void Remove(Mobile m) { if ((m != null) && !m.Player) { if (Engine.m_Highlight == m) { Engine.m_Highlight = null; } if (m.Visible && (m.CorpseSerial == 0)) { Map.RemoveMobile(m); m.Visible = false; } bool flag = false; if ((m.StatusBar != null) && !(m.StatusBar is GPartyHealthBar)) { m.StatusBar.Close(); m.StatusBar = null; m.OpenedStatus = false; flag = true; } else if (m.OpenedStatus) { m.OpenedStatus = false; flag = true; } if (flag) { Network.Send(new PCloseStatus(m)); } if (m.Paperdoll != null) { Gumps.Destroy(m.Paperdoll); m.Paperdoll = null; } } }
protected internal override void OnDragDrop(Gump g) { if ((g != null) && (g.GetType() == typeof(GDraggedItem))) { GDraggedItem item = (GDraggedItem)g; Item toEquip = item.Item; Item item3 = null; Gump[] gumpArray = base.m_Children.ToArray(); Point point = base.PointToClient(new Point(Engine.m_xMouse, Engine.m_yMouse)); for (int i = gumpArray.Length - 1; i >= 0; i--) { if ((gumpArray[i] is GPaperdollItem) && gumpArray[i].HitTest(point.X - gumpArray[i].X, point.Y - gumpArray[i].Y)) { item3 = ((GPaperdollItem)gumpArray[i]).Item; break; } } if ((item3 != null) && Map.m_ItemFlags[item3.ID & 0x3fff][TileFlag.Container]) { Network.Send(new PDropItem(toEquip.Serial, -1, -1, 0, item3.Serial)); } else if (Map.m_ItemFlags[toEquip.ID & 0x3fff][TileFlag.Wearable]) { Network.Send(new PEquipItem(toEquip, this.m_Mobile)); } else { Network.Send(new PDropItem(toEquip.Serial, -1, -1, 0, World.Serial)); } Gumps.Destroy(item); } if (this.m_Image != null) { Gumps.Destroy(this.m_Image); this.m_Image = null; } }
public bool QueryStats() { this.m_OpenedStatus = true; return(Network.Send(new PQueryStats(this.m_Serial))); }
public bool Attack() { return(Network.Send(new PAttackRequest(this))); }
public bool Look() { return(Network.Send(new PLookRequest(this))); }
public void DoAction(string Action) { Network.Send(new PAction(Action)); }
protected internal override void OnDoubleClick(int x, int y) { Network.Send(new PQuestionMenuResponse(this.m_Owner.Serial, this.m_Owner.MenuID, this.m_Entry.Index, this.m_Entry.ItemID, this.m_Entry.Hue)); Gumps.Destroy(this.m_Owner); }
protected override void OnDoubleClicked() { Network.Send(new PVirtueTrigger(this.m_Mobile)); }
public void Use() { Network.Send(new PUseSkill(this)); }
protected override void OnDoubleClicked() { Network.Send(new PCastSpell(this.m_SpellID)); }
public bool Use() { return(Network.Send(new PUseRequest(this))); }
protected internal override void OnDoubleClick(int x, int y) { Network.Send(new PProfileRequest(this.m_Mobile)); }
public void Cast() { Network.Send(new PCastSpell(this.m_SpellID)); }
private void Cancel() { Network.Send(new PQuestionMenuCancel(this.m_Serial, this.m_MenuID)); Gumps.Destroy(this); }
public void Accept() { Network.Send(new PBuyItems(this.m_Serial, this.m_Info)); this.m_OfferMenu.WriteSignature(); }
public void Close() { Network.Send(new PCancelTrade(this.m_Serial)); }
protected internal override void OnDoubleClick(int x, int y) { Network.Send(new PVirtueItemTrigger(base.m_Owner, base.m_GumpID)); }
private static bool IsOk(bool ignoreMobs, bool ignoreDoors, int ourZ, int ourTop, ArrayList tiles) { for (int i = 0; i < tiles.Count; i++) { ICell cell = (ICell)tiles[i]; if (cell is StaticItem) { StaticItem item = (StaticItem)cell; TileFlags flags = Map.m_ItemFlags[item.m_RealID & 0x3fff]; if (flags[TileFlag.Surface | TileFlag.Impassable]) { int z = item.m_Z; int num3 = z + item.CalcHeight; if ((num3 > ourZ) && (ourTop > z)) { return(false); } } } else if (cell is DynamicItem) { Item item2 = ((DynamicItem)cell).m_Item; TileFlags flags2 = Map.m_ItemFlags[item2.ID & 0x3fff]; if (flags2[TileFlag.Surface | TileFlag.Impassable] && !item2.IsDoor) { int num4 = item2.Z; int num5 = num4; if (flags2[TileFlag.Bridge]) { num5 += Map.GetHeight((item2.ID & 0x3fff) + 0x4000) / 2; } else { num5 += Map.GetHeight((item2.ID & 0x3fff) + 0x4000); } if ((num5 > ourZ) && (ourTop > num4)) { if ((!item2.Flags[ItemFlag.CanMove] && (Map.GetWeight(item2.ID) >= 0xff)) || (((Control.ModifierKeys & Keys.Shift) == Keys.None) || ((m_LastLiftBlocker + TimeSpan.FromSeconds(0.6)) >= DateTime.Now))) { return(false); } m_LastLiftBlocker = DateTime.Now; Network.Send(new PPickupItem(item2, item2.Amount)); Network.Send(new PDropItem(item2.Serial, -1, -1, 0, World.Serial)); } } } else if (!ignoreMobs && (cell is MobileCell)) { Mobile mobile = ((MobileCell)cell).m_Mobile; if (!mobile.Ghost && !mobile.Bonded) { int num6 = mobile.Z; int num7 = num6 + 0x10; if ((num7 > ourZ) && (ourTop > num6)) { return(false); } } } } return(true); }