Fixes code according to modern code style. Fixes a few expression bugs.
This commit is contained in:
parent
89eea25e5f
commit
970fd563b2
3324 changed files with 441118 additions and 433755 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue