Fixes code according to modern code style. Fixes a few expression bugs.

This commit is contained in:
Kamron Batman 2018-09-15 09:58:51 -07:00
parent 89eea25e5f
commit 970fd563b2
3324 changed files with 441118 additions and 433755 deletions

View file

@ -2,64 +2,66 @@ using Server.Mobiles;
namespace Server.Engines.Quests.Necro
{
public class CrystalCaveBarrier : Item
{
[Constructible]
public CrystalCaveBarrier() : base( 0x3967 )
{
Movable = false;
}
public class CrystalCaveBarrier : Item
{
[Constructible]
public CrystalCaveBarrier() : base(0x3967)
{
Movable = false;
}
public override bool OnMoveOver( Mobile m )
{
if ( m.AccessLevel > AccessLevel.Player )
return true;
public CrystalCaveBarrier(Serial serial) : base(serial)
{
}
bool sendMessage = m.Player;
public override bool OnMoveOver(Mobile m)
{
if (m.AccessLevel > AccessLevel.Player)
return true;
if ( m is BaseCreature )
m = ((BaseCreature)m).ControlMaster;
bool sendMessage = m.Player;
if ( m is PlayerMobile pm )
{
QuestSystem qs = pm.Quest;
if (m is BaseCreature)
m = ((BaseCreature)m).ControlMaster;
if ( qs is DarkTidesQuest )
{
QuestObjective obj = qs.FindObjective( typeof( SpeakCavePasswordObjective ) );
if (m is PlayerMobile pm)
{
QuestSystem qs = pm.Quest;
if ( obj != null && obj.Completed )
{
if ( sendMessage )
m.SendLocalizedMessage( 1060648 ); // With Horus' permission, you are able to pass through the barrier.
if (qs is DarkTidesQuest)
{
QuestObjective obj = qs.FindObjective(typeof(SpeakCavePasswordObjective));
return true;
}
}
}
if (obj != null && obj.Completed)
{
if (sendMessage)
m.SendLocalizedMessage(
1060648); // With Horus' permission, you are able to pass through the barrier.
if ( sendMessage )
m.SendLocalizedMessage( 1060649, "", 0x66D ); // Without the permission of the guardian Horus, the magic of the barrier prevents your passage.
return true;
}
}
}
return false;
}
if (sendMessage)
m.SendLocalizedMessage(1060649, "",
0x66D); // Without the permission of the guardian Horus, the magic of the barrier prevents your passage.
public CrystalCaveBarrier( Serial serial ) : base( serial )
{
}
return false;
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write( (int) 0 ); // version
}
writer.Write(0); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
int version = reader.ReadInt();
}
}
}

View file

@ -2,36 +2,36 @@ using Server.Mobiles;
namespace Server.Engines.Quests.Necro
{
public class DarkTidesHorn : HornOfRetreat
{
public override bool ValidateUse( Mobile from )
{
return ( from is PlayerMobile pm && pm.Quest is DarkTidesQuest );
}
public class DarkTidesHorn : HornOfRetreat
{
[Constructible]
public DarkTidesHorn()
{
DestLoc = new Point3D(2103, 1319, -68);
DestMap = Map.Malas;
}
[Constructible]
public DarkTidesHorn()
{
DestLoc = new Point3D( 2103, 1319, -68 );
DestMap = Map.Malas;
}
public DarkTidesHorn(Serial serial) : base(serial)
{
}
public DarkTidesHorn( Serial serial ) : base( serial )
{
}
public override bool ValidateUse(Mobile from)
{
return from is PlayerMobile pm && pm.Quest is DarkTidesQuest;
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write( (int) 0 ); // version
}
writer.Write(0); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
int version = reader.ReadInt();
}
}
}

View file

