ModernUO/Scripts/Spells/Third/Telekinesis.cs
asayre 2ad37d54aa Lots of fixes, changes, rewrites of various things, including but not limited to:
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.
2007-05-26 03:12:41 +00:00

110 lines
No EOL
2.4 KiB
C#

using System;
using Server.Targeting;
using Server.Network;
using Server.Regions;
using Server.Items;
namespace Server.Spells.Third
{
public class TelekinesisSpell : MagerySpell
{
private static SpellInfo m_Info = new SpellInfo(
"Telekinesis", "Ort Por Ylem",
203,
9031,
Reagent.Bloodmoss,
Reagent.MandrakeRoot
);
public override SpellCircle Circle { get { return SpellCircle.Third; } }
public TelekinesisSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override void OnCast()
{
Caster.Target = new InternalTarget( this );
}
public void Target( ITelekinesisable obj )
{
if ( CheckSequence() )
{
SpellHelper.Turn( Caster, obj );
obj.OnTelekinesis( Caster );
}
FinishSequence();
}
public void Target( Container item )
{
if ( CheckSequence() )
{
SpellHelper.Turn( Caster, item );
object root = item.RootParent;
if ( !item.IsAccessibleTo( Caster ) )
{
item.OnDoubleClickNotAccessible( Caster );
}
else if ( !item.CheckItemUse( Caster, item ) )
{
}
else if ( root != null && root is Mobile && root != Caster )
{
item.OnSnoop( Caster );
}
else if ( item is Corpse && !((Corpse)item).CheckLoot( Caster ) )
{
}
else if ( Caster.Region.OnDoubleClick( Caster, item ) )
{
Effects.SendLocationParticles( EffectItem.Create( item.Location, item.Map, EffectItem.DefaultDuration ), 0x376A, 9, 32, 5022 );
Effects.PlaySound( item.Location, item.Map, 0x1F5 );
item.DisplayTo( Caster );
item.OnItemUsed( Caster, item );
}
}
FinishSequence();
}
public class InternalTarget : Target
{
private TelekinesisSpell m_Owner;
public InternalTarget( TelekinesisSpell owner ) : base( 12, false, TargetFlags.None )
{
m_Owner = owner;
}
protected override void OnTarget( Mobile from, object o )
{
if ( o is ITelekinesisable )
m_Owner.Target( (ITelekinesisable)o );
else if ( o is Container )
m_Owner.Target( (Container)o );
else
from.SendLocalizedMessage( 501857 ); // This spell won't work on that!
}
protected override void OnTargetFinish( Mobile from )
{
m_Owner.FinishSequence();
}
}
}
}
namespace Server
{
public interface ITelekinesisable : IPoint3D
{
void OnTelekinesis( Mobile from );
}
}