Reorganizes Project (#41)
This commit is contained in:
parent
08bf44af9a
commit
3614a66aee
3499 changed files with 79 additions and 55 deletions
|
|
@ -0,0 +1,36 @@
|
|||
namespace Server.Engines.Quests.Zento
|
||||
{
|
||||
public class AcceptConversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1049092;
|
||||
|
||||
public override void OnRead()
|
||||
{
|
||||
System.AddObjective(new FirstKillObjective());
|
||||
}
|
||||
}
|
||||
|
||||
public class DirectionConversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1063323;
|
||||
|
||||
public override bool Logged => false;
|
||||
}
|
||||
|
||||
public class TakeCareConversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1063324;
|
||||
|
||||
public override bool Logged => false;
|
||||
}
|
||||
|
||||
public class EndConversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1063321;
|
||||
|
||||
public override void OnRead()
|
||||
{
|
||||
System.Complete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,142 @@
|
|||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.Quests.Zento
|
||||
{
|
||||
public class AnsellaGryen : BaseQuester
|
||||
{
|
||||
[Constructible]
|
||||
public AnsellaGryen()
|
||||
{
|
||||
}
|
||||
|
||||
public AnsellaGryen(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName => "Ansella Gryen";
|
||||
|
||||
public override void InitBody()
|
||||
{
|
||||
InitStats(100, 100, 25);
|
||||
|
||||
Hue = 0x83EA;
|
||||
|
||||
Female = true;
|
||||
Body = 0x191;
|
||||
}
|
||||
|
||||
public override void InitOutfit()
|
||||
{
|
||||
HairItemID = 0x203B;
|
||||
HairHue = 0x1BB;
|
||||
|
||||
AddItem(new SamuraiTabi(0x8FD));
|
||||
AddItem(new FemaleKimono(0x4B6));
|
||||
AddItem(new Obi(0x526));
|
||||
|
||||
AddItem(new GoldBracelet());
|
||||
}
|
||||
|
||||
public override int GetAutoTalkRange(PlayerMobile m)
|
||||
{
|
||||
if (m.Quest == null)
|
||||
return 3;
|
||||
return -1;
|
||||
}
|
||||
|
||||
public override void OnTalk(PlayerMobile player, bool contextMenu)
|
||||
{
|
||||
QuestSystem qs = player.Quest;
|
||||
|
||||
if (qs is TerribleHatchlingsQuest)
|
||||
{
|
||||
if (qs.IsObjectiveInProgress(typeof(FirstKillObjective)))
|
||||
{
|
||||
qs.AddConversation(new DirectionConversation());
|
||||
}
|
||||
else if (qs.IsObjectiveInProgress(typeof(SecondKillObjective))
|
||||
|| qs.IsObjectiveInProgress(typeof(ThirdKillObjective)))
|
||||
{
|
||||
qs.AddConversation(new TakeCareConversation());
|
||||
}
|
||||
else
|
||||
{
|
||||
QuestObjective obj = qs.FindObjective<ReturnObjective>();
|
||||
|
||||
if (obj?.Completed == false)
|
||||
{
|
||||
Container cont = GetNewContainer();
|
||||
|
||||
cont.DropItem(new Gold(Utility.RandomMinMax(100, 200)));
|
||||
|
||||
if (Utility.RandomBool())
|
||||
{
|
||||
if (Loot.Construct(Loot.SEWeaponTypes) is BaseWeapon weapon)
|
||||
{
|
||||
BaseRunicTool.ApplyAttributesTo(weapon, 3, 10, 30);
|
||||
cont.DropItem(weapon);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Loot.Construct(Loot.SEArmorTypes) is BaseArmor armor)
|
||||
{
|
||||
BaseRunicTool.ApplyAttributesTo(armor, 1, 10, 20);
|
||||
cont.DropItem(armor);
|
||||
}
|
||||
}
|
||||
|
||||
if (player.PlaceInBackpack(cont))
|
||||
{
|
||||
obj.Complete();
|
||||
}
|
||||
else
|
||||
{
|
||||
cont.Delete();
|
||||
player.SendLocalizedMessage(
|
||||
1046260); // You need to clear some space in your inventory to continue with the quest. Come back here when you have more space in your inventory.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TerribleHatchlingsQuest newQuest = new TerribleHatchlingsQuest(player);
|
||||
|
||||
if (qs != null)
|
||||
{
|
||||
if (contextMenu)
|
||||
SayTo(player,
|
||||
1063322); // Before you can help me with the Terrible Hatchlings, you'll need to finish the quest you've already taken!
|
||||
}
|
||||
else if (QuestSystem.CanOfferQuest(player, typeof(TerribleHatchlingsQuest), out bool inRestartPeriod))
|
||||
{
|
||||
newQuest.SendOffer();
|
||||
}
|
||||
else if (inRestartPeriod && contextMenu)
|
||||
{
|
||||
SayTo(player, 1049357); // I have nothing more for you at this time.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
|
||||
public override void TurnToTokuno()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.Quests.Zento
|
||||
{
|
||||
public class FirstKillObjective : QuestObjective
|
||||
{
|
||||
public override object Message => 1063316;
|
||||
|
||||
public override void RenderProgress(BaseQuestGump gump)
|
||||
{
|
||||
if (!Completed)
|
||||
{
|
||||
// Deathwatch Beetle Hatchlings killed:
|
||||
gump.AddHtmlLocalized(70, 260, 270, 100, 1063318, 0x12DC6BF);
|
||||
|
||||
gump.AddLabel(70, 280, 0x64, "0");
|
||||
gump.AddLabel(100, 280, 0x64, "/");
|
||||
gump.AddLabel(130, 280, 0x64, "10");
|
||||
}
|
||||
else
|
||||
{
|
||||
base.RenderProgress(gump);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnKill(BaseCreature creature, Container corpse)
|
||||
{
|
||||
if (creature is DeathwatchBeetleHatchling)
|
||||
Complete();
|
||||
}
|
||||
|
||||
public override void OnComplete()
|
||||
{
|
||||
System.AddObjective(new SecondKillObjective());
|
||||
}
|
||||
}
|
||||
|
||||
public class SecondKillObjective : QuestObjective
|
||||
{
|
||||
public override object Message => 1063320;
|
||||
|
||||
public override void RenderProgress(BaseQuestGump gump)
|
||||
{
|
||||
if (!Completed)
|
||||
{
|
||||
// Deathwatch Beetle Hatchlings killed:
|
||||
gump.AddHtmlLocalized(70, 260, 270, 100, 1063318, 0x12DC6BF);
|
||||
|
||||
gump.AddLabel(70, 280, 0x64, "1");
|
||||
gump.AddLabel(100, 280, 0x64, "/");
|
||||
gump.AddLabel(130, 280, 0x64, "10");
|
||||
}
|
||||
else
|
||||
{
|
||||
base.RenderProgress(gump);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnKill(BaseCreature creature, Container corpse)
|
||||
{
|
||||
if (creature is DeathwatchBeetleHatchling)
|
||||
{
|
||||
Complete();
|
||||
System.AddObjective(new ThirdKillObjective(2));
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnRead()
|
||||
{
|
||||
if (!Completed)
|
||||
{
|
||||
Complete();
|
||||
System.AddObjective(new ThirdKillObjective(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ThirdKillObjective : QuestObjective
|
||||
{
|
||||
public ThirdKillObjective(int startingProgress)
|
||||
{
|
||||
CurProgress = startingProgress;
|
||||
}
|
||||
|
||||
public ThirdKillObjective()
|
||||
{
|
||||
}
|
||||
|
||||
public override object Message => 1063319;
|
||||
|
||||
public override int MaxProgress => 10;
|
||||
|
||||
public override void RenderProgress(BaseQuestGump gump)
|
||||
{
|
||||
if (!Completed)
|
||||
{
|
||||
// Deathwatch Beetle Hatchlings killed:
|
||||
gump.AddHtmlLocalized(70, 260, 270, 100, 1063318, 0x12DC6BF);
|
||||
|
||||
gump.AddLabel(70, 280, 0x64, CurProgress.ToString());
|
||||
gump.AddLabel(100, 280, 0x64, "/");
|
||||
gump.AddLabel(130, 280, 0x64, "10");
|
||||
}
|
||||
else
|
||||
{
|
||||
base.RenderProgress(gump);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnKill(BaseCreature creature, Container corpse)
|
||||
{
|
||||
if (creature is DeathwatchBeetleHatchling)
|
||||
CurProgress++;
|
||||
}
|
||||
|
||||
public override void OnComplete()
|
||||
{
|
||||
System.AddObjective(new ReturnObjective());
|
||||
}
|
||||
}
|
||||
|
||||
public class ReturnObjective : QuestObjective
|
||||
{
|
||||
public override object Message => 1063313;
|
||||
|
||||
public override void OnComplete()
|
||||
{
|
||||
System.AddConversation(new EndConversation());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
using System;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.Quests.Zento
|
||||
{
|
||||
public class TerribleHatchlingsQuest : QuestSystem
|
||||
{
|
||||
private static Type[] m_TypeReferenceTable =
|
||||
{
|
||||
typeof(AcceptConversation),
|
||||
typeof(DirectionConversation),
|
||||
typeof(TakeCareConversation),
|
||||
typeof(EndConversation),
|
||||
typeof(FirstKillObjective),
|
||||
typeof(SecondKillObjective),
|
||||
typeof(ThirdKillObjective),
|
||||
typeof(ReturnObjective)
|
||||
};
|
||||
|
||||
public TerribleHatchlingsQuest(PlayerMobile from) : base(from)
|
||||
{
|
||||
}
|
||||
|
||||
// Serialization
|
||||
public TerribleHatchlingsQuest()
|
||||
{
|
||||
}
|
||||
|
||||
public override Type[] TypeReferenceTable => m_TypeReferenceTable;
|
||||
|
||||
public override object Name => 1063314;
|
||||
|
||||
public override object OfferMessage => 1063315;
|
||||
|
||||
public override TimeSpan RestartDelay => TimeSpan.MaxValue;
|
||||
public override bool IsTutorial => true;
|
||||
|
||||
public override int Picture => 0x15CF;
|
||||
|
||||
public override void Accept()
|
||||
{
|
||||
base.Accept();
|
||||
|
||||
AddConversation(new AcceptConversation());
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue