fix: Fixes gate travel location issue (#1484)
This commit is contained in:
parent
1b07b00510
commit
15227a53ec
1 changed files with 35 additions and 10 deletions
|
|
@ -1,12 +1,14 @@
|
||||||
using System;
|
using System;
|
||||||
|
using ModernUO.Serialization;
|
||||||
using Server.Factions;
|
using Server.Factions;
|
||||||
using Server.Items;
|
using Server.Items;
|
||||||
using Server.Misc;
|
using Server.Misc;
|
||||||
using Server.Mobiles;
|
using Server.Mobiles;
|
||||||
|
using Server.Multis;
|
||||||
|
|
||||||
namespace Server.Spells.Seventh
|
namespace Server.Spells.Seventh
|
||||||
{
|
{
|
||||||
public class GateTravelSpell : MagerySpell, IRecallSpell
|
public partial class GateTravelSpell : MagerySpell, IRecallSpell
|
||||||
{
|
{
|
||||||
private static readonly SpellInfo _info = new(
|
private static readonly SpellInfo _info = new(
|
||||||
"Gate Travel",
|
"Gate Travel",
|
||||||
|
|
@ -89,6 +91,9 @@ namespace Server.Spells.Seventh
|
||||||
|
|
||||||
var secondGate = new InternalItem(Caster.Location, Caster.Map);
|
var secondGate = new InternalItem(Caster.Location, Caster.Map);
|
||||||
secondGate.MoveToWorld(loc, map);
|
secondGate.MoveToWorld(loc, map);
|
||||||
|
|
||||||
|
firstGate.LinkedGate = secondGate;
|
||||||
|
secondGate.LinkedGate = firstGate;
|
||||||
}
|
}
|
||||||
|
|
||||||
FinishSequence();
|
FinishSequence();
|
||||||
|
|
@ -151,7 +156,8 @@ namespace Server.Spells.Seventh
|
||||||
}
|
}
|
||||||
|
|
||||||
[DispellableField]
|
[DispellableField]
|
||||||
private class InternalItem : Moongate
|
[SerializationGenerator(0)]
|
||||||
|
private partial class InternalItem : Moongate
|
||||||
{
|
{
|
||||||
public InternalItem(Point3D target, Map map) : base(target, map)
|
public InternalItem(Point3D target, Map map) : base(target, map)
|
||||||
{
|
{
|
||||||
|
|
@ -168,21 +174,40 @@ namespace Server.Spells.Seventh
|
||||||
t.Start();
|
t.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public InternalItem(Serial serial) : base(serial)
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
{
|
public Moongate LinkedGate { get; set; }
|
||||||
}
|
|
||||||
|
|
||||||
public override bool ShowFeluccaWarning => Core.AOS;
|
public override bool ShowFeluccaWarning => Core.AOS;
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
public override void UseGate(Mobile m)
|
||||||
{
|
{
|
||||||
base.Serialize(writer);
|
if (LinkedGate?.Deleted != false)
|
||||||
|
{
|
||||||
|
m.SendMessage("The other gate no longer exists.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var target = LinkedGate.Location;
|
||||||
|
var targetMap = LinkedGate.TargetMap;
|
||||||
|
|
||||||
|
// TODO: Add boat permissions
|
||||||
|
// BaseBoat boat = BaseBoat.FindBoatAt(target, targetMap);
|
||||||
|
//
|
||||||
|
// if (boat != null && !boat.HasAccess(m))
|
||||||
|
// {
|
||||||
|
// m.SendLocalizedMessage(1116617); // You do not have permission to board this ship.
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
Target = target;
|
||||||
|
TargetMap = targetMap;
|
||||||
|
|
||||||
|
base.UseGate(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
[AfterDeserialization(false)]
|
||||||
|
private void AfterDeserialization()
|
||||||
{
|
{
|
||||||
base.Deserialize(reader);
|
|
||||||
|
|
||||||
Delete();
|
Delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue