Fixes code according to modern code style. Fixes a few expression bugs.

This commit is contained in:
Kamron Batman 2018-09-15 09:58:51 -07:00
parent 89eea25e5f
commit 970fd563b2
3324 changed files with 441118 additions and 433755 deletions

View file

@ -1,52 +1,36 @@
namespace Server.Engines.Quests.Zento
{
public class AcceptConversation : QuestConversation
{
public override object Message => 1049092;
public class AcceptConversation : QuestConversation
{
public override object Message => 1049092;
public AcceptConversation()
{
}
public override void OnRead()
{
System.AddObjective(new FirstKillObjective());
}
}
public override void OnRead()
{
System.AddObjective( new FirstKillObjective() );
}
}
public class DirectionConversation : QuestConversation
{
public override object Message => 1063323;
public class DirectionConversation : QuestConversation
{
public override object Message => 1063323;
public override bool Logged => false;
}
public override bool Logged => false;
public class TakeCareConversation : QuestConversation
{
public override object Message => 1063324;
public DirectionConversation()
{
}
}
public override bool Logged => false;
}
public class TakeCareConversation : QuestConversation
{
public override object Message => 1063324;
public class EndConversation : QuestConversation
{
public override object Message => 1063321;
public override bool Logged => false;
public TakeCareConversation()
{
}
}
public class EndConversation : QuestConversation
{
public override object Message => 1063321;
public EndConversation()
{
}
public override void OnRead()
{
System.Complete();
}
}
}
public override void OnRead()
{
System.Complete();
}
}
}

View file

