Changes properties to use automatic property initializers
This commit is contained in:
parent
f0a48ad431
commit
06fa31a7bf
623 changed files with 13072 additions and 19304 deletions
|
|
@ -32,13 +32,11 @@ namespace Server.Engines.Quests.Ambitious
|
|||
|
||||
public override int Picture => 0x15C9;
|
||||
|
||||
private bool m_RedSolen;
|
||||
|
||||
public bool RedSolen => m_RedSolen;
|
||||
public bool RedSolen { get; private set; }
|
||||
|
||||
public AmbitiousQueenQuest( PlayerMobile from, bool redSolen ) : base( from )
|
||||
{
|
||||
m_RedSolen = redSolen;
|
||||
RedSolen = redSolen;
|
||||
}
|
||||
|
||||
// Serialization
|
||||
|
|
@ -50,14 +48,14 @@ namespace Server.Engines.Quests.Ambitious
|
|||
{
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_RedSolen = reader.ReadBool();
|
||||
RedSolen = reader.ReadBool();
|
||||
}
|
||||
|
||||
public override void ChildSerialize( GenericWriter writer )
|
||||
{
|
||||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_RedSolen );
|
||||
writer.Write( (bool) RedSolen );
|
||||
}
|
||||
|
||||
public override void Accept()
|
||||
|
|
|
|||
|
|
@ -95,25 +95,17 @@ namespace Server.Engines.Quests.Ambitious
|
|||
{
|
||||
public override object Message => 1054148;
|
||||
|
||||
private bool m_BagOfSending;
|
||||
private bool m_PowderOfTranslocation;
|
||||
private bool m_Gold;
|
||||
public bool BagOfSending { get; set; }
|
||||
|
||||
public bool BagOfSending{ get => m_BagOfSending;
|
||||
set => m_BagOfSending = value;
|
||||
}
|
||||
public bool PowderOfTranslocation{ get => m_PowderOfTranslocation;
|
||||
set => m_PowderOfTranslocation = value;
|
||||
}
|
||||
public bool Gold{ get => m_Gold;
|
||||
set => m_Gold = value;
|
||||
}
|
||||
public bool PowderOfTranslocation { get; set; }
|
||||
|
||||
public bool Gold { get; set; }
|
||||
|
||||
public GetRewardObjective( bool bagOfSending, bool powderOfTranslocation, bool gold)
|
||||
{
|
||||
m_BagOfSending = bagOfSending;
|
||||
m_PowderOfTranslocation = powderOfTranslocation;
|
||||
m_Gold = gold;
|
||||
BagOfSending = bagOfSending;
|
||||
PowderOfTranslocation = powderOfTranslocation;
|
||||
Gold = gold;
|
||||
}
|
||||
|
||||
public GetRewardObjective()
|
||||
|
|
@ -129,18 +121,18 @@ namespace Server.Engines.Quests.Ambitious
|
|||
{
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_BagOfSending = reader.ReadBool();
|
||||
m_PowderOfTranslocation = reader.ReadBool();
|
||||
m_Gold = reader.ReadBool();
|
||||
BagOfSending = reader.ReadBool();
|
||||
PowderOfTranslocation = reader.ReadBool();
|
||||
Gold = reader.ReadBool();
|
||||
}
|
||||
|
||||
public override void ChildSerialize( GenericWriter writer )
|
||||
{
|
||||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_BagOfSending );
|
||||
writer.Write( (bool) m_PowderOfTranslocation );
|
||||
writer.Write( (bool) m_Gold );
|
||||
writer.Write( (bool) BagOfSending );
|
||||
writer.Write( (bool) PowderOfTranslocation );
|
||||
writer.Write( (bool) Gold );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,23 +82,21 @@ namespace Server.Engines.Quests.Collector
|
|||
return images;
|
||||
}
|
||||
|
||||
private int m_Figurine;
|
||||
private Type m_Type;
|
||||
private int m_X;
|
||||
private int m_Y;
|
||||
public int Figurine { get; }
|
||||
|
||||
public int Figurine => m_Figurine;
|
||||
public Type Type => m_Type;
|
||||
public int Name => m_Figurine < 0x4000 ? 1020000 + m_Figurine : 1078872 + m_Figurine;
|
||||
public int X => m_X;
|
||||
public int Y => m_Y;
|
||||
public Type Type { get; }
|
||||
|
||||
public int Name => Figurine < 0x4000 ? 1020000 + Figurine : 1078872 + Figurine;
|
||||
public int X { get; }
|
||||
|
||||
public int Y { get; }
|
||||
|
||||
public ImageTypeInfo( int figurine, Type type, int x, int y )
|
||||
{
|
||||
m_Figurine = figurine;
|
||||
m_Type = type;
|
||||
m_X = x;
|
||||
m_Y = y;
|
||||
Figurine = figurine;
|
||||
Type = type;
|
||||
X = x;
|
||||
Y = y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,23 +5,13 @@ namespace Server.Engines.Quests
|
|||
{
|
||||
public class HornOfRetreat : Item
|
||||
{
|
||||
private Point3D m_DestLoc;
|
||||
private Map m_DestMap;
|
||||
private int m_Charges;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Point3D DestLoc
|
||||
{
|
||||
get => m_DestLoc;
|
||||
set => m_DestLoc = value;
|
||||
}
|
||||
public Point3D DestLoc { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Map DestMap
|
||||
{
|
||||
get => m_DestMap;
|
||||
set => m_DestMap = value;
|
||||
}
|
||||
public Map DestMap { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Charges
|
||||
|
|
@ -116,8 +106,8 @@ namespace Server.Engines.Quests
|
|||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( m_DestLoc );
|
||||
writer.Write( m_DestMap );
|
||||
writer.Write( DestLoc );
|
||||
writer.Write( DestMap );
|
||||
writer.Write( m_Charges );
|
||||
}
|
||||
|
||||
|
|
@ -131,8 +121,8 @@ namespace Server.Engines.Quests
|
|||
{
|
||||
case 0:
|
||||
{
|
||||
m_DestLoc = reader.ReadPoint3D();
|
||||
m_DestMap = reader.ReadMap();
|
||||
DestLoc = reader.ReadPoint3D();
|
||||
DestMap = reader.ReadMap();
|
||||
m_Charges = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,25 +6,14 @@ namespace Server.Engines.Quests
|
|||
{
|
||||
public abstract class QuestConversation
|
||||
{
|
||||
private QuestSystem m_System;
|
||||
private bool m_HasBeenRead;
|
||||
|
||||
public abstract object Message{ get; }
|
||||
|
||||
public virtual QuestItemInfo[] Info => null;
|
||||
public virtual bool Logged => true;
|
||||
|
||||
public QuestSystem System
|
||||
{
|
||||
get => m_System;
|
||||
set => m_System = value;
|
||||
}
|
||||
public QuestSystem System { get; set; }
|
||||
|
||||
public bool HasBeenRead
|
||||
{
|
||||
get => m_HasBeenRead;
|
||||
set => m_HasBeenRead = value;
|
||||
}
|
||||
public bool HasBeenRead { get; set; }
|
||||
|
||||
public QuestConversation()
|
||||
{
|
||||
|
|
@ -38,7 +27,7 @@ namespace Server.Engines.Quests
|
|||
{
|
||||
case 0:
|
||||
{
|
||||
m_HasBeenRead = reader.ReadBool();
|
||||
HasBeenRead = reader.ReadBool();
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -56,7 +45,7 @@ namespace Server.Engines.Quests
|
|||
{
|
||||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_HasBeenRead );
|
||||
writer.Write( (bool) HasBeenRead );
|
||||
|
||||
ChildSerialize( writer );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,25 +4,14 @@ namespace Server.Engines.Quests
|
|||
{
|
||||
public class QuestItemInfo
|
||||
{
|
||||
private object m_Name;
|
||||
private int m_ItemID;
|
||||
public object Name { get; set; }
|
||||
|
||||
public object Name
|
||||
{
|
||||
get => m_Name;
|
||||
set => m_Name = value;
|
||||
}
|
||||
|
||||
public int ItemID
|
||||
{
|
||||
get => m_ItemID;
|
||||
set => m_ItemID = value;
|
||||
}
|
||||
public int ItemID { get; set; }
|
||||
|
||||
public QuestItemInfo( object name, int itemID )
|
||||
{
|
||||
m_Name = name;
|
||||
m_ItemID = itemID;
|
||||
Name = name;
|
||||
ItemID = itemID;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,27 +8,16 @@ namespace Server.Engines.Quests
|
|||
{
|
||||
public abstract class QuestObjective
|
||||
{
|
||||
private QuestSystem m_System;
|
||||
private bool m_HasBeenRead;
|
||||
private int m_CurProgress;
|
||||
private bool m_HasCompleted;
|
||||
|
||||
public abstract object Message{ get; }
|
||||
|
||||
public virtual int MaxProgress => 1;
|
||||
public virtual QuestItemInfo[] Info => null;
|
||||
|
||||
public QuestSystem System
|
||||
{
|
||||
get => m_System;
|
||||
set => m_System = value;
|
||||
}
|
||||
public QuestSystem System { get; set; }
|
||||
|
||||
public bool HasBeenRead
|
||||
{
|
||||
get => m_HasBeenRead;
|
||||
set => m_HasBeenRead = value;
|
||||
}
|
||||
public bool HasBeenRead { get; set; }
|
||||
|
||||
public int CurProgress
|
||||
{
|
||||
|
|
@ -36,11 +25,7 @@ namespace Server.Engines.Quests
|
|||
set{ m_CurProgress = value; CheckCompletionStatus(); }
|
||||
}
|
||||
|
||||
public bool HasCompleted
|
||||
{
|
||||
get => m_HasCompleted;
|
||||
set => m_HasCompleted = value;
|
||||
}
|
||||
public bool HasCompleted { get; set; }
|
||||
|
||||
public virtual bool Completed => m_CurProgress >= MaxProgress;
|
||||
|
||||
|
|
@ -58,13 +43,13 @@ namespace Server.Engines.Quests
|
|||
{
|
||||
case 1:
|
||||
{
|
||||
m_HasBeenRead = reader.ReadBool();
|
||||
HasBeenRead = reader.ReadBool();
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_CurProgress = reader.ReadEncodedInt();
|
||||
m_HasCompleted = reader.ReadBool();
|
||||
HasCompleted = reader.ReadBool();
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -82,9 +67,9 @@ namespace Server.Engines.Quests
|
|||
{
|
||||
writer.WriteEncodedInt( (int) 1 ); // version
|
||||
|
||||
writer.Write( (bool) m_HasBeenRead );
|
||||
writer.Write( (bool) HasBeenRead );
|
||||
writer.WriteEncodedInt( (int) m_CurProgress );
|
||||
writer.Write( (bool) m_HasCompleted );
|
||||
writer.Write( (bool) HasCompleted );
|
||||
|
||||
ChildSerialize( writer );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,39 +4,28 @@ namespace Server.Engines.Quests
|
|||
{
|
||||
public class QuestRestartInfo
|
||||
{
|
||||
private Type m_QuestType;
|
||||
private DateTime m_RestartTime;
|
||||
public Type QuestType { get; set; }
|
||||
|
||||
public Type QuestType
|
||||
{
|
||||
get => m_QuestType;
|
||||
set => m_QuestType = value;
|
||||
}
|
||||
|
||||
public DateTime RestartTime
|
||||
{
|
||||
get => m_RestartTime;
|
||||
set => m_RestartTime = value;
|
||||
}
|
||||
public DateTime RestartTime { get; set; }
|
||||
|
||||
public void Reset( TimeSpan restartDelay )
|
||||
{
|
||||
if ( restartDelay < TimeSpan.MaxValue )
|
||||
m_RestartTime = DateTime.UtcNow + restartDelay;
|
||||
RestartTime = DateTime.UtcNow + restartDelay;
|
||||
else
|
||||
m_RestartTime = DateTime.MaxValue;
|
||||
RestartTime = DateTime.MaxValue;
|
||||
}
|
||||
|
||||
public QuestRestartInfo( Type questType, TimeSpan restartDelay )
|
||||
{
|
||||
m_QuestType = questType;
|
||||
QuestType = questType;
|
||||
Reset( restartDelay );
|
||||
}
|
||||
|
||||
public QuestRestartInfo( Type questType, DateTime restartTime )
|
||||
{
|
||||
m_QuestType = questType;
|
||||
m_RestartTime = restartTime;
|
||||
QuestType = questType;
|
||||
RestartTime = restartTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -37,27 +37,11 @@ namespace Server.Engines.Quests
|
|||
|
||||
public abstract Type[] TypeReferenceTable{ get; }
|
||||
|
||||
private PlayerMobile m_From;
|
||||
private ArrayList m_Objectives;
|
||||
private ArrayList m_Conversations;
|
||||
public PlayerMobile From { get; set; }
|
||||
|
||||
public PlayerMobile From
|
||||
{
|
||||
get => m_From;
|
||||
set => m_From = value;
|
||||
}
|
||||
public ArrayList Objectives { get; set; }
|
||||
|
||||
public ArrayList Objectives
|
||||
{
|
||||
get => m_Objectives;
|
||||
set => m_Objectives = value;
|
||||
}
|
||||
|
||||
public ArrayList Conversations
|
||||
{
|
||||
get => m_Conversations;
|
||||
set => m_Conversations = value;
|
||||
}
|
||||
public ArrayList Conversations { get; set; }
|
||||
|
||||
private Timer m_Timer;
|
||||
|
||||
|
|
@ -78,9 +62,9 @@ namespace Server.Engines.Quests
|
|||
|
||||
public virtual void Slice()
|
||||
{
|
||||
for ( int i = m_Objectives.Count - 1; i >= 0; --i )
|
||||
for ( int i = Objectives.Count - 1; i >= 0; --i )
|
||||
{
|
||||
QuestObjective obj = (QuestObjective)m_Objectives[i];
|
||||
QuestObjective obj = (QuestObjective)Objectives[i];
|
||||
|
||||
if ( obj.GetTimerEvent() )
|
||||
obj.CheckProgress();
|
||||
|
|
@ -89,9 +73,9 @@ namespace Server.Engines.Quests
|
|||
|
||||
public virtual void OnKill( BaseCreature creature, Container corpse )
|
||||
{
|
||||
for ( int i = m_Objectives.Count - 1; i >= 0; --i )
|
||||
for ( int i = Objectives.Count - 1; i >= 0; --i )
|
||||
{
|
||||
QuestObjective obj = (QuestObjective)m_Objectives[i];
|
||||
QuestObjective obj = (QuestObjective)Objectives[i];
|
||||
|
||||
if ( obj.GetKillEvent( creature, corpse ) )
|
||||
obj.OnKill( creature, corpse );
|
||||
|
|
@ -100,9 +84,9 @@ namespace Server.Engines.Quests
|
|||
|
||||
public virtual bool IgnoreYoungProtection( Mobile from )
|
||||
{
|
||||
for ( int i = m_Objectives.Count - 1; i >= 0; --i )
|
||||
for ( int i = Objectives.Count - 1; i >= 0; --i )
|
||||
{
|
||||
QuestObjective obj = (QuestObjective)m_Objectives[i];
|
||||
QuestObjective obj = (QuestObjective)Objectives[i];
|
||||
|
||||
if ( obj.IgnoreYoungProtection( from ) )
|
||||
return true;
|
||||
|
|
@ -113,9 +97,9 @@ namespace Server.Engines.Quests
|
|||
|
||||
public QuestSystem( PlayerMobile from )
|
||||
{
|
||||
m_From = from;
|
||||
m_Objectives = new ArrayList();
|
||||
m_Conversations = new ArrayList();
|
||||
From = from;
|
||||
Objectives = new ArrayList();
|
||||
Conversations = new ArrayList();
|
||||
}
|
||||
|
||||
public QuestSystem()
|
||||
|
|
@ -134,7 +118,7 @@ namespace Server.Engines.Quests
|
|||
{
|
||||
int count = reader.ReadEncodedInt();
|
||||
|
||||
m_Objectives = new ArrayList( count );
|
||||
Objectives = new ArrayList( count );
|
||||
|
||||
for ( int i = 0; i < count; ++i )
|
||||
{
|
||||
|
|
@ -143,13 +127,13 @@ namespace Server.Engines.Quests
|
|||
if ( obj != null )
|
||||
{
|
||||
obj.System = this;
|
||||
m_Objectives.Add( obj );
|
||||
Objectives.Add( obj );
|
||||
}
|
||||
}
|
||||
|
||||
count = reader.ReadEncodedInt();
|
||||
|
||||
m_Conversations = new ArrayList( count );
|
||||
Conversations = new ArrayList( count );
|
||||
|
||||
for ( int i = 0; i < count; ++i )
|
||||
{
|
||||
|
|
@ -158,7 +142,7 @@ namespace Server.Engines.Quests
|
|||
if ( conv != null )
|
||||
{
|
||||
conv.System = this;
|
||||
m_Conversations.Add( conv );
|
||||
Conversations.Add( conv );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -180,15 +164,15 @@ namespace Server.Engines.Quests
|
|||
|
||||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
|
||||
writer.WriteEncodedInt( (int) m_Objectives.Count );
|
||||
writer.WriteEncodedInt( (int) Objectives.Count );
|
||||
|
||||
for ( int i = 0; i < m_Objectives.Count; ++i )
|
||||
QuestSerializer.Serialize( referenceTable, (QuestObjective) m_Objectives[i], writer );
|
||||
for ( int i = 0; i < Objectives.Count; ++i )
|
||||
QuestSerializer.Serialize( referenceTable, (QuestObjective) Objectives[i], writer );
|
||||
|
||||
writer.WriteEncodedInt( (int) m_Conversations.Count );
|
||||
writer.WriteEncodedInt( (int) Conversations.Count );
|
||||
|
||||
for ( int i = 0; i < m_Conversations.Count; ++i )
|
||||
QuestSerializer.Serialize( referenceTable, (QuestConversation) m_Conversations[i], writer );
|
||||
for ( int i = 0; i < Conversations.Count; ++i )
|
||||
QuestSerializer.Serialize( referenceTable, (QuestConversation) Conversations[i], writer );
|
||||
|
||||
ChildSerialize( writer );
|
||||
}
|
||||
|
|
@ -207,9 +191,9 @@ namespace Server.Engines.Quests
|
|||
|
||||
public QuestObjective FindObjective( Type type )
|
||||
{
|
||||
for ( int i = m_Objectives.Count - 1; i >= 0; --i )
|
||||
for ( int i = Objectives.Count - 1; i >= 0; --i )
|
||||
{
|
||||
QuestObjective obj = (QuestObjective)m_Objectives[i];
|
||||
QuestObjective obj = (QuestObjective)Objectives[i];
|
||||
|
||||
if ( obj.GetType() == type )
|
||||
return obj;
|
||||
|
|
@ -220,15 +204,15 @@ namespace Server.Engines.Quests
|
|||
|
||||
public virtual void SendOffer()
|
||||
{
|
||||
m_From.SendGump( new QuestOfferGump( this ) );
|
||||
From.SendGump( new QuestOfferGump( this ) );
|
||||
}
|
||||
|
||||
public virtual void GetContextMenuEntries( List<ContextMenuEntry> list )
|
||||
{
|
||||
if ( m_Objectives.Count > 0 )
|
||||
if ( Objectives.Count > 0 )
|
||||
list.Add( new QuestCallbackEntry( 6154, ShowQuestLog ) ); // View Quest Log
|
||||
|
||||
if ( m_Conversations.Count > 0 )
|
||||
if ( Conversations.Count > 0 )
|
||||
list.Add( new QuestCallbackEntry( 6156, ShowQuestConversation ) ); // Quest Conversation
|
||||
|
||||
list.Add( new QuestCallbackEntry( 6155, BeginCancelQuest ) ); // Cancel Quest
|
||||
|
|
@ -236,63 +220,63 @@ namespace Server.Engines.Quests
|
|||
|
||||
public virtual void ShowQuestLogUpdated()
|
||||
{
|
||||
m_From.CloseGump( typeof( QuestLogUpdatedGump ) );
|
||||
m_From.SendGump( new QuestLogUpdatedGump( this ) );
|
||||
From.CloseGump( typeof( QuestLogUpdatedGump ) );
|
||||
From.SendGump( new QuestLogUpdatedGump( this ) );
|
||||
}
|
||||
|
||||
public virtual void ShowQuestLog()
|
||||
{
|
||||
if ( m_Objectives.Count > 0 )
|
||||
if ( Objectives.Count > 0 )
|
||||
{
|
||||
m_From.CloseGump( typeof( QuestItemInfoGump ) );
|
||||
m_From.CloseGump( typeof( QuestLogUpdatedGump ) );
|
||||
m_From.CloseGump( typeof( QuestObjectivesGump ) );
|
||||
m_From.CloseGump( typeof( QuestConversationsGump ) );
|
||||
From.CloseGump( typeof( QuestItemInfoGump ) );
|
||||
From.CloseGump( typeof( QuestLogUpdatedGump ) );
|
||||
From.CloseGump( typeof( QuestObjectivesGump ) );
|
||||
From.CloseGump( typeof( QuestConversationsGump ) );
|
||||
|
||||
m_From.SendGump( new QuestObjectivesGump( m_Objectives ) );
|
||||
From.SendGump( new QuestObjectivesGump( Objectives ) );
|
||||
|
||||
QuestObjective last = (QuestObjective)m_Objectives[m_Objectives.Count - 1];
|
||||
QuestObjective last = (QuestObjective)Objectives[Objectives.Count - 1];
|
||||
|
||||
if ( last.Info != null )
|
||||
m_From.SendGump( new QuestItemInfoGump( last.Info ) );
|
||||
From.SendGump( new QuestItemInfoGump( last.Info ) );
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void ShowQuestConversation()
|
||||
{
|
||||
if ( m_Conversations.Count > 0 )
|
||||
if ( Conversations.Count > 0 )
|
||||
{
|
||||
m_From.CloseGump( typeof( QuestItemInfoGump ) );
|
||||
m_From.CloseGump( typeof( QuestObjectivesGump ) );
|
||||
m_From.CloseGump( typeof( QuestConversationsGump ) );
|
||||
From.CloseGump( typeof( QuestItemInfoGump ) );
|
||||
From.CloseGump( typeof( QuestObjectivesGump ) );
|
||||
From.CloseGump( typeof( QuestConversationsGump ) );
|
||||
|
||||
m_From.SendGump( new QuestConversationsGump( m_Conversations ) );
|
||||
From.SendGump( new QuestConversationsGump( Conversations ) );
|
||||
|
||||
QuestConversation last = (QuestConversation)m_Conversations[m_Conversations.Count - 1];
|
||||
QuestConversation last = (QuestConversation)Conversations[Conversations.Count - 1];
|
||||
|
||||
if ( last.Info != null )
|
||||
m_From.SendGump( new QuestItemInfoGump( last.Info ) );
|
||||
From.SendGump( new QuestItemInfoGump( last.Info ) );
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void BeginCancelQuest()
|
||||
{
|
||||
m_From.SendGump( new QuestCancelGump( this ) );
|
||||
From.SendGump( new QuestCancelGump( this ) );
|
||||
}
|
||||
|
||||
public virtual void EndCancelQuest( bool shouldCancel )
|
||||
{
|
||||
if ( m_From.Quest != this )
|
||||
if ( From.Quest != this )
|
||||
return;
|
||||
|
||||
if ( shouldCancel )
|
||||
{
|
||||
m_From.SendLocalizedMessage( 1049015 ); // You have canceled your quest.
|
||||
From.SendLocalizedMessage( 1049015 ); // You have canceled your quest.
|
||||
Cancel();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_From.SendLocalizedMessage( 1049014 ); // You have chosen not to cancel your quest.
|
||||
From.SendLocalizedMessage( 1049014 ); // You have chosen not to cancel your quest.
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -310,18 +294,18 @@ namespace Server.Engines.Quests
|
|||
{
|
||||
StopTimer();
|
||||
|
||||
if ( m_From.Quest == this )
|
||||
if ( From.Quest == this )
|
||||
{
|
||||
m_From.Quest = null;
|
||||
From.Quest = null;
|
||||
|
||||
TimeSpan restartDelay = RestartDelay;
|
||||
|
||||
if ( ( completed && restartDelay > TimeSpan.Zero ) || ( !completed && restartDelay == TimeSpan.MaxValue ) )
|
||||
{
|
||||
List<QuestRestartInfo> doneQuests = m_From.DoneQuests;
|
||||
List<QuestRestartInfo> doneQuests = From.DoneQuests;
|
||||
|
||||
if ( doneQuests == null )
|
||||
m_From.DoneQuests = doneQuests = new List<QuestRestartInfo>();
|
||||
From.DoneQuests = doneQuests = new List<QuestRestartInfo>();
|
||||
|
||||
bool found = false;
|
||||
|
||||
|
|
@ -350,43 +334,43 @@ namespace Server.Engines.Quests
|
|||
conv.System = this;
|
||||
|
||||
if ( conv.Logged )
|
||||
m_Conversations.Add( conv );
|
||||
Conversations.Add( conv );
|
||||
|
||||
m_From.CloseGump( typeof( QuestItemInfoGump ) );
|
||||
m_From.CloseGump( typeof( QuestObjectivesGump ) );
|
||||
m_From.CloseGump( typeof( QuestConversationsGump ) );
|
||||
From.CloseGump( typeof( QuestItemInfoGump ) );
|
||||
From.CloseGump( typeof( QuestObjectivesGump ) );
|
||||
From.CloseGump( typeof( QuestConversationsGump ) );
|
||||
|
||||
if ( conv.Logged )
|
||||
m_From.SendGump( new QuestConversationsGump( m_Conversations ) );
|
||||
From.SendGump( new QuestConversationsGump( Conversations ) );
|
||||
else
|
||||
m_From.SendGump( new QuestConversationsGump( conv ) );
|
||||
From.SendGump( new QuestConversationsGump( conv ) );
|
||||
|
||||
if ( conv.Info != null )
|
||||
m_From.SendGump( new QuestItemInfoGump( conv.Info ) );
|
||||
From.SendGump( new QuestItemInfoGump( conv.Info ) );
|
||||
}
|
||||
|
||||
public virtual void AddObjective( QuestObjective obj )
|
||||
{
|
||||
obj.System = this;
|
||||
m_Objectives.Add( obj );
|
||||
Objectives.Add( obj );
|
||||
|
||||
ShowQuestLogUpdated();
|
||||
}
|
||||
|
||||
public virtual void Accept()
|
||||
{
|
||||
if ( m_From.Quest != null )
|
||||
if ( From.Quest != null )
|
||||
return;
|
||||
|
||||
m_From.Quest = this;
|
||||
m_From.SendLocalizedMessage( 1049019 ); // You have accepted the Quest.
|
||||
From.Quest = this;
|
||||
From.SendLocalizedMessage( 1049019 ); // You have accepted the Quest.
|
||||
|
||||
StartTimer();
|
||||
}
|
||||
|
||||
public virtual void Decline()
|
||||
{
|
||||
m_From.SendLocalizedMessage( 1049018 ); // You have declined the Quest.
|
||||
From.SendLocalizedMessage( 1049018 ); // You have declined the Quest.
|
||||
}
|
||||
|
||||
public static bool CanOfferQuest( Mobile check, Type questType )
|
||||
|
|
|
|||
|
|
@ -5,16 +5,11 @@ namespace Server.Engines.Quests.Necro
|
|||
{
|
||||
public class MaabusCoffin : BaseAddon
|
||||
{
|
||||
private Maabus m_Maabus;
|
||||
private Point3D m_SpawnLocation;
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Maabus Maabus { get; private set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Maabus Maabus => m_Maabus;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Point3D SpawnLocation { get => m_SpawnLocation;
|
||||
set => m_SpawnLocation = value;
|
||||
}
|
||||
public Point3D SpawnLocation { get; set; }
|
||||
|
||||
[Constructible]
|
||||
public MaabusCoffin()
|
||||
|
|
@ -32,42 +27,42 @@ namespace Server.Engines.Quests.Necro
|
|||
|
||||
public void Awake( Mobile caller )
|
||||
{
|
||||
if ( m_Maabus != null || m_SpawnLocation == Point3D.Zero )
|
||||
if ( Maabus != null || SpawnLocation == Point3D.Zero )
|
||||
return;
|
||||
|
||||
foreach ( MaabusCoffinComponent c in Components )
|
||||
c.TurnToEmpty();
|
||||
|
||||
m_Maabus = new Maabus();
|
||||
Maabus = new Maabus();
|
||||
|
||||
m_Maabus.Location = m_SpawnLocation;
|
||||
m_Maabus.Map = Map;
|
||||
Maabus.Location = SpawnLocation;
|
||||
Maabus.Map = Map;
|
||||
|
||||
m_Maabus.Direction = m_Maabus.GetDirectionTo( caller );
|
||||
Maabus.Direction = Maabus.GetDirectionTo( caller );
|
||||
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( 7.5 ), BeginSleep );
|
||||
}
|
||||
|
||||
public void BeginSleep()
|
||||
{
|
||||
if ( m_Maabus == null )
|
||||
if ( Maabus == null )
|
||||
return;
|
||||
|
||||
Effects.PlaySound( m_Maabus.Location, m_Maabus.Map, 0x48E );
|
||||
Effects.PlaySound( Maabus.Location, Maabus.Map, 0x48E );
|
||||
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( 2.5 ), Sleep );
|
||||
}
|
||||
|
||||
public void Sleep()
|
||||
{
|
||||
if ( m_Maabus == null )
|
||||
if ( Maabus == null )
|
||||
return;
|
||||
|
||||
Effects.SendLocationParticles( EffectItem.Create( m_Maabus.Location, m_Maabus.Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 0x7E7 );
|
||||
Effects.PlaySound( m_Maabus.Location, m_Maabus.Map, 0x1FE );
|
||||
Effects.SendLocationParticles( EffectItem.Create( Maabus.Location, Maabus.Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 0x7E7 );
|
||||
Effects.PlaySound( Maabus.Location, Maabus.Map, 0x1FE );
|
||||
|
||||
m_Maabus.Delete();
|
||||
m_Maabus = null;
|
||||
Maabus.Delete();
|
||||
Maabus = null;
|
||||
|
||||
foreach ( MaabusCoffinComponent c in Components )
|
||||
c.TurnToFull();
|
||||
|
|
@ -83,8 +78,8 @@ namespace Server.Engines.Quests.Necro
|
|||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( (Mobile) m_Maabus );
|
||||
writer.Write( (Point3D) m_SpawnLocation );
|
||||
writer.Write( (Mobile) Maabus );
|
||||
writer.Write( (Point3D) SpawnLocation );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -93,8 +88,8 @@ namespace Server.Engines.Quests.Necro
|
|||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Maabus = reader.ReadMobile() as Maabus;
|
||||
m_SpawnLocation = reader.ReadPoint3D();
|
||||
Maabus = reader.ReadMobile() as Maabus;
|
||||
SpawnLocation = reader.ReadPoint3D();
|
||||
|
||||
Sleep();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,17 +11,13 @@ namespace Server.Engines.Quests.Ninja
|
|||
1063192 // Ah, a quiet hideout.
|
||||
};
|
||||
|
||||
private int m_Message;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Message{ get => m_Message;
|
||||
set => m_Message = value;
|
||||
}
|
||||
public int Message { get; set; }
|
||||
|
||||
[Constructible]
|
||||
public HiddenFigure()
|
||||
{
|
||||
m_Message = Utility.RandomList( Messages );
|
||||
Message = Utility.RandomList( Messages );
|
||||
}
|
||||
|
||||
public override void InitBody()
|
||||
|
|
@ -67,7 +63,7 @@ namespace Server.Engines.Quests.Ninja
|
|||
|
||||
public override void OnTalk( PlayerMobile player, bool contextMenu )
|
||||
{
|
||||
PrivateOverheadMessage( MessageType.Regular, 0x3B2, m_Message, player.NetState );
|
||||
PrivateOverheadMessage( MessageType.Regular, 0x3B2, Message, player.NetState );
|
||||
}
|
||||
|
||||
public HiddenFigure( Serial serial ) : base( serial )
|
||||
|
|
@ -80,7 +76,7 @@ namespace Server.Engines.Quests.Ninja
|
|||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (int) m_Message );
|
||||
writer.Write( (int) Message );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -89,7 +85,7 @@ namespace Server.Engines.Quests.Ninja
|
|||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_Message = reader.ReadInt();
|
||||
Message = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,13 +53,7 @@ namespace Server.Engines.Quests.Ninja
|
|||
|
||||
public class SneakPastGuardiansObjective : QuestObjective
|
||||
{
|
||||
private bool m_TaughtHowToUseSkills;
|
||||
|
||||
public bool TaughtHowToUseSkills
|
||||
{
|
||||
get => m_TaughtHowToUseSkills;
|
||||
set => m_TaughtHowToUseSkills = value;
|
||||
}
|
||||
public bool TaughtHowToUseSkills { get; set; }
|
||||
|
||||
public override object Message => 1063261;
|
||||
|
||||
|
|
@ -82,14 +76,14 @@ namespace Server.Engines.Quests.Ninja
|
|||
{
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_TaughtHowToUseSkills = reader.ReadBool();
|
||||
TaughtHowToUseSkills = reader.ReadBool();
|
||||
}
|
||||
|
||||
public override void ChildSerialize( GenericWriter writer )
|
||||
{
|
||||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_TaughtHowToUseSkills );
|
||||
writer.Write( (bool) TaughtHowToUseSkills );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -173,13 +167,7 @@ namespace Server.Engines.Quests.Ninja
|
|||
|
||||
public class HallwayWalkObjective : QuestObjective
|
||||
{
|
||||
private bool m_StolenTreasure;
|
||||
|
||||
public bool StolenTreasure
|
||||
{
|
||||
get => m_StolenTreasure;
|
||||
set => m_StolenTreasure = value;
|
||||
}
|
||||
public bool StolenTreasure { get; set; }
|
||||
|
||||
public override object Message => 1063202;
|
||||
|
||||
|
|
@ -196,14 +184,14 @@ namespace Server.Engines.Quests.Ninja
|
|||
{
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_StolenTreasure = reader.ReadBool();
|
||||
StolenTreasure = reader.ReadBool();
|
||||
}
|
||||
|
||||
public override void ChildSerialize( GenericWriter writer )
|
||||
{
|
||||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_StolenTreasure );
|
||||
writer.Write( (bool) StolenTreasure );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -155,13 +155,11 @@ namespace Server.Engines.Quests.Samurai
|
|||
{
|
||||
public override object Message => 1063229;
|
||||
|
||||
private bool m_Dragon;
|
||||
|
||||
public bool Dragon => m_Dragon;
|
||||
public bool Dragon { get; private set; }
|
||||
|
||||
public SecondTrialReturnObjective( bool dragon )
|
||||
{
|
||||
m_Dragon = dragon;
|
||||
Dragon = dragon;
|
||||
}
|
||||
|
||||
public SecondTrialReturnObjective()
|
||||
|
|
@ -170,21 +168,21 @@ namespace Server.Engines.Quests.Samurai
|
|||
|
||||
public override void OnComplete()
|
||||
{
|
||||
System.AddConversation( new ThirdTrialIntroConversation( m_Dragon ) );
|
||||
System.AddConversation( new ThirdTrialIntroConversation( Dragon ) );
|
||||
}
|
||||
|
||||
public override void ChildDeserialize( GenericReader reader )
|
||||
{
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_Dragon = reader.ReadBool();
|
||||
Dragon = reader.ReadBool();
|
||||
}
|
||||
|
||||
public override void ChildSerialize( GenericWriter writer )
|
||||
{
|
||||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_Dragon );
|
||||
writer.Write( (bool) Dragon );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -272,13 +270,11 @@ namespace Server.Engines.Quests.Samurai
|
|||
{
|
||||
public override object Message => 1063242;
|
||||
|
||||
private bool m_KilledCat;
|
||||
|
||||
public bool KilledCat => m_KilledCat;
|
||||
public bool KilledCat { get; private set; }
|
||||
|
||||
public FourthTrialReturnObjective( bool killedCat )
|
||||
{
|
||||
m_KilledCat = killedCat;
|
||||
KilledCat = killedCat;
|
||||
}
|
||||
|
||||
public FourthTrialReturnObjective()
|
||||
|
|
@ -287,21 +283,21 @@ namespace Server.Engines.Quests.Samurai
|
|||
|
||||
public override void OnComplete()
|
||||
{
|
||||
System.AddConversation( new FifthTrialIntroConversation( m_KilledCat ) );
|
||||
System.AddConversation( new FifthTrialIntroConversation( KilledCat ) );
|
||||
}
|
||||
|
||||
public override void ChildDeserialize( GenericReader reader )
|
||||
{
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_KilledCat = reader.ReadBool();
|
||||
KilledCat = reader.ReadBool();
|
||||
}
|
||||
|
||||
public override void ChildSerialize( GenericWriter writer )
|
||||
{
|
||||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_KilledCat );
|
||||
writer.Write( (bool) KilledCat );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -309,11 +305,7 @@ namespace Server.Engines.Quests.Samurai
|
|||
{
|
||||
public override object Message => 1063072;
|
||||
|
||||
private bool m_StolenTreasure;
|
||||
|
||||
public bool StolenTreasure{ get => m_StolenTreasure;
|
||||
set => m_StolenTreasure = value;
|
||||
}
|
||||
public bool StolenTreasure { get; set; }
|
||||
|
||||
public FifthTrialIntroObjective()
|
||||
{
|
||||
|
|
@ -328,14 +320,14 @@ namespace Server.Engines.Quests.Samurai
|
|||
{
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_StolenTreasure = reader.ReadBool();
|
||||
StolenTreasure = reader.ReadBool();
|
||||
}
|
||||
|
||||
public override void ChildSerialize( GenericWriter writer )
|
||||
{
|
||||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_StolenTreasure );
|
||||
writer.Write( (bool) StolenTreasure );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -87,13 +87,11 @@ namespace Server.Engines.Quests.Matriarch
|
|||
|
||||
public override int Picture => 0x15C9;
|
||||
|
||||
private bool m_RedSolen;
|
||||
|
||||
public bool RedSolen => m_RedSolen;
|
||||
public bool RedSolen { get; private set; }
|
||||
|
||||
public SolenMatriarchQuest( PlayerMobile from, bool redSolen ) : base( from )
|
||||
{
|
||||
m_RedSolen = redSolen;
|
||||
RedSolen = redSolen;
|
||||
}
|
||||
|
||||
// Serialization
|
||||
|
|
@ -105,14 +103,14 @@ namespace Server.Engines.Quests.Matriarch
|
|||
{
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_RedSolen = reader.ReadBool();
|
||||
RedSolen = reader.ReadBool();
|
||||
}
|
||||
|
||||
public override void ChildSerialize( GenericWriter writer )
|
||||
{
|
||||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_RedSolen );
|
||||
writer.Write( (bool) RedSolen );
|
||||
}
|
||||
|
||||
public override void Accept()
|
||||
|
|
|
|||
|
|
@ -49,10 +49,9 @@ namespace Server.Engines.Quests.Naturalist
|
|||
return null;
|
||||
}
|
||||
|
||||
private bool m_Special;
|
||||
private Rectangle2D[] m_Rects;
|
||||
|
||||
public bool Special => m_Special;
|
||||
public bool Special { get; }
|
||||
|
||||
public int ID
|
||||
{
|
||||
|
|
@ -69,7 +68,7 @@ namespace Server.Engines.Quests.Naturalist
|
|||
|
||||
private NestArea( bool special, params Rectangle2D[] rects )
|
||||
{
|
||||
m_Special = special;
|
||||
Special = special;
|
||||
m_Rects = rects;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,9 +17,8 @@ namespace Server.Engines.Quests.Naturalist
|
|||
private StudyState m_StudyState;
|
||||
|
||||
private ArrayList m_StudiedNests;
|
||||
private bool m_StudiedSpecialNest;
|
||||
|
||||
public bool StudiedSpecialNest => m_StudiedSpecialNest;
|
||||
public bool StudiedSpecialNest { get; private set; }
|
||||
|
||||
public StudyNestsObjective()
|
||||
{
|
||||
|
|
@ -53,7 +52,7 @@ namespace Server.Engines.Quests.Naturalist
|
|||
if ( m_CurrentNest.Special )
|
||||
{
|
||||
from.SendLocalizedMessage( 1054057 ); // You complete your examination of this bizarre Egg Nest. The Naturalist will undoubtedly be quite interested in these notes!
|
||||
m_StudiedSpecialNest = true;
|
||||
StudiedSpecialNest = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -142,7 +141,7 @@ namespace Server.Engines.Quests.Naturalist
|
|||
m_StudiedNests.Add( nest );
|
||||
}
|
||||
|
||||
m_StudiedSpecialNest = reader.ReadBool();
|
||||
StudiedSpecialNest = reader.ReadBool();
|
||||
}
|
||||
|
||||
public override void ChildSerialize( GenericWriter writer )
|
||||
|
|
@ -155,7 +154,7 @@ namespace Server.Engines.Quests.Naturalist
|
|||
writer.WriteEncodedInt( (int) nest.ID );
|
||||
}
|
||||
|
||||
writer.Write( (bool) m_StudiedSpecialNest );
|
||||
writer.Write( (bool) StudiedSpecialNest );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,13 +27,11 @@ namespace Server.Engines.Quests.Naturalist
|
|||
|
||||
public override int Picture => 0x15C7;
|
||||
|
||||
private Naturalist m_Naturalist;
|
||||
|
||||
public Naturalist Naturalist => m_Naturalist;
|
||||
public Naturalist Naturalist { get; private set; }
|
||||
|
||||
public StudyOfSolenQuest( PlayerMobile from, Naturalist naturalist ) : base( from )
|
||||
{
|
||||
m_Naturalist = naturalist;
|
||||
Naturalist = naturalist;
|
||||
}
|
||||
|
||||
// Serialization
|
||||
|
|
@ -45,21 +43,21 @@ namespace Server.Engines.Quests.Naturalist
|
|||
{
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_Naturalist = (Naturalist) reader.ReadMobile();
|
||||
Naturalist = (Naturalist) reader.ReadMobile();
|
||||
}
|
||||
|
||||
public override void ChildSerialize( GenericWriter writer )
|
||||
{
|
||||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
|
||||
writer.Write( (Mobile) m_Naturalist );
|
||||
writer.Write( (Mobile) Naturalist );
|
||||
}
|
||||
|
||||
public override void Accept()
|
||||
{
|
||||
base.Accept();
|
||||
|
||||
m_Naturalist?.PlaySound( 0x431 );
|
||||
Naturalist?.PlaySound( 0x431 );
|
||||
|
||||
AddConversation( new AcceptConversation() );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,30 +16,14 @@ namespace Server.Engines.Quests.Doom
|
|||
Movable = false;
|
||||
}
|
||||
|
||||
private Chyloth m_Chyloth;
|
||||
private SkeletalDragon m_Dragon;
|
||||
private bool m_Summoning;
|
||||
[CommandProperty( AccessLevel.GameMaster, AccessLevel.Administrator )]
|
||||
public Chyloth Chyloth { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster, AccessLevel.Administrator )]
|
||||
public Chyloth Chyloth
|
||||
{
|
||||
get => m_Chyloth;
|
||||
set => m_Chyloth = value;
|
||||
}
|
||||
public SkeletalDragon Dragon { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster, AccessLevel.Administrator )]
|
||||
public SkeletalDragon Dragon
|
||||
{
|
||||
get => m_Dragon;
|
||||
set => m_Dragon = value;
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster, AccessLevel.Administrator )]
|
||||
public bool Summoning
|
||||
{
|
||||
get => m_Summoning;
|
||||
set => m_Summoning = value;
|
||||
}
|
||||
public bool Summoning { get; set; }
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
|
|
@ -51,17 +35,17 @@ namespace Server.Engines.Quests.Doom
|
|||
|
||||
public virtual void BeginSummon( Mobile from )
|
||||
{
|
||||
if ( m_Chyloth != null && !m_Chyloth.Deleted )
|
||||
if ( Chyloth != null && !Chyloth.Deleted )
|
||||
{
|
||||
from.SendLocalizedMessage( 1050010 ); // The ferry man has already been summoned. There is no need to ring for him again.
|
||||
}
|
||||
else if ( m_Dragon != null && !m_Dragon.Deleted )
|
||||
else if ( Dragon != null && !Dragon.Deleted )
|
||||
{
|
||||
from.SendLocalizedMessage( 1050017 ); // The ferryman has recently been summoned already. You decide against ringing the bell again so soon.
|
||||
}
|
||||
else if ( !m_Summoning )
|
||||
else if ( !Summoning )
|
||||
{
|
||||
m_Summoning = true;
|
||||
Summoning = true;
|
||||
|
||||
Effects.PlaySound( GetWorldLocation(), Map, 0x100 );
|
||||
|
||||
|
|
@ -73,17 +57,17 @@ namespace Server.Engines.Quests.Doom
|
|||
{
|
||||
Mobile from = (Mobile)state;
|
||||
|
||||
if ( m_Chyloth != null && !m_Chyloth.Deleted )
|
||||
if ( Chyloth != null && !Chyloth.Deleted )
|
||||
{
|
||||
from.SendLocalizedMessage( 1050010 ); // The ferry man has already been summoned. There is no need to ring for him again.
|
||||
}
|
||||
else if ( m_Dragon != null && !m_Dragon.Deleted )
|
||||
else if ( Dragon != null && !Dragon.Deleted )
|
||||
{
|
||||
from.SendLocalizedMessage( 1050017 ); // The ferryman has recently been summoned already. You decide against ringing the bell again so soon.
|
||||
}
|
||||
else if ( m_Summoning )
|
||||
else if ( Summoning )
|
||||
{
|
||||
m_Summoning = false;
|
||||
Summoning = false;
|
||||
|
||||
Point3D loc = GetWorldLocation();
|
||||
|
||||
|
|
@ -92,15 +76,15 @@ namespace Server.Engines.Quests.Doom
|
|||
Effects.SendLocationParticles( EffectItem.Create( loc, Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 0, 0, 2023, 0 );
|
||||
Effects.PlaySound( loc, Map, 0x1FE );
|
||||
|
||||
m_Chyloth = new Chyloth();
|
||||
Chyloth = new Chyloth();
|
||||
|
||||
m_Chyloth.Direction = (Direction)(7 & (4 + (int)from.GetDirectionTo( loc )));
|
||||
m_Chyloth.MoveToWorld( loc, Map );
|
||||
Chyloth.Direction = (Direction)(7 & (4 + (int)from.GetDirectionTo( loc )));
|
||||
Chyloth.MoveToWorld( loc, Map );
|
||||
|
||||
m_Chyloth.Bell = this;
|
||||
m_Chyloth.AngryAt = from;
|
||||
m_Chyloth.BeginGiveWarning();
|
||||
m_Chyloth.BeginRemove( TimeSpan.FromSeconds( 40.0 ) );
|
||||
Chyloth.Bell = this;
|
||||
Chyloth.AngryAt = from;
|
||||
Chyloth.BeginGiveWarning();
|
||||
Chyloth.BeginRemove( TimeSpan.FromSeconds( 40.0 ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -114,8 +98,8 @@ namespace Server.Engines.Quests.Doom
|
|||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( (Mobile) m_Chyloth );
|
||||
writer.Write( (Mobile) m_Dragon );
|
||||
writer.Write( (Mobile) Chyloth );
|
||||
writer.Write( (Mobile) Dragon );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -124,10 +108,10 @@ namespace Server.Engines.Quests.Doom
|
|||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Chyloth = reader.ReadMobile() as Chyloth;
|
||||
m_Dragon = reader.ReadMobile() as SkeletalDragon;
|
||||
Chyloth = reader.ReadMobile() as Chyloth;
|
||||
Dragon = reader.ReadMobile() as SkeletalDragon;
|
||||
|
||||
m_Chyloth?.Delete();
|
||||
Chyloth?.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,24 +34,13 @@ namespace Server.Engines.Quests.Doom
|
|||
EquipItem( new ChylothStaff() );
|
||||
}
|
||||
|
||||
private Mobile m_AngryAt;
|
||||
private BellOfTheDead m_Bell;
|
||||
public BellOfTheDead Bell { get; set; }
|
||||
|
||||
public BellOfTheDead Bell
|
||||
{
|
||||
get => m_Bell;
|
||||
set => m_Bell = value;
|
||||
}
|
||||
|
||||
public Mobile AngryAt
|
||||
{
|
||||
get => m_AngryAt;
|
||||
set => m_AngryAt = value;
|
||||
}
|
||||
public Mobile AngryAt { get; set; }
|
||||
|
||||
public virtual void BeginGiveWarning()
|
||||
{
|
||||
if ( Deleted || m_AngryAt == null )
|
||||
if ( Deleted || AngryAt == null )
|
||||
return;
|
||||
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( 4.0 ), EndGiveWarning );
|
||||
|
|
@ -59,10 +48,10 @@ namespace Server.Engines.Quests.Doom
|
|||
|
||||
public virtual void EndGiveWarning()
|
||||
{
|
||||
if ( Deleted || m_AngryAt == null )
|
||||
if ( Deleted || AngryAt == null )
|
||||
return;
|
||||
|
||||
PublicOverheadMessage( MessageType.Regular, 0x3B2, 1050013, m_AngryAt.Name ); // You have summoned me in vain ~1_NAME~! Only the dead may cross!
|
||||
PublicOverheadMessage( MessageType.Regular, 0x3B2, 1050013, AngryAt.Name ); // You have summoned me in vain ~1_NAME~! Only the dead may cross!
|
||||
PublicOverheadMessage( MessageType.Regular, 0x3B2, 1050014 ); // Why have you disturbed me, mortal?!?
|
||||
|
||||
BeginSummonDragon();
|
||||
|
|
@ -70,7 +59,7 @@ namespace Server.Engines.Quests.Doom
|
|||
|
||||
public virtual void BeginSummonDragon()
|
||||
{
|
||||
if ( Deleted || m_AngryAt == null )
|
||||
if ( Deleted || AngryAt == null )
|
||||
return;
|
||||
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( 30.0 ), EndSummonDragon );
|
||||
|
|
@ -108,15 +97,15 @@ namespace Server.Engines.Quests.Doom
|
|||
|
||||
public virtual void EndSummonDragon()
|
||||
{
|
||||
if ( Deleted || m_AngryAt == null )
|
||||
if ( Deleted || AngryAt == null )
|
||||
return;
|
||||
|
||||
Map map = m_AngryAt.Map;
|
||||
Map map = AngryAt.Map;
|
||||
|
||||
if ( map == null )
|
||||
return;
|
||||
|
||||
if ( !m_AngryAt.Region.IsPartOf( "Doom" ) )
|
||||
if ( !AngryAt.Region.IsPartOf( "Doom" ) )
|
||||
return;
|
||||
|
||||
PublicOverheadMessage( MessageType.Regular, 0x3B2, 1050015 ); // Feel the wrath of my legions!!!
|
||||
|
|
@ -130,12 +119,12 @@ namespace Server.Engines.Quests.Doom
|
|||
|
||||
for ( int i = 0; i < m_Offsets.Length; i += 2 )
|
||||
{
|
||||
int x = m_AngryAt.X + m_Offsets[(offset + i) % m_Offsets.Length];
|
||||
int y = m_AngryAt.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];
|
||||
int x = AngryAt.X + m_Offsets[(offset + i) % m_Offsets.Length];
|
||||
int y = AngryAt.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];
|
||||
|
||||
if ( map.CanSpawnMobile( x, y, m_AngryAt.Z ) )
|
||||
if ( map.CanSpawnMobile( x, y, AngryAt.Z ) )
|
||||
{
|
||||
dragon.MoveToWorld( new Point3D( x, y, m_AngryAt.Z ), map );
|
||||
dragon.MoveToWorld( new Point3D( x, y, AngryAt.Z ), map );
|
||||
foundLoc = true;
|
||||
break;
|
||||
}
|
||||
|
|
@ -151,12 +140,12 @@ namespace Server.Engines.Quests.Doom
|
|||
}
|
||||
|
||||
if ( !foundLoc )
|
||||
dragon.MoveToWorld( m_AngryAt.Location, map );
|
||||
dragon.MoveToWorld( AngryAt.Location, map );
|
||||
|
||||
dragon.Combatant = m_AngryAt;
|
||||
dragon.Combatant = AngryAt;
|
||||
|
||||
if ( m_Bell != null )
|
||||
m_Bell.Dragon = dragon;
|
||||
if ( Bell != null )
|
||||
Bell.Dragon = dragon;
|
||||
}
|
||||
|
||||
public static void TeleportToFerry( Mobile from )
|
||||
|
|
@ -192,8 +181,8 @@ namespace Server.Engines.Quests.Doom
|
|||
|
||||
if ( member != from && member.Map == Map.Malas && member.Region.IsPartOf( "Doom" ) )
|
||||
{
|
||||
if ( m_AngryAt == member )
|
||||
m_AngryAt = null;
|
||||
if ( AngryAt == member )
|
||||
AngryAt = null;
|
||||
|
||||
member.CloseGump( typeof( ChylothPartyGump ) );
|
||||
member.SendGump( new ChylothPartyGump( from, member ) );
|
||||
|
|
@ -201,8 +190,8 @@ namespace Server.Engines.Quests.Doom
|
|||
}
|
||||
}
|
||||
|
||||
if ( m_AngryAt == from )
|
||||
m_AngryAt = null;
|
||||
if ( AngryAt == from )
|
||||
AngryAt = null;
|
||||
|
||||
TeleportToFerry( from );
|
||||
|
||||
|
|
|
|||
|
|
@ -72,13 +72,8 @@ namespace Server.Engines.Quests.Doom
|
|||
public class VanquishDaemonObjective : QuestObjective
|
||||
{
|
||||
private BoneDemon m_Daemon;
|
||||
private Corpse m_CorpseWithSkull;
|
||||
|
||||
public Corpse CorpseWithSkull
|
||||
{
|
||||
get => m_CorpseWithSkull;
|
||||
set => m_CorpseWithSkull = value;
|
||||
}
|
||||
public Corpse CorpseWithSkull { get; set; }
|
||||
|
||||
public override object Message => 1050037;
|
||||
|
||||
|
|
@ -143,7 +138,7 @@ namespace Server.Engines.Quests.Doom
|
|||
from.SendLocalizedMessage( 1050035 ); // The devourer lies dead. Search his corpse to claim your prize!
|
||||
|
||||
if ( m_Daemon != null )
|
||||
m_CorpseWithSkull = m_Daemon.Corpse as Corpse;
|
||||
CorpseWithSkull = m_Daemon.Corpse as Corpse;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -153,7 +148,7 @@ namespace Server.Engines.Quests.Doom
|
|||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_Daemon = reader.ReadMobile() as BoneDemon;
|
||||
m_CorpseWithSkull = reader.ReadItem() as Corpse;
|
||||
CorpseWithSkull = reader.ReadItem() as Corpse;
|
||||
}
|
||||
|
||||
public override void ChildSerialize( GenericWriter writer )
|
||||
|
|
@ -161,7 +156,7 @@ namespace Server.Engines.Quests.Doom
|
|||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
|
||||
writer.Write( (Mobile) m_Daemon );
|
||||
writer.Write( (Item) m_CorpseWithSkull );
|
||||
writer.Write( (Item) CorpseWithSkull );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,16 +15,9 @@ namespace Server.Engines.Quests.Doom
|
|||
|
||||
public override Type[] TypeReferenceTable => m_TypeReferenceTable;
|
||||
|
||||
private Victoria m_Victoria;
|
||||
private bool m_WaitForSummon;
|
||||
public Victoria Victoria { get; private set; }
|
||||
|
||||
public Victoria Victoria => m_Victoria;
|
||||
|
||||
public bool WaitForSummon
|
||||
{
|
||||
get => m_WaitForSummon;
|
||||
set => m_WaitForSummon = value;
|
||||
}
|
||||
public bool WaitForSummon { get; set; }
|
||||
|
||||
public override object Name => 1050025;
|
||||
|
||||
|
|
@ -38,15 +31,15 @@ namespace Server.Engines.Quests.Doom
|
|||
|
||||
public override void Slice()
|
||||
{
|
||||
if ( m_WaitForSummon && m_Victoria != null )
|
||||
if ( WaitForSummon && Victoria != null )
|
||||
{
|
||||
SummoningAltar altar = m_Victoria.Altar;
|
||||
SummoningAltar altar = Victoria.Altar;
|
||||
|
||||
if ( altar != null && (altar.Daemon == null || !altar.Daemon.Alive) )
|
||||
{
|
||||
if ( From.Map == m_Victoria.Map && From.InRange( m_Victoria, 8 ) )
|
||||
if ( From.Map == Victoria.Map && From.InRange( Victoria, 8 ) )
|
||||
{
|
||||
m_WaitForSummon = false;
|
||||
WaitForSummon = false;
|
||||
|
||||
AddConversation( new VanquishDaemonConversation() );
|
||||
}
|
||||
|
|
@ -72,7 +65,7 @@ namespace Server.Engines.Quests.Doom
|
|||
|
||||
public TheSummoningQuest( Victoria victoria, PlayerMobile from ) : base( from )
|
||||
{
|
||||
m_Victoria = victoria;
|
||||
Victoria = victoria;
|
||||
}
|
||||
|
||||
public TheSummoningQuest()
|
||||
|
|
@ -104,16 +97,16 @@ namespace Server.Engines.Quests.Doom
|
|||
{
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_Victoria = reader.ReadMobile() as Victoria;
|
||||
m_WaitForSummon = reader.ReadBool();
|
||||
Victoria = reader.ReadMobile() as Victoria;
|
||||
WaitForSummon = reader.ReadBool();
|
||||
}
|
||||
|
||||
public override void ChildSerialize( GenericWriter writer )
|
||||
{
|
||||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
|
||||
writer.Write( (Mobile) m_Victoria );
|
||||
writer.Write( (bool) m_WaitForSummon );
|
||||
writer.Write( (Mobile) Victoria );
|
||||
writer.Write( (bool) WaitForSummon );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,21 +12,16 @@ namespace Server.Engines.Quests.Haven
|
|||
|
||||
public class Cannon : BaseAddon
|
||||
{
|
||||
private CannonDirection m_CannonDirection;
|
||||
private MilitiaCanoneer m_Canoneer;
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public CannonDirection CannonDirection { get; private set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public CannonDirection CannonDirection => m_CannonDirection;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public MilitiaCanoneer Canoneer { get => m_Canoneer;
|
||||
set => m_Canoneer = value;
|
||||
}
|
||||
public MilitiaCanoneer Canoneer { get; set; }
|
||||
|
||||
[Constructible]
|
||||
public Cannon( CannonDirection direction )
|
||||
{
|
||||
m_CannonDirection = direction;
|
||||
CannonDirection = direction;
|
||||
|
||||
switch ( direction )
|
||||
{
|
||||
|
|
@ -72,7 +67,7 @@ namespace Server.Engines.Quests.Haven
|
|||
public void DoFireEffect( IPoint3D target )
|
||||
{
|
||||
Point3D from;
|
||||
switch ( m_CannonDirection )
|
||||
switch ( CannonDirection )
|
||||
{
|
||||
case CannonDirection.North: from = new Point3D( X, Y - 1, Z ); break;
|
||||
case CannonDirection.East: from = new Point3D( X + 1, Y, Z ); break;
|
||||
|
|
@ -94,15 +89,15 @@ namespace Server.Engines.Quests.Haven
|
|||
target.Damage( 9999, from );
|
||||
}
|
||||
|
||||
public override bool HandlesOnMovement => m_Canoneer != null && !m_Canoneer.Deleted && m_Canoneer.Active;
|
||||
public override bool HandlesOnMovement => Canoneer != null && !Canoneer.Deleted && Canoneer.Active;
|
||||
|
||||
public override void OnMovement( Mobile m, Point3D oldLocation )
|
||||
{
|
||||
if ( m_Canoneer == null || m_Canoneer.Deleted || !m_Canoneer.Active )
|
||||
if ( Canoneer == null || Canoneer.Deleted || !Canoneer.Active )
|
||||
return;
|
||||
|
||||
bool canFire;
|
||||
switch ( m_CannonDirection )
|
||||
switch ( CannonDirection )
|
||||
{
|
||||
case CannonDirection.North:
|
||||
canFire = m.X >= X - 7 && m.X <= X + 7 && m.Y == Y - 7 && oldLocation.Y < Y - 7;
|
||||
|
|
@ -118,21 +113,21 @@ namespace Server.Engines.Quests.Haven
|
|||
break;
|
||||
}
|
||||
|
||||
if ( canFire && m_Canoneer.WillFire( this, m ) )
|
||||
Fire( m_Canoneer, m );
|
||||
if ( canFire && Canoneer.WillFire( this, m ) )
|
||||
Fire( Canoneer, m );
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
if ( m_Canoneer != null && m_Canoneer.Deleted )
|
||||
m_Canoneer = null;
|
||||
if ( Canoneer != null && Canoneer.Deleted )
|
||||
Canoneer = null;
|
||||
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.WriteEncodedInt( (int) m_CannonDirection );
|
||||
writer.Write( (Mobile) m_Canoneer );
|
||||
writer.WriteEncodedInt( (int) CannonDirection );
|
||||
writer.Write( (Mobile) Canoneer );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -141,8 +136,8 @@ namespace Server.Engines.Quests.Haven
|
|||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_CannonDirection = (CannonDirection) reader.ReadEncodedInt();
|
||||
m_Canoneer = (MilitiaCanoneer) reader.ReadMobile();
|
||||
CannonDirection = (CannonDirection) reader.ReadEncodedInt();
|
||||
Canoneer = (MilitiaCanoneer) reader.ReadMobile();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -149,15 +149,13 @@ namespace Server.Engines.Quests.Haven
|
|||
|
||||
public class SBDryad : SBInfo
|
||||
{
|
||||
private List<GenericBuyInfo> m_BuyInfo = new InternalBuyInfo();
|
||||
private IShopSellInfo m_SellInfo = new InternalSellInfo();
|
||||
|
||||
public SBDryad()
|
||||
{
|
||||
}
|
||||
|
||||
public override IShopSellInfo SellInfo => m_SellInfo;
|
||||
public override List<GenericBuyInfo> BuyInfo => m_BuyInfo;
|
||||
public override IShopSellInfo SellInfo { get; } = new InternalSellInfo();
|
||||
|
||||
public override List<GenericBuyInfo> BuyInfo { get; } = new InternalBuyInfo();
|
||||
|
||||
public class InternalBuyInfo : List<GenericBuyInfo>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,19 +5,13 @@ namespace Server.Engines.Quests.Haven
|
|||
{
|
||||
public class MilitiaCanoneer : BaseQuester
|
||||
{
|
||||
private bool m_Active;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool Active
|
||||
{
|
||||
get => m_Active;
|
||||
set => m_Active = value;
|
||||
}
|
||||
public bool Active { get; set; }
|
||||
|
||||
[Constructible]
|
||||
public MilitiaCanoneer() : base( "the Militia Canoneer" )
|
||||
{
|
||||
m_Active = true;
|
||||
Active = true;
|
||||
}
|
||||
|
||||
public override void InitBody()
|
||||
|
|
@ -73,7 +67,7 @@ namespace Server.Engines.Quests.Haven
|
|||
|
||||
public bool WillFire( Cannon cannon, Mobile target )
|
||||
{
|
||||
if ( m_Active && IsEnemy( target ) )
|
||||
if ( Active && IsEnemy( target ) )
|
||||
{
|
||||
Direction = GetDirectionTo( target );
|
||||
Say( Utility.RandomList( 500651, 1049098, 1049320, 1043149 ) );
|
||||
|
|
@ -93,7 +87,7 @@ namespace Server.Engines.Quests.Haven
|
|||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_Active );
|
||||
writer.Write( (bool) Active );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -102,7 +96,7 @@ namespace Server.Engines.Quests.Haven
|
|||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Active = reader.ReadBool();
|
||||
Active = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,15 +74,13 @@ namespace Server.Engines.Quests.Haven
|
|||
|
||||
public class KillHordeMinionsObjective : QuestObjective
|
||||
{
|
||||
private KillHordeMinionsStep m_Step;
|
||||
|
||||
public KillHordeMinionsStep Step => m_Step;
|
||||
public KillHordeMinionsStep Step { get; private set; }
|
||||
|
||||
public override object Message
|
||||
{
|
||||
get
|
||||
{
|
||||
switch ( m_Step )
|
||||
switch ( Step )
|
||||
{
|
||||
case KillHordeMinionsStep.First:
|
||||
/* Find the mountain pass beyond the house which lies at the
|
||||
|
|
@ -112,7 +110,7 @@ namespace Server.Engines.Quests.Haven
|
|||
{
|
||||
if ( System.From.Profession == 5 ) // paladin
|
||||
{
|
||||
switch ( m_Step )
|
||||
switch ( Step )
|
||||
{
|
||||
case KillHordeMinionsStep.First: return 1;
|
||||
case KillHordeMinionsStep.LearnKarma: return 2;
|
||||
|
|
@ -128,7 +126,7 @@ namespace Server.Engines.Quests.Haven
|
|||
{
|
||||
get
|
||||
{
|
||||
if ( m_Step == KillHordeMinionsStep.LearnKarma && HasBeenRead )
|
||||
if ( Step == KillHordeMinionsStep.LearnKarma && HasBeenRead )
|
||||
return true;
|
||||
return base.Completed;
|
||||
}
|
||||
|
|
@ -140,7 +138,7 @@ namespace Server.Engines.Quests.Haven
|
|||
|
||||
public KillHordeMinionsObjective( KillHordeMinionsStep step )
|
||||
{
|
||||
m_Step = step;
|
||||
Step = step;
|
||||
}
|
||||
|
||||
public override void RenderProgress( BaseQuestGump gump )
|
||||
|
|
@ -185,7 +183,7 @@ namespace Server.Engines.Quests.Haven
|
|||
{
|
||||
if ( System.From.Profession == 5 )
|
||||
{
|
||||
switch ( m_Step )
|
||||
switch ( Step )
|
||||
{
|
||||
case KillHordeMinionsStep.First:
|
||||
{
|
||||
|
|
@ -218,14 +216,14 @@ namespace Server.Engines.Quests.Haven
|
|||
{
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_Step = (KillHordeMinionsStep) reader.ReadEncodedInt();
|
||||
Step = (KillHordeMinionsStep) reader.ReadEncodedInt();
|
||||
}
|
||||
|
||||
public override void ChildSerialize( GenericWriter writer )
|
||||
{
|
||||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
|
||||
writer.WriteEncodedInt( (int) m_Step );
|
||||
writer.WriteEncodedInt( (int) Step );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -391,13 +389,7 @@ namespace Server.Engines.Quests.Haven
|
|||
|
||||
public class GetDaemonBoneObjective : QuestObjective
|
||||
{
|
||||
private Container m_CorpseWithBone;
|
||||
|
||||
public Container CorpseWithBone
|
||||
{
|
||||
get => m_CorpseWithBone;
|
||||
set => m_CorpseWithBone = value;
|
||||
}
|
||||
public Container CorpseWithBone { get; set; }
|
||||
|
||||
public override object Message
|
||||
{
|
||||
|
|
@ -451,7 +443,7 @@ namespace Server.Engines.Quests.Haven
|
|||
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 )
|
||||
m_CorpseWithBone = corpse;
|
||||
CorpseWithBone = corpse;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -459,17 +451,17 @@ namespace Server.Engines.Quests.Haven
|
|||
{
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_CorpseWithBone = (Container) reader.ReadItem();
|
||||
CorpseWithBone = (Container) reader.ReadItem();
|
||||
}
|
||||
|
||||
public override void ChildSerialize( GenericWriter writer )
|
||||
{
|
||||
if ( m_CorpseWithBone != null && m_CorpseWithBone.Deleted )
|
||||
m_CorpseWithBone = null;
|
||||
if ( CorpseWithBone != null && CorpseWithBone.Deleted )
|
||||
CorpseWithBone = null;
|
||||
|
||||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
|
||||
writer.Write( (Item) m_CorpseWithBone );
|
||||
writer.Write( (Item) CorpseWithBone );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -91,19 +91,17 @@ namespace Server.Engines.Quests.Hag
|
|||
return ingredients[index];
|
||||
}
|
||||
|
||||
private int m_Name;
|
||||
private Type[] m_Creatures;
|
||||
private int m_Quantity;
|
||||
public int Name { get; }
|
||||
|
||||
public int Name => m_Name;
|
||||
public Type[] Creatures => m_Creatures;
|
||||
public int Quantity => m_Quantity;
|
||||
public Type[] Creatures { get; }
|
||||
|
||||
public int Quantity { get; }
|
||||
|
||||
private IngredientInfo( int name, int quantity, params Type[] creatures )
|
||||
{
|
||||
m_Name = name;
|
||||
m_Creatures = creatures;
|
||||
m_Quantity = quantity;
|
||||
Name = name;
|
||||
Creatures = creatures;
|
||||
Quantity = quantity;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,16 +2,10 @@ namespace Server.Engines.Quests.Hag
|
|||
{
|
||||
public class HangoverCure : Item
|
||||
{
|
||||
private int m_Uses;
|
||||
|
||||
public override int LabelNumber => 1055060; // Grizelda's Extra Strength Hangover Cure
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Uses
|
||||
{
|
||||
get => m_Uses;
|
||||
set => m_Uses = value;
|
||||
}
|
||||
public int Uses { get; set; }
|
||||
|
||||
[Constructible]
|
||||
public HangoverCure() : base( 0xE2B )
|
||||
|
|
@ -19,7 +13,7 @@ namespace Server.Engines.Quests.Hag
|
|||
Weight = 1.0;
|
||||
Hue = 0x2D;
|
||||
|
||||
m_Uses = 20;
|
||||
Uses = 20;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
|
|
@ -30,7 +24,7 @@ namespace Server.Engines.Quests.Hag
|
|||
return;
|
||||
}
|
||||
|
||||
if ( m_Uses > 0 )
|
||||
if ( Uses > 0 )
|
||||
{
|
||||
from.PlaySound( 0x2D6 );
|
||||
from.SendLocalizedMessage( 501206 ); // An awful taste fills your mouth.
|
||||
|
|
@ -41,7 +35,7 @@ namespace Server.Engines.Quests.Hag
|
|||
from.SendLocalizedMessage( 501204 ); // You are now sober!
|
||||
}
|
||||
|
||||
m_Uses--;
|
||||
Uses--;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -60,7 +54,7 @@ namespace Server.Engines.Quests.Hag
|
|||
|
||||
writer.Write( (int) 1 ); // version
|
||||
|
||||
writer.WriteEncodedInt( m_Uses );
|
||||
writer.WriteEncodedInt( Uses );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -73,12 +67,12 @@ namespace Server.Engines.Quests.Hag
|
|||
{
|
||||
case 1:
|
||||
{
|
||||
m_Uses = reader.ReadEncodedInt();
|
||||
Uses = reader.ReadEncodedInt();
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_Uses = 20;
|
||||
Uses = 20;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,12 +21,11 @@ namespace Server.Engines.Quests.Hag
|
|||
return m_CorpseLocations[index];
|
||||
}
|
||||
|
||||
private Corpse m_Corpse;
|
||||
private Point3D m_CorpseLocation;
|
||||
|
||||
public override object Message => 1055014;
|
||||
|
||||
public Corpse Corpse => m_Corpse;
|
||||
public Corpse Corpse { get; private set; }
|
||||
|
||||
public FindApprenticeObjective( bool init )
|
||||
{
|
||||
|
|
@ -43,10 +42,10 @@ namespace Server.Engines.Quests.Hag
|
|||
PlayerMobile player = System.From;
|
||||
Map map = player.Map;
|
||||
|
||||
if ( ( m_Corpse == null || m_Corpse.Deleted ) && ( map == Map.Trammel || map == Map.Felucca ) && player.InRange( m_CorpseLocation, 8 ) )
|
||||
if ( ( Corpse == null || Corpse.Deleted ) && ( map == Map.Trammel || map == Map.Felucca ) && player.InRange( m_CorpseLocation, 8 ) )
|
||||
{
|
||||
m_Corpse = new HagApprenticeCorpse();
|
||||
m_Corpse.MoveToWorld( m_CorpseLocation, map );
|
||||
Corpse = new HagApprenticeCorpse();
|
||||
Corpse.MoveToWorld( m_CorpseLocation, map );
|
||||
|
||||
Effects.SendLocationEffect( m_CorpseLocation, map, 0x3728, 10, 10 );
|
||||
Effects.PlaySound( m_CorpseLocation, map, 0x1FE );
|
||||
|
|
@ -55,7 +54,7 @@ namespace Server.Engines.Quests.Hag
|
|||
imp.MoveToWorld( m_CorpseLocation, map );
|
||||
|
||||
// * You see a strange imp stealing a scrap of paper from the bloodied corpse *
|
||||
m_Corpse.SendLocalizedMessageTo( player, 1055049 );
|
||||
Corpse.SendLocalizedMessageTo( player, 1055049 );
|
||||
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( 3.0 ), new TimerStateCallback( DeleteImp ), imp );
|
||||
}
|
||||
|
|
@ -90,7 +89,7 @@ namespace Server.Engines.Quests.Hag
|
|||
}
|
||||
case 0:
|
||||
{
|
||||
m_Corpse = (Corpse) reader.ReadItem();
|
||||
Corpse = (Corpse) reader.ReadItem();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -101,13 +100,13 @@ namespace Server.Engines.Quests.Hag
|
|||
|
||||
public override void ChildSerialize( GenericWriter writer )
|
||||
{
|
||||
if ( m_Corpse != null && m_Corpse.Deleted )
|
||||
m_Corpse = null;
|
||||
if ( Corpse != null && Corpse.Deleted )
|
||||
Corpse = null;
|
||||
|
||||
writer.WriteEncodedInt( (int) 1 ); // version
|
||||
|
||||
writer.Write( (Point3D) m_CorpseLocation );
|
||||
writer.Write( (Item) m_Corpse );
|
||||
writer.Write( (Item) Corpse );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -192,15 +191,13 @@ namespace Server.Engines.Quests.Hag
|
|||
|
||||
public class FindZeefzorpulObjective : QuestObjective
|
||||
{
|
||||
private Point3D m_ImpLocation;
|
||||
|
||||
public override object Message => 1055017;
|
||||
|
||||
public Point3D ImpLocation => m_ImpLocation;
|
||||
public Point3D ImpLocation { get; private set; }
|
||||
|
||||
public FindZeefzorpulObjective( Point3D impLocation )
|
||||
{
|
||||
m_ImpLocation = impLocation;
|
||||
ImpLocation = impLocation;
|
||||
}
|
||||
|
||||
public FindZeefzorpulObjective()
|
||||
|
|
@ -212,11 +209,11 @@ namespace Server.Engines.Quests.Hag
|
|||
Mobile from = System.From;
|
||||
Map map = from.Map;
|
||||
|
||||
Effects.SendLocationEffect( m_ImpLocation, map, 0x3728, 10, 10 );
|
||||
Effects.PlaySound( m_ImpLocation, map, 0x1FE );
|
||||
Effects.SendLocationEffect( ImpLocation, map, 0x3728, 10, 10 );
|
||||
Effects.PlaySound( ImpLocation, map, 0x1FE );
|
||||
|
||||
Mobile imp = new Zeefzorpul();
|
||||
imp.MoveToWorld( m_ImpLocation, map );
|
||||
imp.MoveToWorld( ImpLocation, map );
|
||||
|
||||
imp.Direction = imp.GetDirectionTo( from );
|
||||
|
||||
|
|
@ -242,14 +239,14 @@ namespace Server.Engines.Quests.Hag
|
|||
{
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_ImpLocation = reader.ReadPoint3D();
|
||||
ImpLocation = reader.ReadPoint3D();
|
||||
}
|
||||
|
||||
public override void ChildSerialize( GenericWriter writer )
|
||||
{
|
||||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
|
||||
writer.Write( (Point3D) m_ImpLocation );
|
||||
writer.Write( (Point3D) ImpLocation );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -269,14 +266,11 @@ namespace Server.Engines.Quests.Hag
|
|||
|
||||
public class FindIngredientObjective : QuestObjective
|
||||
{
|
||||
private Ingredient[] m_Ingredients;
|
||||
private bool m_BlackheartMet;
|
||||
|
||||
public override object Message
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( !m_BlackheartMet )
|
||||
if ( !BlackheartMet )
|
||||
{
|
||||
switch ( Step )
|
||||
{
|
||||
|
|
@ -317,10 +311,11 @@ namespace Server.Engines.Quests.Hag
|
|||
}
|
||||
}
|
||||
|
||||
public Ingredient[] Ingredients => m_Ingredients;
|
||||
public Ingredient Ingredient => m_Ingredients[m_Ingredients.Length - 1];
|
||||
public int Step => m_Ingredients.Length;
|
||||
public bool BlackheartMet => m_BlackheartMet;
|
||||
public Ingredient[] Ingredients { get; private set; }
|
||||
|
||||
public Ingredient Ingredient => Ingredients[Ingredients.Length - 1];
|
||||
public int Step => Ingredients.Length;
|
||||
public bool BlackheartMet { get; private set; }
|
||||
|
||||
public FindIngredientObjective( Ingredient[] oldIngredients ) : this( oldIngredients, false )
|
||||
{
|
||||
|
|
@ -330,22 +325,22 @@ namespace Server.Engines.Quests.Hag
|
|||
{
|
||||
if ( !blackheartMet )
|
||||
{
|
||||
m_Ingredients = new Ingredient[oldIngredients.Length + 1];
|
||||
Ingredients = new Ingredient[oldIngredients.Length + 1];
|
||||
|
||||
for ( int i = 0; i < oldIngredients.Length; i++ )
|
||||
m_Ingredients[i] = oldIngredients[i];
|
||||
Ingredients[i] = oldIngredients[i];
|
||||
|
||||
m_Ingredients[m_Ingredients.Length - 1] = IngredientInfo.RandomIngredient( oldIngredients );
|
||||
Ingredients[Ingredients.Length - 1] = IngredientInfo.RandomIngredient( oldIngredients );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Ingredients = new Ingredient[oldIngredients.Length];
|
||||
Ingredients = new Ingredient[oldIngredients.Length];
|
||||
|
||||
for ( int i = 0; i < oldIngredients.Length; i++ )
|
||||
m_Ingredients[i] = oldIngredients[i];
|
||||
Ingredients[i] = oldIngredients[i];
|
||||
}
|
||||
|
||||
m_BlackheartMet = blackheartMet;
|
||||
BlackheartMet = blackheartMet;
|
||||
}
|
||||
|
||||
public FindIngredientObjective()
|
||||
|
|
@ -418,7 +413,7 @@ namespace Server.Engines.Quests.Hag
|
|||
System.From.SendLocalizedMessage( 1055046 ); // You have completed your current task on the Hag's Magic Brew Recipe list.
|
||||
|
||||
if ( Step < 3 )
|
||||
System.AddObjective( new FindIngredientObjective( m_Ingredients ) );
|
||||
System.AddObjective( new FindIngredientObjective( Ingredients ) );
|
||||
else
|
||||
System.AddObjective( new ReturnIngredientsObjective() );
|
||||
}
|
||||
|
|
@ -427,22 +422,22 @@ namespace Server.Engines.Quests.Hag
|
|||
{
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_Ingredients = new Ingredient[reader.ReadEncodedInt()];
|
||||
for ( int i = 0; i < m_Ingredients.Length; i++ )
|
||||
m_Ingredients[i] = (Ingredient) reader.ReadEncodedInt();
|
||||
Ingredients = new Ingredient[reader.ReadEncodedInt()];
|
||||
for ( int i = 0; i < Ingredients.Length; i++ )
|
||||
Ingredients[i] = (Ingredient) reader.ReadEncodedInt();
|
||||
|
||||
m_BlackheartMet = reader.ReadBool();
|
||||
BlackheartMet = reader.ReadBool();
|
||||
}
|
||||
|
||||
public override void ChildSerialize( GenericWriter writer )
|
||||
{
|
||||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
|
||||
writer.WriteEncodedInt( (int) m_Ingredients.Length );
|
||||
for ( int i = 0; i < m_Ingredients.Length; i++ )
|
||||
writer.WriteEncodedInt( (int) m_Ingredients[i] );
|
||||
writer.WriteEncodedInt( (int) Ingredients.Length );
|
||||
for ( int i = 0; i < Ingredients.Length; i++ )
|
||||
writer.WriteEncodedInt( (int) Ingredients[i] );
|
||||
|
||||
writer.Write( (bool) m_BlackheartMet );
|
||||
writer.Write( (bool) BlackheartMet );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue