Overwrite

Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
Unstable Kitsune
2023-11-28 23:20:26 -05:00
parent 3cd54811de
commit b918192e4e
11608 changed files with 2644205 additions and 47 deletions

View File

@@ -0,0 +1,92 @@
using System;
using System.Collections;
using Server;
using Server.Gumps;
using Server.Commands;
using Knives.Utils;
namespace Knives.Chat3
{
public class Pm
{
public static void Initialize()
{
CommandSystem.Register("pm", AccessLevel.Player, new CommandEventHandler(OnMessage));
CommandSystem.Register("msg", AccessLevel.Player, new CommandEventHandler(OnMessage));
}
private static void OnMessage(CommandEventArgs args)
{
if (args.ArgString == null || args.ArgString == "")
return;
string name = args.GetString(0);
string text = "";
if (args.Arguments.Length > 1)
text = args.ArgString.Substring(name.Length + 1, args.ArgString.Length - name.Length - 1);
ArrayList list = GetMsgCanidates(args.Mobile, name);
if (list.Count > 10)
args.Mobile.SendMessage(Data.GetData(args.Mobile).SystemC, General.Local(112));
else if (list.Count == 0)
args.Mobile.SendMessage(Data.GetData(args.Mobile).SystemC, General.Local(113));
else if (list.Count == 1)
SendMessageGump.SendTo(args.Mobile, (Mobile)list[0], text);
else
new InternalGump(args.Mobile, list, text);
}
private static ArrayList GetMsgCanidates(Mobile m, string name)
{
ArrayList list = new ArrayList();
foreach (Data data in new ArrayList(Data.Datas.Values))
if (data.Mobile.Name.ToLower().IndexOf(name) != -1 && Message.CanMessage(m, data.Mobile))
list.Add(data.Mobile);
return list;
}
private class InternalGump : GumpPlus
{
private ArrayList c_List;
private string c_Text;
public InternalGump(Mobile m, ArrayList list, string txt) : base(m, 100, 100)
{
c_List = list;
c_Text = txt;
NewGump();
}
protected override void BuildGump()
{
int y = 10;
AddHtml(0, y, 150, 21, HTML.White + "<CENTER>" + General.Local(114), false, false);
y += 5;
foreach (Mobile m in c_List)
{
AddHtml(60, y += 20, 90, 21, HTML.White + m.Name, false, false);
AddButton(45, y + 3, 0x2716, 0x2716, "Select", new TimerStateCallback(Select), m);
}
Entries.Insert(0, new GumpBackground(0, 0, 150, y + 40, 0x1400));
}
private void Select(object o)
{
if (!(o is Mobile))
return;
SendMessageGump.SendTo(Owner, (Mobile)o, c_Text);
}
}
}
}