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,169 +1,143 @@
using Server.Mobiles;
using Server.Items;
using Server.Mobiles;
namespace Server.Engines.Quests.Matriarch
{
public class KillInfiltratorsObjective : QuestObjective
{
public override object Message => ((SolenMatriarchQuest)System).RedSolen ? 1054086 : 1054085;
public class KillInfiltratorsObjective : QuestObjective
{
public override object Message => ((SolenMatriarchQuest)System).RedSolen ? 1054086 : 1054085;
public override int MaxProgress => 7;
public override int MaxProgress => 7;
public KillInfiltratorsObjective()
{
}
public override void RenderProgress(BaseQuestGump gump)
{
if (!Completed)
{
// Black/Red Solen Infiltrators killed:
gump.AddHtmlLocalized(70, 260, 270, 100, ((SolenMatriarchQuest)System).RedSolen ? 1054088 : 1054087,
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 RenderProgress( BaseQuestGump gump )
{
if ( !Completed )
{
// Black/Red Solen Infiltrators killed:
gump.AddHtmlLocalized( 70, 260, 270, 100, ((SolenMatriarchQuest)System).RedSolen ? 1054088 : 1054087, 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 bool IgnoreYoungProtection(Mobile from)
{
if (Completed)
return false;
public override bool IgnoreYoungProtection( Mobile from )
{
if ( Completed )
return false;
bool redSolen = ((SolenMatriarchQuest)System).RedSolen;
bool redSolen = ((SolenMatriarchQuest)System).RedSolen;
if (redSolen)
return from is BlackSolenInfiltratorWarrior || from is BlackSolenInfiltratorQueen;
return from is RedSolenInfiltratorWarrior || from is RedSolenInfiltratorQueen;
}
if ( redSolen )
return from is BlackSolenInfiltratorWarrior || from is BlackSolenInfiltratorQueen;
return from is RedSolenInfiltratorWarrior || from is RedSolenInfiltratorQueen;
}
public override void OnKill(BaseCreature creature, Container corpse)
{
bool redSolen = ((SolenMatriarchQuest)System).RedSolen;
public override void OnKill( BaseCreature creature, Container corpse )
{
bool redSolen = ((SolenMatriarchQuest)System).RedSolen;
if (redSolen)
{
if (creature is BlackSolenInfiltratorWarrior || creature is BlackSolenInfiltratorQueen)
CurProgress++;
}
else
{
if (creature is RedSolenInfiltratorWarrior || creature is RedSolenInfiltratorQueen)
CurProgress++;
}
}
if ( redSolen )
{
if ( creature is BlackSolenInfiltratorWarrior || creature is BlackSolenInfiltratorQueen )
CurProgress++;
}
else
{
if ( creature is RedSolenInfiltratorWarrior || creature is RedSolenInfiltratorQueen )
CurProgress++;
}
}
public override void OnComplete()
{
System.AddObjective(new ReturnAfterKillsObjective());
}
}
public override void OnComplete()
{
System.AddObjective( new ReturnAfterKillsObjective() );
}
}
public class ReturnAfterKillsObjective : QuestObjective
{
public override object Message => 1054090;
public class ReturnAfterKillsObjective : QuestObjective
{
public override object Message => 1054090;
public override void OnComplete()
{
System.AddConversation(new GatherWaterConversation());
}
}
public ReturnAfterKillsObjective()
{
}
public class GatherWaterObjective : QuestObjective
{
public override object Message => 1054092;
public override void OnComplete()
{
System.AddConversation( new GatherWaterConversation() );
}
}
public override int MaxProgress => 40;
public class GatherWaterObjective : QuestObjective
{
public override object Message => 1054092;
public override void RenderProgress(BaseQuestGump gump)
{
if (!Completed)
{
gump.AddHtmlLocalized(70, 260, 270, 100, 1054093, BaseQuestGump.Blue, false,
false); // Gallons of Water gathered:
gump.AddLabel(70, 280, 0x64, (CurProgress / 5).ToString());
gump.AddLabel(100, 280, 0x64, "/");
gump.AddLabel(130, 280, 0x64, (MaxProgress / 5).ToString());
}
else
{
base.RenderProgress(gump);
}
}
public override int MaxProgress => 40;
public override void OnComplete()
{
System.AddObjective(new ReturnAfterWaterObjective());
}
}
public GatherWaterObjective()
{
}
public class ReturnAfterWaterObjective : QuestObjective
{
public override object Message => 1054095;
public override void RenderProgress( BaseQuestGump gump )
{
if ( !Completed )
{
gump.AddHtmlLocalized( 70, 260, 270, 100, 1054093, BaseQuestGump.Blue, false, false ); // Gallons of Water gathered:
gump.AddLabel( 70, 280, 0x64, (CurProgress / 5).ToString() );
gump.AddLabel( 100, 280, 0x64, "/" );
gump.AddLabel( 130, 280, 0x64, (MaxProgress / 5).ToString() );
}
else
{
base.RenderProgress( gump );
}
}
public override void OnComplete()
{
PlayerMobile player = System.From;
bool redSolen = ((SolenMatriarchQuest)System).RedSolen;
public override void OnComplete()
{
System.AddObjective( new ReturnAfterWaterObjective() );
}
}
bool friend = SolenMatriarchQuest.IsFriend(player, redSolen);
public class ReturnAfterWaterObjective : QuestObjective
{
public override object Message => 1054095;
System.AddConversation(new ProcessFungiConversation(friend));
public ReturnAfterWaterObjective()
{
}
if (redSolen)
player.SolenFriendship = SolenFriendship.Red;
else
player.SolenFriendship = SolenFriendship.Black;
}
}
public override void OnComplete()
{
PlayerMobile player = System.From;
bool redSolen = ((SolenMatriarchQuest)System).RedSolen;
public class ProcessFungiObjective : QuestObjective
{
public override object Message => 1054098;
bool friend = SolenMatriarchQuest.IsFriend( player, redSolen );
public override void OnComplete()
{
if (SolenMatriarchQuest.GiveRewardTo(System.From))
System.Complete();
else
System.AddConversation(new FullBackpackConversation(true));
}
}
System.AddConversation( new ProcessFungiConversation( friend ) );
public class GetRewardObjective : QuestObjective
{
public override object Message => 1054149;
if ( redSolen )
player.SolenFriendship = SolenFriendship.Red;
else
player.SolenFriendship = SolenFriendship.Black;
}
}
public class ProcessFungiObjective : QuestObjective
{
public override object Message => 1054098;
public ProcessFungiObjective()
{
}
public override void OnComplete()
{
if ( SolenMatriarchQuest.GiveRewardTo( System.From ) )
{
System.Complete();
}
else
{
System.AddConversation( new FullBackpackConversation( true ) );
}
}
}
public class GetRewardObjective : QuestObjective
{
public override object Message => 1054149;
public GetRewardObjective()
{
}
public override void OnComplete()
{
System.AddConversation( new EndConversation() );
}
}
}
public override void OnComplete()
{
System.AddConversation(new EndConversation());
}
}
}