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

@ -2,62 +2,54 @@ using Server.Mobiles;
namespace Server.Engines.Quests.Doom
{
public class AcceptConversation : QuestConversation
{
public override object Message => 1050027;
public class AcceptConversation : QuestConversation
{
public override object Message => 1050027;
public AcceptConversation()
{
}
public override void OnRead()
{
System.AddObjective(new CollectBonesObjective());
}
}
public override void OnRead()
{
System.AddObjective( new CollectBonesObjective() );
}
}
public class VanquishDaemonConversation : QuestConversation
{
public override object Message => 1050021;
public class VanquishDaemonConversation : QuestConversation
{
public override object Message => 1050021;
public override void OnRead()
{
Victoria victoria = ((TheSummoningQuest)System).Victoria;
public VanquishDaemonConversation()
{
}
if (victoria == null)
{
System.From.SendMessage("Internal error: unable to find Victoria. Quest unable to continue.");
System.Cancel();
}
else
{
SummoningAltar altar = victoria.Altar;
public override void OnRead()
{
Victoria victoria = ((TheSummoningQuest)System).Victoria;
if (altar == null)
{
System.From.SendMessage("Internal error: unable to find summoning altar. Quest unable to continue.");
System.Cancel();
}
else if (altar.Daemon == null || !altar.Daemon.Alive)
{
BoneDemon daemon = new BoneDemon();
if ( victoria == null )
{
System.From.SendMessage( "Internal error: unable to find Victoria. Quest unable to continue." );
System.Cancel();
}
else
{
SummoningAltar altar = victoria.Altar;
daemon.MoveToWorld(altar.Location, altar.Map);
altar.Daemon = daemon;
if ( altar == null )
{
System.From.SendMessage( "Internal error: unable to find summoning altar. Quest unable to continue." );
System.Cancel();
}
else if ( altar.Daemon == null || !altar.Daemon.Alive )
{
BoneDemon daemon = new BoneDemon();
System.AddObjective(new VanquishDaemonObjective(daemon));
}
else
{
victoria.SayTo(System.From, "The devourer has already been summoned.");
daemon.MoveToWorld( altar.Location, altar.Map );
altar.Daemon = daemon;
System.AddObjective( new VanquishDaemonObjective( daemon ) );
}
else
{
victoria.SayTo( System.From, "The devourer has already been summoned." );
((TheSummoningQuest)System).WaitForSummon = true;
}
}
}
}
((TheSummoningQuest)System).WaitForSummon = true;
}
}
}
}
}

View file

@ -5,113 +5,118 @@ using Server.Network;
namespace Server.Engines.Quests.Doom
{
public class BellOfTheDead : Item
{
public override int LabelNumber => 1050018; // bell of the dead
public class BellOfTheDead : Item
{
[Constructible]
public BellOfTheDead() : base(0x91A)
{
Hue = 0x835;
Movable = false;
}
[Constructible]
public BellOfTheDead() : base( 0x91A )
{
Hue = 0x835;
Movable = false;
}
public BellOfTheDead(Serial serial) : base(serial)
{
}
[CommandProperty( AccessLevel.GameMaster, AccessLevel.Administrator )]
public Chyloth Chyloth { get; set; }
public override int LabelNumber => 1050018; // bell of the dead
[CommandProperty( AccessLevel.GameMaster, AccessLevel.Administrator )]
public SkeletalDragon Dragon { get; set; }
[CommandProperty(AccessLevel.GameMaster, AccessLevel.Administrator)]
public Chyloth Chyloth{ get; set; }
[CommandProperty( AccessLevel.GameMaster, AccessLevel.Administrator )]
public bool Summoning { get; set; }
[CommandProperty(AccessLevel.GameMaster, AccessLevel.Administrator)]
public SkeletalDragon Dragon{ get; set; }
public override void OnDoubleClick( Mobile from )
{
if ( from.InRange( GetWorldLocation(), 2 ) )
BeginSummon( from );
else
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
}
[CommandProperty(AccessLevel.GameMaster, AccessLevel.Administrator)]
public bool Summoning{ get; set; }
public virtual void BeginSummon( Mobile from )
{
if ( Chyloth != null && !Chyloth.Deleted )
{
from.SendLocalizedMessage( 1050010 ); // The ferry man has already been summoned. There is no need to ring for him again.
}
else if ( Dragon != null && !Dragon.Deleted )
{
from.SendLocalizedMessage( 1050017 ); // The ferryman has recently been summoned already. You decide against ringing the bell again so soon.
}
else if ( !Summoning )
{
Summoning = true;
public override void OnDoubleClick(Mobile from)
{
if (from.InRange(GetWorldLocation(), 2))
BeginSummon(from);
else
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
}
Effects.PlaySound( GetWorldLocation(), Map, 0x100 );
public virtual void BeginSummon(Mobile from)
{
if (Chyloth != null && !Chyloth.Deleted)
{
from.SendLocalizedMessage(
1050010); // The ferry man has already been summoned. There is no need to ring for him again.
}
else if (Dragon != null && !Dragon.Deleted)
{
from.SendLocalizedMessage(
1050017); // The ferryman has recently been summoned already. You decide against ringing the bell again so soon.
}
else if (!Summoning)
{
Summoning = true;
Timer.DelayCall( TimeSpan.FromSeconds( 8.0 ), new TimerStateCallback( EndSummon ), from );
}
}
Effects.PlaySound(GetWorldLocation(), Map, 0x100);
public virtual void EndSummon( object state )
{
Mobile from = (Mobile)state;
Timer.DelayCall(TimeSpan.FromSeconds(8.0), new TimerStateCallback(EndSummon), from);
}
}
if ( Chyloth != null && !Chyloth.Deleted )
{
from.SendLocalizedMessage( 1050010 ); // The ferry man has already been summoned. There is no need to ring for him again.
}
else if ( Dragon != null && !Dragon.Deleted )
{
from.SendLocalizedMessage( 1050017 ); // The ferryman has recently been summoned already. You decide against ringing the bell again so soon.
}
else if ( Summoning )
{
Summoning = false;
public virtual void EndSummon(object state)
{
Mobile from = (Mobile)state;
Point3D loc = GetWorldLocation();
if (Chyloth != null && !Chyloth.Deleted)
{
from.SendLocalizedMessage(
1050010); // The ferry man has already been summoned. There is no need to ring for him again.
}
else if (Dragon != null && !Dragon.Deleted)
{
from.SendLocalizedMessage(
1050017); // The ferryman has recently been summoned already. You decide against ringing the bell again so soon.
}
else if (Summoning)
{
Summoning = false;
loc.Z -= 16;
Point3D loc = GetWorldLocation();
Effects.SendLocationParticles( EffectItem.Create( loc, Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 0, 0, 2023, 0 );
Effects.PlaySound( loc, Map, 0x1FE );
loc.Z -= 16;
Chyloth = new Chyloth();
Effects.SendLocationParticles(EffectItem.Create(loc, Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 0, 0,
2023, 0);
Effects.PlaySound(loc, Map, 0x1FE);
Chyloth.Direction = (Direction)(7 & (4 + (int)from.GetDirectionTo( loc )));
Chyloth.MoveToWorld( loc, Map );
Chyloth = new Chyloth();
Chyloth.Bell = this;
Chyloth.AngryAt = from;
Chyloth.BeginGiveWarning();
Chyloth.BeginRemove( TimeSpan.FromSeconds( 40.0 ) );
}
}
Chyloth.Direction = (Direction)(7 & (4 + (int)from.GetDirectionTo(loc)));
Chyloth.MoveToWorld(loc, Map);
public BellOfTheDead( Serial serial ) : base( serial )
{
}
Chyloth.Bell = this;
Chyloth.AngryAt = from;
Chyloth.BeginGiveWarning();
Chyloth.BeginRemove(TimeSpan.FromSeconds(40.0));
}
}
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
writer.Write( (Mobile) Chyloth );
writer.Write( (Mobile) Dragon );
}
writer.Write(Chyloth);
writer.Write(Dragon);
}
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();
Chyloth = reader.ReadMobile() as Chyloth;
Dragon = reader.ReadMobile() as SkeletalDragon;
Chyloth = reader.ReadMobile() as Chyloth;
Dragon = reader.ReadMobile() as SkeletalDragon;
Chyloth?.Delete();
}
}
}
Chyloth?.Delete();
}
}
}