@ -2,72 +2,75 @@ using Server.Mobiles;
namespace Server.Engines.Quests.Necro
{
public class DarkTidesTeleporter : DynamicTeleporter
{
[Constructible]
public DarkTidesTeleporter()
{
}
public class DarkTidesTeleporter : DynamicTeleporter
{
[Constructible]
public DarkTidesTeleporter()
{
}
public override bool GetDestination( PlayerMobile player, ref Point3D loc, ref Map map )
{
QuestSystem qs = player.Quest;
public DarkTidesTeleporter(Serial serial) : base(serial)
{
}
if ( qs is DarkTidesQuest )
{
if ( qs.IsObjectiveInProgress( typeof( FindMaabusTombObjective ) ) )
{
loc = new Point3D( 2038, 1263, -90 );
map = Map.Malas;
qs.AddConversation( new RadarConversation() );
return true;
}
public override bool GetDestination(PlayerMobile player, ref Point3D loc, ref Map map)
{
QuestSystem qs = player.Quest;
if ( qs.IsObjectiveInProgress( typeof( FindCrystalCaveObjective ) ) )
{
loc = new Point3D( 1194, 521, -90 );
map = Map.Malas;
return true;
}
if ( qs.IsObjectiveInProgress( typeof( FindCityOfLightObjective ) ) )
{
loc = new Point3D( 1091, 519, -90 );
map = Map.Malas;
return true;
}
if ( qs.IsObjectiveInProgress( typeof( ReturnToCrystalCaveObjective ) ) )
{
loc = new Point3D( 1194, 521, -90 );
map = Map.Malas;
return true;
}
if ( DarkTidesQuest.HasLostCallingScroll( player ) )
{
loc = new Point3D( 1194, 521, -90 );
map = Map.Malas;
return true;
}
}
if (qs is DarkTidesQuest)
{
if (qs.IsObjectiveInProgress(typeof(FindMaabusTombObjective)))
{
loc = new Point3D(2038, 1263, -90);
map = Map.Malas;
qs.AddConversation(new RadarConversation());
return true;
}
return false;
}
if (qs.IsObjectiveInProgress(typeof(FindCrystalCaveObjective)))
{
loc = new Point3D(1194, 521, -90);
map = Map.Malas;
return true;
}
public DarkTidesTeleporter( Serial serial ) : base( serial )
{
}
if (qs.IsObjectiveInProgress(typeof(FindCityOfLightObjective)))
{
loc = new Point3D(1091, 519, -90);
map = Map.Malas;
return true;
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
if (qs.IsObjectiveInProgress(typeof(ReturnToCrystalCaveObjective)))
{
loc = new Point3D(1194, 521, -90);
map = Map.Malas;
return true;
}
writer.Write( (int) 0 ); // version
}
if (DarkTidesQuest.HasLostCallingScroll(player))
{
loc = new Point3D(1194, 521, -90);
map = Map.Malas;
return true;
}
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
return false;
}
int version = reader.ReadInt();
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write(0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}

View file

@ -1,159 +1,166 @@
using System;
using Server.Mobiles;
using Server.Items;
using Server.Mobiles;
using Server.Network;
namespace Server.Engines.Quests.Necro
{
public class KronusScroll : QuestItem
{
public override int LabelNumber => 1060149; // Calling of Kronus
public class KronusScroll : QuestItem
{
private static readonly Rectangle2D m_WellOfTearsArea = new Rectangle2D(2080, 1346, 10, 10);
private static readonly Map m_WellOfTearsMap = Map.Malas;
[Constructible]
public KronusScroll() : base( 0x227A )
{
Weight = 1.0;
Hue = 0x44E;
}
[Constructible]
public KronusScroll() : base(0x227A)
{
Weight = 1.0;
Hue = 0x44E;
}
public KronusScroll( Serial serial ) : base( serial )
{
}
public KronusScroll(Serial serial) : base(serial)
{
}
public override bool CanDrop( PlayerMobile player )
{
return !(player.Quest is DarkTidesQuest);
public override int LabelNumber => 1060149; // Calling of Kronus
/*return !( qs.IsObjectiveInProgress( typeof( FindCallingScrollObjective ) )
|| qs.IsObjectiveInProgress( typeof( FindMardothAboutKronusObjective ) )
|| qs.IsObjectiveInProgress( typeof( FindWellOfTearsObjective ) )
|| qs.IsObjectiveInProgress( typeof( UseCallingScrollObjective ) ) );*/
}
public override bool CanDrop(PlayerMobile player)
{
return !(player.Quest is DarkTidesQuest);
private static readonly Rectangle2D m_WellOfTearsArea = new Rectangle2D( 2080, 1346, 10, 10 );
private static readonly Map m_WellOfTearsMap = Map.Malas;
/*return !( qs.IsObjectiveInProgress( typeof( FindCallingScrollObjective ) )
|| qs.IsObjectiveInProgress( typeof( FindMardothAboutKronusObjective ) )
|| qs.IsObjectiveInProgress( typeof( FindWellOfTearsObjective ) )
|| qs.IsObjectiveInProgress( typeof( UseCallingScrollObjective ) ) );*/
}
public override void OnDoubleClick( Mobile from )
{
if ( !IsChildOf( from ) )
return;
public override void OnDoubleClick(Mobile from)
{
if (!IsChildOf(from))
return;
if ( from is PlayerMobile pm )
{
QuestSystem qs = pm.Quest;
if (from is PlayerMobile pm)
{
QuestSystem qs = pm.Quest;
if ( qs is DarkTidesQuest )
{
if ( qs.IsObjectiveInProgress( typeof( FindMardothAboutKronusObjective ) ) )
{
pm.SendLocalizedMessage( 1060151, "", 0x41 ); // You read the scroll, but decide against performing the calling until you are instructed to do so by Mardoth.
}
else if ( qs.IsObjectiveInProgress( typeof( FindWellOfTearsObjective ) ) )
{
pm.SendLocalizedMessage( 1060152, "", 0x41 ); // You must be at the Well of Tears in the city of Necromancers to use this scroll.
}
else if ( qs.IsObjectiveInProgress( typeof( UseCallingScrollObjective ) ) )
{
if ( pm.Map == m_WellOfTearsMap && m_WellOfTearsArea.Contains( pm ) )
{
QuestObjective obj = qs.FindObjective( typeof( UseCallingScrollObjective ) );
if (qs is DarkTidesQuest)
{
if (qs.IsObjectiveInProgress(typeof(FindMardothAboutKronusObjective)))
{
pm.SendLocalizedMessage(1060151, "",
0x41); // You read the scroll, but decide against performing the calling until you are instructed to do so by Mardoth.
}
else if (qs.IsObjectiveInProgress(typeof(FindWellOfTearsObjective)))
{
pm.SendLocalizedMessage(1060152, "",
0x41); // You must be at the Well of Tears in the city of Necromancers to use this scroll.
}
else if (qs.IsObjectiveInProgress(typeof(UseCallingScrollObjective)))
{
if (pm.Map == m_WellOfTearsMap && m_WellOfTearsArea.Contains(pm))
{
QuestObjective obj = qs.FindObjective(typeof(UseCallingScrollObjective));
if ( obj != null && !obj.Completed )
obj.Complete();
if (obj != null && !obj.Completed)
obj.Complete();
Delete();
new CallingTimer( pm ).Start();
}
else
{
pm.SendLocalizedMessage( 1060152, "", 0x41 ); // You must be at the Well of Tears in the city of Necromancers to use this scroll.
}
}
else
{
pm.SendLocalizedMessage( 1060150, "", 0x41 ); // A strange terror grips your heart as you attempt to read the scroll. You decide it would be a bad idea to read it out loud.
}
}
}
}
Delete();
new CallingTimer(pm).Start();
}
else
{
pm.SendLocalizedMessage(1060152, "",
0x41); // You must be at the Well of Tears in the city of Necromancers to use this scroll.
}
}
else
{
pm.SendLocalizedMessage(1060150, "",
0x41); // A strange terror grips your heart as you attempt to read the scroll. You decide it would be a bad idea to read it out loud.
}
}
}
}
private class CallingTimer : Timer
{
private PlayerMobile m_Player;
private int m_Step;
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
public CallingTimer( PlayerMobile player ) : base( TimeSpan.Zero, TimeSpan.FromSeconds( 1.0 ), 6 )
{
Priority = TimerPriority.TwentyFiveMS;
writer.Write(0); // version
}
m_Player = player;
m_Step = 0;
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
protected override void OnTick()
{
if ( m_Player.Deleted )
{
Stop();
return;
}
int version = reader.ReadInt();
}
if ( !m_Player.Mounted )
m_Player.Animate( Utility.RandomBool() ? 16 : 17, 7, 1, true, false, 0 );
private class CallingTimer : Timer
{
private PlayerMobile m_Player;
private int m_Step;
if ( m_Step == 4 )
{
int baseX = m_WellOfTearsArea.X;
int baseY = m_WellOfTearsArea.Y;
int width = m_WellOfTearsArea.Width;
int height = m_WellOfTearsArea.Height;
Map map = m_WellOfTearsMap;
public CallingTimer(PlayerMobile player) : base(TimeSpan.Zero, TimeSpan.FromSeconds(1.0), 6)
{
Priority = TimerPriority.TwentyFiveMS;
Effects.SendLocationParticles( EffectItem.Create( m_Player.Location, m_Player.Map, TimeSpan.FromSeconds( 1.0 ) ), 0, 0, 0, 0x13C4 );
Effects.PlaySound( m_Player.Location, m_Player.Map, 0x243 );
m_Player = player;
m_Step = 0;
}
for ( int i = 0; i < 15; i++ )
{
int x = baseX + Utility.Random( width );
int y = baseY + Utility.Random( height );
int z = map.GetAverageZ( x, y );
protected override void OnTick()
{
if (m_Player.Deleted)
{
Stop();
return;
}
Point3D from = new Point3D( x, y, z + Utility.RandomMinMax( 5, 20 ) );
Point3D to = new Point3D( x, y, z );
if (!m_Player.Mounted)
m_Player.Animate(Utility.RandomBool() ? 16 : 17, 7, 1, true, false, 0);
int hue = Utility.RandomList( 0x481, 0x482, 0x489, 0x497, 0x66D );
if (m_Step == 4)
{
int baseX = m_WellOfTearsArea.X;
int baseY = m_WellOfTearsArea.Y;
int width = m_WellOfTearsArea.Width;
int height = m_WellOfTearsArea.Height;
Map map = m_WellOfTearsMap;
Effects.SendPacket( from, map, new HuedEffect( EffectType.Moving, Serial.Zero, Serial.Zero, 0x36D4, from, to, 0, 0, false, true, hue, 0 ) );
}
}
Effects.SendLocationParticles(
EffectItem.Create(m_Player.Location, m_Player.Map, TimeSpan.FromSeconds(1.0)), 0, 0, 0, 0x13C4);
Effects.PlaySound(m_Player.Location, m_Player.Map, 0x243);
if ( m_Step < 5 )
{
m_Player.Frozen = true;
}
else // Cast completed
{
m_Player.Frozen = false;
for (int i = 0; i < 15; i++)
{
int x = baseX + Utility.Random(width);
int y = baseY + Utility.Random(height);
int z = map.GetAverageZ(x, y);
SummonedPaladin.BeginSummon( m_Player );
}
Point3D from = new Point3D(x, y, z + Utility.RandomMinMax(5, 20));
Point3D to = new Point3D(x, y, z);
m_Step++;
}
}
int hue = Utility.RandomList(0x481, 0x482, 0x489, 0x497, 0x66D);
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
Effects.SendPacket(from, map,
new HuedEffect(EffectType.Moving, Serial.Zero, Serial.Zero, 0x36D4, from, to, 0, 0, false, true,
hue, 0));
}
}
writer.Write( (int) 0 ); // version
}
if (m_Step < 5)
{
m_Player.Frozen = true;
}
else // Cast completed
{
m_Player.Frozen = false;
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
SummonedPaladin.BeginSummon(m_Player);
}
int version = reader.ReadInt();
}
}
}
m_Step++;
}
}
}
}

