Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
73
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Channels/Guild.cs
Normal file
73
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Channels/Guild.cs
Normal file
@@ -0,0 +1,73 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Knives.Utils;
|
||||
|
||||
namespace Knives.Chat3
|
||||
{
|
||||
public class Guild : Channel
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
new Guild();
|
||||
}
|
||||
|
||||
public Guild() : base("Guild")
|
||||
{
|
||||
Commands.Add("guild");
|
||||
Commands.Add("g");
|
||||
DefaultC = 0x44;
|
||||
|
||||
Register(this);
|
||||
}
|
||||
|
||||
public override string NameFor(Mobile m)
|
||||
{
|
||||
if (m.Guild == null)
|
||||
return Name;
|
||||
|
||||
if (m.Guild.Abbreviation == "")
|
||||
return Name;
|
||||
|
||||
return m.Guild.Abbreviation;
|
||||
}
|
||||
|
||||
public override bool CanChat(Mobile m, bool say)
|
||||
{
|
||||
if (m.Guild == null)
|
||||
{
|
||||
if (say) m.SendMessage(Data.GetData(m).SystemC, General.Local(36));
|
||||
return false;
|
||||
}
|
||||
|
||||
return base.CanChat(m, say);
|
||||
}
|
||||
|
||||
protected override void Broadcast(Mobile m, string msg)
|
||||
{
|
||||
foreach (Data data in Data.Datas.Values)
|
||||
{
|
||||
if (data.Mobile.AccessLevel >= m.AccessLevel && ((data.GlobalG && !data.GIgnores.Contains(m)) || data.GListens.Contains(m)))
|
||||
data.Mobile.SendMessage(data.GlobalGC, String.Format("(Global) <{0}> {1}: {2}", NameFor(m), m.Name, msg));
|
||||
else if (data.Channels.Contains(Name) && !data.Ignores.Contains(m))
|
||||
{
|
||||
if (data.Mobile.Guild != m.Guild)
|
||||
continue;
|
||||
|
||||
data.Mobile.SendMessage(m.AccessLevel == AccessLevel.Player ? data.ColorFor(this) : Data.GetData(m).StaffC, String.Format("<{0}{1}> {2}: {3}", NameFor(m), (Style == ChatStyle.Regional && m.Region != null ? "-" + m.Region.Name : ""), m.Name, msg));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override ArrayList BuildList(Mobile m)
|
||||
{
|
||||
ArrayList list = base.BuildList(m);
|
||||
|
||||
foreach (Mobile mob in new ArrayList(list))
|
||||
if (mob.Guild != m.Guild)
|
||||
list.Remove(mob);
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user