Logging of staff crafting items, Fixes for the OSI client changes The potion stacking stuff BaseWeapon fix, so that damage increase things don't multiply themselves. admin gump fixes for Firewall Various display tweaks for weight SoS no longer spawn in Tokuno Hiryu hues happified to OSI standards staff now see alliance chat correctly Play barkeeper text increased per OSI Various other OSI skill requirement changes Various unimplemented features of the SE moves EventSink for when the client version is received from client. Client validation moved out of the core. Client version validation now has options to ignore/kick/warn/annoy. Automagically tries to detect current client. Reverted the delayeddamagecontext back to OSI standards. Can no longer use bags of sending in jail. MagerySpell implemented. Now only Magery spells have a circle, and various other properties of 'em. TransformationSpellHelper now implemented. Things moved around for this. Spells now need a Timespan for the cast delay, instead of arbitrarily based on Circle. Circle doesn't make sense for non-Magery spells! Alot of the spellweaving spells added to OSI standards.
89 lines
No EOL
2.5 KiB
C#
89 lines
No EOL
2.5 KiB
C#
using System;
|
|
using Server.Targeting;
|
|
using Server.Network;
|
|
using Server.Items;
|
|
|
|
namespace Server.Spells.Third
|
|
{
|
|
public class UnlockSpell : MagerySpell
|
|
{
|
|
private static SpellInfo m_Info = new SpellInfo(
|
|
"Unlock Spell", "Ex Por",
|
|
215,
|
|
9001,
|
|
Reagent.Bloodmoss,
|
|
Reagent.SulfurousAsh
|
|
);
|
|
|
|
public override SpellCircle Circle { get { return SpellCircle.Third; } }
|
|
|
|
public UnlockSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
|
{
|
|
}
|
|
|
|
public override void OnCast()
|
|
{
|
|
Caster.Target = new InternalTarget( this );
|
|
}
|
|
|
|
private class InternalTarget : Target
|
|
{
|
|
private UnlockSpell m_Owner;
|
|
|
|
public InternalTarget( UnlockSpell owner ) : base( 12, false, TargetFlags.None )
|
|
{
|
|
m_Owner = owner;
|
|
}
|
|
|
|
protected override void OnTarget( Mobile from, object o )
|
|
{
|
|
IPoint3D loc = o as IPoint3D;
|
|
|
|
if ( loc == null )
|
|
return;
|
|
|
|
if ( m_Owner.CheckSequence() ) {
|
|
SpellHelper.Turn( from, o );
|
|
|
|
Effects.SendLocationParticles( EffectItem.Create( new Point3D( loc ), from.Map, EffectItem.DefaultDuration ), 0x376A, 9, 32, 5024 );
|
|
|
|
Effects.PlaySound( loc, from.Map, 0x1FF );
|
|
|
|
if ( o is Mobile )
|
|
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503101 ); // That did not need to be unlocked.
|
|
else if ( !( o is LockableContainer ) )
|
|
from.SendLocalizedMessage( 501666 ); // You can't unlock that!
|
|
else {
|
|
LockableContainer cont = (LockableContainer)o;
|
|
|
|
if ( Multis.BaseHouse.CheckSecured( cont ) )
|
|
from.SendLocalizedMessage( 503098 ); // You cannot cast this on a secure item.
|
|
else if ( !cont.Locked )
|
|
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503101 ); // That did not need to be unlocked.
|
|
else if ( cont.LockLevel == 0 )
|
|
from.SendLocalizedMessage( 501666 ); // You can't unlock that!
|
|
else {
|
|
int level = (int)(from.Skills[SkillName.Magery].Value * 0.8) - 4;
|
|
|
|
if ( level >= cont.RequiredSkill && !(cont is TreasureMapChest && ((TreasureMapChest)cont).Level > 2) ) {
|
|
cont.Locked = false;
|
|
|
|
if ( cont.LockLevel == -255 )
|
|
cont.LockLevel = cont.RequiredSkill - 10;
|
|
}
|
|
else
|
|
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503099 ); // My spell does not seem to have an effect on that lock.
|
|
}
|
|
}
|
|
}
|
|
|
|
m_Owner.FinishSequence();
|
|
}
|
|
|
|
protected override void OnTargetFinish( Mobile from )
|
|
{
|
|
m_Owner.FinishSequence();
|
|
}
|
|
}
|
|
}
|
|
} |