* Fixes a bug with the main loop. Removes unnecessary optimizations for RDRand. * WIP - Rewriting packets. * Cleanup and updates README * Converts more packets * Fixes header * Converts Effects packets. * Forgot the send command * Adds the start of containers packets. * Adds message packets with caching * Extends the send methods * Starts to add Acquire methods * Converted the packets * Cleanup * Cleanup * Adds more packets * Adds more packets * Fixes clearing arrays from pool. Adds Mobile Incoming * Converts more packets. * Moves more packets * Moves more packets * Test compression * Merges * Migrating to an idiomatic syntax that also supports compression, and proxying. * Optimize the stack alloc. Changes attributes * Converted container packets * Visual Studio doesn't auto save files. I am still getting used to subpar IDEs. * Adds static packet caching. Will profile later. Converts more packets * Fixes packets and changes how compression is configured * WIP - Adds basics for Gumps. Not finished though. * Fix file * Fixes formatting * Changed SpanWriter to be more idiomatic. * Fixes Span vs RawSpan and missing stackallocs * Converts over some more gumps * WIP - Deletes 32bit support. * Drops RDRand32 support. * Fixes gump compilation * Converting gump components * Removes old huffman compression function * Revert signature for backwards compatibility * WIP - Converting more gump components * Creates ArraySet for the strings. Updates AppendTo to reference that. * Converts the maining gump components * Cleans up gump components * Cleans up directives * Cleans up ArraySet and moves it. Adds null-coalescing-assignment * Cleanup, Target Packets, and C# 8 changes. * Removed OPL Packet * World packets * Fixing packet uses * Cleans up code. Fixes packet uses in various places. * More cleanup for packets * Code cleanup * Converts more packet uses and cleans up more code * More code cleanup * Finishes fixing the packets in Item * Updates secure trade packets * Updates core and gets it to compile. * Moved packets to scripts. Fixed account handler use of packets * Code cleanup * Updates chat packets * Code cleanuo * Adds party packets, but need to implement them. * Party packets WIP * Finishes party packets * Rearrange movement namespaces and classes * Finishes plant packets * Code Formatting * Fixes moving effects * Code cleanup, eliminates equipinfo * Adds more packets. Fixes bugs with various packets. * Finishes mahjon packets * Fixes mahjong packet * Code cleanup * Finishes mahjong packets * Adds Map packets * Add multifacet maps and charts * Cleans up some packets with UTF8 * Optimizes packets * Cleans up more packets. Moves the MessageHelper * Removes assistant support. Removes extended protocol. Incorporates MapUO packets as normal packets. * Updates protocol extensions packet receiver * Fixes a few bugs. Fixes a few more packets. * Code cleanup and fixing more packets * Fixes packet effects * Cleaned up more code * Buff Icon cleanup * Removed unused constructors * Code Cleanup. Adds BoatHS Packets * Moves house files. Updates house foundation packets. * Deployment cleanup * Fixes: * Code cleanup * More code cleanup * More code cleanup * Cleaned up BaseHouse * Enforces styling * Converts foreach to linq where possible. * Dont need that * Goals/Readme updates * Removes 32bit support at the highest level. Turns on HRT by default. * Code cleanup. Fixes extended features packet. * Fixes various bugs * Code cleanup * Code cleanup * Code cleanup. Fixes gump X/Y assignment. * Code cleanup using |= operator * More code cleanup * Cleanup * Fixes spacing issues. Thanks Visual Studio. You suck. * Compiler error * Fixes NPE from RunUO 2.7 * Renames ScriptCompiler to AssemblyHandler. Fixes packets. Updates README * Fixes more packets. Stupid trailing nulls. * Fixes various bugs. * Fixes for gumps * Fixes more gump stuff. Going to split it out later since it is getting insane * Recoded the gump writing * WIP * *Added output path of scripts project to dev branch *Activated debugging in code
381 lines
10 KiB
C#
381 lines
10 KiB
C#
using Server.Items;
|
|
using Server.Mobiles;
|
|
using Server.Network;
|
|
|
|
namespace Server.Engines.Quests.Haven
|
|
{
|
|
public class FindUzeraanBeginObjective : QuestObjective
|
|
{
|
|
public override object Message => 1046039;
|
|
|
|
public override void OnComplete()
|
|
{
|
|
if (System.From.Profession == 5) // paladin
|
|
System.AddConversation(new UzeraanTitheConversation());
|
|
else
|
|
System.AddConversation(new UzeraanFirstTaskConversation());
|
|
}
|
|
}
|
|
|
|
public class TitheGoldObjective : QuestObjective
|
|
{
|
|
private int m_OldTithingPoints;
|
|
|
|
public TitheGoldObjective() => m_OldTithingPoints = -1;
|
|
|
|
public override object Message => 1060386;
|
|
|
|
public override void CheckProgress()
|
|
{
|
|
PlayerMobile pm = System.From;
|
|
int curTithingPoints = pm.TithingPoints;
|
|
|
|
if (curTithingPoints >= 500)
|
|
Complete();
|
|
else if (curTithingPoints > m_OldTithingPoints && m_OldTithingPoints >= 0)
|
|
pm.SendLocalizedMessage(1060240, "",
|
|
0x41); // You must have at least 500 tithing points before you can continue in your quest.
|
|
|
|
m_OldTithingPoints = curTithingPoints;
|
|
}
|
|
|
|
public override void OnComplete()
|
|
{
|
|
System.AddObjective(new FindUzeraanFirstTaskObjective());
|
|
}
|
|
}
|
|
|
|
public class FindUzeraanFirstTaskObjective : QuestObjective
|
|
{
|
|
public override object Message => 1060387;
|
|
|
|
public override void OnComplete()
|
|
{
|
|
System.AddConversation(new UzeraanFirstTaskConversation());
|
|
}
|
|
}
|
|
|
|
public enum KillHordeMinionsStep
|
|
{
|
|
First,
|
|
LearnKarma,
|
|
Others
|
|
}
|
|
|
|
public class KillHordeMinionsObjective : QuestObjective
|
|
{
|
|
public KillHordeMinionsObjective()
|
|
{
|
|
}
|
|
|
|
public KillHordeMinionsObjective(KillHordeMinionsStep step) => Step = step;
|
|
|
|
public KillHordeMinionsStep Step{ get; private set; }
|
|
|
|
public override object Message =>
|
|
Step switch
|
|
{
|
|
return Step switch
|
|
{
|
|
KillHordeMinionsStep.First =>
|
|
/* Find the mountain pass beyond the house which lies at the
|
|
* end of the runic road.<BR><BR>
|
|
*
|
|
* Assist the city Militia by slaying <I>Horde Minions</I>
|
|
*/
|
|
1049089,
|
|
KillHordeMinionsStep.LearnKarma =>
|
|
/* You have just gained some <a href="?ForceTopic45">Karma</a>
|
|
* for killing the horde minion. <a href="?ForceTopic134">Learn</a>
|
|
* how this affects your Paladin abilities.
|
|
*/
|
|
1060389,
|
|
_ => 1060507
|
|
};
|
|
}
|
|
}
|
|
|
|
public override int MaxProgress
|
|
{
|
|
get
|
|
{
|
|
if (System.From.Profession == 5) // paladin
|
|
return Step switch
|
|
{
|
|
KillHordeMinionsStep.First => 1,
|
|
KillHordeMinionsStep.LearnKarma => 2,
|
|
_ => 5
|
|
};
|
|
|
|
public override bool Completed => Step == KillHordeMinionsStep.LearnKarma && HasBeenRead || base.Completed;
|
|
|
|
public override void RenderProgress(BaseQuestGump gump)
|
|
{
|
|
if (!Completed)
|
|
{
|
|
gump.AddHtmlObject(70, 260, 270, 100, 1049090, BaseQuestGump.Blue, false, false); // Horde Minions killed:
|
|
gump.AddLabel(70, 280, 0x64, CurProgress.ToString());
|
|
}
|
|
else
|
|
{
|
|
base.RenderProgress(gump);
|
|
}
|
|
}
|
|
|
|
public override void OnRead()
|
|
{
|
|
CheckCompletionStatus();
|
|
}
|
|
|
|
public override bool IgnoreYoungProtection(Mobile from) =>
|
|
from is HordeMinion && from.Map == Map.Trammel && TreasureMap.IsInHavenIsland(from);
|
|
|
|
public override void OnKill(BaseCreature creature, Container corpse)
|
|
{
|
|
if (creature is HordeMinion && corpse.Map == Map.Trammel && TreasureMap.IsInHavenIsland(corpse))
|
|
{
|
|
if (CurProgress == 0)
|
|
ContentPackets.SendDisplayHelpTopic(System.From.NetState, 29, false); // HEALING
|
|
|
|
CurProgress++;
|
|
}
|
|
}
|
|
|
|
public override void OnComplete()
|
|
{
|
|
if (System.From.Profession == 5)
|
|
switch (Step)
|
|
{
|
|
case KillHordeMinionsStep.First:
|
|
{
|
|
QuestObjective obj = new KillHordeMinionsObjective(KillHordeMinionsStep.LearnKarma);
|
|
System.AddObjective(obj);
|
|
obj.CurProgress = CurProgress;
|
|
break;
|
|
}
|
|
case KillHordeMinionsStep.LearnKarma:
|
|
{
|
|
QuestObjective obj = new KillHordeMinionsObjective(KillHordeMinionsStep.Others);
|
|
System.AddObjective(obj);
|
|
obj.CurProgress = CurProgress;
|
|
break;
|
|
}
|
|
default:
|
|
{
|
|
System.AddObjective(new FindUzeraanAboutReportObjective());
|
|
break;
|
|
}
|
|
}
|
|
else
|
|
System.AddObjective(new FindUzeraanAboutReportObjective());
|
|
}
|
|
|
|
public override void ChildDeserialize(GenericReader reader)
|
|
{
|
|
int version = reader.ReadEncodedInt();
|
|
|
|
Step = (KillHordeMinionsStep)reader.ReadEncodedInt();
|
|
}
|
|
|
|
public override void ChildSerialize(GenericWriter writer)
|
|
{
|
|
writer.WriteEncodedInt(0); // version
|
|
|
|
writer.WriteEncodedInt((int)Step);
|
|
}
|
|
}
|
|
|
|
public class FindUzeraanAboutReportObjective : QuestObjective
|
|
{
|
|
public override object Message => 1049091;
|
|
|
|
public override void OnComplete()
|
|
{
|
|
System.AddConversation(new UzeraanReportConversation());
|
|
}
|
|
}
|
|
|
|
public class FindSchmendrickObjective : QuestObjective
|
|
{
|
|
public override object Message => 1049120;
|
|
|
|
public override bool IgnoreYoungProtection(Mobile from)
|
|
{
|
|
// This restriction begins when this objective is completed, and continues until the quest is ended
|
|
if (Completed && from is RestlessSoul && from.Map == Map.Trammel && from.X >= 5199 && from.X <= 5271 &&
|
|
from.Y >= 1812 && from.Y <= 1865) // Schmendrick's cave
|
|
return true;
|
|
|
|
return false;
|
|
}
|
|
|
|
public override void OnComplete()
|
|
{
|
|
System.AddConversation(new SchmendrickConversation());
|
|
}
|
|
}
|
|
|
|
public class FindApprenticeObjective : QuestObjective
|
|
{
|
|
public override object Message => 1049323;
|
|
|
|
public override void OnComplete()
|
|
{
|
|
System.AddObjective(new ReturnScrollOfPowerObjective());
|
|
}
|
|
}
|
|
|
|
public class ReturnScrollOfPowerObjective : QuestObjective
|
|
{
|
|
public override object Message => 1049324;
|
|
|
|
public override void OnComplete()
|
|
{
|
|
System.AddConversation(new UzeraanScrollOfPowerConversation());
|
|
}
|
|
}
|
|
|
|
public class FindDryadObjective : QuestObjective
|
|
{
|
|
public override object Message => 1049358;
|
|
|
|
public override void OnComplete()
|
|
{
|
|
System.AddConversation(new DryadConversation());
|
|
}
|
|
}
|
|
|
|
public class ReturnFertileDirtObjective : QuestObjective
|
|
{
|
|
public override object Message => 1049327;
|
|
|
|
public override void OnComplete()
|
|
{
|
|
System.AddConversation(new UzeraanFertileDirtConversation());
|
|
}
|
|
}
|
|
|
|
public class GetDaemonBloodObjective : QuestObjective
|
|
{
|
|
private bool m_Ambushed;
|
|
|
|
public override object Message => 1049361;
|
|
|
|
public override void CheckProgress()
|
|
{
|
|
PlayerMobile player = System.From;
|
|
|
|
if (!m_Ambushed && player.Map == Map.Trammel && player.InRange(new Point3D(3456, 2558, 50), 30))
|
|
{
|
|
int x = player.X - 1;
|
|
int y = player.Y - 2;
|
|
int z = Map.Trammel.GetAverageZ(x, y);
|
|
|
|
if (Map.Trammel.CanSpawnMobile(x, y, z))
|
|
{
|
|
m_Ambushed = true;
|
|
|
|
player.LocalOverheadMessage(MessageType.Regular, 0x3B2,
|
|
1049330); // You have been ambushed! Fight for your honor!!!
|
|
|
|
BaseCreature creature = new HordeMinion();
|
|
creature.MoveToWorld(new Point3D(x, y, z), Map.Trammel);
|
|
creature.Combatant = player;
|
|
}
|
|
}
|
|
}
|
|
|
|
public override void OnComplete()
|
|
{
|
|
System.AddObjective(new ReturnDaemonBloodObjective());
|
|
}
|
|
|
|
public override void ChildDeserialize(GenericReader reader)
|
|
{
|
|
int version = reader.ReadEncodedInt();
|
|
|
|
m_Ambushed = reader.ReadBool();
|
|
}
|
|
|
|
public override void ChildSerialize(GenericWriter writer)
|
|
{
|
|
writer.WriteEncodedInt(0); // version
|
|
|
|
writer.Write(m_Ambushed);
|
|
}
|
|
}
|
|
|
|
public class ReturnDaemonBloodObjective : QuestObjective
|
|
{
|
|
public override object Message => 1049332;
|
|
|
|
public override void OnComplete()
|
|
{
|
|
System.AddConversation(new UzeraanDaemonBloodConversation());
|
|
}
|
|
}
|
|
|
|
public class GetDaemonBoneObjective : QuestObjective
|
|
{
|
|
public Container CorpseWithBone{ get; set; }
|
|
|
|
public override object Message => System.From.Profession == 5 ? 1060755 : 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) =>
|
|
(from is Zombie || from is Skeleton) && from.Map == Map.Trammel && IsInHavenGraveyard(from);
|
|
|
|
public override bool GetKillEvent(BaseCreature creature, Container corpse) =>
|
|
base.GetKillEvent(creature, corpse) || 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;
|
|
}
|
|
|
|
public override void ChildDeserialize(GenericReader reader)
|
|
{
|
|
int version = reader.ReadEncodedInt();
|
|
|
|
CorpseWithBone = (Container)reader.ReadItem();
|
|
}
|
|
|
|
public override void ChildSerialize(GenericWriter writer)
|
|
{
|
|
if (CorpseWithBone?.Deleted == true)
|
|
CorpseWithBone = null;
|
|
|
|
writer.WriteEncodedInt(0); // version
|
|
|
|
writer.Write(CorpseWithBone);
|
|
}
|
|
}
|
|
|
|
public class ReturnDaemonBoneObjective : QuestObjective
|
|
{
|
|
public override object Message => 1049334;
|
|
|
|
public override void OnComplete()
|
|
{
|
|
System.AddConversation(new UzeraanDaemonBoneConversation());
|
|
}
|
|
}
|
|
|
|
public class CashBankCheckObjective : QuestObjective
|
|
{
|
|
public override object Message => 1049336;
|
|
|
|
public override void OnComplete()
|
|
{
|
|
System.AddConversation(new BankerConversation());
|
|
}
|
|
}
|
|
}
|