Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
48
Scripts/Services/Quests/Regions/CancelQuestRegion.cs
Normal file
48
Scripts/Services/Quests/Regions/CancelQuestRegion.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.Xml;
|
||||
using Server.Mobiles;
|
||||
using Server.Regions;
|
||||
|
||||
namespace Server.Engines.Quests
|
||||
{
|
||||
public class CancelQuestRegion : BaseRegion
|
||||
{
|
||||
private readonly Type m_Quest;
|
||||
public CancelQuestRegion(XmlElement xml, Map map, Region parent)
|
||||
: base(xml, map, parent)
|
||||
{
|
||||
ReadType(xml["quest"], "type", ref this.m_Quest);
|
||||
}
|
||||
|
||||
public Type Quest
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Quest;
|
||||
}
|
||||
}
|
||||
public override bool OnMoveInto(Mobile m, Direction d, Point3D newLocation, Point3D oldLocation)
|
||||
{
|
||||
if (!base.OnMoveInto(m, d, newLocation, oldLocation))
|
||||
return false;
|
||||
|
||||
if (m.IsStaff())
|
||||
return true;
|
||||
|
||||
if (this.m_Quest == null)
|
||||
return true;
|
||||
|
||||
PlayerMobile player = m as PlayerMobile;
|
||||
|
||||
if (player != null && player.Quest != null && player.Quest.GetType() == this.m_Quest)
|
||||
{
|
||||
if (!player.HasGump(typeof(QuestCancelGump)))
|
||||
player.Quest.BeginCancelQuest();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Xml;
|
||||
using Server.Mobiles;
|
||||
using Server.Regions;
|
||||
|
||||
namespace Server.Engines.Quests
|
||||
{
|
||||
public class QuestCompleteObjectiveRegion : BaseRegion
|
||||
{
|
||||
private readonly Type m_Quest;
|
||||
private readonly Type m_Objective;
|
||||
public QuestCompleteObjectiveRegion(XmlElement xml, Map map, Region parent)
|
||||
: base(xml, map, parent)
|
||||
{
|
||||
XmlElement questEl = xml["quest"];
|
||||
|
||||
ReadType(questEl, "type", ref this.m_Quest);
|
||||
ReadType(questEl, "complete", ref this.m_Objective);
|
||||
}
|
||||
|
||||
public Type Quest
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Quest ;
|
||||
}
|
||||
}
|
||||
public Type Objective
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Objective;
|
||||
}
|
||||
}
|
||||
public override void OnEnter(Mobile m)
|
||||
{
|
||||
base.OnEnter(m);
|
||||
|
||||
if (this.m_Quest != null && this.m_Objective != null)
|
||||
{
|
||||
PlayerMobile player = m as PlayerMobile;
|
||||
|
||||
if (player != null && player.Quest != null && player.Quest.GetType() == this.m_Quest)
|
||||
{
|
||||
QuestObjective obj = player.Quest.FindObjective(this.m_Objective);
|
||||
|
||||
if (obj != null && !obj.Completed)
|
||||
obj.Complete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
89
Scripts/Services/Quests/Regions/QuestNoEntryRegion.cs
Normal file
89
Scripts/Services/Quests/Regions/QuestNoEntryRegion.cs
Normal file
@@ -0,0 +1,89 @@
|
||||
using System;
|
||||
using System.Xml;
|
||||
using Server.Mobiles;
|
||||
using Server.Regions;
|
||||
|
||||
namespace Server.Engines.Quests
|
||||
{
|
||||
public class QuestNoEntryRegion : BaseRegion
|
||||
{
|
||||
private readonly Type m_Quest;
|
||||
private readonly Type m_MinObjective;
|
||||
private readonly Type m_MaxObjective;
|
||||
private readonly int m_Message;
|
||||
public QuestNoEntryRegion(XmlElement xml, Map map, Region parent)
|
||||
: base(xml, map, parent)
|
||||
{
|
||||
XmlElement questEl = xml["quest"];
|
||||
|
||||
ReadType(questEl, "type", ref this.m_Quest);
|
||||
ReadType(questEl, "min", ref this.m_MinObjective, false);
|
||||
ReadType(questEl, "max", ref this.m_MaxObjective, false);
|
||||
ReadInt32(questEl, "message", ref this.m_Message, false);
|
||||
}
|
||||
|
||||
public Type Quest
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Quest;
|
||||
}
|
||||
}
|
||||
public Type MinObjective
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_MinObjective;
|
||||
}
|
||||
}
|
||||
public Type MaxObjective
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_MaxObjective;
|
||||
}
|
||||
}
|
||||
public int Message
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Message;
|
||||
}
|
||||
}
|
||||
public override bool OnMoveInto(Mobile m, Direction d, Point3D newLocation, Point3D oldLocation)
|
||||
{
|
||||
if (!base.OnMoveInto(m, d, newLocation, oldLocation))
|
||||
return false;
|
||||
|
||||
if (m.IsStaff())
|
||||
return true;
|
||||
|
||||
if (m is BaseCreature)
|
||||
{
|
||||
BaseCreature bc = m as BaseCreature;
|
||||
|
||||
if (!bc.Controlled && !bc.Summoned)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (this.m_Quest == null)
|
||||
return true;
|
||||
|
||||
PlayerMobile player = m as PlayerMobile;
|
||||
|
||||
if (player != null && player.Quest != null && player.Quest.GetType() == this.m_Quest &&
|
||||
(this.m_MinObjective == null || player.Quest.FindObjective(this.m_MinObjective) != null) &&
|
||||
(this.m_MaxObjective == null || player.Quest.FindObjective(this.m_MaxObjective) == null))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.m_Message != 0)
|
||||
m.SendLocalizedMessage(this.m_Message);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
47
Scripts/Services/Quests/Regions/QuestOfferRegion.cs
Normal file
47
Scripts/Services/Quests/Regions/QuestOfferRegion.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Xml;
|
||||
using Server.Mobiles;
|
||||
using Server.Regions;
|
||||
|
||||
namespace Server.Engines.Quests
|
||||
{
|
||||
public class QuestOfferRegion : BaseRegion
|
||||
{
|
||||
private readonly Type m_Quest;
|
||||
public QuestOfferRegion(XmlElement xml, Map map, Region parent)
|
||||
: base(xml, map, parent)
|
||||
{
|
||||
ReadType(xml["quest"], "type", ref this.m_Quest);
|
||||
}
|
||||
|
||||
public Type Quest
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Quest ;
|
||||
}
|
||||
}
|
||||
public override void OnEnter(Mobile m)
|
||||
{
|
||||
base.OnEnter(m);
|
||||
|
||||
if (this.m_Quest == null)
|
||||
return;
|
||||
|
||||
PlayerMobile player = m as PlayerMobile;
|
||||
|
||||
if (player != null && player.Quest == null && QuestSystem.CanOfferQuest(m, this.m_Quest))
|
||||
{
|
||||
try
|
||||
{
|
||||
QuestSystem qs = (QuestSystem)Activator.CreateInstance(this.m_Quest, new object[] { player });
|
||||
qs.SendOffer();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Error creating quest {0}: {1}", this.m_Quest, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user