Overwrite

Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
Unstable Kitsune
2023-11-28 23:20:26 -05:00
parent 3cd54811de
commit b918192e4e
11608 changed files with 2644205 additions and 47 deletions

View File

@@ -0,0 +1,97 @@
using System;
using System.Collections;
using System.Xml;
using Server.Engines.Quests;
using Server.Mobiles;
namespace Server.Regions
{
public class ApprenticeRegion : BaseRegion
{
private readonly Hashtable m_Table = new Hashtable();
public ApprenticeRegion(XmlElement xml, Map map, Region parent)
: base(xml, map, parent)
{
}
public Hashtable Table
{
get
{
return this.m_Table;
}
}
public override void OnEnter(Mobile m)
{
base.OnEnter(m);
if (m is PlayerMobile)
{
PlayerMobile player = (PlayerMobile)m;
for (int i = 0; i < player.Quests.Count; i ++)
{
BaseQuest quest = player.Quests[i];
for (int j = 0; j < quest.Objectives.Count; j ++)
{
BaseObjective objective = quest.Objectives[j];
if (objective is ApprenticeObjective && !objective.Completed)
{
ApprenticeObjective apprentice = (ApprenticeObjective)objective;
if (this.IsPartOf(apprentice.Region))
{
if (apprentice.Enter is int)
player.SendLocalizedMessage((int)apprentice.Enter);
else if (apprentice.Enter is string)
player.SendMessage((string)apprentice.Enter);
BuffInfo info = new BuffInfo(BuffIcon.ArcaneEmpowerment, 1078511, 1078512, apprentice.Skill.ToString()); // Accelerated Skillgain Skill: ~1_val~
BuffInfo.AddBuff(m, info);
this.m_Table[m] = info;
}
}
}
}
}
}
public override void OnExit(Mobile m)
{
base.OnExit(m);
if (m is PlayerMobile)
{
PlayerMobile player = (PlayerMobile)m;
for (int i = 0; i < player.Quests.Count; i ++)
{
BaseQuest quest = player.Quests[i];
for (int j = 0; j < quest.Objectives.Count; j ++)
{
BaseObjective objective = quest.Objectives[j];
if (objective is ApprenticeObjective && !objective.Completed)
{
ApprenticeObjective apprentice = (ApprenticeObjective)objective;
if (this.IsPartOf(apprentice.Region))
{
if (apprentice.Leave is int)
player.SendLocalizedMessage((int)apprentice.Leave);
else if (apprentice.Leave is string)
player.SendMessage((string)apprentice.Leave);
if (this.m_Table[m] is BuffInfo)
BuffInfo.RemoveBuff(m, (BuffInfo)this.m_Table[m]);
}
}
}
}
}
}
}
}