View file

@ -3,71 +3,72 @@ using Server.Mobiles;
namespace Server.Engines.Quests.Necro
{
public class KronusScrollBox : MetalBox
{
[Constructible]
public KronusScrollBox()
{
ItemID = 0xE80;
Movable = false;
public class KronusScrollBox : MetalBox
{
[Constructible]
public KronusScrollBox()
{
ItemID = 0xE80;
Movable = false;
for ( int i = 0; i < 40; i++ )
{
Item scroll = Loot.RandomScroll( 0, 15, SpellbookType.Necromancer );
scroll.Movable = false;
DropItem( scroll );
}
}
for (int i = 0; i < 40; i++)
{
Item scroll = Loot.RandomScroll(0, 15, SpellbookType.Necromancer);
scroll.Movable = false;
DropItem(scroll);
}
}
public KronusScrollBox( Serial serial ) : base( serial )
{
}
public KronusScrollBox(Serial serial) : base(serial)
{
}
public override void OnDoubleClick( Mobile from )
{
if ( from is PlayerMobile pm && pm.InRange( GetWorldLocation(), 2 ) )
{
QuestSystem qs = pm.Quest;
public override void OnDoubleClick(Mobile from)
{
if (from is PlayerMobile pm && pm.InRange(GetWorldLocation(), 2))
{
QuestSystem qs = pm.Quest;
if ( qs is DarkTidesQuest )
{
QuestObjective obj = qs.FindObjective( typeof( FindCallingScrollObjective ) );
if (qs is DarkTidesQuest)
{
QuestObjective obj = qs.FindObjective(typeof(FindCallingScrollObjective));
if ( (obj != null && !obj.Completed) || DarkTidesQuest.HasLostCallingScroll( from ) )
{
Item scroll = new KronusScroll();
if (obj != null && !obj.Completed || DarkTidesQuest.HasLostCallingScroll(from))
{
Item scroll = new KronusScroll();
if ( pm.PlaceInBackpack( scroll ) )
{
pm.SendLocalizedMessage( 1060120, "", 0x41 ); // You rummage through the scrolls until you find the Scroll of Calling. You quickly put it in your pack.
if (pm.PlaceInBackpack(scroll))
{
pm.SendLocalizedMessage(1060120, "",
0x41); // You rummage through the scrolls until you find the Scroll of Calling. You quickly put it in your pack.
if ( obj != null && !obj.Completed )
obj.Complete();
}
else
{
pm.SendLocalizedMessage( 1060148, "", 0x41 ); // You were unable to take the scroll.
scroll.Delete();
}
}
}
}
if (obj != null && !obj.Completed)
obj.Complete();
}
else
{
pm.SendLocalizedMessage(1060148, "", 0x41); // You were unable to take the scroll.
scroll.Delete();
}
}
}
}
base.OnDoubleClick( from );
}
base.OnDoubleClick(from);
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write( (int) 0 ); // version
}
writer.Write(0); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
int version = reader.ReadInt();
}
}
}

