Reorganizes Project (#41)
This commit is contained in:
parent
08bf44af9a
commit
3614a66aee
3499 changed files with 79 additions and 55 deletions
89
Projects/Scripts/Engines/Quests/Collector/CollectorQuest.cs
Normal file
89
Projects/Scripts/Engines/Quests/Collector/CollectorQuest.cs
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
using System;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.Quests.Collector
|
||||
{
|
||||
public class CollectorQuest : QuestSystem
|
||||
{
|
||||
private static Type[] m_TypeReferenceTable =
|
||||
{
|
||||
typeof(DontOfferConversation),
|
||||
typeof(DeclineConversation),
|
||||
typeof(AcceptConversation),
|
||||
typeof(ElwoodDuringFishConversation),
|
||||
typeof(ReturnPearlsConversation),
|
||||
typeof(AlbertaPaintingConversation),
|
||||
typeof(AlbertaStoolConversation),
|
||||
typeof(AlbertaEndPaintingConversation),
|
||||
typeof(AlbertaAfterPaintingConversation),
|
||||
typeof(ElwoodDuringPainting1Conversation),
|
||||
typeof(ElwoodDuringPainting2Conversation),
|
||||
typeof(ReturnPaintingConversation),
|
||||
typeof(GabrielAutographConversation),
|
||||
typeof(GabrielNoSheetMusicConversation),
|
||||
typeof(NoSheetMusicConversation),
|
||||
typeof(GetSheetMusicConversation),
|
||||
typeof(GabrielSheetMusicConversation),
|
||||
typeof(GabrielIgnoreConversation),
|
||||
typeof(ElwoodDuringAutograph1Conversation),
|
||||
typeof(ElwoodDuringAutograph2Conversation),
|
||||
typeof(ElwoodDuringAutograph3Conversation),
|
||||
typeof(ReturnAutographConversation),
|
||||
typeof(TomasToysConversation),
|
||||
typeof(TomasDuringCollectingConversation),
|
||||
typeof(ReturnImagesConversation),
|
||||
typeof(ElwoodDuringToys1Conversation),
|
||||
typeof(ElwoodDuringToys2Conversation),
|
||||
typeof(ElwoodDuringToys3Conversation),
|
||||
typeof(FullEndConversation),
|
||||
typeof(FishPearlsObjective),
|
||||
typeof(ReturnPearlsObjective),
|
||||
typeof(FindAlbertaObjective),
|
||||
typeof(SitOnTheStoolObjective),
|
||||
typeof(ReturnPaintingObjective),
|
||||
typeof(FindGabrielObjective),
|
||||
typeof(FindSheetMusicObjective),
|
||||
typeof(ReturnSheetMusicObjective),
|
||||
typeof(ReturnAutographObjective),
|
||||
typeof(FindTomasObjective),
|
||||
typeof(CaptureImagesObjective),
|
||||
typeof(ReturnImagesObjective),
|
||||
typeof(ReturnToysObjective),
|
||||
typeof(MakeRoomObjective)
|
||||
};
|
||||
|
||||
public CollectorQuest(PlayerMobile from) : base(from)
|
||||
{
|
||||
}
|
||||
|
||||
// Serialization
|
||||
public CollectorQuest()
|
||||
{
|
||||
}
|
||||
|
||||
public override Type[] TypeReferenceTable => m_TypeReferenceTable;
|
||||
|
||||
public override object Name => "Collector's Quest";
|
||||
|
||||
public override object OfferMessage => 1055081;
|
||||
|
||||
public override TimeSpan RestartDelay => TimeSpan.Zero;
|
||||
public override bool IsTutorial => false;
|
||||
|
||||
public override int Picture => 0x15A9;
|
||||
|
||||
public override void Accept()
|
||||
{
|
||||
base.Accept();
|
||||
|
||||
AddConversation(new AcceptConversation());
|
||||
}
|
||||
|
||||
public override void Decline()
|
||||
{
|
||||
base.Decline();
|
||||
|
||||
AddConversation(new DeclineConversation());
|
||||
}
|
||||
}
|
||||
}
|
||||
266
Projects/Scripts/Engines/Quests/Collector/Conversations.cs
Normal file
266
Projects/Scripts/Engines/Quests/Collector/Conversations.cs
Normal file
|
|
@ -0,0 +1,266 @@
|
|||
namespace Server.Engines.Quests.Collector
|
||||
{
|
||||
public class DontOfferConversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055080;
|
||||
|
||||
public override bool Logged => false;
|
||||
}
|
||||
|
||||
public class DeclineConversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055082;
|
||||
|
||||
public override bool Logged => false;
|
||||
}
|
||||
|
||||
public class AcceptConversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055083;
|
||||
|
||||
public override void OnRead()
|
||||
{
|
||||
System.AddObjective(new FishPearlsObjective());
|
||||
}
|
||||
}
|
||||
|
||||
public class ElwoodDuringFishConversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055089;
|
||||
|
||||
public override bool Logged => false;
|
||||
}
|
||||
|
||||
public class ReturnPearlsConversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055090;
|
||||
|
||||
public override void OnRead()
|
||||
{
|
||||
System.AddObjective(new FindAlbertaObjective());
|
||||
}
|
||||
}
|
||||
|
||||
public class AlbertaPaintingConversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055092;
|
||||
|
||||
public override void OnRead()
|
||||
{
|
||||
System.AddObjective(new SitOnTheStoolObjective());
|
||||
}
|
||||
}
|
||||
|
||||
public class AlbertaStoolConversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055096;
|
||||
|
||||
public override bool Logged => false;
|
||||
}
|
||||
|
||||
public class AlbertaEndPaintingConversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055098;
|
||||
|
||||
public override void OnRead()
|
||||
{
|
||||
System.AddObjective(new ReturnPaintingObjective());
|
||||
}
|
||||
}
|
||||
|
||||
public class AlbertaAfterPaintingConversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055102;
|
||||
|
||||
public override bool Logged => false;
|
||||
}
|
||||
|
||||
public class ElwoodDuringPainting1Conversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055094;
|
||||
|
||||
public override bool Logged => false;
|
||||
}
|
||||
|
||||
public class ElwoodDuringPainting2Conversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055097;
|
||||
|
||||
public override bool Logged => false;
|
||||
}
|
||||
|
||||
public class ReturnPaintingConversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055100;
|
||||
|
||||
public override void OnRead()
|
||||
{
|
||||
System.AddObjective(new FindGabrielObjective());
|
||||
}
|
||||
}
|
||||
|
||||
public class GabrielAutographConversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055103;
|
||||
|
||||
public override void OnRead()
|
||||
{
|
||||
System.AddObjective(new FindSheetMusicObjective(true));
|
||||
}
|
||||
}
|
||||
|
||||
public class GabrielNoSheetMusicConversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055111;
|
||||
|
||||
public override bool Logged => false;
|
||||
}
|
||||
|
||||
public class NoSheetMusicConversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055106;
|
||||
|
||||
public override bool Logged => false;
|
||||
}
|
||||
|
||||
public class GetSheetMusicConversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055109;
|
||||
|
||||
public override void OnRead()
|
||||
{
|
||||
System.AddObjective(new ReturnSheetMusicObjective());
|
||||
}
|
||||
}
|
||||
|
||||
public class GabrielSheetMusicConversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055113;
|
||||
|
||||
public override void OnRead()
|
||||
{
|
||||
System.AddObjective(new ReturnAutographObjective());
|
||||
}
|
||||
}
|
||||
|
||||
public class GabrielIgnoreConversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055118;
|
||||
|
||||
public override bool Logged => false;
|
||||
}
|
||||
|
||||
public class ElwoodDuringAutograph1Conversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055105;
|
||||
|
||||
public override bool Logged => false;
|
||||
}
|
||||
|
||||
public class ElwoodDuringAutograph2Conversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055112;
|
||||
|
||||
public override bool Logged => false;
|
||||
}
|
||||
|
||||
public class ElwoodDuringAutograph3Conversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055115;
|
||||
|
||||
public override bool Logged => false;
|
||||
}
|
||||
|
||||
public class ReturnAutographConversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055116;
|
||||
|
||||
public override void OnRead()
|
||||
{
|
||||
System.AddObjective(new FindTomasObjective());
|
||||
}
|
||||
}
|
||||
|
||||
public class TomasToysConversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055119;
|
||||
|
||||
public override void OnRead()
|
||||
{
|
||||
System.AddObjective(new CaptureImagesObjective(true));
|
||||
}
|
||||
}
|
||||
|
||||
public class TomasDuringCollectingConversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055129;
|
||||
|
||||
public override bool Logged => false;
|
||||
}
|
||||
|
||||
public class ReturnImagesConversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055131;
|
||||
|
||||
public override void OnRead()
|
||||
{
|
||||
System.AddObjective(new ReturnToysObjective());
|
||||
}
|
||||
}
|
||||
|
||||
public class ElwoodDuringToys1Conversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055123;
|
||||
|
||||
public override bool Logged => false;
|
||||
}
|
||||
|
||||
public class ElwoodDuringToys2Conversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055130;
|
||||
|
||||
public override bool Logged => false;
|
||||
}
|
||||
|
||||
public class ElwoodDuringToys3Conversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055133;
|
||||
|
||||
public override bool Logged => false;
|
||||
}
|
||||
|
||||
public class EndConversation : QuestConversation
|
||||
{
|
||||
public override object Message => 1055134;
|
||||
|
||||
public override void OnRead()
|
||||
{
|
||||
System.Complete();
|
||||
}
|
||||
}
|
||||
|
||||
public class FullEndConversation : QuestConversation
|
||||
{
|
||||
private bool m_Logged;
|
||||
|
||||
public FullEndConversation(bool logged)
|
||||
{
|
||||
m_Logged = logged;
|
||||
}
|
||||
|
||||
public FullEndConversation()
|
||||
{
|
||||
m_Logged = true;
|
||||
}
|
||||
|
||||
public override object Message => 1055135;
|
||||
|
||||
public override bool Logged => m_Logged;
|
||||
|
||||
public override void OnRead()
|
||||
{
|
||||
if (m_Logged)
|
||||
System.AddObjective(new MakeRoomObjective());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,133 @@
|
|||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Engines.Quests.Collector
|
||||
{
|
||||
public class EnchantedPaints : QuestItem
|
||||
{
|
||||
[Constructible]
|
||||
public EnchantedPaints() : base(0xFC1)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public EnchantedPaints(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool CanDrop(PlayerMobile player)
|
||||
{
|
||||
return !(player.Quest is CollectorQuest);
|
||||
|
||||
/*return !( qs.IsObjectiveInProgress( typeof( CaptureImagesObjective ) )
|
||||
|| qs.IsObjectiveInProgress( typeof( ReturnImagesObjective ) ) );*/
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (from is PlayerMobile player)
|
||||
{
|
||||
QuestSystem qs = player.Quest;
|
||||
|
||||
if (qs is CollectorQuest)
|
||||
if (qs.IsObjectiveInProgress(typeof(CaptureImagesObjective)))
|
||||
{
|
||||
player.SendAsciiMessage(0x59, "Target the creature whose image you wish to create.");
|
||||
player.Target = new InternalTarget(this);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage(1010085); // You cannot use this.
|
||||
}
|
||||
|
||||
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 InternalTarget : Target
|
||||
{
|
||||
private EnchantedPaints m_Paints;
|
||||
|
||||
public InternalTarget(EnchantedPaints paints) : base(-1, false, TargetFlags.None)
|
||||
{
|
||||
CheckLOS = false;
|
||||
m_Paints = paints;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Paints.Deleted || !m_Paints.IsChildOf(from.Backpack))
|
||||
return;
|
||||
|
||||
if (from is PlayerMobile player)
|
||||
{
|
||||
QuestSystem qs = player.Quest;
|
||||
|
||||
if (!(qs is CollectorQuest))
|
||||
return;
|
||||
|
||||
CaptureImagesObjective obj = qs.FindObjective<CaptureImagesObjective>();
|
||||
|
||||
if (obj?.Completed != false)
|
||||
return;
|
||||
|
||||
if (targeted is Mobile)
|
||||
{
|
||||
CaptureResponse response = obj.CaptureImage(
|
||||
targeted.GetType().Name == "GreaterMongbat"
|
||||
? new Mongbat().GetType()
|
||||
: targeted.GetType(), out ImageType image);
|
||||
|
||||
switch (response)
|
||||
{
|
||||
case CaptureResponse.Valid:
|
||||
{
|
||||
player.SendLocalizedMessage(
|
||||
1055125); // The enchanted paints swirl for a moment then an image begins to take shape. *Click*
|
||||
player.AddToBackpack(new PaintedImage(image));
|
||||
|
||||
break;
|
||||
}
|
||||
case CaptureResponse.AlreadyDone:
|
||||
{
|
||||
player.SendAsciiMessage(0x2C,
|
||||
"You have already captured the image of this creature");
|
||||
|
||||
break;
|
||||
}
|
||||
case CaptureResponse.Invalid:
|
||||
{
|
||||
player.SendLocalizedMessage(
|
||||
1055124); // You have no interest in capturing the image of this creature.
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player.SendAsciiMessage(0x35, "You have no interest in that.");
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage(1010085); // You cannot use this.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.Quests.Collector
|
||||
{
|
||||
public enum ImageType
|
||||
{
|
||||
Betrayer,
|
||||
Bogling,
|
||||
BogThing,
|
||||
Gazer,
|
||||
Beetle,
|
||||
GiantBlackWidow,
|
||||
Scorpion,
|
||||
JukaMage,
|
||||
JukaWarrior,
|
||||
Lich,
|
||||
MeerMage,
|
||||
MeerWarrior,
|
||||
Mongbat,
|
||||
Mummy,
|
||||
Pixie,
|
||||
PlagueBeast,
|
||||
SandVortex,
|
||||
StoneGargoyle,
|
||||
SwampDragon,
|
||||
Wisp,
|
||||
Juggernaut
|
||||
}
|
||||
|
||||
public class ImageTypeInfo
|
||||
{
|
||||
private static readonly ImageTypeInfo[] m_Table =
|
||||
{
|
||||
new ImageTypeInfo(9734, typeof(Betrayer), 75, 45),
|
||||
new ImageTypeInfo(9735, typeof(Bogling), 75, 45),
|
||||
new ImageTypeInfo(9736, typeof(BogThing), 60, 47),
|
||||
new ImageTypeInfo(9615, typeof(Gazer), 75, 45),
|
||||
new ImageTypeInfo(9743, typeof(Beetle), 60, 55),
|
||||
new ImageTypeInfo(9667, typeof(GiantBlackWidow), 55, 52),
|
||||
new ImageTypeInfo(9657, typeof(Scorpion), 65, 47),
|
||||
new ImageTypeInfo(9758, typeof(JukaMage), 75, 45),
|
||||
new ImageTypeInfo(9759, typeof(JukaWarrior), 75, 45),
|
||||
new ImageTypeInfo(9636, typeof(Lich), 75, 45),
|
||||
new ImageTypeInfo(9756, typeof(MeerMage), 75, 45),
|
||||
new ImageTypeInfo(9757, typeof(MeerWarrior), 75, 45),
|
||||
new ImageTypeInfo(9638, typeof(Mongbat), 70, 50),
|
||||
new ImageTypeInfo(9639, typeof(Mummy), 75, 45),
|
||||
new ImageTypeInfo(9654, typeof(Pixie), 75, 45),
|
||||
new ImageTypeInfo(9747, typeof(PlagueBeast), 60, 45),
|
||||
new ImageTypeInfo(9750, typeof(SandVortex), 60, 43),
|
||||
new ImageTypeInfo(9614, typeof(StoneGargoyle), 75, 45),
|
||||
new ImageTypeInfo(9753, typeof(SwampDragon), 50, 55),
|
||||
new ImageTypeInfo(8448, typeof(Wisp), 75, 45),
|
||||
new ImageTypeInfo(9746, typeof(Juggernaut), 55, 38)
|
||||
};
|
||||
|
||||
private static ImageType[] m_ImageTypeList;
|
||||
|
||||
public ImageTypeInfo(int figurine, Type type, int x, int y)
|
||||
{
|
||||
Figurine = figurine;
|
||||
Type = type;
|
||||
X = x;
|
||||
Y = y;
|
||||
}
|
||||
|
||||
public int Figurine{ get; }
|
||||
|
||||
public Type Type{ get; }
|
||||
|
||||
public int Name => Figurine < 0x4000 ? 1020000 + Figurine : 1078872 + Figurine;
|
||||
public int X{ get; }
|
||||
public int Y{ get; }
|
||||
|
||||
public static ImageTypeInfo Get(ImageType image)
|
||||
{
|
||||
int index = (int)image;
|
||||
return m_Table[index >= 0 && index < m_Table.Length ? index : 0];
|
||||
}
|
||||
|
||||
public static ImageType[] RandomList(int count)
|
||||
{
|
||||
if (m_ImageTypeList == null)
|
||||
{
|
||||
m_ImageTypeList = new ImageType[m_Table.Length];
|
||||
for (int i = 0; i < m_Table.Length; i++)
|
||||
m_ImageTypeList[i] = (ImageType)i;
|
||||
}
|
||||
|
||||
ImageType[] array = m_ImageTypeList.ToArray();
|
||||
Utility.Shuffle(array);
|
||||
return array.Take(count).ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
265
Projects/Scripts/Engines/Quests/Collector/Items/Obsidian.cs
Normal file
265
Projects/Scripts/Engines/Quests/Collector/Items/Obsidian.cs
Normal file
|
|
@ -0,0 +1,265 @@
|
|||
using System.Collections.Generic;
|
||||
using Server.ContextMenus;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Engines.Quests.Collector
|
||||
{
|
||||
public class Obsidian : Item
|
||||
{
|
||||
private const int m_Partial = 2;
|
||||
private const int m_Completed = 10;
|
||||
|
||||
private static readonly string[] m_Names =
|
||||
{
|
||||
null,
|
||||
"an aggressive cavalier",
|
||||
"a beguiling rogue",
|
||||
"a benevolent physician",
|
||||
"a brilliant artisan",
|
||||
"a capricious adventurer",
|
||||
"a clever beggar",
|
||||
"a convincing charlatan",
|
||||
"a creative inventor",
|
||||
"a creative tinker",
|
||||
"a cunning knave",
|
||||
"a dauntless explorer",
|
||||
"a despicable ruffian",
|
||||
"an earnest malcontent",
|
||||
"an exultant animal tamer",
|
||||
"a famed adventurer",
|
||||
"a fanatical crusader",
|
||||
"a fastidious clerk",
|
||||
"a fearless hunter",
|
||||
"a festive harlequin",
|
||||
"a fidgety assassin",
|
||||
"a fierce soldier",
|
||||
"a fierce warrior",
|
||||
"a frugal magnate",
|
||||
"a glib pundit",
|
||||
"a gnomic shaman",
|
||||
"a graceful noblewoman",
|
||||
"a idiotic madman",
|
||||
"a imaginative designer",
|
||||
"an inept conjurer",
|
||||
"an innovative architect",
|
||||
"an inventive blacksmith",
|
||||
"a judicious mayor",
|
||||
"a masterful chef",
|
||||
"a masterful woodworker",
|
||||
"a melancholy clown",
|
||||
"a melodic bard",
|
||||
"a merciful guard",
|
||||
"a mirthful jester",
|
||||
"a nervous surgeon",
|
||||
"a peaceful scholar",
|
||||
"a prolific gardener",
|
||||
"a quixotic knight",
|
||||
"a regal aristocrat",
|
||||
"a resourceful smith",
|
||||
"a reticent alchemist",
|
||||
"a sanctified priest",
|
||||
"a scheming patrician",
|
||||
"a shrewd mage",
|
||||
"a singing minstrel",
|
||||
"a skilled tailor",
|
||||
"a squeamish assassin",
|
||||
"a stoic swordsman",
|
||||
"a studious scribe",
|
||||
"a thought provoking writer",
|
||||
"a treacherous scoundrel",
|
||||
"a troubled poet",
|
||||
"an unflappable wizard",
|
||||
"a valiant warrior",
|
||||
"a wayward fool"
|
||||
};
|
||||
|
||||
private int m_Quantity;
|
||||
private string m_StatueName;
|
||||
|
||||
[Constructible]
|
||||
public Obsidian() : base(0x1EA7)
|
||||
{
|
||||
Hue = 0x497;
|
||||
|
||||
m_Quantity = 1;
|
||||
m_StatueName = "";
|
||||
}
|
||||
|
||||
public Obsidian(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Quantity
|
||||
{
|
||||
get => m_Quantity;
|
||||
set
|
||||
{
|
||||
if (value <= 1)
|
||||
m_Quantity = 1;
|
||||
else if (value >= m_Completed)
|
||||
m_Quantity = m_Completed;
|
||||
else
|
||||
m_Quantity = value;
|
||||
|
||||
if (m_Quantity < m_Partial)
|
||||
ItemID = 0x1EA7;
|
||||
else if (m_Quantity < m_Completed)
|
||||
ItemID = 0x1F13;
|
||||
else
|
||||
ItemID = 0x12CB;
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public string StatueName
|
||||
{
|
||||
get => m_StatueName;
|
||||
set
|
||||
{
|
||||
m_StatueName = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ForceShowProperties => ObjectPropertyList.Enabled;
|
||||
|
||||
public static string RandomName(Mobile from)
|
||||
{
|
||||
int index = Utility.Random(m_Names.Length);
|
||||
if (m_Names[index] == null)
|
||||
return from.Name;
|
||||
return m_Names[index];
|
||||
}
|
||||
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
if (m_Quantity < m_Partial)
|
||||
list.Add(1055137); // a section of an obsidian statue
|
||||
else if (m_Quantity < m_Completed)
|
||||
list.Add(1055138); // a partially reconstructed obsidian statue
|
||||
else
|
||||
list.Add(1055139, m_StatueName); // an obsidian statue of ~1_STATUE_NAME~
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
if (m_Quantity < m_Partial)
|
||||
LabelTo(from, 1055137); // a section of an obsidian statue
|
||||
else if (m_Quantity < m_Completed)
|
||||
LabelTo(from, 1055138); // a partially reconstructed obsidian statue
|
||||
else
|
||||
LabelTo(from, 1055139, m_StatueName); // an obsidian statue of ~1_STATUE_NAME~
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
if (from.Alive && m_Quantity >= m_Partial && m_Quantity < m_Completed && IsChildOf(from.Backpack))
|
||||
list.Add(new DisassembleEntry(this));
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (m_Quantity < m_Completed)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
from.Send(new MessageLocalized(Serial, ItemID, MessageType.Regular, 0x2C, 3, 500309, "",
|
||||
"")); // Nothing Happens.
|
||||
else
|
||||
from.Target = new InternalTarget(this);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
|
||||
writer.WriteEncodedInt(m_Quantity);
|
||||
writer.Write(m_StatueName);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Quantity = reader.ReadEncodedInt();
|
||||
m_StatueName = Utility.Intern(reader.ReadString());
|
||||
}
|
||||
|
||||
private class DisassembleEntry : ContextMenuEntry
|
||||
{
|
||||
private Obsidian m_Obsidian;
|
||||
|
||||
public DisassembleEntry(Obsidian obsidian) : base(6142)
|
||||
{
|
||||
m_Obsidian = obsidian;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
Mobile from = Owner.From;
|
||||
if (!m_Obsidian.Deleted && m_Obsidian.Quantity >= m_Partial && m_Obsidian.Quantity < m_Completed &&
|
||||
m_Obsidian.IsChildOf(from.Backpack) && from.CheckAlive())
|
||||
{
|
||||
for (int i = 0; i < m_Obsidian.Quantity - 1; i++)
|
||||
from.AddToBackpack(new Obsidian());
|
||||
|
||||
m_Obsidian.Quantity = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private Obsidian m_Obsidian;
|
||||
|
||||
public InternalTarget(Obsidian obsidian) : base(-1, false, TargetFlags.None)
|
||||
{
|
||||
m_Obsidian = obsidian;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Obsidian.Deleted || m_Obsidian.Quantity >= m_Completed || !(targeted is Item targ))
|
||||
return;
|
||||
|
||||
if (m_Obsidian.IsChildOf(from.Backpack) && targ.IsChildOf(from.Backpack) && targ is Obsidian targObsidian &&
|
||||
targ != m_Obsidian)
|
||||
if (targObsidian.Quantity < m_Completed)
|
||||
{
|
||||
if (targObsidian.Quantity + m_Obsidian.Quantity <= m_Completed)
|
||||
{
|
||||
targObsidian.Quantity += m_Obsidian.Quantity;
|
||||
m_Obsidian.Delete();
|
||||
}
|
||||
else
|
||||
{
|
||||
int delta = m_Completed - targObsidian.Quantity;
|
||||
targObsidian.Quantity += delta;
|
||||
m_Obsidian.Quantity -= delta;
|
||||
}
|
||||
|
||||
if (targObsidian.Quantity >= m_Completed)
|
||||
targObsidian.StatueName = RandomName(from);
|
||||
|
||||
from.Send(new AsciiMessage(targObsidian.Serial, targObsidian.ItemID, MessageType.Regular, 0x59, 3,
|
||||
m_Obsidian.Name, "Something Happened."));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
from.Send(new MessageLocalized(m_Obsidian.Serial, m_Obsidian.ItemID, MessageType.Regular, 0x2C, 3, 500309,
|
||||
m_Obsidian.Name, "")); // Nothing Happens.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Engines.Quests.Collector
|
||||
{
|
||||
public class PaintedImage : Item
|
||||
{
|
||||
private ImageType m_Image;
|
||||
|
||||
[Constructible]
|
||||
public PaintedImage(ImageType image) : base(0xFF3)
|
||||
{
|
||||
Weight = 1.0;
|
||||
Hue = 0x8FD;
|
||||
|
||||
m_Image = image;
|
||||
}
|
||||
|
||||
public PaintedImage(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public ImageType Image
|
||||
{
|
||||
get => m_Image;
|
||||
set
|
||||
{
|
||||
m_Image = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
ImageTypeInfo info = ImageTypeInfo.Get(m_Image);
|
||||
list.Add(1060847, "#1055126\t#" + info.Name); // a painted image of:
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
ImageTypeInfo info = ImageTypeInfo.Get(m_Image);
|
||||
LabelTo(from, 1060847, "#1055126\t#" + info.Name); // a painted image of:
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!from.InRange(GetWorldLocation(), 2))
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
return;
|
||||
}
|
||||
|
||||
from.SendGump(new InternalGump(m_Image));
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
|
||||
writer.WriteEncodedInt((int)m_Image);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Image = (ImageType)reader.ReadEncodedInt();
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
public InternalGump(ImageType image) : base(75, 25)
|
||||
{
|
||||
ImageTypeInfo info = ImageTypeInfo.Get(image);
|
||||
|
||||
AddBackground(45, 20, 100, 100, 0xA3C);
|
||||
AddBackground(52, 29, 86, 82, 0xBB8);
|
||||
|
||||
AddItem(info.X, info.Y, info.Figurine);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.Quests.Collector
|
||||
{
|
||||
public class AlbertaGiacco : BaseQuester
|
||||
{
|
||||
[Constructible]
|
||||
public AlbertaGiacco() : base("the respected painter")
|
||||
{
|
||||
}
|
||||
|
||||
public AlbertaGiacco(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName => "Alberta Giacco";
|
||||
|
||||
public override void InitBody()
|
||||
{
|
||||
InitStats(100, 100, 25);
|
||||
|
||||
Hue = 0x83F2;
|
||||
|
||||
Female = true;
|
||||
Body = 0x191;
|
||||
}
|
||||
|
||||
public override void InitOutfit()
|
||||
{
|
||||
AddItem(new FancyShirt());
|
||||
AddItem(new Skirt(0x59B));
|
||||
AddItem(new Boots());
|
||||
AddItem(new FeatheredHat(0x59B));
|
||||
AddItem(new FullApron(0x59B));
|
||||
|
||||
HairItemID = 0x203D; // Pony Tail
|
||||
HairHue = 0x457;
|
||||
}
|
||||
|
||||
public override bool CanTalkTo(PlayerMobile to)
|
||||
{
|
||||
QuestSystem qs = to.Quest as CollectorQuest;
|
||||
|
||||
if (qs == null)
|
||||
return false;
|
||||
|
||||
return qs.IsObjectiveInProgress(typeof(FindAlbertaObjective))
|
||||
|| qs.IsObjectiveInProgress(typeof(SitOnTheStoolObjective))
|
||||
|| qs.IsObjectiveInProgress(typeof(ReturnPaintingObjective));
|
||||
}
|
||||
|
||||
public override void OnTalk(PlayerMobile player, bool contextMenu)
|
||||
{
|
||||
QuestSystem qs = player.Quest;
|
||||
|
||||
if (qs is CollectorQuest)
|
||||
{
|
||||
Direction = GetDirectionTo(player);
|
||||
|
||||
QuestObjective obj = qs.FindObjective<FindAlbertaObjective>();
|
||||
|
||||
if (obj?.Completed == false)
|
||||
obj.Complete();
|
||||
else if (qs.IsObjectiveInProgress(typeof(SitOnTheStoolObjective)))
|
||||
qs.AddConversation(new AlbertaStoolConversation());
|
||||
else if (qs.IsObjectiveInProgress(typeof(ReturnPaintingObjective)))
|
||||
qs.AddConversation(new AlbertaAfterPaintingConversation());
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,228 @@
|
|||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.Quests.Collector
|
||||
{
|
||||
public class ElwoodMcCarrin : BaseQuester
|
||||
{
|
||||
[Constructible]
|
||||
public ElwoodMcCarrin() : base("the well-known collector")
|
||||
{
|
||||
}
|
||||
|
||||
public ElwoodMcCarrin(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName => "Elwood McCarrin";
|
||||
|
||||
public override void InitBody()
|
||||
{
|
||||
InitStats(100, 100, 25);
|
||||
|
||||
Hue = 0x83ED;
|
||||
|
||||
Female = false;
|
||||
Body = 0x190;
|
||||
}
|
||||
|
||||
public override void InitOutfit()
|
||||
{
|
||||
AddItem(new FancyShirt());
|
||||
AddItem(new LongPants(0x544));
|
||||
AddItem(new Shoes(0x454));
|
||||
AddItem(new JesterHat(0x4D2));
|
||||
AddItem(new FullApron(0x4D2));
|
||||
|
||||
HairItemID = 0x203D; // Pony Tail
|
||||
HairHue = 0x47D;
|
||||
|
||||
FacialHairItemID = 0x2040; // Goatee
|
||||
FacialHairHue = 0x47D;
|
||||
}
|
||||
|
||||
public override void OnTalk(PlayerMobile player, bool contextMenu)
|
||||
{
|
||||
Direction = GetDirectionTo(player);
|
||||
|
||||
QuestSystem qs = player.Quest;
|
||||
|
||||
if (qs is CollectorQuest)
|
||||
{
|
||||
if (qs.IsObjectiveInProgress(typeof(FishPearlsObjective)))
|
||||
{
|
||||
qs.AddConversation(new ElwoodDuringFishConversation());
|
||||
}
|
||||
else
|
||||
{
|
||||
QuestObjective obj = qs.FindObjective<ReturnPearlsObjective>();
|
||||
|
||||
if (obj?.Completed == false)
|
||||
{
|
||||
obj.Complete();
|
||||
}
|
||||
else if (qs.IsObjectiveInProgress(typeof(FindAlbertaObjective)))
|
||||
{
|
||||
qs.AddConversation(new ElwoodDuringPainting1Conversation());
|
||||
}
|
||||
else if (qs.IsObjectiveInProgress(typeof(SitOnTheStoolObjective)))
|
||||
{
|
||||
qs.AddConversation(new ElwoodDuringPainting2Conversation());
|
||||
}
|
||||
else
|
||||
{
|
||||
obj = qs.FindObjective<ReturnPaintingObjective>();
|
||||
|
||||
if (obj?.Completed == false)
|
||||
{
|
||||
obj.Complete();
|
||||
}
|
||||
else if (qs.IsObjectiveInProgress(typeof(FindGabrielObjective)))
|
||||
{
|
||||
qs.AddConversation(new ElwoodDuringAutograph1Conversation());
|
||||
}
|
||||
else if (qs.IsObjectiveInProgress(typeof(FindSheetMusicObjective)))
|
||||
{
|
||||
qs.AddConversation(new ElwoodDuringAutograph2Conversation());
|
||||
}
|
||||
else if (qs.IsObjectiveInProgress(typeof(ReturnSheetMusicObjective)))
|
||||
{
|
||||
qs.AddConversation(new ElwoodDuringAutograph3Conversation());
|
||||
}
|
||||
else
|
||||
{
|
||||
obj = qs.FindObjective<ReturnAutographObjective>();
|
||||
|
||||
if (obj?.Completed == false)
|
||||
{
|
||||
obj.Complete();
|
||||
}
|
||||
else if (qs.IsObjectiveInProgress(typeof(FindTomasObjective)))
|
||||
{
|
||||
qs.AddConversation(new ElwoodDuringToys1Conversation());
|
||||
}
|
||||
else if (qs.IsObjectiveInProgress(typeof(CaptureImagesObjective)))
|
||||
{
|
||||
qs.AddConversation(new ElwoodDuringToys2Conversation());
|
||||
}
|
||||
else if (qs.IsObjectiveInProgress(typeof(ReturnImagesObjective)))
|
||||
{
|
||||
qs.AddConversation(new ElwoodDuringToys3Conversation());
|
||||
}
|
||||
else
|
||||
{
|
||||
obj = qs.FindObjective<ReturnToysObjective>();
|
||||
|
||||
if (obj?.Completed == false)
|
||||
{
|
||||
obj.Complete();
|
||||
|
||||
if (GiveReward(player))
|
||||
qs.AddConversation(new EndConversation());
|
||||
else
|
||||
qs.AddConversation(new FullEndConversation(true));
|
||||
}
|
||||
else
|
||||
{
|
||||
obj = qs.FindObjective<MakeRoomObjective>();
|
||||
|
||||
if (obj?.Completed == false)
|
||||
{
|
||||
if (GiveReward(player))
|
||||
{
|
||||
obj.Complete();
|
||||
qs.AddConversation(new EndConversation());
|
||||
}
|
||||
else
|
||||
{
|
||||
qs.AddConversation(new FullEndConversation(false));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QuestSystem newQuest = new CollectorQuest(player);
|
||||
|
||||
if (qs == null && QuestSystem.CanOfferQuest(player, typeof(CollectorQuest)))
|
||||
newQuest.SendOffer();
|
||||
else
|
||||
newQuest.AddConversation(new DontOfferConversation());
|
||||
}
|
||||
}
|
||||
|
||||
public bool GiveReward(Mobile to)
|
||||
{
|
||||
Bag bag = new Bag();
|
||||
|
||||
bag.DropItem(new Gold(Utility.RandomMinMax(500, 1000)));
|
||||
|
||||
if (Utility.RandomBool())
|
||||
{
|
||||
BaseWeapon weapon = Loot.RandomWeapon();
|
||||
|
||||
if (Core.AOS)
|
||||
{
|
||||
BaseRunicTool.ApplyAttributesTo(weapon, 2, 20, 30);
|
||||
}
|
||||
else
|
||||
{
|
||||
weapon.DamageLevel = (WeaponDamageLevel)RandomMinMaxScaled(2, 3);
|
||||
weapon.AccuracyLevel = (WeaponAccuracyLevel)RandomMinMaxScaled(2, 3);
|
||||
weapon.DurabilityLevel = (WeaponDurabilityLevel)RandomMinMaxScaled(2, 3);
|
||||
}
|
||||
|
||||
bag.DropItem(weapon);
|
||||
}
|
||||
else
|
||||
{
|
||||
Item item;
|
||||
|
||||
if (Core.AOS)
|
||||
{
|
||||
item = Loot.RandomArmorOrShieldOrJewelry();
|
||||
|
||||
if (item is BaseArmor armor)
|
||||
BaseRunicTool.ApplyAttributesTo(armor, 2, 20, 30);
|
||||
else if (item is BaseJewel jewel)
|
||||
BaseRunicTool.ApplyAttributesTo(jewel, 2, 20, 30);
|
||||
}
|
||||
else
|
||||
{
|
||||
BaseArmor armor = Loot.RandomArmorOrShield();
|
||||
item = armor;
|
||||
|
||||
armor.ProtectionLevel = (ArmorProtectionLevel)RandomMinMaxScaled(2, 3);
|
||||
armor.Durability = (ArmorDurabilityLevel)RandomMinMaxScaled(2, 3);
|
||||
}
|
||||
|
||||
bag.DropItem(item);
|
||||
}
|
||||
|
||||
bag.DropItem(new Obsidian());
|
||||
|
||||
if (to.PlaceInBackpack(bag)) return true;
|
||||
|
||||
bag.Delete();
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.Quests.Collector
|
||||
{
|
||||
public class GabrielPiete : BaseQuester
|
||||
{
|
||||
[Constructible]
|
||||
public GabrielPiete() : base("the renowned minstrel")
|
||||
{
|
||||
}
|
||||
|
||||
public GabrielPiete(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName => "Gabriel Piete";
|
||||
|
||||
public override void InitBody()
|
||||
{
|
||||
InitStats(100, 100, 25);
|
||||
|
||||
Hue = 0x83EF;
|
||||
|
||||
Female = false;
|
||||
Body = 0x190;
|
||||
}
|
||||
|
||||
public override void InitOutfit()
|
||||
{
|
||||
AddItem(new FancyShirt());
|
||||
AddItem(new LongPants(0x5F7));
|
||||
AddItem(new Shoes(0x5F7));
|
||||
|
||||
HairItemID = 0x2049; // Pig Tails
|
||||
HairHue = 0x460;
|
||||
|
||||
FacialHairItemID = 0x2041; // Mustache
|
||||
FacialHairHue = 0x460;
|
||||
}
|
||||
|
||||
public override bool CanTalkTo(PlayerMobile to)
|
||||
{
|
||||
QuestSystem qs = to.Quest as CollectorQuest;
|
||||
|
||||
if (qs == null)
|
||||
return false;
|
||||
|
||||
return qs.IsObjectiveInProgress(typeof(FindGabrielObjective))
|
||||
|| qs.IsObjectiveInProgress(typeof(FindSheetMusicObjective))
|
||||
|| qs.IsObjectiveInProgress(typeof(ReturnSheetMusicObjective))
|
||||
|| qs.IsObjectiveInProgress(typeof(ReturnAutographObjective));
|
||||
}
|
||||
|
||||
public override void OnTalk(PlayerMobile player, bool contextMenu)
|
||||
{
|
||||
QuestSystem qs = player.Quest;
|
||||
|
||||
if (qs is CollectorQuest)
|
||||
{
|
||||
Direction = GetDirectionTo(player);
|
||||
|
||||
QuestObjective obj = qs.FindObjective<FindGabrielObjective>();
|
||||
|
||||
if (obj?.Completed == false)
|
||||
{
|
||||
obj.Complete();
|
||||
}
|
||||
else if (qs.IsObjectiveInProgress(typeof(FindSheetMusicObjective)))
|
||||
{
|
||||
qs.AddConversation(new GabrielNoSheetMusicConversation());
|
||||
}
|
||||
else
|
||||
{
|
||||
obj = qs.FindObjective<ReturnSheetMusicObjective>();
|
||||
|
||||
if (obj?.Completed == false)
|
||||
obj.Complete();
|
||||
else if (qs.IsObjectiveInProgress(typeof(ReturnAutographObjective)))
|
||||
qs.AddConversation(new GabrielIgnoreConversation());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
163
Projects/Scripts/Engines/Quests/Collector/Mobiles/Impresario.cs
Normal file
163
Projects/Scripts/Engines/Quests/Collector/Mobiles/Impresario.cs
Normal file
|
|
@ -0,0 +1,163 @@
|
|||
using Server.Gumps;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Engines.Quests.Collector
|
||||
{
|
||||
public class Impresario : BaseQuester
|
||||
{
|
||||
[Constructible]
|
||||
public Impresario() : base("the impresario")
|
||||
{
|
||||
}
|
||||
|
||||
public Impresario(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void InitBody()
|
||||
{
|
||||
InitStats(100, 100, 25);
|
||||
|
||||
Hue = Race.Human.RandomSkinHue();
|
||||
|
||||
Female = false;
|
||||
Body = 0x190;
|
||||
Name = NameList.RandomName("male");
|
||||
}
|
||||
|
||||
public override void InitOutfit()
|
||||
{
|
||||
AddItem(new FancyShirt(Utility.RandomDyedHue()));
|
||||
AddItem(new LongPants(Utility.RandomNondyedHue()));
|
||||
AddItem(new Shoes(Utility.RandomNeutralHue()));
|
||||
|
||||
Utility.AssignRandomHair(this);
|
||||
Utility.AssignRandomFacialHair(this);
|
||||
}
|
||||
|
||||
public override bool CanTalkTo(PlayerMobile to)
|
||||
{
|
||||
QuestSystem qs = to.Quest as CollectorQuest;
|
||||
|
||||
if (qs == null)
|
||||
return false;
|
||||
|
||||
return qs.IsObjectiveInProgress(typeof(FindSheetMusicObjective));
|
||||
}
|
||||
|
||||
public override void OnTalk(PlayerMobile player, bool contextMenu)
|
||||
{
|
||||
QuestSystem qs = player.Quest;
|
||||
|
||||
if (!(qs is CollectorQuest))
|
||||
return;
|
||||
|
||||
FindSheetMusicObjective obj = qs.FindObjective<FindSheetMusicObjective>();
|
||||
|
||||
if (obj?.Completed == false)
|
||||
{
|
||||
Direction = GetDirectionTo(player);
|
||||
|
||||
if (obj.IsInRightTheater())
|
||||
{
|
||||
player.CloseGump<SheetMusicOfferGump>();
|
||||
player.SendGump(new SheetMusicOfferGump());
|
||||
}
|
||||
else
|
||||
{
|
||||
qs.AddConversation(new NoSheetMusicConversation());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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 SheetMusicOfferGump : BaseQuestGump
|
||||
{
|
||||
public SheetMusicOfferGump() : base(75, 25)
|
||||
{
|
||||
Closable = false;
|
||||
|
||||
AddImage(349, 10, 0x24B0);
|
||||
AddImageTiled(349, 130, 100, 120, 0x24B3);
|
||||
AddImageTiled(149, 10, 200, 140, 0x24AF);
|
||||
AddImageTiled(149, 300, 200, 140, 0x24B5);
|
||||
AddImage(349, 300, 0x24B6);
|
||||
AddImage(35, 10, 0x24AE);
|
||||
AddImageTiled(35, 150, 120, 100, 0x24B1);
|
||||
AddImage(35, 300, 0x24B4);
|
||||
|
||||
AddHtmlLocalized(110, 60, 200, 20, 1049069, White); // <STRONG>Conversation Event</STRONG>
|
||||
|
||||
AddImage(65, 14, 0x2776);
|
||||
AddImageTiled(81, 14, 349, 17, 0x2775);
|
||||
AddImage(426, 14, 0x2778);
|
||||
|
||||
AddImageTiled(50, 37, 400, 376, 0xA40);
|
||||
AddAlphaRegion(50, 37, 400, 376);
|
||||
|
||||
AddImage(0, 0, 0x28C8);
|
||||
|
||||
AddImageTiled(75, 90, 200, 1, 0x238D);
|
||||
AddImage(75, 58, 0x2635);
|
||||
AddImage(380, 45, 0xDF);
|
||||
|
||||
AddHtmlLocalized(98, 140, 312, 200, 1055107, LightGreen, false,
|
||||
true); // Sure, I have some sheet music for a Gabriel Piete song. I'd be happy to sell you a copy for 10 gold.
|
||||
|
||||
AddRadio(85, 350, 0x25F8, 0x25FB, true, 1);
|
||||
AddHtmlLocalized(120, 356, 280, 20, 1014088, White); // I accept.
|
||||
|
||||
AddRadio(85, 385, 0x25F8, 0x25FB, false, 0);
|
||||
AddHtmlLocalized(120, 391, 280, 20, 1049012, White); // No thanks, I decline.
|
||||
|
||||
AddButton(340, 390, 0xF7, 0xF8, 1);
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
if (info.ButtonID == 1 && info.IsSwitched(1))
|
||||
if (sender.Mobile is PlayerMobile player)
|
||||
{
|
||||
QuestSystem qs = player.Quest;
|
||||
|
||||
if (!(qs is CollectorQuest))
|
||||
return;
|
||||
|
||||
FindSheetMusicObjective obj = qs.FindObjective<FindSheetMusicObjective>();
|
||||
|
||||
if (obj?.Completed != false)
|
||||
return;
|
||||
|
||||
if (player.Backpack?.ConsumeTotal(typeof(Gold), 10) == true)
|
||||
{
|
||||
obj.Complete();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (player.FindBankNoCreate()?.ConsumeTotal(typeof(Gold), 10) == true)
|
||||
obj.Complete();
|
||||
|
||||
else
|
||||
player.SendLocalizedMessage(
|
||||
1055108); // You don't have enough gold to buy the sheet music.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.Quests.Collector
|
||||
{
|
||||
public class TomasONeerlan : BaseQuester
|
||||
{
|
||||
[Constructible]
|
||||
public TomasONeerlan() : base("the famed toymaker")
|
||||
{
|
||||
}
|
||||
|
||||
public TomasONeerlan(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName => "Tomas O'Neerlan";
|
||||
|
||||
public override void InitBody()
|
||||
{
|
||||
InitStats(100, 100, 25);
|
||||
|
||||
Hue = 0x83F8;
|
||||
|
||||
Female = false;
|
||||
Body = 0x190;
|
||||
}
|
||||
|
||||
public override void InitOutfit()
|
||||
{
|
||||
AddItem(new FancyShirt());
|
||||
AddItem(new LongPants(0x546));
|
||||
AddItem(new Boots(0x452));
|
||||
AddItem(new FullApron(0x455));
|
||||
|
||||
HairItemID = 0x203B; //ShortHair
|
||||
HairHue = 0x455;
|
||||
}
|
||||
|
||||
public override bool CanTalkTo(PlayerMobile to)
|
||||
{
|
||||
QuestSystem qs = to.Quest as CollectorQuest;
|
||||
|
||||
if (qs == null)
|
||||
return false;
|
||||
|
||||
return qs.IsObjectiveInProgress(typeof(FindTomasObjective))
|
||||
|| qs.IsObjectiveInProgress(typeof(CaptureImagesObjective))
|
||||
|| qs.IsObjectiveInProgress(typeof(ReturnImagesObjective));
|
||||
}
|
||||
|
||||
public override void OnTalk(PlayerMobile player, bool contextMenu)
|
||||
{
|
||||
QuestSystem qs = player.Quest;
|
||||
|
||||
if (qs is CollectorQuest)
|
||||
{
|
||||
Direction = GetDirectionTo(player);
|
||||
|
||||
QuestObjective obj = qs.FindObjective<FindTomasObjective>();
|
||||
|
||||
if (obj?.Completed == false)
|
||||
{
|
||||
Item paints = new EnchantedPaints();
|
||||
|
||||
if (!player.PlaceInBackpack(paints))
|
||||
{
|
||||
paints.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
|
||||
{
|
||||
obj.Complete();
|
||||
}
|
||||
}
|
||||
else if (qs.IsObjectiveInProgress(typeof(CaptureImagesObjective)))
|
||||
{
|
||||
qs.AddConversation(new TomasDuringCollectingConversation());
|
||||
}
|
||||
else
|
||||
{
|
||||
obj = qs.FindObjective<ReturnImagesObjective>();
|
||||
|
||||
if (obj?.Completed == false)
|
||||
{
|
||||
player.Backpack?.ConsumeUpTo(typeof(EnchantedPaints), 1);
|
||||
|
||||
obj.Complete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
372
Projects/Scripts/Engines/Quests/Collector/Objectives.cs
Normal file
372
Projects/Scripts/Engines/Quests/Collector/Objectives.cs
Normal file
|
|
@ -0,0 +1,372 @@
|
|||
using System;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.Quests.Collector
|
||||
{
|
||||
public class FishPearlsObjective : QuestObjective
|
||||
{
|
||||
public override object Message => 1055084;
|
||||
|
||||
public override int MaxProgress => 6;
|
||||
|
||||
public override void RenderProgress(BaseQuestGump gump)
|
||||
{
|
||||
if (!Completed)
|
||||
{
|
||||
// Rainbow pearls collected:
|
||||
gump.AddHtmlObject(70, 260, 270, 100, 1055085, BaseQuestGump.Blue, false, false);
|
||||
|
||||
gump.AddLabel(70, 280, 0x64, CurProgress.ToString());
|
||||
gump.AddLabel(100, 280, 0x64, "/");
|
||||
gump.AddLabel(130, 280, 0x64, MaxProgress.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
base.RenderProgress(gump);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnComplete()
|
||||
{
|
||||
System.AddObjective(new ReturnPearlsObjective());
|
||||
}
|
||||
}
|
||||
|
||||
public class ReturnPearlsObjective : QuestObjective
|
||||
{
|
||||
public override object Message => 1055088;
|
||||
|
||||
public override void OnComplete()
|
||||
{
|
||||
System.AddConversation(new ReturnPearlsConversation());
|
||||
}
|
||||
}
|
||||
|
||||
public class FindAlbertaObjective : QuestObjective
|
||||
{
|
||||
public override object Message => 1055091;
|
||||
|
||||
public override void OnComplete()
|
||||
{
|
||||
System.AddConversation(new AlbertaPaintingConversation());
|
||||
}
|
||||
}
|
||||
|
||||
public class SitOnTheStoolObjective : QuestObjective
|
||||
{
|
||||
private static readonly Point3D m_StoolLocation = new Point3D(2899, 706, 0);
|
||||
private static readonly Map m_StoolMap = Map.Trammel;
|
||||
|
||||
private DateTime m_Begin;
|
||||
|
||||
public SitOnTheStoolObjective()
|
||||
{
|
||||
m_Begin = DateTime.MaxValue;
|
||||
}
|
||||
|
||||
public override object Message => 1055093;
|
||||
|
||||
public override void CheckProgress()
|
||||
{
|
||||
PlayerMobile pm = System.From;
|
||||
|
||||
if (pm.Map == m_StoolMap && pm.Location == m_StoolLocation)
|
||||
{
|
||||
if (m_Begin == DateTime.MaxValue)
|
||||
m_Begin = DateTime.UtcNow;
|
||||
else if (DateTime.UtcNow - m_Begin > TimeSpan.FromSeconds(30.0)) Complete();
|
||||
}
|
||||
else if (m_Begin != DateTime.MaxValue)
|
||||
{
|
||||
m_Begin = DateTime.MaxValue;
|
||||
pm.SendLocalizedMessage(1055095, "",
|
||||
0x26); // You must remain seated on the stool until the portrait is complete. Alberta will now have to start again with a fresh canvas.
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnComplete()
|
||||
{
|
||||
System.AddConversation(new AlbertaEndPaintingConversation());
|
||||
}
|
||||
}
|
||||
|
||||
public class ReturnPaintingObjective : QuestObjective
|
||||
{
|
||||
public override object Message => 1055099;
|
||||
|
||||
public override void OnComplete()
|
||||
{
|
||||
System.AddConversation(new ReturnPaintingConversation());
|
||||
}
|
||||
}
|
||||
|
||||
public class FindGabrielObjective : QuestObjective
|
||||
{
|
||||
public override object Message => 1055101;
|
||||
|
||||
public override void OnComplete()
|
||||
{
|
||||
System.AddConversation(new GabrielAutographConversation());
|
||||
}
|
||||
}
|
||||
|
||||
public enum Theater
|
||||
{
|
||||
Britain,
|
||||
Nujelm,
|
||||
Jhelom
|
||||
}
|
||||
|
||||
public class FindSheetMusicObjective : QuestObjective
|
||||
{
|
||||
private Theater m_Theater;
|
||||
|
||||
public FindSheetMusicObjective(bool init)
|
||||
{
|
||||
if (init)
|
||||
InitTheater();
|
||||
}
|
||||
|
||||
public FindSheetMusicObjective()
|
||||
{
|
||||
}
|
||||
|
||||
public override object Message => 1055104;
|
||||
|
||||
public void InitTheater()
|
||||
{
|
||||
switch (Utility.Random(3))
|
||||
{
|
||||
case 1:
|
||||
m_Theater = Theater.Britain;
|
||||
break;
|
||||
case 2:
|
||||
m_Theater = Theater.Nujelm;
|
||||
break;
|
||||
default:
|
||||
m_Theater = Theater.Jhelom;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsInRightTheater()
|
||||
{
|
||||
PlayerMobile player = System.From;
|
||||
|
||||
Region region = Region.Find(player.Location, player.Map);
|
||||
|
||||
if (region == null)
|
||||
return false;
|
||||
|
||||
switch (m_Theater)
|
||||
{
|
||||
case Theater.Britain: return region.IsPartOf("Britain");
|
||||
case Theater.Nujelm: return region.IsPartOf("Nujel'm");
|
||||
case Theater.Jhelom: return region.IsPartOf("Jhelom");
|
||||
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnComplete()
|
||||
{
|
||||
System.AddConversation(new GetSheetMusicConversation());
|
||||
}
|
||||
|
||||
public override void ChildDeserialize(GenericReader reader)
|
||||
{
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_Theater = (Theater)reader.ReadEncodedInt();
|
||||
}
|
||||
|
||||
public override void ChildSerialize(GenericWriter writer)
|
||||
{
|
||||
writer.WriteEncodedInt(0); // version
|
||||
|
||||
writer.WriteEncodedInt((int)m_Theater);
|
||||
}
|
||||
}
|
||||
|
||||
public class ReturnSheetMusicObjective : QuestObjective
|
||||
{
|
||||
public override object Message => 1055110;
|
||||
|
||||
public override void OnComplete()
|
||||
{
|
||||
System.AddConversation(new GabrielSheetMusicConversation());
|
||||
}
|
||||
}
|
||||
|
||||
public class ReturnAutographObjective : QuestObjective
|
||||
{
|
||||
public override object Message => 1055114;
|
||||
|
||||
public override void OnComplete()
|
||||
{
|
||||
System.AddConversation(new ReturnAutographConversation());
|
||||
}
|
||||
}
|
||||
|
||||
public class FindTomasObjective : QuestObjective
|
||||
{
|
||||
public override object Message => 1055117;
|
||||
|
||||
public override void OnComplete()
|
||||
{
|
||||
System.AddConversation(new TomasToysConversation());
|
||||
}
|
||||
}
|
||||
|
||||
public enum CaptureResponse
|
||||
{
|
||||
Valid,
|
||||
AlreadyDone,
|
||||
Invalid
|
||||
}
|
||||
|
||||
public class CaptureImagesObjective : QuestObjective
|
||||
{
|
||||
private bool[] m_Done;
|
||||
private ImageType[] m_Images;
|
||||
|
||||
public CaptureImagesObjective(bool init)
|
||||
{
|
||||
if (init)
|
||||
{
|
||||
m_Images = ImageTypeInfo.RandomList(4);
|
||||
m_Done = new bool[4];
|
||||
}
|
||||
}
|
||||
|
||||
public CaptureImagesObjective()
|
||||
{
|
||||
}
|
||||
|
||||
public override object Message => 1055120;
|
||||
|
||||
public override bool Completed
|
||||
{
|
||||
get
|
||||
{
|
||||
for (int i = 0; i < m_Done.Length; i++)
|
||||
if (!m_Done[i])
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IgnoreYoungProtection(Mobile from)
|
||||
{
|
||||
if (Completed)
|
||||
return false;
|
||||
|
||||
Type fromType = from.GetType();
|
||||
|
||||
for (int i = 0; i < m_Images.Length; i++)
|
||||
{
|
||||
ImageTypeInfo info = ImageTypeInfo.Get(m_Images[i]);
|
||||
|
||||
if (info.Type == fromType)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public CaptureResponse CaptureImage(Type type, out ImageType image)
|
||||
{
|
||||
for (int i = 0; i < m_Images.Length; i++)
|
||||
{
|
||||
ImageTypeInfo info = ImageTypeInfo.Get(m_Images[i]);
|
||||
|
||||
if (info.Type == type)
|
||||
{
|
||||
image = m_Images[i];
|
||||
|
||||
if (m_Done[i]) return CaptureResponse.AlreadyDone;
|
||||
|
||||
m_Done[i] = true;
|
||||
|
||||
CheckCompletionStatus();
|
||||
|
||||
return CaptureResponse.Valid;
|
||||
}
|
||||
}
|
||||
|
||||
image = 0;
|
||||
return CaptureResponse.Invalid;
|
||||
}
|
||||
|
||||
public override void RenderProgress(BaseQuestGump gump)
|
||||
{
|
||||
if (!Completed)
|
||||
for (int i = 0; i < m_Images.Length; i++)
|
||||
{
|
||||
ImageTypeInfo info = ImageTypeInfo.Get(m_Images[i]);
|
||||
|
||||
gump.AddHtmlObject(70, 260 + 20 * i, 200, 100, info.Name, BaseQuestGump.Blue, false, false);
|
||||
gump.AddLabel(200, 260 + 20 * i, 0x64, " : ");
|
||||
gump.AddHtmlObject(220, 260 + 20 * i, 100, 100, m_Done[i] ? 1055121 : 1055122, BaseQuestGump.Blue, false,
|
||||
false);
|
||||
}
|
||||
else
|
||||
base.RenderProgress(gump);
|
||||
}
|
||||
|
||||
public override void OnComplete()
|
||||
{
|
||||
System.AddObjective(new ReturnImagesObjective());
|
||||
}
|
||||
|
||||
public override void ChildDeserialize(GenericReader reader)
|
||||
{
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
int count = reader.ReadEncodedInt();
|
||||
|
||||
m_Images = new ImageType[count];
|
||||
m_Done = new bool[count];
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
m_Images[i] = (ImageType)reader.ReadEncodedInt();
|
||||
m_Done[i] = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
|
||||
public override void ChildSerialize(GenericWriter writer)
|
||||
{
|
||||
writer.WriteEncodedInt(0); // version
|
||||
|
||||
writer.WriteEncodedInt(m_Images.Length);
|
||||
|
||||
for (int i = 0; i < m_Images.Length; i++)
|
||||
{
|
||||
writer.WriteEncodedInt((int)m_Images[i]);
|
||||
writer.Write(m_Done[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ReturnImagesObjective : QuestObjective
|
||||
{
|
||||
public override object Message => 1055128;
|
||||
|
||||
public override void OnComplete()
|
||||
{
|
||||
System.AddConversation(new ReturnImagesConversation());
|
||||
}
|
||||
}
|
||||
|
||||
public class ReturnToysObjective : QuestObjective
|
||||
{
|
||||
public override object Message => 1055132;
|
||||
}
|
||||
|
||||
public class MakeRoomObjective : QuestObjective
|
||||
{
|
||||
public override object Message => 1055136;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue