Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
89
Scripts/Quests/TheSummoning/Conversations.cs
Normal file
89
Scripts/Quests/TheSummoning/Conversations.cs
Normal file
@@ -0,0 +1,89 @@
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.Quests.Doom
|
||||
{
|
||||
public class AcceptConversation : QuestConversation
|
||||
{
|
||||
public AcceptConversation()
|
||||
{
|
||||
}
|
||||
|
||||
public override object Message
|
||||
{
|
||||
get
|
||||
{
|
||||
/* You have accepted Victoria's help. She requires 1000 Daemon
|
||||
* bones to summon the devourer.<BR><BR>
|
||||
*
|
||||
* You may hand Victoria the bones as you collect them and she
|
||||
* will keep count of how many you have brought her.<BR><BR>
|
||||
*
|
||||
* Daemon bones can be collected via various means throughout
|
||||
* Dungeon Doom.<BR><BR>
|
||||
*
|
||||
* Good luck.
|
||||
*/
|
||||
return 1050027;
|
||||
}
|
||||
}
|
||||
public override void OnRead()
|
||||
{
|
||||
this.System.AddObjective(new CollectBonesObjective());
|
||||
}
|
||||
}
|
||||
|
||||
public class VanquishDaemonConversation : QuestConversation
|
||||
{
|
||||
public VanquishDaemonConversation()
|
||||
{
|
||||
}
|
||||
|
||||
public override object Message
|
||||
{
|
||||
get
|
||||
{
|
||||
/* Well done brave soul. I shall summon the beast to the circle
|
||||
* of stones just South-East of here. Take great care - the beast
|
||||
* takes many forms. Now hurry...
|
||||
*/
|
||||
return 1050021;
|
||||
}
|
||||
}
|
||||
public override void OnRead()
|
||||
{
|
||||
Victoria victoria = ((TheSummoningQuest)this.System).Victoria;
|
||||
|
||||
if (victoria == null)
|
||||
{
|
||||
this.System.From.SendMessage("Internal error: unable to find Victoria. Quest unable to continue.");
|
||||
this.System.Cancel();
|
||||
}
|
||||
else
|
||||
{
|
||||
SummoningAltar altar = victoria.Altar;
|
||||
|
||||
if (altar == null)
|
||||
{
|
||||
this.System.From.SendMessage("Internal error: unable to find summoning altar. Quest unable to continue.");
|
||||
this.System.Cancel();
|
||||
}
|
||||
else if (altar.Daemon == null || !altar.Daemon.Alive)
|
||||
{
|
||||
BoneDemon daemon = new BoneDemon();
|
||||
|
||||
daemon.MoveToWorld(altar.Location, altar.Map);
|
||||
altar.Daemon = daemon;
|
||||
|
||||
this.System.AddObjective(new VanquishDaemonObjective(daemon));
|
||||
}
|
||||
else
|
||||
{
|
||||
victoria.SayTo(this.System.From, "The devourer has already been summoned.");
|
||||
|
||||
((TheSummoningQuest)this.System).WaitForSummon = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
196
Scripts/Quests/TheSummoning/Objectives.cs
Normal file
196
Scripts/Quests/TheSummoning/Objectives.cs
Normal file
@@ -0,0 +1,196 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.Quests.Doom
|
||||
{
|
||||
public class CollectBonesObjective : QuestObjective
|
||||
{
|
||||
public CollectBonesObjective()
|
||||
{
|
||||
}
|
||||
|
||||
public override object Message
|
||||
{
|
||||
get
|
||||
{
|
||||
/* Find 1000 Daemon bones and hand them
|
||||
* to Victoria as you find them.
|
||||
*/
|
||||
return 1050026;
|
||||
}
|
||||
}
|
||||
public override int MaxProgress
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1000;
|
||||
}
|
||||
}
|
||||
public override void OnComplete()
|
||||
{
|
||||
Victoria victoria = ((TheSummoningQuest)this.System).Victoria;
|
||||
|
||||
if (victoria == null)
|
||||
{
|
||||
this.System.From.SendMessage("Internal error: unable to find Victoria. Quest unable to continue.");
|
||||
this.System.Cancel();
|
||||
}
|
||||
else
|
||||
{
|
||||
SummoningAltar altar = victoria.Altar;
|
||||
|
||||
if (altar == null)
|
||||
{
|
||||
this.System.From.SendMessage("Internal error: unable to find summoning altar. Quest unable to continue.");
|
||||
this.System.Cancel();
|
||||
}
|
||||
else if (altar.Daemon == null || !altar.Daemon.Alive)
|
||||
{
|
||||
this.System.AddConversation(new VanquishDaemonConversation());
|
||||
}
|
||||
else
|
||||
{
|
||||
victoria.SayTo(this.System.From, "The devourer has already been summoned. Return when the devourer has been slain and I will summon it for you.");
|
||||
((TheSummoningQuest)this.System).WaitForSummon = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void RenderMessage(BaseQuestGump gump)
|
||||
{
|
||||
if (this.CurProgress > 0 && this.CurProgress < this.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 (this.CurProgress > 0 && this.CurProgress < this.MaxProgress)
|
||||
{
|
||||
gump.AddHtmlObject(70, 260, 270, 100, 1050019, BaseQuestGump.Blue, false, false); // Number of bones collected:
|
||||
|
||||
gump.AddLabel(70, 280, 100, this.CurProgress.ToString());
|
||||
gump.AddLabel(100, 280, 100, "/");
|
||||
gump.AddLabel(130, 280, 100, this.MaxProgress.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
base.RenderProgress(gump);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class VanquishDaemonObjective : QuestObjective
|
||||
{
|
||||
private BoneDemon m_Daemon;
|
||||
private Corpse m_CorpseWithSkull;
|
||||
public VanquishDaemonObjective(BoneDemon daemon)
|
||||
{
|
||||
this.m_Daemon = daemon;
|
||||
}
|
||||
|
||||
// Serialization
|
||||
public VanquishDaemonObjective()
|
||||
{
|
||||
}
|
||||
|
||||
public Corpse CorpseWithSkull
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_CorpseWithSkull;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_CorpseWithSkull = value;
|
||||
}
|
||||
}
|
||||
public override object Message
|
||||
{
|
||||
get
|
||||
{
|
||||
/* Go forth and vanquish the devourer that has been summoned!
|
||||
*/
|
||||
return 1050037;
|
||||
}
|
||||
}
|
||||
public override void CheckProgress()
|
||||
{
|
||||
if (this.m_Daemon == null || !this.m_Daemon.Alive)
|
||||
this.Complete();
|
||||
}
|
||||
|
||||
public override void OnComplete()
|
||||
{
|
||||
Victoria victoria = ((TheSummoningQuest)this.System).Victoria;
|
||||
|
||||
if (victoria != null)
|
||||
{
|
||||
SummoningAltar altar = victoria.Altar;
|
||||
|
||||
if (altar != null)
|
||||
altar.CheckDaemon();
|
||||
}
|
||||
|
||||
PlayerMobile from = this.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)this.System).WaitForSummon = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
bool hasRights = true;
|
||||
|
||||
if (this.m_Daemon != null)
|
||||
{
|
||||
List<DamageStore> lootingRights = this.m_Daemon.GetLootingRights();
|
||||
|
||||
for (int i = 0; i < lootingRights.Count; ++i)
|
||||
{
|
||||
DamageStore ds = lootingRights[i];
|
||||
|
||||
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)this.System).WaitForSummon = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1050035); // The devourer lies dead. Search his corpse to claim your prize!
|
||||
|
||||
if (this.m_Daemon != null)
|
||||
this.m_CorpseWithSkull = this.m_Daemon.Corpse as Corpse;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void ChildDeserialize(GenericReader reader)
|
||||
{
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
this.m_Daemon = reader.ReadMobile() as BoneDemon;
|
||||
this.m_CorpseWithSkull = reader.ReadItem() as Corpse;
|
||||
}
|
||||
|
||||
public override void ChildSerialize(GenericWriter writer)
|
||||
{
|
||||
writer.WriteEncodedInt((int)0); // version
|
||||
|
||||
writer.Write((Mobile)this.m_Daemon);
|
||||
writer.Write((Item)this.m_CorpseWithSkull);
|
||||
}
|
||||
}
|
||||
}
|
||||
190
Scripts/Quests/TheSummoning/TheSummoningQuest.cs
Normal file
190
Scripts/Quests/TheSummoning/TheSummoningQuest.cs
Normal file
@@ -0,0 +1,190 @@
|
||||
using System;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.Quests.Doom
|
||||
{
|
||||
public class TheSummoningQuest : QuestSystem
|
||||
{
|
||||
private static readonly Type[] m_TypeReferenceTable = new Type[]
|
||||
{
|
||||
typeof(Doom.AcceptConversation),
|
||||
typeof(Doom.CollectBonesObjective),
|
||||
typeof(Doom.VanquishDaemonConversation),
|
||||
typeof(Doom.VanquishDaemonObjective)
|
||||
};
|
||||
private Victoria m_Victoria;
|
||||
private bool m_WaitForSummon;
|
||||
public TheSummoningQuest(Victoria victoria, PlayerMobile from)
|
||||
: base(from)
|
||||
{
|
||||
this.m_Victoria = victoria;
|
||||
}
|
||||
|
||||
public TheSummoningQuest()
|
||||
{
|
||||
}
|
||||
|
||||
public override Type[] TypeReferenceTable
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_TypeReferenceTable;
|
||||
}
|
||||
}
|
||||
public Victoria Victoria
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Victoria;
|
||||
}
|
||||
}
|
||||
public bool WaitForSummon
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_WaitForSummon;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_WaitForSummon = value;
|
||||
}
|
||||
}
|
||||
public override object Name
|
||||
{
|
||||
get
|
||||
{
|
||||
// The Summoning
|
||||
return 1050025;
|
||||
}
|
||||
}
|
||||
public override object OfferMessage
|
||||
{
|
||||
get
|
||||
{
|
||||
/* <I>Victoria turns to you and smiles...</I><BR><BR>
|
||||
*
|
||||
* Chyloth, eh? He is the ferry man of lake <I>Mortis</I>, beyond which lies
|
||||
* the nest of the <I>The Dark Father</I> - the fountainhead of all the evil
|
||||
* that you see around you here.<BR><BR>
|
||||
*
|
||||
* 800 and some years ago, my sisters and I persuaded the ferry man Chyloth
|
||||
* to take us across the lake to battle the <I>The Dark Father</I>.
|
||||
* My party was utterly destroyed, except for me. For my insolence, I was
|
||||
* cursed by the <I>The Dark Father</I> to wander these halls for eternity,
|
||||
* unable to die - unable to leave.<BR><BR>
|
||||
*
|
||||
* Chyloth usually only crosses over the souls of the undead, but he can be
|
||||
* persuaded otherwise...with a token of gold, in the form of a human skull.
|
||||
* Such a gem can be found only in the belly of the hellspawn known as
|
||||
* <I>the devourer</I>.<BR><BR>
|
||||
*
|
||||
* I can help you summon the beast from the depths of the abyss, but I require
|
||||
* 1000 Daemon bones to do so. If you accept my help, I will store the Daemon
|
||||
* bones for you until you have collected all 1000 of them. Once the bones
|
||||
* are collected in full, I will summon the beast for you, which you must
|
||||
* slay to claim your prize.<BR><BR>
|
||||
*
|
||||
* Do you accept?
|
||||
*/
|
||||
return 1050020;
|
||||
}
|
||||
}
|
||||
public override bool IsTutorial
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public override TimeSpan RestartDelay
|
||||
{
|
||||
get
|
||||
{
|
||||
return TimeSpan.Zero;
|
||||
}
|
||||
}
|
||||
public override int Picture
|
||||
{
|
||||
get
|
||||
{
|
||||
return 0x15B5;
|
||||
}
|
||||
}
|
||||
public static int GetDaemonBonesFor(BaseCreature creature)
|
||||
{
|
||||
if (creature == null || creature.Controlled || creature.Summoned)
|
||||
return 0;
|
||||
|
||||
if (creature is DarkGuardian)
|
||||
return 30;
|
||||
|
||||
int fame = creature.Fame;
|
||||
|
||||
if (fame < 1500)
|
||||
return Utility.Dice(2, 5, -1);
|
||||
else if (fame < 20000)
|
||||
return Utility.Dice(2, 4, 8);
|
||||
else
|
||||
return 50;
|
||||
}
|
||||
|
||||
// NOTE: Quest not entirely OSI-accurate: some changes made to prevent numerous OSI bugs
|
||||
public override void Slice()
|
||||
{
|
||||
if (this.m_WaitForSummon && this.m_Victoria != null)
|
||||
{
|
||||
SummoningAltar altar = this.m_Victoria.Altar;
|
||||
|
||||
if (altar != null && (altar.Daemon == null || !altar.Daemon.Alive))
|
||||
{
|
||||
if (this.From.Map == this.m_Victoria.Map && this.From.InRange(this.m_Victoria, 8))
|
||||
{
|
||||
this.m_WaitForSummon = false;
|
||||
|
||||
this.AddConversation(new VanquishDaemonConversation());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
base.Slice();
|
||||
}
|
||||
|
||||
public override void Cancel()
|
||||
{
|
||||
base.Cancel();
|
||||
|
||||
QuestObjective obj = this.FindObjective(typeof(CollectBonesObjective));
|
||||
|
||||
if (obj != null && obj.CurProgress > 0)
|
||||
{
|
||||
this.From.BankBox.DropItem(new DaemonBone(obj.CurProgress));
|
||||
|
||||
this.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();
|
||||
|
||||
this.AddConversation(new AcceptConversation());
|
||||
}
|
||||
|
||||
public override void ChildDeserialize(GenericReader reader)
|
||||
{
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
this.m_Victoria = reader.ReadMobile() as Victoria;
|
||||
this.m_WaitForSummon = reader.ReadBool();
|
||||
}
|
||||
|
||||
public override void ChildSerialize(GenericWriter writer)
|
||||
{
|
||||
writer.WriteEncodedInt((int)0); // version
|
||||
|
||||
writer.Write((Mobile)this.m_Victoria);
|
||||
writer.Write((bool)this.m_WaitForSummon);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user