#region Custom Skill Mod and Collectibles Skill Updates
//Updates the collectible skills that should be applied to the mobile
public virtual void UpdateCollectibleSkills(Mobile owner, int Level)
{
foreach (CustomSkillMod mod in m_SkillMods)
{
if (mod == null)
continue;
// Does this mod have a collectible set requirement?
if (mod.CollectibleRequirement >= 0)
{
// This skill mod qualifies but has not been added, add it.
if (mod.CollectibleRequirement <= Level && !mod.Applied)
{
mod.Apply(owner);
}
// This skill mod does not qualify, if it has been applied, remove it.
if (mod.CollectibleRequirement > Level && mod.Applied)
{
mod.Remove(owner);
}
}
}
}
public virtual void UpdateCollectibleResistances(int level)
{
foreach (CollectibleResistance res in m_CollectibleResistances)
{
if (res == null)
continue;
// Does this mod have a collectible set requirement?
if (res.CollectibleRequirement >= 0)
{
// This attribute mod qualifies but has not been added, add it.
if (res.CollectibleRequirement <= level && !res.Applied)
{
res.Apply(this);
}
// This skill mod does not qualify, if it has been applied, remove it.
if (res.CollectibleRequirement > level && res.Applied)
{
res.Remove(this);
}
}
}
}
public virtual void UpdateCollectibleAttributes(int level)
{
foreach (CollectibleAttribute aca in m_CollectibleAttributes)
{
if (aca == null)
continue;
// Does this mod have a collectible set requirement?
if (aca.CollectibleRequirement >= 0)
{
// This attribute mod qualifies but has not been added, add it.
if (aca.CollectibleRequirement <= level && !aca.Applied)
{
aca.Apply(this);
}
// This skill mod does not qualify, if it has been applied, remove it.
if (aca.CollectibleRequirement > level && aca.Applied)
{
aca.Remove(this);
}
}
}
}
public void ApplySkillMods(Mobile m)
{
if (m_SkillMods.Count > 0)
{
foreach (CustomSkillMod mod in m_SkillMods)
{
if (mod == null)
continue;
if (mod.CollectibleRequirement < 0)
{
mod.Apply(m);
}
}
}
}