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

@ -253,7 +253,7 @@ namespace Server.Items
healerNumber = 501042; // Target can not be resurrected at that location.
patientNumber = 502391; // Thou can not be resurrected there!
}
else if (Patient.Region != null && Patient.Region.IsPartOf("Khaldun"))
else if (Patient.Region?.IsPartOf("Khaldun") == true)
{
healerNumber =
1010395; // The veil of death in this area is too strong and resists thy efforts to restore life.
@ -281,7 +281,7 @@ namespace Server.Items
{
healerNumber = 503255; // You are able to resurrect the creature.
master.CloseGump(typeof(PetResurrectGump));
master.CloseGump<PetResurrectGump>();
master.SendGump(new PetResurrectGump(Healer, petPatient));
}
else
@ -298,7 +298,7 @@ namespace Server.Items
{
healerNumber = 503255; // You are able to resurrect the creature.
friend.CloseGump(typeof(PetResurrectGump));
friend.CloseGump<PetResurrectGump>();
friend.SendGump(new PetResurrectGump(Healer, petPatient));
found = true;
@ -312,7 +312,7 @@ namespace Server.Items
}
else
{
Patient.CloseGump(typeof(ResurrectGump));
Patient.CloseGump<ResurrectGump>();
Patient.SendGump(new ResurrectGump(Patient, Healer));
}
}

View file

@ -32,7 +32,7 @@ namespace Server.Items
return false;
}
if (!from.CanBeginAction(typeof(FireHorn)))
if (!from.CanBeginAction<FireHorn>())
{
from.SendLocalizedMessage(1049615); // You must take a moment to catch your breath.
return false;
@ -62,11 +62,10 @@ namespace Server.Items
if (!CheckUse(from))
return;
from.BeginAction(typeof(FireHorn));
Timer.DelayCall(Core.AOS ? TimeSpan.FromSeconds(6.0) : TimeSpan.FromSeconds(12.0),
new TimerStateCallback(EndAction), from);
from.BeginAction<FireHorn>();
Timer.DelayCall(Core.AOS ? TimeSpan.FromSeconds(6.0) : TimeSpan.FromSeconds(12.0), EndAction, from);
int music = from.Skills[SkillName.Musicianship].Fixed;
int music = from.Skills.Musicianship.Fixed;
int sucChance = 500 + (music - 775) * 2;
double dSucChance = sucChance / 1000.0;
@ -107,9 +106,9 @@ namespace Server.Items
if (targets.Count > 0)
{
int prov = from.Skills[SkillName.Provocation].Fixed;
int disc = from.Skills[SkillName.Discordance].Fixed;
int peace = from.Skills[SkillName.Peacemaking].Fixed;
int prov = from.Skills.Provocation.Fixed;
int disc = from.Skills.Discordance.Fixed;
int peace = from.Skills.Peacemaking.Fixed;
int minDamage, maxDamage;
@ -176,12 +175,10 @@ namespace Server.Items
}
}
private static void EndAction(object state)
private static void EndAction(Mobile m)
{
Mobile m = (Mobile)state;
m.EndAction(typeof(FireHorn));
m.SendLocalizedMessage(1049621); // You catch your breath.
m?.EndAction<FireHorn>();
m?.SendLocalizedMessage(1049621); // You catch your breath.
}
public override void Serialize(GenericWriter writer)

View file

@ -172,11 +172,7 @@ namespace Server.Items
public bool VerifyRegion(Mobile m)
{
//TODO: When the entire region system data is in, convert to that instead of a proximity thing.
if (!m.Region.IsPartOf(typeof(TownRegion)))
return false;
return Faction.IsNearType(m, RepairSkillInfo.GetInfo(m_Skill).NearbyTypes, 6);
return m.Region.IsPartOf<TownRegion>() && Faction.IsNearType(m, RepairSkillInfo.GetInfo(m_Skill).NearbyTypes, 6);
}
public override void Serialize(GenericWriter writer)