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

@ -51,15 +51,15 @@ namespace Server.SkillHandlers
{
from.RevealingAction();
if (!(targeted is Mobile))
if (!(targeted is Mobile targ))
{
from.SendLocalizedMessage(1049528); // You cannot calm that!
}
else if (from.Region.IsPartOf(typeof(SafeZone)))
else if (from.Region.IsPartOf<SafeZone>())
{
from.SendMessage("You may not peacemake in this area.");
}
else if (((Mobile)targeted).Region.IsPartOf(typeof(SafeZone)))
else if (targ.Region.IsPartOf<SafeZone>())
{
from.SendMessage("You may not peacemake there.");
}
@ -105,8 +105,8 @@ namespace Server.SkillHandlers
foreach (Mobile m in from.GetMobilesInRange(range))
{
if (m is BaseCreature && ((BaseCreature)m).Uncalmable ||
m is BaseCreature && ((BaseCreature)m).AreaPeaceImmune || m == from ||
BaseCreature bc = m as BaseCreature;
if (bc?.Uncalmable == true || bc?.AreaPeaceImmune == true || m == from ||
!from.CanBeHarmful(m, false))
continue;
@ -117,8 +117,8 @@ namespace Server.SkillHandlers
m.Combatant = null;
m.Warmode = false;
if (m is BaseCreature && !((BaseCreature)m).BardPacified)
((BaseCreature)m).Pacify(from, DateTime.UtcNow + TimeSpan.FromSeconds(1.0));
if (bc?.BardPacified == false)
bc.Pacify(from, DateTime.UtcNow + TimeSpan.FromSeconds(1.0));
}
if (!calmed)
@ -132,20 +132,19 @@ namespace Server.SkillHandlers
else
{
// Target mode : pacify a single target for a longer duration
Mobile targ = (Mobile)targeted;
BaseCreature bc = targ as BaseCreature;
if (!from.CanBeHarmful(targ, false))
{
from.SendLocalizedMessage(1049528);
m_SetSkillTime = true;
}
else if (targ is BaseCreature && ((BaseCreature)targ).Uncalmable)
else if (bc?.Uncalmable == true)
{
from.SendLocalizedMessage(1049526); // You have no chance of calming that creature.
m_SetSkillTime = true;
}
else if (targ is BaseCreature && ((BaseCreature)targ).BardPacified)
else if (bc?.BardPacified == true)
{
from.SendLocalizedMessage(1049527); // That creature is already being calmed.
m_SetSkillTime = true;
@ -160,7 +159,7 @@ namespace Server.SkillHandlers
else
{
double diff = m_Instrument.GetDifficultyFor(targ) - 10.0;
double music = from.Skills[SkillName.Musicianship].Value;
double music = from.Skills.Musicianship.Value;
if (music > 100.0)
diff -= (music - 100.0) * 0.5;
@ -177,15 +176,13 @@ namespace Server.SkillHandlers
m_Instrument.ConsumeUse(from);
from.NextSkillTime = Core.TickCount + 5000;
if (targ is BaseCreature)
targ.Combatant = null;
targ.Warmode = false;
if (bc != null)
{
BaseCreature bc = (BaseCreature)targ;
from.SendLocalizedMessage(1049532); // You play hypnotic music, calming your target.
targ.Combatant = null;
targ.Warmode = false;
double seconds = 100 - diff / 1.5;
if (seconds > 120)
@ -201,8 +198,6 @@ namespace Server.SkillHandlers
targ.SendLocalizedMessage(
500616); // You hear lovely music, and forget to continue battling!
targ.Combatant = null;
targ.Warmode = false;
}
}
}