Revert "Updates Packets & Randomizer (#43)" (#61)

This reverts commit 179cb50557.
This commit is contained in:
Kamron Batman 2019-11-11 08:46:11 -08:00 • committed by GitHub
parent 179cb50557
commit c2ecc76457
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
588 changed files with 16260 additions and 10926 deletions

View file

@ -167,10 +167,11 @@ namespace Server.Engines.Quests.Collector
{
if (m_Quantity < m_Completed)
{
if (IsChildOf(from.Backpack))
from.Target = new InternalTarget(this);
if (!IsChildOf(from.Backpack))
from.Send(new MessageLocalized(Serial, ItemID, MessageType.Regular, 0x2C, 3, 500309, "",
"")); // Nothing Happens.
else
Packets.SendMessageLocalized(from.NetState, Serial, ItemID, MessageType.Regular, 0x2C, 3, 500309); // Nothing Happens.
from.Target = new InternalTarget(this);
}
}
@ -244,15 +245,15 @@ namespace Server.Engines.Quests.Collector
if (targObsidian.Quantity >= m_Completed)
targObsidian.StatueName = RandomName(from);
Packets.SendAsciiMessage(from.NetState, targObsidian.Serial, targObsidian.ItemID, MessageType.Regular, 0x59, 3,
m_Obsidian.Name, "Something Happened.");
from.Send(new AsciiMessage(targObsidian.Serial, targObsidian.ItemID, MessageType.Regular, 0x59, 3,
m_Obsidian.Name, "Something Happened."));
return;
}
Packets.SendMessageLocalized(from.NetState, m_Obsidian.Serial, m_Obsidian.ItemID, MessageType.Regular, 0x2C, 3, 500309,
m_Obsidian.Name); // Nothing Happens.
from.Send(new MessageLocalized(m_Obsidian.Serial, m_Obsidian.ItemID, MessageType.Regular, 0x2C, 3, 500309,
m_Obsidian.Name, "")); // Nothing Happens.
}
}
}
}
}

View file

@ -359,4 +359,4 @@ namespace Server.Engines.Quests.Collector
{
public override object Message => 1055136;
}
}
}

View file

