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

@ -217,28 +217,19 @@ namespace Server.Mobiles
public override bool HandlesOnSpeech(Mobile from)
{
if (InRange(from, 3))
return true;
return base.HandlesOnSpeech(from);
return InRange(from, 3) || base.HandlesOnSpeech(from);
}
private void ShoutNews_Callback(object state)
private void ShoutNews_Callback(TownCrierEntry tce, int index)
{
object[] states = (object[])state;
TownCrierEntry tce = (TownCrierEntry)states[0];
int index = (int)states[1];
if (index < 0 || index >= tce.Lines.Length)
{
m_NewsTimer?.Stop();
m_NewsTimer = null;
}
else
{
PublicOverheadMessage(MessageType.Regular, 0x3B2, false, tce.Lines[index]);
states[1] = index + 1;
}
}
@ -278,8 +269,9 @@ namespace Server.Mobiles
}
else
{
int index = 0;
m_NewsTimer = Timer.DelayCall(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(3.0),
new TimerStateCallback(ShoutNews_Callback), new object[] { tce, 0 });
() => ShoutNews_Callback(tce, index));
PublicOverheadMessage(MessageType.Regular, 0x3B2, 502978); // Some of the latest news!
}
@ -456,7 +448,7 @@ namespace Server.Mobiles
public void BeginChangeAppearance(Mobile from)
{
from.CloseGump(typeof(PlayerVendorCustomizeGump));
from.CloseGump<PlayerVendorCustomizeGump>();
from.SendGump(new PlayerVendorCustomizeGump(this, from));
}
@ -623,8 +615,8 @@ namespace Server.Mobiles
m_From = from;
m_Barkeeper = barkeeper;
from.CloseGump(typeof(BarkeeperGump));
from.CloseGump(typeof(BarkeeperTitleGump));
from.CloseGump<BarkeeperGump>();
from.CloseGump<BarkeeperTitleGump>();
Entry[] entries = m_Entries;
@ -767,8 +759,8 @@ namespace Server.Mobiles
m_From = from;
m_Barkeeper = barkeeper;
from.CloseGump(typeof(BarkeeperGump));
from.CloseGump(typeof(BarkeeperTitleGump));
from.CloseGump<BarkeeperGump>();
from.CloseGump<BarkeeperTitleGump>();
RenderBackground();
RenderCategories();