ModernUO/Scripts/Engines/Quests/Ambitious Solen Queen/Conversations.cs
2018-09-14 08:46:14 -07:00

154 lines
3.2 KiB
C#

namespace Server.Engines.Quests.Ambitious
{
public class DontOfferConversation : QuestConversation
{
public override object Message => 1054059;
public override bool Logged => false;
public DontOfferConversation()
{
}
}
public class AcceptConversation : QuestConversation
{
public override object Message => 1054061;
public AcceptConversation()
{
}
public override void OnRead()
{
System.AddObjective( new KillQueensObjective() );
}
}
public class DuringKillQueensConversation : QuestConversation
{
public override object Message => 1054066;
public override bool Logged => false;
public DuringKillQueensConversation()
{
}
}
public class GatherFungiConversation : QuestConversation
{
public override object Message => 1054068;
public GatherFungiConversation()
{
}
public override void OnRead()
{
System.AddObjective( new GatherFungiObjective() );
}
}
public class DuringFungiGatheringConversation : QuestConversation
{
public override object Message => 1054070;
public override bool Logged => false;
public DuringFungiGatheringConversation()
{
}
}
public class EndConversation : QuestConversation
{
public override object Message => 1054073;
public EndConversation()
{
}
public override void OnRead()
{
bool bagOfSending = true;
bool powderOfTranslocation = true;
bool gold = true;
AmbitiousQueenQuest.GiveRewardTo( System.From, ref bagOfSending, ref powderOfTranslocation, ref gold );
if ( !bagOfSending && !powderOfTranslocation && !gold )
{
System.Complete();
}
else
{
System.AddConversation( new FullBackpackConversation( true, bagOfSending, powderOfTranslocation, gold ) );
}
}
}
public class FullBackpackConversation : QuestConversation
{
public override object Message => 1054077;
private bool m_Logged;
private bool m_BagOfSending;
private bool m_PowderOfTranslocation;
private bool m_Gold;
public override bool Logged => m_Logged;
public FullBackpackConversation( bool logged, bool bagOfSending, bool powderOfTranslocation, bool gold )
{
m_Logged = logged;
m_BagOfSending = bagOfSending;
m_PowderOfTranslocation = powderOfTranslocation;
m_Gold = gold;
}
public FullBackpackConversation()
{
m_Logged = true;
}
public override void OnRead()
{
if ( m_Logged )
System.AddObjective( new GetRewardObjective( m_BagOfSending, m_PowderOfTranslocation, m_Gold ) );
}
public override void ChildDeserialize( GenericReader reader )
{
int version = reader.ReadEncodedInt();
m_BagOfSending = reader.ReadBool();
m_PowderOfTranslocation = reader.ReadBool();
m_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 );
}
}
public class End2Conversation : QuestConversation
{
public override object Message => 1054078;
public End2Conversation()
{
}
public override void OnRead()
{
System.Complete();
}
}
}