@ -99,10 +99,11 @@ namespace Server.Items
else if (from.Map == Map.Ilshenar)
{
#if false
banks = m_IlshenarBanks;
moongates = PMList.Ilshenar;
banks = m_IlshenarBanks;
moongates = PMList.Ilshenar;
#else
Packets.SendMessageLocalized(from.NetState, Serial, ItemID, MessageType.Label, 0x482, 3, 1061684); // The magic of the sextant fails...
from.Send(new MessageLocalized(Serial, ItemID, MessageType.Label, 0x482, 3, 1061684, "",
"")); // The magic of the sextant fails...
return;
#endif
}
@ -153,7 +154,7 @@ namespace Server.Items
else
moonMsg = 1048018; // You are next to a Moongate at the moment.
Packets.SendMessageLocalized(from.NetState, Serial, ItemID, MessageType.Label, 0x482, 3, moonMsg);
from.Send(new MessageLocalized(Serial, ItemID, MessageType.Label, 0x482, 3, moonMsg, "", ""));
int bankMsg;
if (bankDistance == double.MaxValue)
@ -165,7 +166,7 @@ namespace Server.Items
else
bankMsg = 1048019; // You are next to a Bank at the moment.
Packets.SendMessageLocalized(from.NetState, Serial, ItemID, MessageType.Label, 0x5AA, 3, bankMsg);
from.Send(new MessageLocalized(Serial, ItemID, MessageType.Label, 0x5AA, 3, bankMsg, "", ""));
}
public override void Serialize(GenericWriter writer)
@ -182,4 +183,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -44,7 +44,9 @@ namespace Server.Engines.Quests
switch (encoding)
{
default:
{
return null;
}
case 0x01: // indexed
{
int index = reader.ReadEncodedInt();
@ -73,7 +75,9 @@ namespace Server.Engines.Quests
switch (encoding)
{
default:
{
return null;
}
case 0x01:
{
Type type = ReadType(QuestSystem.QuestTypes, reader);
@ -90,7 +94,9 @@ namespace Server.Engines.Quests
public static void Serialize(QuestSystem qs, GenericWriter writer)
{
if (qs == null)
{
writer.WriteEncodedInt(0x00);
}
else
{
writer.WriteEncodedInt(0x01);
@ -108,7 +114,9 @@ namespace Server.Engines.Quests
switch (encoding)
{
default:
{
return null;
}
case 0x01:
{
Type type = ReadType(referenceTable, reader);
@ -125,7 +133,9 @@ namespace Server.Engines.Quests
public static void Serialize(Type[] referenceTable, QuestObjective obj, GenericWriter writer)
{
if (obj == null)
{
writer.WriteEncodedInt(0x00);
}
else
{
writer.WriteEncodedInt(0x01);
@ -143,7 +153,9 @@ namespace Server.Engines.Quests
switch (encoding)
{
default:
{
return null;
}
case 0x01:
{
Type type = ReadType(referenceTable, reader);
@ -160,7 +172,9 @@ namespace Server.Engines.Quests
public static void Serialize(Type[] referenceTable, QuestConversation conv, GenericWriter writer)
{
if (conv == null)
{
writer.WriteEncodedInt(0x00);
}
else
{
writer.WriteEncodedInt(0x01);

View file

@ -259,7 +259,7 @@ namespace Server.Engines.Quests
From.SendGump(new QuestObjectivesGump(Objectives));
QuestObjective last = Objectives[^1];
QuestObjective last = Objectives[Objectives.Count - 1];
if (last.Info != null)
From.SendGump(new QuestItemInfoGump(last.Info));
@ -276,7 +276,7 @@ namespace Server.Engines.Quests
From.SendGump(new QuestConversationsGump(Conversations));
QuestConversation last = Conversations[^1];
QuestConversation last = Conversations[Conversations.Count - 1];
if (last.Info != null)
From.SendGump(new QuestItemInfoGump(last.Info));

View file

@ -1,12 +1,13 @@
using System;
using Server.Items;
using Server.Mobiles;
using Server.Network;
namespace Server.Engines.Quests.Necro
{
public class KronusScroll : QuestItem
{
private static Rectangle2D m_WellOfTearsArea = new Rectangle2D(2080, 1346, 10, 10);
private static readonly Rectangle2D m_WellOfTearsArea = new Rectangle2D(2080, 1346, 10, 10);
private static readonly Map m_WellOfTearsMap = Map.Malas;
[Constructible]
@ -133,7 +134,9 @@ namespace Server.Engines.Quests.Necro
int hue = Utility.RandomList(0x481, 0x482, 0x489, 0x497, 0x66D);
Effects.SendMovingEffect(from, to, map, 0x36D4, 0, 0, false, true, hue);
Effects.SendPacket(from, map,
new HuedEffect(EffectType.Moving, Serial.Zero, Serial.Zero, 0x36D4, from, to, 0, 0, false, true,
hue, 0));
}
}
@ -152,4 +155,4 @@ namespace Server.Engines.Quests.Necro
}
}
}
}
}

View file

@ -65,8 +65,8 @@ namespace Server.Engines.Quests.Necro
Maabus.Delete();
Maabus = null;
foreach (AddonComponent addonComponent in Components)
(addonComponent as MaabusCoffinComponent)?.TurnToFull();
foreach (MaabusCoffinComponent c in Components)
c.TurnToFull();
}
public override void Serialize(GenericWriter writer)
@ -151,4 +151,4 @@ namespace Server.Engines.Quests.Necro
m_EmptyItemID = reader.ReadInt();
}
}
}
}

View file

@ -258,7 +258,7 @@ namespace Server.Engines.Quests.Necro
public class FindWellOfTearsObjective : QuestObjective
{
private static Rectangle2D m_WellOfTearsArea = new Rectangle2D(2080, 1346, 10, 10);
private static readonly Rectangle2D m_WellOfTearsArea = new Rectangle2D(2080, 1346, 10, 10);
private bool m_Inside;

View file

@ -36,29 +36,29 @@ namespace Server.Engines.Quests.Haven
if (System.From.Profession == 2) // magician
return 1049386;
/* <I>Uzeraan nods at you with approval and begins to speak...</I><BR><BR>
*
* Now that you are ready, let me give you your first task.<BR><BR>
*
* As I mentioned earlier, we have been trying to fight back the wicked
* <I>Horde Minions</I> which have recently begun attacking our cities
* - but to no avail. Our need is great!<BR><BR>
*
* Your first task will be to assess the situation in the mountain pass,
* and help our troops defeat the Horde Minions there.<BR><BR>
*
* Take the road marked with glowing runes, that starts just outside of this mansion.
* Before you go into battle, it would be prudent to
* <a href="?ForceTopic27">review combat techniques</a> as well as
* <a href = "?ForceTopic29">information on healing yourself,
* using your Paladin ability 'Close Wounds'</a>.<BR><BR>
*
* To aid you in your fight, you may also wish to
* <a href = "?ForceTopic33">purchase equipment</a> from Frank the Blacksmith,
* who is standing just <a href = "?ForceTopic13">South</a> of here.<BR><BR>
*
* Good luck young Paladin!
*/
/* <I>Uzeraan nods at you with approval and begins to speak...</I><BR><BR>
*
* Now that you are ready, let me give you your first task.<BR><BR>
*
* As I mentioned earlier, we have been trying to fight back the wicked
* <I>Horde Minions</I> which have recently begun attacking our cities
* - but to no avail. Our need is great!<BR><BR>
*
* Your first task will be to assess the situation in the mountain pass,
* and help our troops defeat the Horde Minions there.<BR><BR>
*
* Take the road marked with glowing runes, that starts just outside of this mansion.
* Before you go into battle, it would be prudent to
* <a href="?ForceTopic27">review combat techniques</a> as well as
* <a href = "?ForceTopic29">information on healing yourself,
* using your Paladin ability 'Close Wounds'</a>.<BR><BR>
*
* To aid you in your fight, you may also wish to
* <a href = "?ForceTopic33">purchase equipment</a> from Frank the Blacksmith,
* who is standing just <a href = "?ForceTopic13">South</a> of here.<BR><BR>
*
* Good luck young Paladin!
*/
return 1060388;
}
}
@ -73,7 +73,7 @@ namespace Server.Engines.Quests.Haven
public class UzeraanReportConversation : QuestConversation
{
private static readonly QuestItemInfo[] m_Info =
private static QuestItemInfo[] m_Info =
{
new QuestItemInfo(1026153, 0x1822), // teleporter
new QuestItemInfo(1048032, 0xE76) // a bag
@ -469,4 +469,4 @@ namespace Server.Engines.Quests.Haven
public override bool Logged => false;
}
}
}

View file

@ -28,14 +28,15 @@ namespace Server.Engines.Quests.Haven
{
}
// TODO: Should be a better way than making/deleting a mob.
// TODO: What is this? Why are we creating and deleting a mobile?
private static Mobile GetOwner()
{
Mobile apprentice = new Mobile
{
Hue = Race.Human.RandomSkinHue(), Female = false, Body = 0x190, Name = NameList.RandomName("male")
};
Mobile apprentice = new Mobile();
apprentice.Hue = Race.Human.RandomSkinHue();
apprentice.Female = false;
apprentice.Body = 0x190;
apprentice.Name = NameList.RandomName("male");
apprentice.Delete();
@ -44,14 +45,12 @@ namespace Server.Engines.Quests.Haven
private static List<Item> GetEquipment()
{
List<Item> list = new List<Item>
{
new Robe(QuestSystem.RandomBrightHue()),
new WizardsHat(Utility.RandomNeutralHue()),
new Shoes(Utility.RandomNeutralHue()),
new Spellbook()
};
List<Item> list = new List<Item>();
list.Add(new Robe(QuestSystem.RandomBrightHue()));
list.Add(new WizardsHat(Utility.RandomNeutralHue()));
list.Add(new Shoes(Utility.RandomNeutralHue()));
list.Add(new Spellbook());
return list;
}
@ -87,10 +86,11 @@ namespace Server.Engines.Quests.Haven
int hue = Notoriety.GetHue(NotorietyHandlers.CorpseNotoriety(from, this));
if (ItemID == 0x2006) // Corpse form
Packets.SendMessageLocalized(from.NetState, Serial, ItemID, MessageType.Label, hue, 3, 1049144, "",
Name); // the remains of ~1_NAME~ the apprentice
from.Send(new MessageLocalized(Serial, ItemID, MessageType.Label, hue, 3, 1049144, "",
Name)); // the remains of ~1_NAME~ the apprentice
else
Packets.SendMessageLocalized(from.NetState, Serial, ItemID, MessageType.Label, hue, 3, 1049145); // the remains of a wizard's apprentice
from.Send(new MessageLocalized(Serial, ItemID, MessageType.Label, hue, 3, 1049145, "",
"")); // the remains of a wizard's apprentice
}
public override void Open(Mobile from, bool checkSelfLoot)

View file

@ -118,10 +118,11 @@ namespace Server.Engines.Quests.Haven
int hue = Notoriety.GetHue(NotorietyHandlers.CorpseNotoriety(from, this));
if (ItemID == 0x2006) // Corpse form
Packets.SendMessageLocalized(from.NetState, Serial, ItemID, MessageType.Label, hue, 3, 1049318, "",
Name); // the remains of ~1_NAME~ the militia fighter
from.Send(new MessageLocalized(Serial, ItemID, MessageType.Label, hue, 3, 1049318, "",
Name)); // the remains of ~1_NAME~ the militia fighter
else
Packets.SendMessageLocalized(from.NetState, Serial, ItemID, MessageType.Label, hue, 3, 1049318); // the remains of a militia fighters
from.Send(new MessageLocalized(Serial, ItemID, MessageType.Label, hue, 3, 1049319, "",
"")); // the remains of a militia fighter
}
public override void Open(Mobile from, bool checkSelfLoot)
@ -145,4 +146,4 @@ namespace Server.Engines.Quests.Haven
int version = reader.ReadInt();
}
}
}
}

View file

@ -72,8 +72,9 @@ namespace Server.Engines.Quests.Haven
public KillHordeMinionsStep Step{ get; private set; }
public override object Message =>
Step switch
public override object Message
{
get
{
return Step switch
{
@ -107,7 +108,19 @@ namespace Server.Engines.Quests.Haven
_ => 5
};
public override bool Completed => Step == KillHordeMinionsStep.LearnKarma && HasBeenRead || base.Completed;
return 5;
}
}
public override bool Completed
{
get
{
if (Step == KillHordeMinionsStep.LearnKarma && HasBeenRead)
return true;
return base.Completed;
}
}
public override void RenderProgress(BaseQuestGump gump)
{
@ -127,15 +140,23 @@ namespace Server.Engines.Quests.Haven
CheckCompletionStatus();
}
public override bool IgnoreYoungProtection(Mobile from) =>
from is HordeMinion && from.Map == Map.Trammel && TreasureMap.IsInHavenIsland(from);
public override bool IgnoreYoungProtection(Mobile from)
{
// This restriction continues until the quest is ended
if (from is HordeMinion && from.Map == Map.Trammel && from.X >= 3314 && from.X <= 3814 && from.Y >= 2345 &&
from.Y <= 3095) // Haven island
return true;
return false;
}
public override void OnKill(BaseCreature creature, Container corpse)
{
if (creature is HordeMinion && corpse.Map == Map.Trammel && TreasureMap.IsInHavenIsland(corpse))
if (creature is HordeMinion && corpse.Map == Map.Trammel && corpse.X >= 3314 && corpse.X <= 3814 &&
corpse.Y >= 2345 && corpse.Y <= 3095) // Haven island
{
if (CurProgress == 0)
ContentPackets.SendDisplayHelpTopic(System.From.NetState, 29, false); // HEALING
System.From.Send(new DisplayHelpTopic(29, false)); // HEALING
CurProgress++;
}
@ -319,26 +340,49 @@ namespace Server.Engines.Quests.Haven
{
public Container CorpseWithBone{ get; set; }
public override object Message => System.From.Profession == 5 ? 1060755 : 1049362;
public override object Message
{
get
{
if (System.From.Profession == 5) return 1060755;
/* Use Uzeraan's teleporter to get to the Haunted graveyard.<BR><BR>
*
* Slay the undead until you find a <I>Daemon Bone</I>.
*/
return 1049362;
}
}
public override void OnComplete()
{
System.AddObjective(new ReturnDaemonBoneObjective());
}
private static bool IsInHavenGraveyard(IPoint2D p) => p.X >= 3391 && p.X <= 3424 &&
p.Y >= 2639 && p.Y <= 2664;
public override bool IgnoreYoungProtection(Mobile from)
{
// This restriction continues until the end of the quest
if ((from is Zombie || from is Skeleton) && from.Map == Map.Trammel && from.X >= 3391 && from.X <= 3424 &&
from.Y >= 2639 && from.Y <= 2664) // Haven graveyard
return true;
public override bool IgnoreYoungProtection(Mobile from) =>
(from is Zombie || from is Skeleton) && from.Map == Map.Trammel && IsInHavenGraveyard(from);
return false;
}
public override bool GetKillEvent(BaseCreature creature, Container corpse) =>
base.GetKillEvent(creature, corpse) || UzeraanTurmoilQuest.HasLostDaemonBone(System.From);
public override bool GetKillEvent(BaseCreature creature, Container corpse)
{
if (base.GetKillEvent(creature, corpse))
return true;
return UzeraanTurmoilQuest.HasLostDaemonBone(System.From);
}
public override void OnKill(BaseCreature creature, Container corpse)
{
if ((creature is Zombie || creature is Skeleton) && corpse.Map == Map.Trammel && IsInHavenGraveyard(corpse) && Utility.RandomDouble() < 0.25)
CorpseWithBone = corpse;
if ((creature is Zombie || creature is Skeleton) && corpse.Map == Map.Trammel && corpse.X >= 3391 &&
corpse.X <= 3424 && corpse.Y >= 2639 && corpse.Y <= 2664) // Haven graveyard
if (Utility.RandomDouble() < 0.25)
CorpseWithBone = corpse;
}
public override void ChildDeserialize(GenericReader reader)

View file

@ -62,8 +62,9 @@ namespace Server.Engines.Quests.Haven
public override TimeSpan RestartDelay => TimeSpan.MaxValue;
public override bool IsTutorial => true;
public override int Picture =>
From.Profession switch
public override int Picture
{
get
{
return From.Profession switch
{

View file

@ -1,5 +1,4 @@
using System;
using System.Linq;
using Server.Mobiles;
namespace Server.Engines.Quests.Hag
@ -90,7 +89,12 @@ namespace Server.Engines.Quests.Hag
{
Ingredient currIngredient = (Ingredient)i;
if (oldIngredients.All(ingredient => ingredient != currIngredient))
bool found = false;
for (int j = 0; !found && j < oldIngredients.Length; j++)
if (oldIngredients[j] == currIngredient)
found = true;
if (!found)
ingredients[n++] = currIngredient;
}
@ -99,4 +103,4 @@ namespace Server.Engines.Quests.Hag
return ingredients[index];
}
}
}
}

View file

@ -46,7 +46,7 @@ namespace Server.Engines.Quests.Hag
{
int hue = Notoriety.GetHue(NotorietyHandlers.CorpseNotoriety(from, this));
Packets.SendAsciiMessage(from.NetState, Serial, ItemID, MessageType.Label, hue, 3, "", "a charred corpse");
from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, hue, 3, "", "a charred corpse"));
}
public override void Open(Mobile from, bool checkSelfLoot)
@ -96,4 +96,4 @@ namespace Server.Engines.Quests.Hag
int version = reader.ReadInt();
}
}
}
}

