Modernization Fixes & Updates to Default Values (#3)

This commit is contained in:
Kamron Batman 2018-10-28 00:33:16 -07:00 committed by GitHub
parent 445eddff68
commit dcf64091b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
768 changed files with 10507 additions and 14196 deletions

View file

@ -314,28 +314,13 @@ namespace Server.Guilds
m_Members[i].GuildMessage(number);
}
public void AllianceMessage(int number, string args)
{
AllianceMessage(number, args, 0x3B2);
}
public void AllianceMessage(int number, string args, int hue)
public void AllianceMessage(int number, string args, int hue = 0x3B2)
{
for (int i = 0; i < m_Members.Count; ++i)
m_Members[i].GuildMessage(number, args, hue);
}
public void AllianceMessage(int number, bool append, string affix)
{
AllianceMessage(number, append, affix, "", 0x3B2);
}
public void AllianceMessage(int number, bool append, string affix, string args)
{
AllianceMessage(number, append, affix, args, 0x3B2);
}
public void AllianceMessage(int number, bool append, string affix, string args, int hue)
public void AllianceMessage(int number, bool append, string affix, string args = "", int hue = 0x3B2)
{
for (int i = 0; i < m_Members.Count; ++i)
m_Members[i].GuildMessage(number, append, affix, args, hue);
@ -483,9 +468,8 @@ namespace Server.Guilds
{
if (Kills > w.Kills)
return WarStatus.Win;
if (Kills < w.Kills)
return WarStatus.Lose;
return WarStatus.Draw;
return Kills < w.Kills ? WarStatus.Lose : WarStatus.Draw;
}
if (MaxKills > 0)
@ -534,8 +518,8 @@ namespace Server.Guilds
protected override void OnTick()
{
foreach (Guild g in BaseGuild.List.Values)
g.CheckExpiredWars();
foreach (BaseGuild g in BaseGuild.List.Values)
(g as Guild)?.CheckExpiredWars();
}
}
@ -583,7 +567,7 @@ namespace Server.Guilds
#endregion
}
public Guild(int id) : base(id) //serialization ctor
public Guild(uint id) : base(id) //serialization ctor
{
}
@ -674,7 +658,6 @@ namespace Server.Guilds
RemoveMember(mob);
}
public void Disband()
{
m_Leader = null;
@ -727,7 +710,7 @@ namespace Server.Guilds
}
else
{
Guild g = int.TryParse(arg, out int id)
Guild g = uint.TryParse(arg, out uint id)
? Find(id) as Guild
: FindByAbbrev(arg) as Guild ?? FindByName(arg) as Guild;
@ -751,7 +734,7 @@ namespace Server.Guilds
{
if (!BaseCommand.IsAccessible(from, o))
{
from.SendMessage("That is not accessible.");
from.SendLocalizedMessage(500447); // That is not accessible.
return;
}
@ -970,12 +953,7 @@ namespace Server.Guilds
}
}
public static void HandleDeath(Mobile victim)
{
HandleDeath(victim, null);
}
public static void HandleDeath(Mobile victim, Mobile killer)
public static void HandleDeath(Mobile victim, Mobile killer = null)
{
if (!NewGuildSystem)
return;
@ -1264,10 +1242,7 @@ namespace Server.Guilds
Members.Add(m);
m.Guild = this;
if (!NewGuildSystem)
m.GuildFealty = m_Leader;
else
m.GuildFealty = null;
m.GuildFealty = !NewGuildSystem ? m_Leader : null;
if (m is PlayerMobile mobile)
mobile.GuildRank = RankDefinition.Lowest;
@ -1276,12 +1251,7 @@ namespace Server.Guilds
}
}
public void RemoveMember(Mobile m)
{
RemoveMember(m, 1018028); // You have been dismissed from your guild.
}
public void RemoveMember(Mobile m, int message)
public void RemoveMember(Mobile m, int message = 1018028) // You have been dismissed from your guild.
{
if (Members.Contains(m))
{
@ -1599,4 +1569,4 @@ namespace Server.Guilds
#endregion
}
}
}