View file

@ -3,152 +3,156 @@ using Server.Items;
namespace Server.Engines.Quests.Necro
{
public class MaabusCoffin : BaseAddon
{
[CommandProperty( AccessLevel.GameMaster )]
public Maabus Maabus { get; private set; }
public class MaabusCoffin : BaseAddon
{
[Constructible]
public MaabusCoffin()
{
AddComponent(new MaabusCoffinComponent(0x1C2B, 0x1C2B), -1, -1, 0);
[CommandProperty( AccessLevel.GameMaster )]
public Point3D SpawnLocation { get; set; }
AddComponent(new MaabusCoffinComponent(0x1D16, 0x1C2C), 0, -1, 0);
AddComponent(new MaabusCoffinComponent(0x1D17, 0x1C2D), 1, -1, 0);
AddComponent(new MaabusCoffinComponent(0x1D51, 0x1C2E), 2, -1, 0);
[Constructible]
public MaabusCoffin()
{
AddComponent( new MaabusCoffinComponent( 0x1C2B, 0x1C2B ), -1, -1, 0 );
AddComponent(new MaabusCoffinComponent(0x1D4E, 0x1C2A), 0, 0, 0);
AddComponent(new MaabusCoffinComponent(0x1D4D, 0x1C29), 1, 0, 0);
AddComponent(new MaabusCoffinComponent(0x1D4C, 0x1C28), 2, 0, 0);
}
AddComponent( new MaabusCoffinComponent( 0x1D16, 0x1C2C ), 0, -1, 0 );
AddComponent( new MaabusCoffinComponent( 0x1D17, 0x1C2D ), 1, -1, 0 );
AddComponent( new MaabusCoffinComponent( 0x1D51, 0x1C2E ), 2, -1, 0 );
public MaabusCoffin(Serial serial) : base(serial)
{
}
AddComponent( new MaabusCoffinComponent( 0x1D4E, 0x1C2A ), 0, 0, 0 );
AddComponent( new MaabusCoffinComponent( 0x1D4D, 0x1C29 ), 1, 0, 0 );
AddComponent( new MaabusCoffinComponent( 0x1D4C, 0x1C28 ), 2, 0, 0 );
}
[CommandProperty(AccessLevel.GameMaster)]
public Maabus Maabus{ get; private set; }
public void Awake( Mobile caller )
{
if ( Maabus != null || SpawnLocation == Point3D.Zero )
return;
[CommandProperty(AccessLevel.GameMaster)]
public Point3D SpawnLocation{ get; set; }
foreach ( MaabusCoffinComponent c in Components )
c.TurnToEmpty();
public void Awake(Mobile caller)
{
if (Maabus != null || SpawnLocation == Point3D.Zero)
return;
Maabus = new Maabus();
foreach (MaabusCoffinComponent c in Components)
c.TurnToEmpty();
Maabus.Location = SpawnLocation;
Maabus.Map = Map;
Maabus = new Maabus();
Maabus.Direction = Maabus.GetDirectionTo( caller );
Maabus.Location = SpawnLocation;
Maabus.Map = Map;
Timer.DelayCall( TimeSpan.FromSeconds( 7.5 ), BeginSleep );
}
Maabus.Direction = Maabus.GetDirectionTo(caller);
public void BeginSleep()
{
if ( Maabus == null )
return;
Timer.DelayCall(TimeSpan.FromSeconds(7.5), BeginSleep);
}
Effects.PlaySound( Maabus.Location, Maabus.Map, 0x48E );
public void BeginSleep()
{
if (Maabus == null)
return;
Timer.DelayCall( TimeSpan.FromSeconds( 2.5 ), Sleep );
}
Effects.PlaySound(Maabus.Location, Maabus.Map, 0x48E);
public void Sleep()
{
if ( Maabus == null )
return;
Timer.DelayCall(TimeSpan.FromSeconds(2.5), Sleep);
}
Effects.SendLocationParticles( EffectItem.Create( Maabus.Location, Maabus.Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 0x7E7 );
Effects.PlaySound( Maabus.Location, Maabus.Map, 0x1FE );
public void Sleep()
{
if (Maabus == null)
return;
Maabus.Delete();
Maabus = null;
Effects.SendLocationParticles(EffectItem.Create(Maabus.Location, Maabus.Map, EffectItem.DefaultDuration), 0x3728,
10, 10, 0x7E7);
Effects.PlaySound(Maabus.Location, Maabus.Map, 0x1FE);
foreach ( MaabusCoffinComponent c in Components )
c.TurnToFull();
}
Maabus.Delete();
Maabus = null;
public MaabusCoffin( Serial serial ) : base( serial )
{
}
foreach (MaabusCoffinComponent c in Components)
c.TurnToFull();
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write( (int) 0 ); // version
writer.Write(0); // version
writer.Write( (Mobile) Maabus );
writer.Write( (Point3D) SpawnLocation );
}
writer.Write(Maabus);
writer.Write(SpawnLocation);
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
int version = reader.ReadInt();
Maabus = reader.ReadMobile() as Maabus;
SpawnLocation = reader.ReadPoint3D();
Maabus = reader.ReadMobile() as Maabus;
SpawnLocation = reader.ReadPoint3D();
Sleep();
}
}
Sleep();
}
}
public class MaabusCoffinComponent : AddonComponent
{
private int m_FullItemID;
private int m_EmptyItemID;
public class MaabusCoffinComponent : AddonComponent
{
private int m_EmptyItemID;
private int m_FullItemID;
[CommandProperty( AccessLevel.GameMaster )]
public Point3D SpawnLocation
{
get => Addon is MaabusCoffin coffin ? coffin.SpawnLocation : Point3D.Zero;
set { if ( Addon is MaabusCoffin coffin ) coffin.SpawnLocation = value; }
}
public MaabusCoffinComponent(int itemID) : this(itemID, itemID)
{
}
public MaabusCoffinComponent( int itemID ) : this( itemID, itemID )
{
}
public MaabusCoffinComponent(int fullItemID, int emptyItemID) : base(fullItemID)
{
m_FullItemID = fullItemID;
m_EmptyItemID = emptyItemID;
}
public MaabusCoffinComponent( int fullItemID, int emptyItemID ) : base( fullItemID )
{
m_FullItemID = fullItemID;
m_EmptyItemID = emptyItemID;
}
public MaabusCoffinComponent(Serial serial) : base(serial)
{
}
public void TurnToEmpty()
{
ItemID = m_EmptyItemID;
}
[CommandProperty(AccessLevel.GameMaster)]
public Point3D SpawnLocation
{
get => Addon is MaabusCoffin coffin ? coffin.SpawnLocation : Point3D.Zero;
set
{
if (Addon is MaabusCoffin coffin) coffin.SpawnLocation = value;
}
}
public void TurnToFull()
{
ItemID = m_FullItemID;
}
public void TurnToEmpty()
{
ItemID = m_EmptyItemID;
}
public MaabusCoffinComponent( Serial serial ) : base( serial )
{
}
public void TurnToFull()
{
ItemID = m_FullItemID;
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write( (int) 0 ); // version
writer.Write(0); // version
writer.Write( (int) m_FullItemID );
writer.Write( (int) m_EmptyItemID );
}
writer.Write(m_FullItemID);
writer.Write(m_EmptyItemID);
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
int version = reader.ReadInt();
m_FullItemID = reader.ReadInt();
m_EmptyItemID = reader.ReadInt();
}
}
}
m_FullItemID = reader.ReadInt();
m_EmptyItemID = reader.ReadInt();
}
}
}