View file

@ -1,5 +1,4 @@
using System;
using System.Linq;
using Server.Items;
using Server.Mobiles;
@ -51,7 +50,7 @@ namespace Server.Engines.Quests.Hag
Corpse = new HagApprenticeCorpse();
Corpse.MoveToWorld(m_CorpseLocation, map);
Effects.SendLocationEffect(m_CorpseLocation, map, 0x3728, 10);
Effects.SendLocationEffect(m_CorpseLocation, map, 0x3728, 10, 10);
Effects.PlaySound(m_CorpseLocation, map, 0x1FE);
Mobile imp = new Zeefzorpul();
@ -67,7 +66,7 @@ namespace Server.Engines.Quests.Hag
{
if (m?.Deleted == false)
{
Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 10);
Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 10, 10);
Effects.PlaySound(m.Location, m.Map, 0x1FE);
m.Delete();
@ -205,7 +204,7 @@ namespace Server.Engines.Quests.Hag
Mobile from = System.From;
Map map = from.Map;
Effects.SendLocationEffect(ImpLocation, map, 0x3728, 10);
Effects.SendLocationEffect(ImpLocation, map, 0x3728, 10, 10);
Effects.PlaySound(ImpLocation, map, 0x1FE);
Mobile imp = new Zeefzorpul();
@ -220,7 +219,7 @@ namespace Server.Engines.Quests.Hag
{
if (imp is Mobile m && !m.Deleted)
{
Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 10);
Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 10, 10);
Effects.PlaySound(m.Location, m.Map, 0x1FE);
m.Delete();
@ -267,7 +266,7 @@ namespace Server.Engines.Quests.Hag
for (int i = 0; i < oldIngredients.Length; i++)
Ingredients[i] = oldIngredients[i];
Ingredients[^1] = IngredientInfo.RandomIngredient(oldIngredients);
Ingredients[Ingredients.Length - 1] = IngredientInfo.RandomIngredient(oldIngredients);
}
else
{
@ -280,8 +279,13 @@ namespace Server.Engines.Quests.Hag
BlackheartMet = blackheartMet;
}
public override object Message =>
!BlackheartMet ? Step switch
public FindIngredientObjective()
{
}
public override object Message
{
get
{
if (!BlackheartMet)
return Step switch
@ -306,13 +310,21 @@ namespace Server.Engines.Quests.Hag
*/
return 1055055;
}
: 1055055;
}
public override int MaxProgress => IngredientInfo.Get(Ingredient).Quantity;
public override int MaxProgress
{
get
{
IngredientInfo info = IngredientInfo.Get(Ingredient);
return info.Quantity;
}
}
public Ingredient[] Ingredients{ get; private set; }
public Ingredient Ingredient => Ingredients[^1];
public Ingredient Ingredient => Ingredients[Ingredients.Length - 1];
public int Step => Ingredients.Length;
public bool BlackheartMet{ get; private set; }
@ -333,14 +345,26 @@ namespace Server.Engines.Quests.Hag
}
}
public override bool IgnoreYoungProtection(Mobile from) =>
!Completed && IngredientInfo.Get(Ingredient).Creatures.Any(t => from.GetType() == t);
public override bool IgnoreYoungProtection(Mobile from)
{
if (Completed)
return false;
IngredientInfo info = IngredientInfo.Get(Ingredient);
Type fromType = from.GetType();
for (int i = 0; i < info.Creatures.Length; i++)
if (fromType == info.Creatures[i])
return true;
return false;
}
public override void OnKill(BaseCreature creature, Container corpse)
{
IngredientInfo info = IngredientInfo.Get(Ingredient);
if (info.Creatures.Any(type => creature.GetType() == type))
for (int i = 0; i < info.Creatures.Length; i++)
{
Type type = info.Creatures[i];
@ -351,7 +375,8 @@ namespace Server.Engines.Quests.Hag
CurProgress++;
CurProgress++;
break;
}
}
}