Cleanup & Fixes for .NET 5 (#309)

- [X] Fixes several bugs
- [X] Updates more ordinal issues
- [X] Cleans up the code a bit
- [X] Turns classes static that should have been
- [X] Changes TcpServer.Instances to a HashSet

Bumps release version
This commit is contained in:
Kamron Batman 2020-11-15 10:03:50 -08:00 • committed by GitHub
parent 4ad8811df2
commit 525cda5413
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
266 changed files with 1348 additions and 1800 deletions

View file

@ -1,7 +1,6 @@
using System;
using Server.Items;
using Server.Mobiles;
using Server.Network;
namespace Server.Engines.Quests.Necro
{
@ -32,21 +31,46 @@ namespace Server.Engines.Quests.Necro
return;
}
if (from is PlayerMobile pm)
if (!(from is PlayerMobile pm))
{
var qs = pm.Quest;
return;
}
if (qs is DarkTidesQuest)
var qs = pm.Quest;
if (qs is DarkTidesQuest)
{
if (qs.IsObjectiveInProgress(typeof(FindMardothAboutKronusObjective)))
{
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))
{
pm.SendLocalizedMessage(
1060151,
"",
0x41
); // You read the scroll, but decide against performing the calling until you are instructed to do so by Mardoth.
QuestObjective obj = qs.FindObjective<UseCallingScrollObjective>();
if (obj?.Completed == false)
{
obj.Complete();
}
Delete();
new CallingTimer(pm).Start();
}
else if (qs.IsObjectiveInProgress(typeof(FindWellOfTearsObjective)))
else
{
pm.SendLocalizedMessage(
1060152,
@ -54,37 +78,14 @@ namespace Server.Engines.Quests.Necro
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.
}
}
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.
}
}
}

View file

@ -78,9 +78,9 @@ namespace Server.Engines.Quests.Necro
Maabus.Delete();
Maabus = null;
foreach (MaabusCoffinComponent c in Components)
foreach (var c in Components)
{
c.TurnToFull();
(c as MaabusCoffinComponent)?.TurnToFull();
}
}

View file

@ -49,7 +49,7 @@ namespace Server.Engines.Quests.Hag
Corpse = new HagApprenticeCorpse();
Corpse.MoveToWorld(m_CorpseLocation, map);
Effects.SendLocationEffect(m_CorpseLocation, map, 0x3728, 10, 10);
Effects.SendLocationEffect(m_CorpseLocation, map, 0x3728, 10);
Effects.PlaySound(m_CorpseLocation, map, 0x1FE);
Mobile imp = new Zeefzorpul();
@ -65,7 +65,7 @@ namespace Server.Engines.Quests.Hag
{
if (m?.Deleted == false)
{
Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 10, 10);
Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 10);
Effects.PlaySound(m.Location, m.Map, 0x1FE);
m.Delete();
@ -213,7 +213,7 @@ namespace Server.Engines.Quests.Hag
Mobile from = System.From;
var map = from.Map;
Effects.SendLocationEffect(ImpLocation, map, 0x3728, 10, 10);
Effects.SendLocationEffect(ImpLocation, map, 0x3728, 10);
Effects.PlaySound(ImpLocation, map, 0x1FE);
Mobile imp = new Zeefzorpul();
@ -228,7 +228,7 @@ namespace Server.Engines.Quests.Hag
{
if (imp is Mobile m && !m.Deleted)
{
Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 10, 10);
Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 10);
Effects.PlaySound(m.Location, m.Map, 0x1FE);
m.Delete();