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

@ -34,6 +34,7 @@ namespace Server
}
catch
{
// ignored
}
}
}

View file

@ -93,7 +93,7 @@ namespace Server
private static void Honor(PlayerMobile source, Mobile target)
{
IHonorTarget honorTarget = target as IHonorTarget;
GuardedRegion reg = (GuardedRegion)source.Region.GetRegion(typeof(GuardedRegion));
GuardedRegion reg = source.Region.GetRegion<GuardedRegion>();
Map map = source.Map;
if (honorTarget == null)
@ -343,7 +343,7 @@ namespace Server
return;
double dGain =
targetFame / 100 * (m_HonorDamage / m_TotalDamage); //Initial honor gain is 100th of the monsters honor
targetFame / 100.0 * (m_HonorDamage / m_TotalDamage); //Initial honor gain is 100th of the monsters honor
if (m_HonorDamage == m_TotalDamage && m_FirstHit == FirstHit.Granted)
dGain = dGain * 1.5; //honor gain is increased alot more if the combat was fully honorable

View file

@ -52,7 +52,7 @@ namespace Server
{
protector.SendLocalizedMessage(1049610); // You must reach the first path in this virtue to invoke it.
}
else if (!protector.CanBeginAction(typeof(JusticeVirtue)))
else if (!protector.CanBeginAction<JusticeVirtue>())
{
protector.SendLocalizedMessage(1049370); // You must wait a while before offering your protection again.
}
@ -81,7 +81,7 @@ namespace Server
if (!VirtueHelper.IsSeeker(protector, VirtueName.Justice))
protector.SendLocalizedMessage(1049610); // You must reach the first path in this virtue to invoke it.
else if (!protector.CanBeginAction(typeof(JusticeVirtue)))
else if (!protector.CanBeginAction<JusticeVirtue>())
protector.SendLocalizedMessage(1049370); // You must wait a while before offering your protection again.
else if (protector.JusticeProtectors.Count > 0)
protector.SendLocalizedMessage(1049542); // You cannot protect someone while being protected.
@ -95,7 +95,7 @@ namespace Server
protector.SendLocalizedMessage(1049436); // That player cannot be protected.
else if (pm.JusticeProtectors.Count > 0)
protector.SendLocalizedMessage(1049369); // You cannot protect that player right now.
else if (pm.HasGump(typeof(AcceptProtectorGump)))
else if (pm.HasGump<AcceptProtectorGump>())
protector.SendLocalizedMessage(1049369); // You cannot protect that player right now.
else
pm.SendGump(new AcceptProtectorGump(protector, pm));
@ -107,7 +107,7 @@ namespace Server
{
protector.SendLocalizedMessage(1049610); // You must reach the first path in this virtue to invoke it.
}
else if (!protector.CanBeginAction(typeof(JusticeVirtue)))
else if (!protector.CanBeginAction<JusticeVirtue>())
{
protector.SendLocalizedMessage(1049370); // You must wait a while before offering your protection again.
}
@ -149,14 +149,8 @@ namespace Server
protectee.SendLocalizedMessage(1049453, args); // You have declined protection from ~1_NAME~.
protector.SendLocalizedMessage(1049454, args); // ~2_NAME~ has declined your protection.
if (protector.BeginAction(typeof(JusticeVirtue)))
Timer.DelayCall(TimeSpan.FromMinutes(15.0), new TimerStateCallback(RejectDelay_Callback), protector);
}
public static void RejectDelay_Callback(object state)
{
if (state is Mobile m)
m.EndAction(typeof(JusticeVirtue));
if (protector.BeginAction<JusticeVirtue>())
Timer.DelayCall(TimeSpan.FromMinutes(15.0), protector.EndAction<JusticeVirtue>);
}
public static void CheckAtrophy(Mobile from)
@ -176,6 +170,7 @@ namespace Server
}
catch
{
// ignored
}
}
}

View file

@ -52,6 +52,7 @@ namespace Server
}
catch
{
// ignored
}
}
@ -81,7 +82,7 @@ namespace Server
* We need to wait for them to accept the gump or they can just use
* Sacrifice and cancel to have items in their backpack for free.
*/
from.CloseGump(typeof(ResurrectGump));
from.CloseGump<ResurrectGump>();
from.SendGump(new ResurrectGump(from, true));
}
}

View file

@ -41,6 +41,7 @@ namespace Server
}
catch
{
// ignored
}
}

View file

@ -10,8 +10,7 @@ namespace Server
{
private static Dictionary<int, OnVirtueUsed> m_Callbacks = new Dictionary<int, OnVirtueUsed>();
private static int[] m_Table = new int[24]
{
private static int[] m_Table = {
0x0481, 0x0963, 0x0965,
0x060A, 0x060F, 0x002A,
0x08A4, 0x08A7, 0x0034,
@ -70,7 +69,7 @@ namespace Server
if (e.Beholder != e.Beheld)
return;
e.Beholder.CloseGump(typeof(VirtueGump));
e.Beholder.CloseGump<VirtueGump>();
if (e.Beholder.Kills >= 5)
{
@ -118,7 +117,7 @@ namespace Server
}
else if (beholder.Map == beheld.Map && beholder.InRange(beheld, 12))
{
beholder.CloseGump(typeof(VirtueGump));
beholder.CloseGump<VirtueGump>();
beholder.SendGump(new VirtueGump(beholder, beheld));
}
}