Formats UO Content (#201)

This commit is contained in:
Kamron Batman 2020-08-27 18:30:38 -07:00 • committed by GitHub
parent 86b7b3aed1
commit ad3775c4d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3249 changed files with 431083 additions and 440981 deletions

View file

@ -5,70 +5,95 @@ using Server.Targeting;
namespace Server.Spells.Third
{
public class UnlockSpell : MagerySpell, ISpellTargetingPoint3D
{
private static readonly SpellInfo m_Info = new SpellInfo(
"Unlock Spell", "Ex Por",
215,
9001,
Reagent.Bloodmoss,
Reagent.SulfurousAsh);
public UnlockSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
public class UnlockSpell : MagerySpell, ISpellTargetingPoint3D
{
}
private static readonly SpellInfo m_Info = new SpellInfo(
"Unlock Spell",
"Ex Por",
215,
9001,
Reagent.Bloodmoss,
Reagent.SulfurousAsh
);
public override SpellCircle Circle => SpellCircle.Third;
public override void OnCast()
{
Caster.Target = new SpellTargetPoint3D(this, TargetFlags.None, Core.ML ? 10 : 12);
}
public void Target(IPoint3D p)
{
if (CheckSequence())
{
SpellHelper.Turn(Caster, p);
Effects.SendLocationParticles(EffectItem.Create(new Point3D(p), Caster.Map, EffectItem.DefaultDuration),
0x376A, 9, 32, 5024);
Effects.PlaySound(p, Caster.Map, 0x1FF);
if (p is Mobile)
Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 503101); // That did not need to be unlocked.
else if (!(p is LockableContainer cont))
Caster.SendLocalizedMessage(501666); // You can't unlock that!
else
public UnlockSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
if (BaseHouse.CheckSecured(cont))
Caster.SendLocalizedMessage(503098); // You cannot cast this on a secure item.
else if (!cont.Locked)
Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2,
503101); // That did not need to be unlocked.
else if (cont.LockLevel == 0)
Caster.SendLocalizedMessage(501666); // You can't unlock that!
else
{
int level = (int)(Caster.Skills.Magery.Value * 0.8) - 4;
if (level >= cont.RequiredSkill &&
!(cont is TreasureMapChest chest && chest.Level > 2))
{
cont.Locked = false;
if (cont.LockLevel == -255)
cont.LockLevel = cont.RequiredSkill - 10;
}
else
Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2,
503099); // My spell does not seem to have an effect on that lock.
}
}
}
FinishSequence();
public override SpellCircle Circle => SpellCircle.Third;
public void Target(IPoint3D p)
{
if (CheckSequence())
{
SpellHelper.Turn(Caster, p);
Effects.SendLocationParticles(
EffectItem.Create(new Point3D(p), Caster.Map, EffectItem.DefaultDuration),
0x376A,
9,
32,
5024
);
Effects.PlaySound(p, Caster.Map, 0x1FF);
if (p is Mobile)
{
Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 503101); // That did not need to be unlocked.
}
else if (!(p is LockableContainer cont))
{
Caster.SendLocalizedMessage(501666); // You can't unlock that!
}
else
{
if (BaseHouse.CheckSecured(cont))
{
Caster.SendLocalizedMessage(503098); // You cannot cast this on a secure item.
}
else if (!cont.Locked)
{
Caster.LocalOverheadMessage(
MessageType.Regular,
0x3B2,
503101
); // That did not need to be unlocked.
}
else if (cont.LockLevel == 0)
{
Caster.SendLocalizedMessage(501666); // You can't unlock that!
}
else
{
var level = (int)(Caster.Skills.Magery.Value * 0.8) - 4;
if (level >= cont.RequiredSkill &&
!(cont is TreasureMapChest chest && chest.Level > 2))
{
cont.Locked = false;
if (cont.LockLevel == -255)
cont.LockLevel = cont.RequiredSkill - 10;
}
else
{
Caster.LocalOverheadMessage(
MessageType.Regular,
0x3B2,
503099
); // My spell does not seem to have an effect on that lock.
}
}
}
}
FinishSequence();
}
public override void OnCast()
{
Caster.Target = new SpellTargetPoint3D(this, TargetFlags.None, Core.ML ? 10 : 12);
}
}
}
}