View file

@ -1,30 +1,30 @@
namespace Server.Engines.Quests.Doom
{
public class ChylothShroud : Item
{
[Constructible]
public ChylothShroud() : base( 0x204E )
{
Hue = 0x846;
Layer = Layer.OuterTorso;
}
public class ChylothShroud : Item
{
[Constructible]
public ChylothShroud() : base(0x204E)
{
Hue = 0x846;
Layer = Layer.OuterTorso;
}
public ChylothShroud( Serial serial ) : base( serial )
{
}
public ChylothShroud(Serial serial) : base(serial)
{
}
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,32 +2,32 @@ using Server.Items;
namespace Server.Engines.Quests.Doom
{
public class ChylothStaff : BlackStaff
{
public override int LabelNumber => 1041111; // a magic staff
public class ChylothStaff : BlackStaff
{
[Constructible]
public ChylothStaff()
{
Hue = 0x482;
}
[Constructible]
public ChylothStaff()
{
Hue = 0x482;
}
public ChylothStaff(Serial serial) : base(serial)
{
}
public ChylothStaff( Serial serial ) : base( serial )
{
}
public override int LabelNumber => 1041111; // a magic staff
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

@ -1,33 +1,33 @@
namespace Server.Engines.Quests.Doom
{
public class GoldenSkull : Item
{
public override int LabelNumber => 1061619; // a golden skull
public class GoldenSkull : Item
{
[Constructible]
public GoldenSkull() : base(Utility.Random(0x1AE2, 3))
{
Weight = 1.0;
Hue = 0x8A5;
LootType = LootType.Blessed;
}
[Constructible]
public GoldenSkull() : base( Utility.Random( 0x1AE2, 3 ) )
{
Weight = 1.0;
Hue = 0x8A5;
LootType = LootType.Blessed;
}
public GoldenSkull(Serial serial) : base(serial)
{
}
public GoldenSkull( Serial serial ) : base( serial )
{
}
public override int LabelNumber => 1061619; // a golden skull
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

@ -1,34 +1,34 @@
namespace Server.Engines.Quests.Doom
{
public class GrandGrimoire : Item
{
public override int LabelNumber => 1060801; // The Grand Grimoire
public class GrandGrimoire : Item
{
[Constructible]
public GrandGrimoire() : base(0xEFA)
{
Weight = 1.0;
Hue = 0x835;
Layer = Layer.OneHanded;
LootType = LootType.Blessed;
}
[Constructible]
public GrandGrimoire() : base( 0xEFA )
{
Weight = 1.0;
Hue = 0x835;
Layer = Layer.OneHanded;
LootType = LootType.Blessed;
}
public GrandGrimoire(Serial serial) : base(serial)
{
}
public GrandGrimoire( Serial serial ) : base( serial )
{
}
public override int LabelNumber => 1060801; // The Grand Grimoire
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

@ -3,60 +3,60 @@ using Server.Mobiles;
namespace Server.Engines.Quests.Doom
{
public class SummoningAltar : AbbatoirAddon
{
private BoneDemon m_Daemon;
public class SummoningAltar : AbbatoirAddon
{
private BoneDemon m_Daemon;
public BoneDemon Daemon
{
get => m_Daemon;
set
{
m_Daemon = value;
CheckDaemon();
}
}
[Constructible]
public SummoningAltar()
{
}
public void CheckDaemon()
{
if ( m_Daemon == null || !m_Daemon.Alive )
{
m_Daemon = null;
Hue = 0;
}
else
{
Hue = 0x66D;
}
}
public SummoningAltar(Serial serial) : base(serial)
{
}
[Constructible]
public SummoningAltar()
{
}
public BoneDemon Daemon
{
get => m_Daemon;
set
{
m_Daemon = value;
CheckDaemon();
}
}
public SummoningAltar( Serial serial ) : base( serial )
{
}
public void CheckDaemon()
{
if (m_Daemon == null || !m_Daemon.Alive)
{
m_Daemon = null;
Hue = 0;
}
else
{
Hue = 0x66D;
}
}
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
writer.Write( (Mobile) m_Daemon );
}
writer.Write(m_Daemon);
}
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();
m_Daemon = reader.ReadMobile() as BoneDemon;
m_Daemon = reader.ReadMobile() as BoneDemon;
CheckDaemon();
}
}
CheckDaemon();
}
}
}

View file

@ -1,304 +1,311 @@
using System;
using Server.Engines.PartySystem;
using Server.Gumps;
using Server.Items;
using Server.Mobiles;
using Server.Network;
using Server.Engines.PartySystem;
namespace Server.Engines.Quests.Doom
{
public class Chyloth : BaseQuester
{
public override string DefaultName => "Chyloth";
public class Chyloth : BaseQuester
{
private static int[] m_Offsets =
{
-1, -1,
-1, 0,
-1, 1,
0, -1,
0, 1,
1, -1,
1, 0,
1, 1
};
[Constructible]
public Chyloth() : base( "the Ferryman" )
{
}
[Constructible]
public Chyloth() : base("the Ferryman")
{
}
public Chyloth( Serial serial ) : base( serial )
{
}
public Chyloth(Serial serial) : base(serial)
{
}
public override void InitBody()
{
InitStats( 100, 100, 25 );
public override string DefaultName => "Chyloth";
Hue = 0x8455;
Body = 0x190;
}
public BellOfTheDead Bell{ get; set; }
public override void InitOutfit()
{
EquipItem( new ChylothShroud() );
EquipItem( new ChylothStaff() );
}
public Mobile AngryAt{ get; set; }
public BellOfTheDead Bell { get; set; }
public override void InitBody()
{
InitStats(100, 100, 25);
Hue = 0x8455;
Body = 0x190;
}
public override void InitOutfit()
{
EquipItem(new ChylothShroud());
EquipItem(new ChylothStaff());
}
public Mobile AngryAt { get; set; }
public virtual void BeginGiveWarning()
{
if (Deleted || AngryAt == null)
return;
Timer.DelayCall(TimeSpan.FromSeconds(4.0), EndGiveWarning);
}
public virtual void BeginGiveWarning()
{
if ( Deleted || AngryAt == null )
return;
public virtual void EndGiveWarning()
{
if (Deleted || AngryAt == null)
return;
Timer.DelayCall( TimeSpan.FromSeconds( 4.0 ), EndGiveWarning );
}
PublicOverheadMessage(MessageType.Regular, 0x3B2, 1050013,
AngryAt.Name); // You have summoned me in vain ~1_NAME~! Only the dead may cross!
PublicOverheadMessage(MessageType.Regular, 0x3B2, 1050014); // Why have you disturbed me, mortal?!?
public virtual void EndGiveWarning()
{
if ( Deleted || AngryAt == null )
return;
BeginSummonDragon();
}
PublicOverheadMessage( MessageType.Regular, 0x3B2, 1050013, AngryAt.Name ); // You have summoned me in vain ~1_NAME~! Only the dead may cross!
PublicOverheadMessage( MessageType.Regular, 0x3B2, 1050014 ); // Why have you disturbed me, mortal?!?
public virtual void BeginSummonDragon()
{
if (Deleted || AngryAt == null)
return;
BeginSummonDragon();
}
Timer.DelayCall(TimeSpan.FromSeconds(30.0), EndSummonDragon);
}
public virtual void BeginSummonDragon()
{
if ( Deleted || AngryAt == null )
return;
public virtual void BeginRemove(TimeSpan delay)
{
Timer.DelayCall(delay, EndRemove);
}
Timer.DelayCall( TimeSpan.FromSeconds( 30.0 ), EndSummonDragon );
}
public virtual void EndRemove()
{
if (Deleted)
return;
public virtual void BeginRemove( TimeSpan delay )
{
Timer.DelayCall( delay, EndRemove );
}
Point3D loc = Location;
Map map = Map;
Effects.SendLocationParticles(EffectItem.Create(loc, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 0, 0,
2023, 0);
Effects.PlaySound(loc, map, 0x1FE);
Delete();
}
public virtual void EndRemove()
{
if ( Deleted )
return;
public virtual void EndSummonDragon()
{
if (Deleted || AngryAt == null)
return;
Point3D loc = Location;
Map map = Map;
Map map = AngryAt.Map;
Effects.SendLocationParticles( EffectItem.Create( loc, map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 0, 0, 2023, 0 );
Effects.PlaySound( loc, map, 0x1FE );
if (map == null)
return;
Delete();
}
if (!AngryAt.Region.IsPartOf("Doom"))
return;
private static int[] m_Offsets = {
-1, -1,
-1, 0,
-1, 1,
0, -1,
0, 1,
1, -1,
1, 0,
1, 1
};
PublicOverheadMessage(MessageType.Regular, 0x3B2, 1050015); // Feel the wrath of my legions!!!
PublicOverheadMessage(MessageType.Regular, 0x3B2, false, "MUHAHAHAHA HAHAH HAHA"); // A wee bit crazy, aren't we?
public virtual void EndSummonDragon()
{
if ( Deleted || AngryAt == null )
return;
SkeletalDragon dragon = new SkeletalDragon();
Map map = AngryAt.Map;
int offset = Utility.Random(8) * 2;
if ( map == null )
return;
bool foundLoc = false;
if ( !AngryAt.Region.IsPartOf( "Doom" ) )
return;
for (int i = 0; i < m_Offsets.Length; i += 2)
{
int x = AngryAt.X + m_Offsets[(offset + i) % m_Offsets.Length];
int y = AngryAt.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];
PublicOverheadMessage( MessageType.Regular, 0x3B2, 1050015 ); // Feel the wrath of my legions!!!
PublicOverheadMessage( MessageType.Regular, 0x3B2, false, "MUHAHAHAHA HAHAH HAHA" ); // A wee bit crazy, aren't we?
if (map.CanSpawnMobile(x, y, AngryAt.Z))
{
dragon.MoveToWorld(new Point3D(x, y, AngryAt.Z), map);
foundLoc = true;
break;
}
SkeletalDragon dragon = new SkeletalDragon();
int z = map.GetAverageZ(x, y);
int offset = Utility.Random( 8 ) * 2;
if (map.CanSpawnMobile(x, y, z))
{
dragon.MoveToWorld(new Point3D(x, y, z), map);
foundLoc = true;
break;
}
}
bool foundLoc = false;
if (!foundLoc)
dragon.MoveToWorld(AngryAt.Location, map);
for ( int i = 0; i < m_Offsets.Length; i += 2 )
{
int x = AngryAt.X + m_Offsets[(offset + i) % m_Offsets.Length];
int y = AngryAt.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];
dragon.Combatant = AngryAt;
if ( map.CanSpawnMobile( x, y, AngryAt.Z ) )
{
dragon.MoveToWorld( new Point3D( x, y, AngryAt.Z ), map );
foundLoc = true;
break;
}
if (Bell != null)
Bell.Dragon = dragon;
}
int z = map.GetAverageZ( x, y );
public static void TeleportToFerry(Mobile from)
{
Point3D loc = new Point3D(408, 251, 2);
Map map = Map.Malas;
if ( map.CanSpawnMobile( x, y, z ) )
{
dragon.MoveToWorld( new Point3D( x, y, z ), map );
foundLoc = true;
break;
}
}
Effects.SendLocationParticles(EffectItem.Create(loc, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 0, 0,
2023, 0);
Effects.PlaySound(loc, map, 0x1FE);
if ( !foundLoc )
dragon.MoveToWorld( AngryAt.Location, map );
TeleportPets(from, loc, map);
dragon.Combatant = AngryAt;
from.MoveToWorld(loc, map);
}
if ( Bell != null )
Bell.Dragon = dragon;
}
public override bool OnDragDrop(Mobile from, Item dropped)
{
if (dropped is GoldenSkull)
{
dropped.Delete();
public static void TeleportToFerry( Mobile from )
{
Point3D loc = new Point3D( 408, 251, 2 );
Map map = Map.Malas;
PublicOverheadMessage(MessageType.Regular, 0x3B2, 1050046,
from.Name); // Very well, ~1_NAME~, I accept your token. You may cross.
BeginRemove(TimeSpan.FromSeconds(4.0));
Effects.SendLocationParticles( EffectItem.Create( loc, map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 0, 0, 2023, 0 );
Effects.PlaySound( loc, map, 0x1FE );
Party p = PartySystem.Party.Get(from);
TeleportPets( from, loc, map );
if (p != null)
for (int i = 0; i < p.Members.Count; ++i)
{
PartyMemberInfo pmi = p.Members[i];
Mobile member = pmi.Mobile;
from.MoveToWorld( loc, map );
}
if (member != from && member.Map == Map.Malas && member.Region.IsPartOf("Doom"))
{
if (AngryAt == member)
AngryAt = null;
public override bool OnDragDrop( Mobile from, Item dropped )
{
if ( dropped is GoldenSkull )
{
dropped.Delete();
member.CloseGump(typeof(ChylothPartyGump));
member.SendGump(new ChylothPartyGump(from, member));
}
}
PublicOverheadMessage( MessageType.Regular, 0x3B2, 1050046, from.Name ); // Very well, ~1_NAME~, I accept your token. You may cross.
BeginRemove( TimeSpan.FromSeconds( 4.0 ) );
if (AngryAt == from)
AngryAt = null;
Party p = PartySystem.Party.Get( from );
TeleportToFerry(from);
if ( p != null )
{
for ( int i = 0; i < p.Members.Count; ++i )
{
PartyMemberInfo pmi = (PartyMemberInfo)p.Members[i];
Mobile member = pmi.Mobile;
return false;
}
if ( member != from && member.Map == Map.Malas && member.Region.IsPartOf( "Doom" ) )
{
if ( AngryAt == member )
AngryAt = null;
return base.OnDragDrop(from, dropped);
}
member.CloseGump( typeof( ChylothPartyGump ) );
member.SendGump( new ChylothPartyGump( from, member ) );
}
}
}
if ( AngryAt == from )
AngryAt = null;
TeleportToFerry( from );
return false;
}
return base.OnDragDrop( from, dropped );
}
public override bool CanTalkTo( PlayerMobile to )
{
return false;
}
public override void OnTalk( PlayerMobile player, bool contextMenu )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
public class ChylothPartyGump : Gump
{
private Mobile m_Leader;
private Mobile m_Member;
public ChylothPartyGump( Mobile leader, Mobile member ) : base( 150, 50 )
{
m_Leader = leader;
m_Member = member;
Closable = false;
AddPage( 0 );
AddImage( 0, 0, 3600 );
AddImageTiled( 0, 14, 15, 200, 3603 );
AddImageTiled( 380, 14, 14, 200, 3605 );
AddImage( 0, 201, 3606 );
AddImageTiled( 15, 201, 370, 16, 3607 );
AddImageTiled( 15, 0, 370, 16, 3601 );
AddImage( 380, 0, 3602 );
AddImage( 380, 201, 3608 );
AddImageTiled( 15, 15, 365, 190, 2624 );
AddRadio( 30, 140, 9727, 9730, true, 1 );
AddHtmlLocalized( 65, 145, 300, 25, 1050050, 0x7FFF, false, false ); // Yes, let's go!
AddRadio( 30, 175, 9727, 9730, false, 0 );
AddHtmlLocalized( 65, 178, 300, 25, 1050049, 0x7FFF, false, false ); // No thanks, I'd rather stay here.
AddHtmlLocalized( 30, 20, 360, 35, 1050047, 0x7FFF, false, false ); // Another player has paid Chyloth for your passage across lake Mortis:
AddHtmlLocalized( 30, 105, 345, 40, 1050048, 0x5B2D, false, false ); // Do you wish to accept their invitation at this time?
AddImage( 65, 72, 5605 );
AddImageTiled( 80, 90, 200, 1, 9107 );
AddImageTiled( 95, 92, 200, 1, 9157 );
AddLabel( 90, 70, 1645, leader.Name );
AddButton( 290, 175, 247, 248, 2, GumpButtonType.Reply, 0 );
AddImageTiled( 15, 14, 365, 1, 9107 );
AddImageTiled( 380, 14, 1, 190, 9105 );
AddImageTiled( 15, 205, 365, 1, 9107 );
AddImageTiled( 15, 14, 1, 190, 9105 );
AddImageTiled( 0, 0, 395, 1, 9157 );
AddImageTiled( 394, 0, 1, 217, 9155 );
AddImageTiled( 0, 216, 395, 1, 9157 );
AddImageTiled( 0, 0, 1, 217, 9155 );
}
public override void OnResponse( NetState sender, RelayInfo info )
{
if ( info.ButtonID == 2 && info.IsSwitched( 1 ) )
{
if ( m_Member.Region.IsPartOf( "Doom" ) )
{
m_Leader.SendLocalizedMessage( 1050054, m_Member.Name ); // ~1_NAME~ has accepted your invitation to cross lake Mortis.
Chyloth.TeleportToFerry( m_Member );
}
else
{
m_Member.SendLocalizedMessage( 1050051 ); // The invitation has been revoked.
}
}
else
{
m_Member.SendLocalizedMessage( 1050052 ); // You have declined their invitation.
m_Leader.SendLocalizedMessage( 1050053, m_Member.Name ); // ~1_NAME~ has declined your invitation to cross lake Mortis.
}
}
}
}
public override bool CanTalkTo(PlayerMobile to)
{
return false;
}
public override void OnTalk(PlayerMobile player, bool contextMenu)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write(0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
public class ChylothPartyGump : Gump
{
private Mobile m_Leader;
private Mobile m_Member;
public ChylothPartyGump(Mobile leader, Mobile member) : base(150, 50)
{
m_Leader = leader;
m_Member = member;
Closable = false;
AddPage(0);
AddImage(0, 0, 3600);
AddImageTiled(0, 14, 15, 200, 3603);
AddImageTiled(380, 14, 14, 200, 3605);
AddImage(0, 201, 3606);
AddImageTiled(15, 201, 370, 16, 3607);
AddImageTiled(15, 0, 370, 16, 3601);
AddImage(380, 0, 3602);
AddImage(380, 201, 3608);
AddImageTiled(15, 15, 365, 190, 2624);
AddRadio(30, 140, 9727, 9730, true, 1);
AddHtmlLocalized(65, 145, 300, 25, 1050050, 0x7FFF, false, false); // Yes, let's go!
AddRadio(30, 175, 9727, 9730, false, 0);
AddHtmlLocalized(65, 178, 300, 25, 1050049, 0x7FFF, false, false); // No thanks, I'd rather stay here.
AddHtmlLocalized(30, 20, 360, 35, 1050047, 0x7FFF, false,
false); // Another player has paid Chyloth for your passage across lake Mortis:
AddHtmlLocalized(30, 105, 345, 40, 1050048, 0x5B2D, false,
false); // Do you wish to accept their invitation at this time?
AddImage(65, 72, 5605);
AddImageTiled(80, 90, 200, 1, 9107);
AddImageTiled(95, 92, 200, 1, 9157);
AddLabel(90, 70, 1645, leader.Name);
AddButton(290, 175, 247, 248, 2, GumpButtonType.Reply, 0);
AddImageTiled(15, 14, 365, 1, 9107);
AddImageTiled(380, 14, 1, 190, 9105);
AddImageTiled(15, 205, 365, 1, 9107);
AddImageTiled(15, 14, 1, 190, 9105);
AddImageTiled(0, 0, 395, 1, 9157);
AddImageTiled(394, 0, 1, 217, 9155);
AddImageTiled(0, 216, 395, 1, 9157);
AddImageTiled(0, 0, 1, 217, 9155);
}
public override void OnResponse(NetState sender, RelayInfo info)
{
if (info.ButtonID == 2 && info.IsSwitched(1))
{
if (m_Member.Region.IsPartOf("Doom"))
{
m_Leader.SendLocalizedMessage(1050054,
m_Member.Name); // ~1_NAME~ has accepted your invitation to cross lake Mortis.
Chyloth.TeleportToFerry(m_Member);
}
else
{
m_Member.SendLocalizedMessage(1050051); // The invitation has been revoked.
}
}
else
{
m_Member.SendLocalizedMessage(1050052); // You have declined their invitation.
m_Leader.SendLocalizedMessage(1050053,
m_Member.Name); // ~1_NAME~ has declined your invitation to cross lake Mortis.
}
}
}
}

View file

@ -3,150 +3,144 @@ using Server.Mobiles;
namespace Server.Engines.Quests.Doom
{
public class Victoria : BaseQuester
{
public override int TalkNumber => 6159; // Ask about Chyloth
public override string DefaultName => "Victoria";
public override bool ClickTitle => true;
public override bool IsActiveVendor => true;
public override bool DisallowAllMoves => false;
public class Victoria : BaseQuester
{
private const int AltarRange = 24;
public override void InitSBInfo()
{
m_SBInfos.Add( new SBMage() );
}
private SummoningAltar m_Altar;
[Constructible]
public Victoria() : base( "the Sorceress" )
{
}
[Constructible]
public Victoria() : base("the Sorceress")
{
}
public Victoria( Serial serial ) : base( serial )
{
}
public Victoria(Serial serial) : base(serial)
{
}
public override void InitBody()
{
InitStats( 100, 100, 25 );
public override int TalkNumber => 6159; // Ask about Chyloth
public override string DefaultName => "Victoria";
public override bool ClickTitle => true;
public override bool IsActiveVendor => true;
public override bool DisallowAllMoves => false;
Female = true;
Hue = 0x8835;
Body = 0x191;
}
public SummoningAltar Altar
{
get
{
if (m_Altar == null || m_Altar.Deleted || m_Altar.Map != Map ||
!Utility.InRange(m_Altar.Location, Location, AltarRange))
foreach (Item item in GetItemsInRange(AltarRange))
if (item is SummoningAltar altar)
{
m_Altar = altar;
break;
}
private SummoningAltar m_Altar;
return m_Altar;
}
}
private const int AltarRange = 24;
public override void InitSBInfo()
{
m_SBInfos.Add(new SBMage());
}
public SummoningAltar Altar
{
get
{
if ( m_Altar == null || m_Altar.Deleted || m_Altar.Map != Map || !Utility.InRange( m_Altar.Location, Location, AltarRange ) )
{
foreach ( Item item in GetItemsInRange( AltarRange ) )
{
if ( item is SummoningAltar altar )
{
m_Altar = altar;
break;
}
}
}
public override void InitBody()
{
InitStats(100, 100, 25);
return m_Altar;
}
}
Female = true;
Hue = 0x8835;
Body = 0x191;
}
public override void InitOutfit()
{
EquipItem( new GrandGrimoire() );
public override void InitOutfit()
{
EquipItem(new GrandGrimoire());
EquipItem( SetHue( new Sandals(), 0x455 ) );
EquipItem( SetHue( new SkullCap(), 0x455 ) );
EquipItem( SetHue( new PlainDress(), 0x455 ) );
EquipItem(SetHue(new Sandals(), 0x455));
EquipItem(SetHue(new SkullCap(), 0x455));
EquipItem(SetHue(new PlainDress(), 0x455));
HairItemID = 0x203C;
HairHue = 0x482;
}
HairItemID = 0x203C;
HairHue = 0x482;
}
public override bool OnDragDrop( Mobile from, Item dropped )
{
if ( from is PlayerMobile player )
{
QuestSystem qs = player.Quest;
public override bool OnDragDrop(Mobile from, Item dropped)
{
if (from is PlayerMobile player)
{
QuestSystem qs = player.Quest;
if ( qs is TheSummoningQuest )
{
if ( dropped is DaemonBone bones )
{
QuestObjective obj = qs.FindObjective( typeof( CollectBonesObjective ) );
if (qs is TheSummoningQuest)
if (dropped is DaemonBone bones)
{
QuestObjective obj = qs.FindObjective(typeof(CollectBonesObjective));
if ( obj != null && !obj.Completed )
{
int need = obj.MaxProgress - obj.CurProgress;
if (obj != null && !obj.Completed)
{
int need = obj.MaxProgress - obj.CurProgress;
if ( bones.Amount < need )
{
obj.CurProgress += bones.Amount;
bones.Delete();
if (bones.Amount < need)
{
obj.CurProgress += bones.Amount;
bones.Delete();
qs.ShowQuestLogUpdated();
}
else
{
obj.Complete();
bones.Consume( need );
qs.ShowQuestLogUpdated();
}
else
{
obj.Complete();
bones.Consume(need);
if ( !bones.Deleted )
{
// TODO: Accurate?
SayTo( from, 1050038 ); // You have already given me all the Daemon bones necessary to weave the spell. Keep these for a later time.
}
}
}
else
{
// TODO: Accurate?
SayTo( from, 1050038 ); // You have already given me all the Daemon bones necessary to weave the spell. Keep these for a later time.
}
if (!bones.Deleted)
SayTo(from,
1050038); // You have already given me all the Daemon bones necessary to weave the spell. Keep these for a later time.
}
}
else
{
// TODO: Accurate?
SayTo(from,
1050038); // You have already given me all the Daemon bones necessary to weave the spell. Keep these for a later time.
}
return false;
}
}
}
return false;
}
}
return base.OnDragDrop( from, dropped );
}
return base.OnDragDrop(from, dropped);
}
public override bool CanTalkTo( PlayerMobile to )
{
return ( to.Quest == null && QuestSystem.CanOfferQuest( to, typeof( TheSummoningQuest ) ) );
}
public override bool CanTalkTo(PlayerMobile to)
{
return to.Quest == null && QuestSystem.CanOfferQuest(to, typeof(TheSummoningQuest));
}
public override void OnTalk( PlayerMobile player, bool contextMenu )
{
QuestSystem qs = player.Quest;
public override void OnTalk(PlayerMobile player, bool contextMenu)
{
QuestSystem qs = player.Quest;
if ( qs == null && QuestSystem.CanOfferQuest( player, typeof( TheSummoningQuest ) ) )
{
Direction = GetDirectionTo( player );
new TheSummoningQuest( this, player ).SendOffer();
}
}
if (qs == null && QuestSystem.CanOfferQuest(player, typeof(TheSummoningQuest)))
{
Direction = GetDirectionTo(player);
new TheSummoningQuest(this, player).SendOffer();
}
}
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

@ -1,162 +1,164 @@
using System.Collections.Generic;
using Server.Items;
using Server.Mobiles;
using System.Collections.Generic;
namespace Server.Engines.Quests.Doom
{
public class CollectBonesObjective : QuestObjective
{
public override object Message => 1050026;
public class CollectBonesObjective : QuestObjective
{
public override object Message => 1050026;
public override int MaxProgress => 1000;
public override int MaxProgress => 1000;
public CollectBonesObjective()
{
}
public override void OnComplete()
{
Victoria victoria = ((TheSummoningQuest)System).Victoria;
public override void OnComplete()
{
Victoria victoria = ((TheSummoningQuest)System).Victoria;
if (victoria == null)
{
System.From.SendMessage("Internal error: unable to find Victoria. Quest unable to continue.");
System.Cancel();
}
else
{
SummoningAltar altar = victoria.Altar;
if ( victoria == null )
{
System.From.SendMessage( "Internal error: unable to find Victoria. Quest unable to continue." );
System.Cancel();
}
else
{
SummoningAltar altar = victoria.Altar;
if (altar == null)
{
System.From.SendMessage("Internal error: unable to find summoning altar. Quest unable to continue.");
System.Cancel();
}
else if (altar.Daemon == null || !altar.Daemon.Alive)
{
System.AddConversation(new VanquishDaemonConversation());
}
else
{
victoria.SayTo(System.From,
"The devourer has already been summoned. Return when the devourer has been slain and I will summon it for you.");
((TheSummoningQuest)System).WaitForSummon = true;
}
}
}
if ( altar == null )
{
System.From.SendMessage( "Internal error: unable to find summoning altar. Quest unable to continue." );
System.Cancel();
}
else if ( altar.Daemon == null || !altar.Daemon.Alive )
{
System.AddConversation( new VanquishDaemonConversation() );
}
else
{
victoria.SayTo( System.From, "The devourer has already been summoned. Return when the devourer has been slain and I will summon it for you." );
((TheSummoningQuest)System).WaitForSummon = true;
}
}
}
public override void RenderMessage(BaseQuestGump gump)
{
if (CurProgress > 0 && CurProgress < MaxProgress)
gump.AddHtmlObject(70, 130, 300, 100, 1050028, BaseQuestGump.Blue, false,
false); // Victoria has accepted the Daemon bones, but the requirement is not yet met.
else
base.RenderMessage(gump);
}
public override void RenderMessage( BaseQuestGump gump )
{
if ( CurProgress > 0 && CurProgress < MaxProgress )
gump.AddHtmlObject( 70, 130, 300, 100, 1050028, BaseQuestGump.Blue, false, false ); // Victoria has accepted the Daemon bones, but the requirement is not yet met.
else
base.RenderMessage( gump );
}
public override void RenderProgress(BaseQuestGump gump)
{
if (CurProgress > 0 && CurProgress < MaxProgress)
{
gump.AddHtmlObject(70, 260, 270, 100, 1050019, BaseQuestGump.Blue, false,
false); // Number of bones collected:
public override void RenderProgress( BaseQuestGump gump )
{
if ( CurProgress > 0 && CurProgress < MaxProgress )
{
gump.AddHtmlObject( 70, 260, 270, 100, 1050019, BaseQuestGump.Blue, false, false ); // Number of bones collected:
gump.AddLabel(70, 280, 100, CurProgress.ToString());
gump.AddLabel(100, 280, 100, "/");
gump.AddLabel(130, 280, 100, MaxProgress.ToString());
}
else
{
base.RenderProgress(gump);
}
}
}
gump.AddLabel( 70, 280, 100, CurProgress.ToString() );
gump.AddLabel( 100, 280, 100, "/" );
gump.AddLabel( 130, 280, 100, MaxProgress.ToString() );
}
else
{
base.RenderProgress( gump );
}
}
}
public class VanquishDaemonObjective : QuestObjective
{
private BoneDemon m_Daemon;
public class VanquishDaemonObjective : QuestObjective
{
private BoneDemon m_Daemon;
public VanquishDaemonObjective(BoneDemon daemon)
{
m_Daemon = daemon;
}
public Corpse CorpseWithSkull { get; set; }
// Serialization
public VanquishDaemonObjective()
{
}
public override object Message => 1050037;
public Corpse CorpseWithSkull{ get; set; }
public VanquishDaemonObjective( BoneDemon daemon )
{
m_Daemon = daemon;
}
public override object Message => 1050037;
// Serialization
public VanquishDaemonObjective()
{
}
public override void CheckProgress()
{
if (m_Daemon == null || !m_Daemon.Alive)
Complete();
}
public override void CheckProgress()
{
if ( m_Daemon == null || !m_Daemon.Alive )
Complete();
}
public override void OnComplete()
{
Victoria victoria = ((TheSummoningQuest)System).Victoria;
public override void OnComplete()
{
Victoria victoria = ((TheSummoningQuest)System).Victoria;
SummoningAltar altar = victoria?.Altar;
SummoningAltar altar = victoria?.Altar;
altar?.CheckDaemon();
altar?.CheckDaemon();
PlayerMobile from = System.From;
PlayerMobile from = System.From;
if (!from.Alive)
{
from.SendLocalizedMessage(
1050033); // The devourer lies dead, unfortunately so do you. You cannot claim your reward while dead. You will need to face him again.
((TheSummoningQuest)System).WaitForSummon = true;
}
else
{
bool hasRights = true;
if ( !from.Alive )
{
from.SendLocalizedMessage( 1050033 ); // The devourer lies dead, unfortunately so do you. You cannot claim your reward while dead. You will need to face him again.
((TheSummoningQuest)System).WaitForSummon = true;
}
else
{
bool hasRights = true;
if (m_Daemon != null)
{
List<DamageStore> lootingRights =
BaseCreature.GetLootingRights(m_Daemon.DamageEntries, m_Daemon.HitsMax);
if ( m_Daemon != null )
{
List<DamageStore> lootingRights = BaseCreature.GetLootingRights( m_Daemon.DamageEntries, m_Daemon.HitsMax );
for (int i = 0; i < lootingRights.Count; ++i)
{
DamageStore ds = lootingRights[i];
for ( int i = 0; i < lootingRights.Count; ++i )
{
DamageStore ds = lootingRights[i];
if (ds.m_HasRight && ds.m_Mobile == from)
{
hasRights = true;
break;
}
}
}
if ( ds.m_HasRight && ds.m_Mobile == from )
{
hasRights = true;
break;
}
}
}
if (!hasRights)
{
from.SendLocalizedMessage(
1050034); // The devourer lies dead. Unfortunately you did not sufficiently prove your worth in combating the devourer. Victoria shall summon another incarnation of the devourer to the circle of stones. Try again noble adventurer.
((TheSummoningQuest)System).WaitForSummon = true;
}
else
{
from.SendLocalizedMessage(1050035); // The devourer lies dead. Search his corpse to claim your prize!
if ( !hasRights )
{
from.SendLocalizedMessage( 1050034 ); // The devourer lies dead. Unfortunately you did not sufficiently prove your worth in combating the devourer. Victoria shall summon another incarnation of the devourer to the circle of stones. Try again noble adventurer.
((TheSummoningQuest)System).WaitForSummon = true;
}
else
{
from.SendLocalizedMessage( 1050035 ); // The devourer lies dead. Search his corpse to claim your prize!
if (m_Daemon != null)
CorpseWithSkull = m_Daemon.Corpse as Corpse;
}
}
}
if ( m_Daemon != null )
CorpseWithSkull = m_Daemon.Corpse as Corpse;
}
}
}
public override void ChildDeserialize(GenericReader reader)
{
int version = reader.ReadEncodedInt();
public override void ChildDeserialize( GenericReader reader )
{
int version = reader.ReadEncodedInt();
m_Daemon = reader.ReadMobile() as BoneDemon;
CorpseWithSkull = reader.ReadItem() as Corpse;
}
m_Daemon = reader.ReadMobile() as BoneDemon;
CorpseWithSkull = reader.ReadItem() as Corpse;
}
public override void ChildSerialize(GenericWriter writer)
{
writer.WriteEncodedInt(0); // version
public override void ChildSerialize( GenericWriter writer )
{
writer.WriteEncodedInt( (int) 0 ); // version
writer.Write( (Mobile) m_Daemon );
writer.Write( (Item) CorpseWithSkull );
}
}
}
writer.Write(m_Daemon);
writer.Write(CorpseWithSkull);
}
}
}

View file

@ -4,109 +4,109 @@ using Server.Mobiles;
namespace Server.Engines.Quests.Doom
{
public class TheSummoningQuest : QuestSystem
{
private static Type[] m_TypeReferenceTable = {
typeof( AcceptConversation ),
typeof( CollectBonesObjective ),
typeof( VanquishDaemonConversation ),
typeof( VanquishDaemonObjective )
};
public class TheSummoningQuest : QuestSystem
{
private static Type[] m_TypeReferenceTable =
{
typeof(AcceptConversation),
typeof(CollectBonesObjective),
typeof(VanquishDaemonConversation),
typeof(VanquishDaemonObjective)
};
public override Type[] TypeReferenceTable => m_TypeReferenceTable;
public TheSummoningQuest(Victoria victoria, PlayerMobile from) : base(from)
{
Victoria = victoria;
}
public Victoria Victoria { get; private set; }
public TheSummoningQuest()
{
}
public bool WaitForSummon { get; set; }
public override Type[] TypeReferenceTable => m_TypeReferenceTable;
public override object Name => 1050025;
public Victoria Victoria{ get; private set; }
public override object OfferMessage => 1050020;
public bool WaitForSummon{ get; set; }
public override bool IsTutorial => false;
public override TimeSpan RestartDelay => TimeSpan.Zero;
public override int Picture => 0x15B5;
public override object Name => 1050025;
// NOTE: Quest not entirely OSI-accurate: some changes made to prevent numerous OSI bugs
public override object OfferMessage => 1050020;
public override void Slice()
{
if ( WaitForSummon && Victoria != null )
{
SummoningAltar altar = Victoria.Altar;
public override bool IsTutorial => false;
public override TimeSpan RestartDelay => TimeSpan.Zero;
public override int Picture => 0x15B5;
if ( altar != null && (altar.Daemon == null || !altar.Daemon.Alive) )
{
if ( From.Map == Victoria.Map && From.InRange( Victoria, 8 ) )
{
WaitForSummon = false;
// NOTE: Quest not entirely OSI-accurate: some changes made to prevent numerous OSI bugs
AddConversation( new VanquishDaemonConversation() );
}
}
}
public override void Slice()
{
if (WaitForSummon && Victoria != null)
{
SummoningAltar altar = Victoria.Altar;
base.Slice();
}
if (altar != null && (altar.Daemon == null || !altar.Daemon.Alive))
if (From.Map == Victoria.Map && From.InRange(Victoria, 8))
{
WaitForSummon = false;
public static int GetDaemonBonesFor( BaseCreature creature )
{
if ( creature == null || creature.Controlled || creature.Summoned )
return 0;
AddConversation(new VanquishDaemonConversation());
}
}
int fame = creature.Fame;
base.Slice();
}
if ( fame < 1500 )
return Utility.Dice( 2, 5, -1 );
if ( fame < 20000 )
return Utility.Dice( 2, 4, 8 );
return 50;
}
public static int GetDaemonBonesFor(BaseCreature creature)
{
if (creature == null || creature.Controlled || creature.Summoned)
return 0;
public TheSummoningQuest( Victoria victoria, PlayerMobile from ) : base( from )
{
Victoria = victoria;
}
int fame = creature.Fame;
public TheSummoningQuest()
{
}
if (fame < 1500)
return Utility.Dice(2, 5, -1);
if (fame < 20000)
return Utility.Dice(2, 4, 8);
return 50;
}
public override void Cancel()
{
base.Cancel();
public override void Cancel()
{
base.Cancel();
QuestObjective obj = FindObjective( typeof( CollectBonesObjective ) );
QuestObjective obj = FindObjective(typeof(CollectBonesObjective));
if ( obj != null && obj.CurProgress > 0 )
{
From.BankBox.DropItem( new DaemonBone( obj.CurProgress ) );
if (obj != null && obj.CurProgress > 0)
{
From.BankBox.DropItem(new DaemonBone(obj.CurProgress));
From.SendLocalizedMessage( 1050030 ); // The Daemon bones that you have thus far given to Victoria have been returned to you.
}
}
From.SendLocalizedMessage(
1050030); // The Daemon bones that you have thus far given to Victoria have been returned to you.
}
}
public override void Accept()
{
base.Accept();
public override void Accept()
{
base.Accept();
AddConversation( new AcceptConversation() );
}
AddConversation(new AcceptConversation());
}
public override void ChildDeserialize( GenericReader reader )
{
int version = reader.ReadEncodedInt();
public override void ChildDeserialize(GenericReader reader)
{
int version = reader.ReadEncodedInt();
Victoria = reader.ReadMobile() as Victoria;
WaitForSummon = reader.ReadBool();
}
Victoria = reader.ReadMobile() as Victoria;
WaitForSummon = reader.ReadBool();
}
public override void ChildSerialize( GenericWriter writer )
{
writer.WriteEncodedInt( (int) 0 ); // version
public override void ChildSerialize(GenericWriter writer)
{
writer.WriteEncodedInt(0); // version
writer.Write( (Mobile) Victoria );
writer.Write( (bool) WaitForSummon );
}
}
}
writer.Write(Victoria);
writer.Write(WaitForSummon);
}
}
}