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,101 +1,97 @@
using System.Collections.Generic;
using Server.Items;
using Server.Misc;
using Server.Mobiles;
using Server.Network;
using Server.Misc;
namespace Server.Engines.Quests.Hag
{
public class HagApprenticeCorpse : Corpse
{
private static Mobile GetOwner()
{
Mobile apprentice = new Mobile();
public class HagApprenticeCorpse : Corpse
{
[Constructible]
public HagApprenticeCorpse() : base(GetOwner(), GetEquipment())
{
Direction = Direction.South;
apprentice.Hue = Utility.RandomSkinHue();
apprentice.Female = false;
apprentice.Body = 0x190;
foreach (Item item in EquipItems) DropItem(item);
}
apprentice.Delete();
public HagApprenticeCorpse(Serial serial) : base(serial)
{
}
return apprentice;
}
private static Mobile GetOwner()
{
Mobile apprentice = new Mobile();
private static List<Item> GetEquipment()
{
return new List<Item>();
}
apprentice.Hue = Utility.RandomSkinHue();
apprentice.Female = false;
apprentice.Body = 0x190;
public override void AddNameProperty( ObjectPropertyList list )
{
list.Add( "a charred corpse" );
}
apprentice.Delete();
public override void OnSingleClick( Mobile from )
{
int hue = Notoriety.GetHue( NotorietyHandlers.CorpseNotoriety( from, this ) );
return apprentice;
}
from.Send( new AsciiMessage( Serial, ItemID, MessageType.Label, hue, 3, "", "a charred corpse" ) );
}
private static List<Item> GetEquipment()
{
return new List<Item>();
}
[Constructible]
public HagApprenticeCorpse() : base( GetOwner(), GetEquipment() )
{
Direction = Direction.South;
public override void AddNameProperty(ObjectPropertyList list)
{
list.Add("a charred corpse");
}
foreach ( Item item in EquipItems )
{
DropItem( item );
}
}
public override void OnSingleClick(Mobile from)
{
int hue = Notoriety.GetHue(NotorietyHandlers.CorpseNotoriety(from, this));
public HagApprenticeCorpse( Serial serial ) : base( serial )
{
}
from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, hue, 3, "", "a charred corpse"));
}
public override void Open( Mobile from, bool checkSelfLoot )
{
if ( !from.InRange( GetWorldLocation(), 2 ) )
return;
public override void Open(Mobile from, bool checkSelfLoot)
{
if (!from.InRange(GetWorldLocation(), 2))
return;
if ( from is PlayerMobile player )
{
QuestSystem qs = player.Quest;
if (from is PlayerMobile player)
{
QuestSystem qs = player.Quest;
if ( qs is WitchApprenticeQuest )
{
if ( qs.FindObjective( typeof( FindApprenticeObjective ) ) is FindApprenticeObjective obj && !obj.Completed )
{
if ( obj.Corpse == this )
{
obj.Complete();
Delete();
}
else
{
SendLocalizedMessageTo( from, 1055047 ); // You examine the corpse, but it doesn't fit the description of the particular apprentice the Hag tasked you with finding.
}
if (qs is WitchApprenticeQuest)
if (qs.FindObjective(typeof(FindApprenticeObjective)) is FindApprenticeObjective obj && !obj.Completed)
{
if (obj.Corpse == this)
{
obj.Complete();
Delete();
}
else
{
SendLocalizedMessageTo(from,
1055047); // You examine the corpse, but it doesn't fit the description of the particular apprentice the Hag tasked you with finding.
}
return;
}
}
}
return;
}
}
SendLocalizedMessageTo( from, 1055048 ); // You examine the corpse, but find nothing of interest.
}
SendLocalizedMessageTo(from, 1055048); // You examine the corpse, but find nothing of interest.
}
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();
}
}
}