ModernUO/Projects/UOContent/Engines/Quests/Emino's Undertaking/Items/WhiteNinjaQuestTeleporter.cs
Kamron Batman e994505ad0
fix: Adds safety to corpses and cleans up quests (#1685)
### Summary
- Adds some more checks in case a corpse's owner is somehow null. Would like to eventually allow null owner corpses, but more work is needed.
- Cleans up variable unboxing and reassignment in quests. Also flattens quest logic. Still more work needs to be done.
- Codegens more quest items/mobiles.
2024-02-18 19:33:08 -08:00

42 lines
1 KiB
C#

using ModernUO.Serialization;
using Server.Mobiles;
namespace Server.Engines.Quests.Ninja;
[SerializationGenerator(0, false)]
public partial class WhiteNinjaQuestTeleporter : DynamicTeleporter
{
[Constructible]
public WhiteNinjaQuestTeleporter() : base(0x51C, 0x47E)
{
}
public override int LabelNumber => 1026157; // teleporter
public override int NotWorkingMessage => 1063198; // You stand on the strange floor tile but nothing happens.
public override bool GetDestination(PlayerMobile player, ref Point3D loc, ref Map map)
{
var qs = player.Quest;
if (qs is EminosUndertakingQuest)
{
var obj = qs.FindObjective<SearchForSwordObjective>();
if (obj != null)
{
if (!obj.Completed)
{
obj.Complete();
}
loc = new Point3D(411, 1085, 0);
map = Map.Malas;
return true;
}
}
return false;
}
}