private void BecomeUser() { NewGump(); General.List(Owner, c_Target); }
private void ViewOptions(int x) { int y = 10; int width = 150; AddHtml(x, y += 10, width, "<CENTER>" + General.Local(0)); AddButton(x + width / 2 - 60, y, Data.GetData(Owner).Friends.Contains(c_Target) ? 0x2343 : 0x2342, "Friend", new GumpCallback(Friend)); AddButton(x + width / 2 + 40, y, Data.GetData(Owner).Friends.Contains(c_Target) ? 0x2343 : 0x2342, "Friend", new GumpCallback(Friend)); AddHtml(x, y += 20, width, "<CENTER>" + General.Local(2)); AddButton(x + width / 2 - 60, y, Data.GetData(Owner).Ignores.Contains(c_Target) ? 0x2343 : 0x2342, "Ignore", new GumpCallback(Ignore)); AddButton(x + width / 2 + 40, y, Data.GetData(Owner).Ignores.Contains(c_Target) ? 0x2343 : 0x2342, "Ignore", new GumpCallback(Ignore)); if (Chat3.Message.CanMessage(Owner, c_Target)) { AddHtml(x, y += 20, width, "<CENTER>" + General.Local(13)); AddButton(x + width / 2 - 60, y + 3, 0x2716, "Send Message", new GumpCallback(Message)); AddButton(x + width / 2 + 50, y + 3, 0x2716, "Send Message", new GumpCallback(Message)); } if (Owner.AccessLevel >= AccessLevel.Administrator) { if (Owner.AccessLevel > c_Target.AccessLevel) { AddHtml(x, y += 20, width, HTML.LightPurple + "<CENTER>" + General.Local(14), false); AddButton(x + width / 2 - 60, y + 3, 0x2716, "Become User", new GumpCallback(BecomeUser)); AddButton(x + width / 2 + 50, y + 3, 0x2716, "Become User", new GumpCallback(BecomeUser)); } if (c_Target.AccessLevel < AccessLevel.Administrator && c_Target.AccessLevel != AccessLevel.Player) { AddHtml(x, y += 20, width, HTML.LightPurple + "<CENTER>" + General.Local(4), false); AddButton(x + width / 2 - 60, y, Data.GetData(c_Target).GlobalAccess ? 0x2343 : 0x2342, "Global Access", new GumpCallback(GlobalAccess)); AddButton(x + width / 2 + 40, y, Data.GetData(c_Target).GlobalAccess ? 0x2343 : 0x2342, "Global Access", new GumpCallback(GlobalAccess)); } } if (Owner.AccessLevel >= AccessLevel.GameMaster && c_Target.AccessLevel == AccessLevel.Player) { AddHtml(x, y += 20, width, HTML.Red + "<CENTER>" + General.Local(6), false); AddButton(x + width / 2 - 60, y, Data.GetData(c_Target).Banned ? 0x2343 : 0x2342, "Ban", new GumpCallback(Ban)); AddButton(x + width / 2 + 40, y, Data.GetData(c_Target).Banned ? 0x2343 : 0x2342, "Ban", new GumpCallback(Ban)); } if (Data.GetData(Owner).GlobalAccess) { y += 20; if (Data.GetData(Owner).Global) { AddHtml(x, y += 20, width, HTML.Red + "<CENTER>" + General.Local(8), false); AddButton(x + width / 2 - 60, y, Data.GetData(Owner).GIgnores.Contains(c_Target) ? 0x2343 : 0x2342, "Global Ignore", new GumpCallback(GIgnore)); AddButton(x + width / 2 + 40, y, Data.GetData(Owner).GIgnores.Contains(c_Target) ? 0x2343 : 0x2342, "Global Ignore", new GumpCallback(GIgnore)); } else { AddHtml(x, y += 20, width, HTML.Red + "<CENTER>" + General.Local(10), false); AddButton(x + width / 2 - 60, y, Data.GetData(Owner).GListens.Contains(c_Target) ? 0x2343 : 0x2342, "Global Listen", new GumpCallback(GListen)); AddButton(x + width / 2 + 40, y, Data.GetData(Owner).GListens.Contains(c_Target) ? 0x2343 : 0x2342, "Global Listen", new GumpCallback(GListen)); } } if (Owner.AccessLevel >= AccessLevel.GameMaster && c_Target.NetState != null) { AddHtml(x, y += 20, width, HTML.Red + "<CENTER>" + General.Local(15), false); AddButton(x + width / 2 - 60, y + 3, 0x2716, "Client", new GumpCallback(Client)); AddButton(x + width / 2 + 50, y + 3, 0x2716, "Client", new GumpCallback(Client)); AddHtml(x, y += 20, width, HTML.Red + "<CENTER>" + General.Local(16), false); AddButton(x + width / 2 - 60, y + 3, 0x2716, "Goto", new GumpCallback(Goto)); AddButton(x + width / 2 + 50, y + 3, 0x2716, "Goto", new GumpCallback(Goto)); } if (Data.GetData(Owner).MsgSound) { AddHtml(x, y += 25, width, "<CENTER>" + General.Local(17)); AddImageTiled(x + width / 2 - 25, y += 25, 50, 21, 0xBBA); AddTextField(x + width / 2 - 25, y, 50, 21, 0x480, 0xBBA, "Sound", Data.GetData(Owner).GetSound(c_Target).ToString()); AddButton(x + width / 2 + 30, y + 3, 0x15E1, 0x15E5, "Play Sound", new GumpCallback(PlaySound)); AddButton(x + width / 2 - 40, y, 0x983, "Sound Up", new GumpCallback(SoundUp)); AddButton(x + width / 2 - 40, y + 10, 0x985, "Sound Down", new GumpCallback(SoundDown)); } AddBackgroundZero(x, 0, width, y + 40, Data.GetData(c_Target).DefaultBack, false); }
protected override void BuildGump() { int width = 300; int y = 10; AddImage(10, y, 0x589); Avatar av = Avatar.GetAvatar(c_Target); if (av.Id < 100000) { AddImage(10 + av.X, y + av.Y, av.Id); } else { AddItem(10 + av.X, y + av.Y, av.Id - 100000); } AddHtml(95, y, width - 95, Server.Misc.Titles.ComputeTitle(Owner, c_Target)); if (Owner.AccessLevel != AccessLevel.Player) { AddHtml(95, y += 20, width - 95, "Access: " + c_Target.AccessLevel); } else if (c_Target.AccessLevel != AccessLevel.Player) { AddHtml(95, y += 20, width - 95, "" + c_Target.AccessLevel); } else { if (c_Target.Guild != null) { AddHtml(95, y += 20, width - 95, "[" + c_Target.Guild.Abbreviation + "] " + c_Target.GuildTitle); } // if (General.IsInFaction(c_Target)) // AddHtml(95, y += 20, width - 95, General.FactionName(c_Target) + " " + General.FactionTitle(c_Target)); } if (y < 89) { y = 89; } if (Owner == c_Target) { AddButton(32, y, 0x2626, 0x2627, "Avatar Down", new GumpCallback(AvatarDown)); AddButton(52, y, 0x2622, 0x2623, "Avatar Up", new GumpCallback(AvatarUp)); } AddHtml(0, y += 20, width, "<CENTER>" + General.Local(253) + " " + Data.GetData(c_Target).Karma); if (Owner == c_Target) { AddHtml(20, y += 25, 100, General.Local(247)); AddTextField(20, y += 25, width - 40, 65, 0x480, 0xBBC, "Signature", Data.GetData(c_Target).Signature); AddHtml(width - 125, y += 65, 50, General.Local(244)); AddHtml(width - 65, y, 50, General.Local(245)); AddButton(width - 140, y + 3, 0x2716, "Clear Sig", new GumpCallback(ClearSig)); AddButton(width - 80, y + 3, 0x2716, "Submit Sig", new GumpCallback(SubmitSig)); } else { AddHtml(20, y += 25, width - 40, 65, "'" + Data.GetData(c_Target).Signature + "'", false, false); y += 65; } if (Owner != c_Target) { ViewOptions(width); } AddBackgroundZero(0, 0, width, y + 40, Data.GetData(c_Target).DefaultBack); }
private void Friend() { if (Data.GetData(c_Target).ByRequest&& !Data.GetData(Owner).Friends.Contains(c_Target)) { if (!TrackSpam.LogSpam(Owner, "Request " + c_Target.Name, TimeSpan.FromHours(Data.RequestSpam))) { TimeSpan ts = TrackSpam.NextAllowedIn(Owner, "Request " + c_Target.Name, TimeSpan.FromHours(Data.RequestSpam)); string txt = (ts.Days != 0 ? ts.Days + " " + General.Local(170) + " " : "") + (ts.Hours != 0 ? ts.Hours + " " + General.Local(171) + " " : "") + (ts.Minutes != 0 ? ts.Minutes + " " + General.Local(172) + " " : ""); Owner.SendMessage(Data.GetData(Owner).SystemC, General.Local(96) + " " + txt); NewGump(); return; } Data.GetData(c_Target).AddMessage(new Message(Owner, General.Local(84), General.Local(85), MsgType.Invite)); Owner.SendMessage(Data.GetData(Owner).SystemC, General.Local(86) + " " + c_Target.Name); NewGump(); return; } if (Data.GetData(Owner).Friends.Contains(c_Target)) { Data.GetData(Owner).RemoveFriend(c_Target); } else { Data.GetData(Owner).AddFriend(c_Target); } NewGump(); }
protected override void BuildGump() { int width = 300; int y = 10; AddImage(10, y, 0x589); Avatar av = Avatar.GetAvatar(c_Message.From); if (av.Id < 100000) { AddImage(10 + av.X, y + av.Y, av.Id); } else { AddItem(10 + av.X, y + av.Y, av.Id - 100000); } AddButton(20, 20, 0x2716, "Profile", new GumpCallback(Profile)); AddHtml(95, y += 15, width - 105, General.Local(60) + " " + c_Message.From.RawName); AddHtml(95, y += 20, width - 105, 42, c_Message.Subject, false, false); AddHtml(20, y += 50, width - 40, 80, HTML.Black + c_Message.Msg, true, true); y += 90; if (Data.GetData(Owner).Messages.Contains(c_Message)) { if (c_Message.Type == MsgType.Normal) { if (Message.CanMessage(Owner, c_Message.From) && !Message.StaffTimeout(c_Message)) { AddHtml(width - 85, y, 50, General.Local(248)); AddButton(width - 100, y + 3, 0x2716, "Reply", new GumpCallback(Reply)); } AddHtml(width - 145, y, 50, General.Local(249)); AddButton(width - 160, y + 3, 0x2716, "Delete", new GumpCallback(Delete)); if (c_Message.From.AccessLevel == AccessLevel.Player) { AddHtml(95, y, 50, General.Local(2)); AddButton(80, y + 3, 0x2716, "Ignore", new GumpCallback(Ignore)); } } else if (c_Message.Type == MsgType.Invite) { AddHtml(width - 85, y, 50, General.Local(250)); AddButton(width - 100, y + 3, 0x2716, "Accept", new GumpCallback(Accept)); AddHtml(width - 145, y, 50, General.Local(251)); AddButton(width - 160, y + 3, 0x2716, "Deny", new GumpCallback(Deny)); if (c_Message.From.AccessLevel == AccessLevel.Player) { AddHtml(95, y, 50, General.Local(2)); AddButton(80, y + 3, 0x2716, "Ignore", new GumpCallback(Ignore)); } } } AddBackgroundZero(0, 0, width, y + 30, Data.GetData(Owner).DefaultBack); }
public static string FilterText(Mobile m, string s, bool punish) { try { string filter = ""; //string subOne = ""; //string subTwo = ""; //string subThree = ""; int index = 0; for (int i = 0; i < Data.Filters.Count; ++i) { filter = Data.Filters[i].ToString(); if (filter == "") { Data.Filters.Remove(filter); continue; } index = s.ToLower().IndexOf(filter); if (index >= 0) { if (m.AccessLevel == AccessLevel.Player && punish) { if (++Data.GetData(m).Warnings <= Data.FilterWarnings) { m.SendMessage(Data.GetData(m).SystemC, General.Local(111) + " " + filter); } else { Data.GetData(m).Warnings = 0; Events.InvokeFilterViolation(new FilterViolationEventArgs(m)); if (Data.FilterPenalty == FilterPenalty.Ban) { Data.GetData(m).Ban(TimeSpan.FromMinutes(Data.FilterBanLength)); } if (Data.FilterPenalty == FilterPenalty.Jail) { ChatJail.SendToJail(m); } if (Data.FilterPenalty != FilterPenalty.None) { return(""); } } } if (m.AccessLevel == AccessLevel.Player) { m.SendAsciiMessage("Harassing and excessive swearing is not allowed! Repeated offences will get you jailed!"); return(""); } m.SendAsciiMessage("You are staff so you can swear, but please try not to."); /* * subOne = s.Substring(0, index); * subTwo = ""; * * for (int ii = 0; ii < filter.Length; ++ii) * subTwo += "*"; * * subThree = s.Substring(index + filter.Length, s.Length - filter.Length - index); * * s = subOne + subTwo + subThree; * * i--;*/ } } } catch { Errors.Report(General.Local(176)); } return(s); }
private void Deny() { c_Message.From.SendMessage(Data.GetData(c_Message.From).SystemC, Owner.RawName + " " + General.Local(88)); Owner.SendMessage(Data.GetData(Owner).SystemC, General.Local(89) + " " + c_Message.From.RawName); Data.GetData(Owner).Messages.Remove(c_Message); }
private void Accept() { c_Message.From.SendMessage(Data.GetData(c_Message.From).SystemC, Owner.RawName + " " + General.Local(87)); Data.GetData(Owner).AddFriend(c_Message.From); Data.GetData(c_Message.From).AddFriend(Owner); Data.GetData(Owner).Messages.Remove(c_Message); }
private void Message() { General.List(Owner, 2); }
private static void OnView(CommandInfo e) { General.List(e.Mobile, 0); }
public virtual void OnChat(Mobile m, string msg, bool spam) { if (msg == null || msg == "") { if (!CanChat(m, false)) { General.List(m, 0); return; } if (c_Mobiles.Contains(m)) { Data.GetData(m).CurrentChannel = this; } General.List(m, 1); return; } if (!CanChat(m, true)) { return; } if (c_Filter) { msg = Chat3.Filter.FilterText(m, msg); } if (!CanChat(m, false)) { return; } if (!c_Mobiles.Contains(m)) { m.SendMessage(Data.GetData(m).SystemC, General.Local(34)); return; } if (c_Delay && !TrackSpam.LogSpam(m, "Chat", TimeSpan.FromSeconds(Data.ChatSpam))) { if (spam) { m.SendMessage(Data.GetData(m).SystemC, General.Local(97)); } Timer.DelayCall(TimeSpan.FromSeconds(4), new TimerStateCallback(OnChat), new object[] { m, msg }); return; } AddHistory(m, msg); UpdateHistory(m); Events.InvokeChat(new ChatEventArgs(m, this, msg)); if (Data.LogChat) { Logging.LogChat(String.Format(DateTime.Now + " <{0}{1}> {2}: {3}", c_Name, (c_Style == ChatStyle.Regional && m.Region != null ? "-" + Server.Misc.Worlds.GetRegionName(m.Map, m.Location) : ""), m.RawName, msg)); } Data.TotalChats++; Data.GetData(m).Karma++; Broadcast(m, msg); if (c_ToIrc && IrcConnection.Connection.Connected) { IrcConnection.Connection.SendUserMessage(m, "(" + c_Name + ") " + msg); } }