Fixes FindItemsByType and FindItemByType and new override of IsLockedDown and IsSecure by renaming their methods.

This commit is contained in:
Kamron Batman 2018-09-15 15:50:35 -07:00
parent 7321fa1b63
commit a48ebb3a5f
50 changed files with 416 additions and 643 deletions

View file

@ -68,7 +68,7 @@ namespace Server.Mobiles
// When we have no ammo, we flee
Container pack = m_Mobile.Backpack;
if (pack?.FindItemByType(typeof(Arrow)) == null)
if (pack?.FindItemByType<Arrow>() == null)
{
Action = ActionType.Flee;
return true;

View file

@ -81,7 +81,7 @@ namespace Server.Mobiles
if (cpack != null)
{
Item steala = cpack.FindItemByType(typeof(Bandage));
Item steala = cpack.FindItemByType<Bandage>();
if (steala != null)
{
m_Mobile.DebugSay("Trying to steal from combatant.");
@ -89,7 +89,7 @@ namespace Server.Mobiles
m_Mobile.Target?.Invoke(m_Mobile, steala);
}
Item stealb = cpack.FindItemByType(typeof(Nightshade));
Item stealb = cpack.FindItemByType<Nightshade>();
if (stealb != null)
{
m_Mobile.DebugSay("Trying to steal from combatant.");
@ -97,7 +97,7 @@ namespace Server.Mobiles
m_Mobile.Target?.Invoke(m_Mobile, stealb);
}
Item stealc = cpack.FindItemByType(typeof(BlackPearl));
Item stealc = cpack.FindItemByType<BlackPearl>();
if (stealc != null)
{
m_Mobile.DebugSay("Trying to steal from combatant.");
@ -105,14 +105,14 @@ namespace Server.Mobiles
m_Mobile.Target?.Invoke(m_Mobile, stealc);
}
Item steald = cpack.FindItemByType(typeof(MandrakeRoot));
Item steald = cpack.FindItemByType<MandrakeRoot>();
if (steald != null)
{
m_Mobile.DebugSay("Trying to steal from combatant.");
m_Mobile.UseSkill(SkillName.Stealing);
m_Mobile.Target?.Invoke(m_Mobile, steald);
}
else if (steala == null && stealb == null && stealc == null && steald == null)
else if (steala == null && stealb == null && stealc == null)
{
m_Mobile.DebugSay("I am going to flee from {0}", combatant.Name);