@ -1,139 +1,143 @@
using Server.Mobiles;
using Server.Items;
using Server.Mobiles;
namespace Server.Engines.Quests.Zento
{
public class AnsellaGryen : BaseQuester
{
public override string DefaultName => "Ansella Gryen";
public class AnsellaGryen : BaseQuester
{
[Constructible]
public AnsellaGryen()
{
}
[Constructible]
public AnsellaGryen()
{
}
public AnsellaGryen(Serial serial) : base(serial)
{
}
public override void InitBody()
{
InitStats( 100, 100, 25 );
public override string DefaultName => "Ansella Gryen";
Hue = 0x83EA;
public override void InitBody()
{
InitStats(100, 100, 25);
Female = true;
Body = 0x191;
}
Hue = 0x83EA;
public override void InitOutfit()
{
HairItemID = 0x203B;
HairHue = 0x1BB;
Female = true;
Body = 0x191;
}
AddItem( new SamuraiTabi( 0x8FD ) );
AddItem( new FemaleKimono( 0x4B6 ) );
AddItem( new Obi( 0x526 ) );
public override void InitOutfit()
{
HairItemID = 0x203B;
HairHue = 0x1BB;
AddItem( new GoldBracelet() );
}
AddItem(new SamuraiTabi(0x8FD));
AddItem(new FemaleKimono(0x4B6));
AddItem(new Obi(0x526));
public override int GetAutoTalkRange( PlayerMobile m )
{
if ( m.Quest == null )
return 3;
return -1;
}
AddItem(new GoldBracelet());
}
public override void OnTalk( PlayerMobile player, bool contextMenu )
{
QuestSystem qs = player.Quest;
public override int GetAutoTalkRange(PlayerMobile m)
{
if (m.Quest == null)
return 3;
return -1;
}
if ( qs is TerribleHatchlingsQuest )
{
if ( qs.IsObjectiveInProgress( typeof( FirstKillObjective ) ) )
{
qs.AddConversation( new DirectionConversation() );
}
else if ( qs.IsObjectiveInProgress( typeof( SecondKillObjective ) )
|| qs.IsObjectiveInProgress( typeof( ThirdKillObjective ) ) )
{
qs.AddConversation( new TakeCareConversation() );
}
else
{
QuestObjective obj = qs.FindObjective( typeof( ReturnObjective ) );
public override void OnTalk(PlayerMobile player, bool contextMenu)
{
QuestSystem qs = player.Quest;
if ( obj != null && !obj.Completed )
{
Container cont = GetNewContainer();
if (qs is TerribleHatchlingsQuest)
{
if (qs.IsObjectiveInProgress(typeof(FirstKillObjective)))
{
qs.AddConversation(new DirectionConversation());
}
else if (qs.IsObjectiveInProgress(typeof(SecondKillObjective))
|| qs.IsObjectiveInProgress(typeof(ThirdKillObjective)))
{
qs.AddConversation(new TakeCareConversation());
}
else
{
QuestObjective obj = qs.FindObjective(typeof(ReturnObjective));
cont.DropItem( new Gold( Utility.RandomMinMax( 100, 200 ) ) );
if (obj != null && !obj.Completed)
{
Container cont = GetNewContainer();
if ( Utility.RandomBool() )
{
if ( Loot.Construct( Loot.SEWeaponTypes ) is BaseWeapon weapon )
{
BaseRunicTool.ApplyAttributesTo( weapon, 3, 10, 30 );
cont.DropItem( weapon );
}
}
else
{
if ( Loot.Construct( Loot.SEArmorTypes ) is BaseArmor armor )
{
BaseRunicTool.ApplyAttributesTo( armor, 1, 10, 20 );
cont.DropItem( armor );
}
}
cont.DropItem(new Gold(Utility.RandomMinMax(100, 200)));
if ( player.PlaceInBackpack( cont ) )
{
obj.Complete();
}
else
{
cont.Delete();
player.SendLocalizedMessage( 1046260 ); // You need to clear some space in your inventory to continue with the quest. Come back here when you have more space in your inventory.
}
}
}
}
else
{
TerribleHatchlingsQuest newQuest = new TerribleHatchlingsQuest( player );
bool inRestartPeriod = false;
if (Utility.RandomBool())
{
if (Loot.Construct(Loot.SEWeaponTypes) is BaseWeapon weapon)
{
BaseRunicTool.ApplyAttributesTo(weapon, 3, 10, 30);
cont.DropItem(weapon);
}
}
else
{
if (Loot.Construct(Loot.SEArmorTypes) is BaseArmor armor)
{
BaseRunicTool.ApplyAttributesTo(armor, 1, 10, 20);
cont.DropItem(armor);
}
}
if ( qs != null )
{
if ( contextMenu )
SayTo( player, 1063322 ); // Before you can help me with the Terrible Hatchlings, you'll need to finish the quest you've already taken!
}
else if ( QuestSystem.CanOfferQuest( player, typeof( TerribleHatchlingsQuest ), out inRestartPeriod ) )
{
newQuest.SendOffer();
}
else if ( inRestartPeriod && contextMenu )
{
SayTo( player, 1049357 ); // I have nothing more for you at this time.
}
}
}
if (player.PlaceInBackpack(cont))
{
obj.Complete();
}
else
{
cont.Delete();
player.SendLocalizedMessage(
1046260); // You need to clear some space in your inventory to continue with the quest. Come back here when you have more space in your inventory.
}
}
}
}
else
{
TerribleHatchlingsQuest newQuest = new TerribleHatchlingsQuest(player);
bool inRestartPeriod = false;
public AnsellaGryen( Serial serial ) : base( serial )
{
}
if (qs != null)
{
if (contextMenu)
SayTo(player,
1063322); // Before you can help me with the Terrible Hatchlings, you'll need to finish the quest you've already taken!
}
else if (QuestSystem.CanOfferQuest(player, typeof(TerribleHatchlingsQuest), out inRestartPeriod))
{
newQuest.SendOffer();
}
else if (inRestartPeriod && contextMenu)
{
SayTo(player, 1049357); // I have nothing more for you at this time.
}
}
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt( 0 ); // version
}
writer.WriteEncodedInt(0); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
int version = reader.ReadEncodedInt();
}
public override void TurnToTokuno() { }
}
}
public override void TurnToTokuno()
{
}
}
}

View file

