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,114 +1,114 @@
using System;
using Server.Mobiles;
using Server.Items;
using Server.Mobiles;
using Server.Network;
namespace Server.Engines.Quests.Hag
{
public class Blackheart : BaseQuester
{
public override string DefaultName => "Captain Blackheart";
public class Blackheart : BaseQuester
{
[Constructible]
public Blackheart() : base("the Drunken Pirate")
{
}
[Constructible]
public Blackheart() : base( "the Drunken Pirate" )
{
}
public Blackheart(Serial serial) : base(serial)
{
}
public Blackheart( Serial serial ) : base( serial )
{
}
public override string DefaultName => "Captain Blackheart";
public override void InitBody()
{
InitStats( 100, 100, 25 );
public override void InitBody()
{
InitStats(100, 100, 25);
Hue = 0x83EF;
Hue = 0x83EF;
Female = false;
Body = 0x190;
}
Female = false;
Body = 0x190;
}
public override void InitOutfit()
{
AddItem( new FancyShirt() );
AddItem( new LongPants( 0x66D ) );
AddItem( new ThighBoots() );
AddItem( new TricorneHat( 0x1 ) );
AddItem( new BodySash( 0x66D ) );
public override void InitOutfit()
{
AddItem(new FancyShirt());
AddItem(new LongPants(0x66D));
AddItem(new ThighBoots());
AddItem(new TricorneHat(0x1));
AddItem(new BodySash(0x66D));
LeatherGloves gloves = new LeatherGloves();
gloves.Hue = 0x66D;
AddItem( gloves );
LeatherGloves gloves = new LeatherGloves();
gloves.Hue = 0x66D;
AddItem(gloves);
FacialHairItemID = 0x203E; // Long Beard
FacialHairHue = 0x455;
FacialHairItemID = 0x203E; // Long Beard
FacialHairHue = 0x455;
Item sword = new Cutlass();
sword.Movable = false;
AddItem( sword );
}
Item sword = new Cutlass();
sword.Movable = false;
AddItem(sword);
}
public override void OnTalk( PlayerMobile player, bool contextMenu )
{
Direction = GetDirectionTo( player );
Animate( 33, 20, 1, true, false, 0 );
public override void OnTalk(PlayerMobile player, bool contextMenu)
{
Direction = GetDirectionTo(player);
Animate(33, 20, 1, true, false, 0);
QuestSystem qs = player.Quest;
QuestSystem qs = player.Quest;
if ( qs is WitchApprenticeQuest )
{
if ( qs.FindObjective( typeof( FindIngredientObjective ) ) is FindIngredientObjective obj && !obj.Completed && obj.Ingredient == Ingredient.Whiskey )
{
PlaySound( Utility.RandomBool() ? 0x42E : 0x43F );
if (qs is WitchApprenticeQuest)
if (qs.FindObjective(typeof(FindIngredientObjective)) is FindIngredientObjective obj && !obj.Completed &&
obj.Ingredient == Ingredient.Whiskey)
{
PlaySound(Utility.RandomBool() ? 0x42E : 0x43F);
Item hat = player.FindItemOnLayer( Layer.Helm );
bool tricorne = hat is TricorneHat;
Item hat = player.FindItemOnLayer(Layer.Helm);
bool tricorne = hat is TricorneHat;
if ( tricorne && player.BAC >= 20 )
{
obj.Complete();
if (tricorne && player.BAC >= 20)
{
obj.Complete();
qs.AddConversation( new BlackheartPirateConversation( !obj.BlackheartMet ) );
}
else if ( !obj.BlackheartMet )
{
obj.Complete();
qs.AddConversation(new BlackheartPirateConversation(!obj.BlackheartMet));
}
else if (!obj.BlackheartMet)
{
obj.Complete();
qs.AddConversation( new BlackheartFirstConversation() );
}
else
{
qs.AddConversation( new BlackheartNoPirateConversation( tricorne, player.BAC > 0 ) );
}
qs.AddConversation(new BlackheartFirstConversation());
}
else
{
qs.AddConversation(new BlackheartNoPirateConversation(tricorne, player.BAC > 0));
}
return;
}
}
return;
}
PlaySound( 0x42C );
SayTo( player, 1055041 ); // The drunken pirate shakes his fist at you and goes back to drinking.
}
PlaySound(0x42C);
SayTo(player, 1055041); // The drunken pirate shakes his fist at you and goes back to drinking.
}
private void Heave()
{
PublicOverheadMessage( Network.MessageType.Regular, 0x3B2, 500849 ); // *hic*
private void Heave()
{
PublicOverheadMessage(MessageType.Regular, 0x3B2, 500849); // *hic*
Timer.DelayCall( TimeSpan.FromSeconds( Utility.RandomMinMax( 60, 180 ) ), Heave );
}
Timer.DelayCall(TimeSpan.FromSeconds(Utility.RandomMinMax(60, 180)), Heave);
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write( (int) 0 ); // version
}
writer.Write(0); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
int version = reader.ReadInt();
Heave();
}
}
}
Heave();
}
}
}

