Reorganizes Project (#41)

This commit is contained in:
Kamron Batman 2019-08-02 18:13:40 -07:00 • committed by GitHub
parent 08bf44af9a
commit 3614a66aee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3499 changed files with 79 additions and 55 deletions

View file

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

@ -0,0 +1,37 @@
using Server.Mobiles;
namespace Server.Engines.Quests.Necro
{
public class DarkTidesHorn : HornOfRetreat
{
[Constructible]
public DarkTidesHorn()
{
DestLoc = new Point3D(2103, 1319, -68);
DestMap = Map.Malas;
}
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);
writer.Write(0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}

View file

@ -0,0 +1,76 @@
using Server.Mobiles;
namespace Server.Engines.Quests.Necro
{
public class DarkTidesTeleporter : DynamicTeleporter
{
[Constructible]
public DarkTidesTeleporter()
{
}
public DarkTidesTeleporter(Serial serial) : base(serial)
{
}
public override bool GetDestination(PlayerMobile player, ref Point3D loc, ref Map map)
{
QuestSystem qs = player.Quest;
if (qs is DarkTidesQuest)
{
if (qs.IsObjectiveInProgress(typeof(FindMaabusTombObjective)))
{
loc = new Point3D(2038, 1263, -90);
map = Map.Malas;
qs.AddConversation(new RadarConversation());
return true;
}
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;
}
}
return false;
}
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

@ -0,0 +1,166 @@
using System;
using Server.Items;
using Server.Mobiles;
using Server.Network;
namespace Server.Engines.Quests.Necro
{
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;
}
public KronusScroll(Serial serial) : base(serial)
{
}
public override int LabelNumber => 1060149; // Calling of Kronus
public override bool CanDrop(PlayerMobile player)
{
return !(player.Quest is DarkTidesQuest);
/*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;
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<UseCallingScrollObjective>();
if (obj?.Completed == false)
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.
}
}
}
}
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();
}
private class CallingTimer : Timer
{
private PlayerMobile m_Player;
private int m_Step;
public CallingTimer(PlayerMobile player) : base(TimeSpan.Zero, TimeSpan.FromSeconds(1.0), 6)
{
Priority = TimerPriority.TwentyFiveMS;
m_Player = player;
m_Step = 0;
}
protected override void OnTick()
{
if (m_Player.Deleted)
{
Stop();
return;
}
if (!m_Player.Mounted)
m_Player.Animate(Utility.RandomBool() ? 16 : 17, 7, 1, true, false, 0);
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.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);
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);
Point3D from = new Point3D(x, y, z + Utility.RandomMinMax(5, 20));
Point3D to = new Point3D(x, y, z);
int hue = Utility.RandomList(0x481, 0x482, 0x489, 0x497, 0x66D);
Effects.SendPacket(from, map,
new HuedEffect(EffectType.Moving, Serial.Zero, Serial.Zero, 0x36D4, from, to, 0, 0, false, true,
hue, 0));
}
}
if (m_Step < 5)
{
m_Player.Frozen = true;
}
else // Cast completed
{
m_Player.Frozen = false;
SummonedPaladin.BeginSummon(m_Player);
}
m_Step++;
}
}
}
}

View file

@ -0,0 +1,74 @@
using Server.Items;
using Server.Mobiles;
namespace Server.Engines.Quests.Necro
{
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);
}
}
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;
if (qs is DarkTidesQuest)
{
QuestObjective obj = qs.FindObjective<FindCallingScrollObjective>();
if (obj?.Completed == false || 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 (obj?.Completed == false)
obj.Complete();
}
else
{
pm.SendLocalizedMessage(1060148, "", 0x41); // You were unable to take the scroll.
scroll.Delete();
}
}
}
}
base.OnDoubleClick(from);
}
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

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

View file

@ -0,0 +1,133 @@
using Server.Gumps;
using Server.Mobiles;
namespace Server.Engines.Quests.Necro
{
public class ScrollOfAbraxus : QuestItem
{
[Constructible]
public ScrollOfAbraxus() : base(0x227B)
{
Weight = 1.0;
}
public ScrollOfAbraxus(Serial serial) : base(serial)
{
}
public override int LabelNumber => 1028827; // Scroll of Abraxus
public override bool CanDrop(PlayerMobile player)
{
return !(player.Quest is DarkTidesQuest);
//return !( qs.IsObjectiveInProgress( typeof( RetrieveAbraxusScrollObjective ) ) || qs.IsObjectiveInProgress( typeof( ReadAbraxusScrollObjective ) ) );
}
public override void OnAdded(IEntity parent)
{
base.OnAdded(parent);
if (RootParent is PlayerMobile pm)
{
QuestSystem qs = pm.Quest;
if (qs is DarkTidesQuest)
{
QuestObjective obj = qs.FindObjective<RetrieveAbraxusScrollObjective>();
if (obj?.Completed == false)
obj.Complete();
}
}
}
public override void OnDoubleClick(Mobile from)
{
if (IsChildOf(from.Backpack))
{
from.SendGump(new ScrollOfAbraxusGump());
if (from is PlayerMobile pm)
{
QuestSystem qs = pm.Quest;
if (qs is DarkTidesQuest)
{
QuestObjective obj = qs.FindObjective<ReadAbraxusScrollObjective>();
if (obj?.Completed == false)
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);
writer.Write(0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
public class ScrollOfAbraxusGump : Gump
{
public ScrollOfAbraxusGump() : base(150, 50)
{
AddPage(0);
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);
}
}
}

View file

@ -0,0 +1,46 @@
using Server.Mobiles;
namespace Server.Engines.Quests.Necro
{
public class VaultOfSecretsBarrier : Item
{
[Constructible]
public VaultOfSecretsBarrier() : base(0x49E)
{
Movable = false;
Visible = false;
}
public VaultOfSecretsBarrier(Serial serial) : base(serial)
{
}
public override bool OnMoveOver(Mobile m)
{
if (m.AccessLevel > AccessLevel.Player)
return true;
if (m is PlayerMobile pm && pm.Profession == 4)
{
m.SendLocalizedMessage(1060188, "", 0x24); // The wicked may not enter!
return false;
}
return base.OnMoveOver(m);
}
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();
}
}
}