@ -3,142 +3,130 @@ using Server.Mobiles;
namespace Server.Engines.Quests.Zento
{
public class FirstKillObjective : QuestObjective
{
public override object Message => 1063316;
public class FirstKillObjective : QuestObjective
{
public override object Message => 1063316;
public override void RenderProgress( BaseQuestGump gump )
{
if ( !Completed )
{
// Deathwatch Beetle Hatchlings killed:
gump.AddHtmlLocalized( 70, 260, 270, 100, 1063318, 0x12DC6BF, false, false );
public override void RenderProgress(BaseQuestGump gump)
{
if (!Completed)
{
// Deathwatch Beetle Hatchlings killed:
gump.AddHtmlLocalized(70, 260, 270, 100, 1063318, 0x12DC6BF, false, false);
gump.AddLabel( 70, 280, 0x64, "0" );
gump.AddLabel( 100, 280, 0x64, "/" );
gump.AddLabel( 130, 280, 0x64, "10" );
}
else
{
base.RenderProgress( gump );
}
}
gump.AddLabel(70, 280, 0x64, "0");
gump.AddLabel(100, 280, 0x64, "/");
gump.AddLabel(130, 280, 0x64, "10");
}
else
{
base.RenderProgress(gump);
}
}
public FirstKillObjective()
{
}
public override void OnKill(BaseCreature creature, Container corpse)
{
if (creature is DeathwatchBeetleHatchling)
Complete();
}
public override void OnKill( BaseCreature creature, Container corpse )
{
if ( creature is DeathwatchBeetleHatchling )
Complete();
}
public override void OnComplete()
{
System.AddObjective(new SecondKillObjective());
}
}
public override void OnComplete()
{
System.AddObjective( new SecondKillObjective() );
}
}
public class SecondKillObjective : QuestObjective
{
public override object Message => 1063320;
public class SecondKillObjective : QuestObjective
{
public override object Message => 1063320;
public override void RenderProgress(BaseQuestGump gump)
{
if (!Completed)
{
// Deathwatch Beetle Hatchlings killed:
gump.AddHtmlLocalized(70, 260, 270, 100, 1063318, 0x12DC6BF, false, false);
public override void RenderProgress( BaseQuestGump gump )
{
if ( !Completed )
{
// Deathwatch Beetle Hatchlings killed:
gump.AddHtmlLocalized( 70, 260, 270, 100, 1063318, 0x12DC6BF, false, false );
gump.AddLabel(70, 280, 0x64, "1");
gump.AddLabel(100, 280, 0x64, "/");
gump.AddLabel(130, 280, 0x64, "10");
}
else
{
base.RenderProgress(gump);
}
}
gump.AddLabel( 70, 280, 0x64, "1" );
gump.AddLabel( 100, 280, 0x64, "/" );
gump.AddLabel( 130, 280, 0x64, "10" );
}
else
{
base.RenderProgress( gump );
}
}
public override void OnKill(BaseCreature creature, Container corpse)
{
if (creature is DeathwatchBeetleHatchling)
{
Complete();
System.AddObjective(new ThirdKillObjective(2));
}
}
public SecondKillObjective()
{
}
public override void OnRead()
{
if (!Completed)
{
Complete();
System.AddObjective(new ThirdKillObjective(1));
}
}
}
public override void OnKill( BaseCreature creature, Container corpse )
{
if ( creature is DeathwatchBeetleHatchling )
{
Complete();
System.AddObjective( new ThirdKillObjective( 2 ) );
}
}
public class ThirdKillObjective : QuestObjective
{
public ThirdKillObjective(int startingProgress)
{
CurProgress = startingProgress;
}
public override void OnRead()
{
if ( !Completed )
{
Complete();
System.AddObjective( new ThirdKillObjective( 1 ) );
}
}
}
public ThirdKillObjective()
{
}
public class ThirdKillObjective : QuestObjective
{
public override object Message => 1063319;
public override object Message => 1063319;
public override void RenderProgress( BaseQuestGump gump )
{
if ( !Completed )
{
// Deathwatch Beetle Hatchlings killed:
gump.AddHtmlLocalized( 70, 260, 270, 100, 1063318, 0x12DC6BF, false, false );
public override int MaxProgress => 10;
gump.AddLabel( 70, 280, 0x64, CurProgress.ToString() );
gump.AddLabel( 100, 280, 0x64, "/" );
gump.AddLabel( 130, 280, 0x64, "10" );
}
else
{
base.RenderProgress( gump );
}
}
public override void RenderProgress(BaseQuestGump gump)
{
if (!Completed)
{
// Deathwatch Beetle Hatchlings killed:
gump.AddHtmlLocalized(70, 260, 270, 100, 1063318, 0x12DC6BF, false, false);
public override int MaxProgress => 10;
gump.AddLabel(70, 280, 0x64, CurProgress.ToString());
gump.AddLabel(100, 280, 0x64, "/");
gump.AddLabel(130, 280, 0x64, "10");
}
else
{
base.RenderProgress(gump);
}
}
public ThirdKillObjective( int startingProgress )
{
CurProgress = startingProgress;
}
public override void OnKill(BaseCreature creature, Container corpse)
{
if (creature is DeathwatchBeetleHatchling)
CurProgress++;
}
public ThirdKillObjective()
{
}
public override void OnComplete()
{
System.AddObjective(new ReturnObjective());
}
}
public override void OnKill( BaseCreature creature, Container corpse )
{
if ( creature is DeathwatchBeetleHatchling )
CurProgress++;
}
public class ReturnObjective : QuestObjective
{
public override object Message => 1063313;
public override void OnComplete()
{
System.AddObjective( new ReturnObjective() );
}
}
public class ReturnObjective : QuestObjective
{
public override object Message => 1063313;
public ReturnObjective()
{
}
public override void OnComplete()
{
System.AddConversation( new EndConversation() );
}
}
}
public override void OnComplete()
{
System.AddConversation(new EndConversation());
}
}
}