View file

@ -3,131 +3,131 @@ using Server.Mobiles;
namespace Server.Engines.Quests.Necro
{
public class ScrollOfAbraxus : QuestItem
{
public override int LabelNumber => 1028827; // Scroll of Abraxus
public class ScrollOfAbraxus : QuestItem
{
[Constructible]
public ScrollOfAbraxus() : base(0x227B)
{
Weight = 1.0;
}
[Constructible]
public ScrollOfAbraxus() : base( 0x227B )
{
Weight = 1.0;
}
public ScrollOfAbraxus(Serial serial) : base(serial)
{
}
public override bool CanDrop( PlayerMobile player )
{
return !(player.Quest is DarkTidesQuest);
public override int LabelNumber => 1028827; // Scroll of Abraxus
//return !( qs.IsObjectiveInProgress( typeof( RetrieveAbraxusScrollObjective ) ) || qs.IsObjectiveInProgress( typeof( ReadAbraxusScrollObjective ) ) );
}
public override bool CanDrop(PlayerMobile player)
{
return !(player.Quest is DarkTidesQuest);
public override void OnAdded(IEntity parent)
{
base.OnAdded( parent );
//return !( qs.IsObjectiveInProgress( typeof( RetrieveAbraxusScrollObjective ) ) || qs.IsObjectiveInProgress( typeof( ReadAbraxusScrollObjective ) ) );
}
if ( RootParent is PlayerMobile pm )
{
QuestSystem qs = pm.Quest;
public override void OnAdded(IEntity parent)
{
base.OnAdded(parent);
if ( qs is DarkTidesQuest )
{
QuestObjective obj = qs.FindObjective( typeof( RetrieveAbraxusScrollObjective ) );
if (RootParent is PlayerMobile pm)
{
QuestSystem qs = pm.Quest;
if ( obj != null && !obj.Completed )
obj.Complete();
}
}
}
if (qs is DarkTidesQuest)
{
QuestObjective obj = qs.FindObjective(typeof(RetrieveAbraxusScrollObjective));
public override void OnDoubleClick( Mobile from )
{
if ( IsChildOf( from.Backpack ) )
{
from.SendGump( new ScrollOfAbraxusGump() );
if (obj != null && !obj.Completed)
obj.Complete();
}
}
}
if ( from is PlayerMobile pm )
{
QuestSystem qs = pm.Quest;
public override void OnDoubleClick(Mobile from)
{
if (IsChildOf(from.Backpack))
{
from.SendGump(new ScrollOfAbraxusGump());
if ( qs is DarkTidesQuest )
{
QuestObjective obj = qs.FindObjective( typeof( ReadAbraxusScrollObjective ) );
if (from is PlayerMobile pm)
{
QuestSystem qs = pm.Quest;
if ( obj != null && !obj.Completed )
obj.Complete();
}
}
}
else
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
}
if (qs is DarkTidesQuest)
{
QuestObjective obj = qs.FindObjective(typeof(ReadAbraxusScrollObjective));
public ScrollOfAbraxus( Serial serial ) : base( serial )
{
}
if (obj != null && !obj.Completed)
obj.Complete();
}
}
}
else
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write( (int) 0 ); // version
}
writer.Write(0); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
int version = reader.ReadInt();
}
}
public class ScrollOfAbraxusGump : Gump
{
public ScrollOfAbraxusGump() : base( 150, 50 )
{
AddPage( 0 );
public class ScrollOfAbraxusGump : Gump
{
public ScrollOfAbraxusGump() : base(150, 50)
{
AddPage(0);
AddImage( 0, 0, 1228 );
AddImage( 340, 255, 9005 );
AddImage(0, 0, 1228);
AddImage(340, 255, 9005);
/* Security at the Crystal Cave<BR><BR>
*
* We have taken great measuresto ensure the safety of the
* Scroll of Calling, which we have so valiantly taken from
* the Necromancer Maabus during the battle of the wood
* nearly 200 years ago.<BR><BR>
*
* The scroll must never fall into the hands of the
* Necromancers again, lest they use it to summon the ancient
* daemon Kronus. The scroll of calling is a necessity in the
* series of dark rites the Necromancers must perform to once again
* re-awaken Kronus.<BR><BR>
*
* Should Kronus ever rise again, the days of the Paladins, and
* indeed humanity as we know it will be numbered.<BR><BR>
*
* For this reason, we have posted the honorable Horus, former
* General of the Northern Legions to guard the entrance of the
* Crystal Cave where we keep the Scroll of Calling. Horus was
* infused with magical life from the tree Urywen during his last
* battle. The power gave him eternal life, but it also,
* unfortunately, took his eye sight.<BR><BR>
*
* Since Horus cannot see those he admits to the Crystal Cave,
* he will only allow those that know the secret password to enter.
* Speak the following word to Horus and he shall grant you passage
* to the Crystal Cave:<BR><BR>
*
* <I>Urywen</I><BR><BR>
*
* Do not speak this password anywhere except when seeking passage
* into the Crystal Cave, as our adversaries are lurking in the
* shadows <EFBFBD> they are everywhere.<BR><BR>Go with the light, friend.<BR><BR>
*
* <I>- Frater Melkeer</I>
*/
AddHtmlLocalized( 25, 36, 350, 210, 1060116, 1, false, true );
}
}
}
/* Security at the Crystal Cave<BR><BR>
*
* We have taken great measuresto ensure the safety of the
* Scroll of Calling, which we have so valiantly taken from
* the Necromancer Maabus during the battle of the wood
* nearly 200 years ago.<BR><BR>
*
* The scroll must never fall into the hands of the
* Necromancers again, lest they use it to summon the ancient
* daemon Kronus. The scroll of calling is a necessity in the
* series of dark rites the Necromancers must perform to once again
* re-awaken Kronus.<BR><BR>
*
* Should Kronus ever rise again, the days of the Paladins, and
* indeed humanity as we know it will be numbered.<BR><BR>
*
* For this reason, we have posted the honorable Horus, former
* General of the Northern Legions to guard the entrance of the
* Crystal Cave where we keep the Scroll of Calling. Horus was
* infused with magical life from the tree Urywen during his last
* battle. The power gave him eternal life, but it also,
* unfortunately, took his eye sight.<BR><BR>
*
* Since Horus cannot see those he admits to the Crystal Cave,
* he will only allow those that know the secret password to enter.
* Speak the following word to Horus and he shall grant you passage
* to the Crystal Cave:<BR><BR>
*
* <I>Urywen</I><BR><BR>
*
* Do not speak this password anywhere except when seeking passage
* into the Crystal Cave, as our adversaries are lurking in the
* shadows <EFBFBD> they are everywhere.<BR><BR>Go with the light, friend.<BR><BR>
*
* <I>- Frater Melkeer</I>
*/
AddHtmlLocalized(25, 36, 350, 210, 1060116, 1, false, true);
}
}
}

