### 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.
51 lines
1.2 KiB
C#
51 lines
1.2 KiB
C#
using ModernUO.Serialization;
|
|
using Server.Mobiles;
|
|
|
|
namespace Server.Engines.Quests.Necro;
|
|
|
|
[SerializationGenerator(0, false)]
|
|
public partial class CrystalCaveBarrier : Item
|
|
{
|
|
[Constructible]
|
|
public CrystalCaveBarrier() : base(0x3967) => Movable = false;
|
|
|
|
public override bool OnMoveOver(Mobile m)
|
|
{
|
|
if (m.AccessLevel > AccessLevel.Player)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
var mob = m;
|
|
|
|
if (m is BaseCreature creature)
|
|
{
|
|
mob = creature.ControlMaster;
|
|
}
|
|
|
|
if (mob is not PlayerMobile pm)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
var qs = pm.Quest;
|
|
|
|
if (qs is DarkTidesQuest)
|
|
{
|
|
var obj = qs.FindObjective<SpeakCavePasswordObjective>();
|
|
|
|
if (obj?.Completed == true)
|
|
{
|
|
// With Horus' permission, you are able to pass through the barrier.
|
|
m.SendLocalizedMessage(1060648);
|
|
|
|
return true;
|
|
}
|
|
}
|
|
|
|
// Without the permission of the guardian Horus, the magic of the barrier prevents your passage.
|
|
m.SendLocalizedMessage(1060649, "", 0x66D);
|
|
|
|
return false;
|
|
}
|
|
}
|