View file

@ -1,217 +1,219 @@
using Server.Mobiles;
using Server.Items;
using Server.Mobiles;
namespace Server.Engines.Quests.Hag
{
public class Grizelda : BaseQuester
{
public override bool ClickTitle => true;
public override string DefaultName => "Grizelda";
public class Grizelda : BaseQuester
{
[Constructible]
public Grizelda() : base("the Hag")
{
}
[Constructible]
public Grizelda() : base( "the Hag" )
{
}
public Grizelda(Serial serial) : base(serial)
{
}
public Grizelda( Serial serial ) : base( serial )
{
}
public override bool ClickTitle => true;
public override string DefaultName => "Grizelda";
public override void InitBody()
{
InitStats( 100, 100, 25 );
public override void InitBody()
{
InitStats(100, 100, 25);
Hue = 0x83EA;
Hue = 0x83EA;
Female = true;
Body = 0x191;
}
Female = true;
Body = 0x191;
}
public override void InitOutfit()
{
AddItem( new Robe( 0x1 ) );
AddItem( new Sandals() );
AddItem( new WizardsHat( 0x1 ) );
AddItem( new GoldBracelet() );
public override void InitOutfit()
{
AddItem(new Robe(0x1));
AddItem(new Sandals());
AddItem(new WizardsHat(0x1));
AddItem(new GoldBracelet());
HairItemID = 0x203C;
HairItemID = 0x203C;
Item staff = new GnarledStaff();
staff.Movable = false;
AddItem( staff );
}
Item staff = new GnarledStaff();
staff.Movable = false;
AddItem(staff);
}
public override void OnTalk( PlayerMobile player, bool contextMenu )
{
Direction = GetDirectionTo( player );
public override void OnTalk(PlayerMobile player, bool contextMenu)
{
Direction = GetDirectionTo(player);
QuestSystem qs = player.Quest;
QuestSystem qs = player.Quest;
if ( qs is WitchApprenticeQuest )
{
if ( qs.IsObjectiveInProgress( typeof( FindApprenticeObjective ) ) )
{
PlaySound( 0x259 );
PlaySound( 0x206 );
qs.AddConversation( new HagDuringCorpseSearchConversation() );
}
else
{
QuestObjective obj = qs.FindObjective( typeof( FindGrizeldaAboutMurderObjective ) );
if (qs is WitchApprenticeQuest)
{
if (qs.IsObjectiveInProgress(typeof(FindApprenticeObjective)))
{
PlaySound(0x259);
PlaySound(0x206);
qs.AddConversation(new HagDuringCorpseSearchConversation());
}
else
{
QuestObjective obj = qs.FindObjective(typeof(FindGrizeldaAboutMurderObjective));
if ( obj != null && !obj.Completed )
{
PlaySound( 0x420 );
PlaySound( 0x20 );
obj.Complete();
}
else if ( qs.IsObjectiveInProgress( typeof( KillImpsObjective ) )
|| qs.IsObjectiveInProgress( typeof( FindZeefzorpulObjective ) ) )
{
PlaySound( 0x259 );
PlaySound( 0x206 );
qs.AddConversation( new HagDuringImpSearchConversation() );
}
else
{
obj = qs.FindObjective( typeof( ReturnRecipeObjective ) );
if (obj != null && !obj.Completed)
{
PlaySound(0x420);
PlaySound(0x20);
obj.Complete();
}
else if (qs.IsObjectiveInProgress(typeof(KillImpsObjective))
|| qs.IsObjectiveInProgress(typeof(FindZeefzorpulObjective)))
{
PlaySound(0x259);
PlaySound(0x206);
qs.AddConversation(new HagDuringImpSearchConversation());
}
else
{
obj = qs.FindObjective(typeof(ReturnRecipeObjective));
if ( obj != null && !obj.Completed )
{
PlaySound( 0x258 );
PlaySound( 0x41B );
obj.Complete();
}
else if ( qs.IsObjectiveInProgress( typeof( FindIngredientObjective ) ) )
{
PlaySound( 0x259 );
PlaySound( 0x206 );
qs.AddConversation( new HagDuringIngredientsConversation() );
}
else
{
obj = qs.FindObjective( typeof( ReturnIngredientsObjective ) );
if (obj != null && !obj.Completed)
{
PlaySound(0x258);
PlaySound(0x41B);
obj.Complete();
}
else if (qs.IsObjectiveInProgress(typeof(FindIngredientObjective)))
{
PlaySound(0x259);
PlaySound(0x206);
qs.AddConversation(new HagDuringIngredientsConversation());
}
else
{
obj = qs.FindObjective(typeof(ReturnIngredientsObjective));
if ( obj != null && !obj.Completed )
{
Container cont = GetNewContainer();
if (obj != null && !obj.Completed)
{
Container cont = GetNewContainer();
cont.DropItem( new BlackPearl( 30 ) );
cont.DropItem( new Bloodmoss( 30 ) );
cont.DropItem( new Garlic( 30 ) );
cont.DropItem( new Ginseng( 30 ) );
cont.DropItem( new MandrakeRoot( 30 ) );
cont.DropItem( new Nightshade( 30 ) );
cont.DropItem( new SulfurousAsh( 30 ) );
cont.DropItem( new SpidersSilk( 30 ) );
cont.DropItem(new BlackPearl(30));
cont.DropItem(new Bloodmoss(30));
cont.DropItem(new Garlic(30));
cont.DropItem(new Ginseng(30));
cont.DropItem(new MandrakeRoot(30));
cont.DropItem(new Nightshade(30));
cont.DropItem(new SulfurousAsh(30));
cont.DropItem(new SpidersSilk(30));
cont.DropItem( new Cauldron() );
cont.DropItem( new MoonfireBrew() );
cont.DropItem( new TreasureMap( Utility.RandomMinMax( 1, 4 ), Map ) );
cont.DropItem( new Gold( 2000, 2200 ) );
cont.DropItem(new Cauldron());
cont.DropItem(new MoonfireBrew());
cont.DropItem(new TreasureMap(Utility.RandomMinMax(1, 4), Map));
cont.DropItem(new Gold(2000, 2200));
if ( Utility.RandomBool() )
{
BaseWeapon weapon = Loot.RandomWeapon();
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 );
}
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);
}
cont.DropItem( weapon );
}
else
{
Item item;
cont.DropItem(weapon);
}
else
{
Item item;
if ( Core.AOS )
{
item = Loot.RandomArmorOrShieldOrJewelry();
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;
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 );
}
armor.ProtectionLevel = (ArmorProtectionLevel)RandomMinMaxScaled(2, 3);
armor.Durability = (ArmorDurabilityLevel)RandomMinMaxScaled(2, 3);
}
cont.DropItem( item );
}
cont.DropItem(item);
}
if ( player.BAC > 0 )
cont.DropItem( new HangoverCure() );
if (player.BAC > 0)
cont.DropItem(new HangoverCure());
if ( player.PlaceInBackpack( cont ) )
{
bool gainedPath = false;
if (player.PlaceInBackpack(cont))
{
bool gainedPath = false;
if ( VirtueHelper.Award( player, VirtueName.Sacrifice, 250, ref gainedPath ) ) // TODO: Check amount on OSI.
player.SendLocalizedMessage( 1054160 ); // You have gained in sacrifice.
if (VirtueHelper.Award(player, VirtueName.Sacrifice, 250, ref gainedPath)
) // TODO: Check amount on OSI.
player.SendLocalizedMessage(1054160); // You have gained in sacrifice.
PlaySound( 0x253 );
PlaySound( 0x20 );
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
{
QuestSystem newQuest = new WitchApprenticeQuest( player );
bool inRestartPeriod = false;
PlaySound(0x253);
PlaySound(0x20);
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
{
QuestSystem newQuest = new WitchApprenticeQuest(player);
bool inRestartPeriod = false;
if ( qs != null )
{
newQuest.AddConversation( new DontOfferConversation() );
}
else if ( QuestSystem.CanOfferQuest( player, typeof( WitchApprenticeQuest ), out inRestartPeriod ) )
{
PlaySound( 0x20 );
PlaySound( 0x206 );
newQuest.SendOffer();
}
else if ( inRestartPeriod )
{
PlaySound( 0x259 );
PlaySound( 0x206 );
newQuest.AddConversation( new RecentlyFinishedConversation() );
}
}
}
if (qs != null)
{
newQuest.AddConversation(new DontOfferConversation());
}
else if (QuestSystem.CanOfferQuest(player, typeof(WitchApprenticeQuest), out inRestartPeriod))
{
PlaySound(0x20);
PlaySound(0x206);
newQuest.SendOffer();
}
else if (inRestartPeriod)
{
PlaySound(0x259);
PlaySound(0x206);
newQuest.AddConversation(new RecentlyFinishedConversation());
}
}
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write( (int) 0 ); // version
}
writer.Write(0); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
int version = reader.ReadInt();
}
}
}

View file

@ -2,46 +2,46 @@ using Server.Mobiles;
namespace Server.Engines.Quests.Hag
{
public class Zeefzorpul : BaseQuester
{
public override string DefaultName => "Zeefzorpul";
public class Zeefzorpul : BaseQuester
{
public Zeefzorpul()
{
}
public Zeefzorpul()
{
}
public Zeefzorpul(Serial serial) : base(serial)
{
}
public override void InitBody()
{
Body = 0x4A;
}
public override string DefaultName => "Zeefzorpul";
public Zeefzorpul( Serial serial ) : base( serial )
{
}
public override void InitBody()
{
Body = 0x4A;
}
public override bool CanTalkTo( PlayerMobile to )
{
return false;
}
public override bool CanTalkTo(PlayerMobile to)
{
return false;
}
public override void OnTalk( PlayerMobile player, bool contextMenu )
{
}
public override void OnTalk(PlayerMobile player, bool contextMenu)
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write( (int) 0 ); // version
}
writer.Write(0); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
int version = reader.ReadInt();
Delete();
}
}
}
Delete();
}
}
}