View file

@ -3,44 +3,45 @@ using Server.Mobiles;
namespace Server.Engines.Quests.Zento
{
public class TerribleHatchlingsQuest : QuestSystem
{
private static Type[] m_TypeReferenceTable = {
typeof( AcceptConversation ),
typeof( DirectionConversation ),
typeof( TakeCareConversation ),
typeof( EndConversation ),
typeof( FirstKillObjective ),
typeof( SecondKillObjective ),
typeof( ThirdKillObjective ),
typeof( ReturnObjective )
};
public class TerribleHatchlingsQuest : QuestSystem
{
private static Type[] m_TypeReferenceTable =
{
typeof(AcceptConversation),
typeof(DirectionConversation),
typeof(TakeCareConversation),
typeof(EndConversation),
typeof(FirstKillObjective),
typeof(SecondKillObjective),
typeof(ThirdKillObjective),
typeof(ReturnObjective)
};
public override Type[] TypeReferenceTable => m_TypeReferenceTable;
public TerribleHatchlingsQuest(PlayerMobile from) : base(from)
{
}
public override object Name => 1063314;
// Serialization
public TerribleHatchlingsQuest()
{
}
public override object OfferMessage => 1063315;
public override Type[] TypeReferenceTable => m_TypeReferenceTable;
public override TimeSpan RestartDelay => TimeSpan.MaxValue;
public override bool IsTutorial => true;
public override object Name => 1063314;
public override int Picture => 0x15CF;
public override object OfferMessage => 1063315;
public TerribleHatchlingsQuest( PlayerMobile from ) : base( from )
{
}
public override TimeSpan RestartDelay => TimeSpan.MaxValue;
public override bool IsTutorial => true;
// Serialization
public TerribleHatchlingsQuest()
{
}
public override int Picture => 0x15CF;
public override void Accept()
{
base.Accept();
public override void Accept()
{
base.Accept();
AddConversation( new AcceptConversation() );
}
}
}
AddConversation(new AcceptConversation());
}
}
}