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

@ -90,7 +90,7 @@ namespace Server.Engines.Quests.Necro
if (qs.IsObjectiveInProgress(typeof(FindMardothAboutKronusObjective)) ||
qs.IsObjectiveInProgress(typeof(FindWellOfTearsObjective)) ||
qs.IsObjectiveInProgress(typeof(UseCallingScrollObjective)))
return from.Backpack?.FindItemByType(typeof(KronusScroll)) == null;
return from.Backpack?.FindItemByType<KronusScroll>() == null;
return false;
}

View file

@ -106,7 +106,7 @@ namespace Server.Engines.Quests.Ninja
if (qs is EminosUndertakingQuest)
if (qs.IsObjectiveInProgress(typeof(GiveZoelNoteObjective)))
return from.Backpack?.FindItemByType(typeof(NoteForZoel)) == null;
return from.Backpack?.FindItemByType<NoteForZoel>() == null;
return false;
}
@ -120,7 +120,7 @@ namespace Server.Engines.Quests.Ninja
if (qs is EminosUndertakingQuest)
if (qs.IsObjectiveInProgress(typeof(GiveEminoSwordObjective)))
return from.Backpack?.FindItemByType(typeof(EminosKatana)) == null;
return from.Backpack?.FindItemByType<EminosKatana>() == null;
return false;
}

View file

@ -147,7 +147,7 @@ namespace Server.Engines.Quests.Ninja
Item katana = null;
if (player.Backpack != null)
katana = player.Backpack.FindItemByType(typeof(EminosKatana));
katana = player.Backpack.FindItemByType<EminosKatana>();
if (katana != null)
{

View file

@ -109,7 +109,7 @@ namespace Server.Engines.Quests.Samurai
if (qs is HaochisTrialsQuest)
if (qs.IsObjectiveInProgress(typeof(FifthTrialReturnObjective)))
return from.Backpack?.FindItemByType(typeof(HaochisKatana)) == null;
return from.Backpack?.FindItemByType<HaochisKatana>() == null;
return false;
}

View file

@ -117,21 +117,18 @@ namespace Server.Engines.Quests.Samurai
if (obj != null && !obj.Completed)
{
Container pack = player.Backpack;
Item katana = pack?.FindItemByType(typeof(HaochisKatana));
if (katana != null)
{
katana.Delete();
obj.Complete();
HaochisKatana katana = player.Backpack?.FindItemByType<HaochisKatana>();
if (katana == null)
return;
katana.Delete();
obj.Complete();
obj = qs.FindObjective(typeof(FifthTrialIntroObjective));
if (obj != null && ((FifthTrialIntroObjective)obj).StolenTreasure)
qs.AddConversation(new SixthTrialIntroConversation(true));
else
qs.AddConversation(new SixthTrialIntroConversation(false));
}
return;
obj = qs.FindObjective(typeof(FifthTrialIntroObjective));
if (obj != null && ((FifthTrialIntroObjective)obj).StolenTreasure)
qs.AddConversation(new SixthTrialIntroConversation(true));
else
qs.AddConversation(new SixthTrialIntroConversation(false));
}
obj = qs.FindObjective(typeof(SixthTrialReturnObjective));

View file

@ -117,7 +117,7 @@ namespace Server.Engines.Quests.Haven
if (qs is UzeraanTurmoilQuest)
if (qs.IsObjectiveInProgress(typeof(ReturnScrollOfPowerObjective)))
return from.Backpack?.FindItemByType(typeof(SchmendrickScrollOfPower)) == null;
return from.Backpack?.FindItemByType<SchmendrickScrollOfPower>() == null;
return false;
}
@ -131,7 +131,7 @@ namespace Server.Engines.Quests.Haven
if (qs is UzeraanTurmoilQuest)
if (qs.IsObjectiveInProgress(typeof(ReturnFertileDirtObjective)))
return from.Backpack?.FindItemByType(typeof(QuestFertileDirt)) == null;
return from.Backpack?.FindItemByType<QuestFertileDirt>() == null;
return false;
}
@ -145,7 +145,7 @@ namespace Server.Engines.Quests.Haven
if (qs is UzeraanTurmoilQuest)
if (qs.IsObjectiveInProgress(typeof(ReturnDaemonBloodObjective)))
return from.Backpack?.FindItemByType(typeof(QuestDaemonBlood)) == null;
return from.Backpack?.FindItemByType<QuestDaemonBlood>() == null;
return false;
}
@ -159,7 +159,7 @@ namespace Server.Engines.Quests.Haven
if (qs is UzeraanTurmoilQuest)
if (qs.IsObjectiveInProgress(typeof(ReturnDaemonBoneObjective)))
return from.Backpack?.FindItemByType(typeof(QuestDaemonBone)) == null;
return from.Backpack?.FindItemByType<QuestDaemonBone>() == null;
return false;
}