View file

@ -2,45 +2,45 @@ using Server.Mobiles;
namespace Server.Engines.Quests.Necro
{
public class VaultOfSecretsBarrier : Item
{
[Constructible]
public VaultOfSecretsBarrier() : base( 0x49E )
{
Movable = false;
Visible = false;
}
public class VaultOfSecretsBarrier : Item
{
[Constructible]
public VaultOfSecretsBarrier() : base(0x49E)
{
Movable = false;
Visible = false;
}
public override bool OnMoveOver( Mobile m )
{
if ( m.AccessLevel > AccessLevel.Player )
return true;
public VaultOfSecretsBarrier(Serial serial) : base(serial)
{
}
if ( m is PlayerMobile pm && pm.Profession == 4 )
{
m.SendLocalizedMessage( 1060188, "", 0x24 ); // The wicked may not enter!
return false;
}
public override bool OnMoveOver(Mobile m)
{
if (m.AccessLevel > AccessLevel.Player)
return true;
return base.OnMoveOver( m );
}
if (m is PlayerMobile pm && pm.Profession == 4)
{
m.SendLocalizedMessage(1060188, "", 0x24); // The wicked may not enter!
return false;
}
public VaultOfSecretsBarrier( Serial serial ) : base( serial )
{
}
return base.OnMoveOver(m);
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write( (int) 0 ); // version
}
writer.Write(0); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
int version = reader.ReadInt();
}
}
}