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.
This commit is contained in:
parent
f12e9745c6
commit
2ad37d54aa
214 changed files with 4881 additions and 1243 deletions
|
|
@ -7,7 +7,7 @@ using Server.Spells.Seventh;
|
|||
|
||||
namespace Server.Spells.Necromancy
|
||||
{
|
||||
public abstract class TransformationSpell : NecromancerSpell
|
||||
public abstract class TransformationSpell : NecromancerSpell, ITransformationSpell
|
||||
{
|
||||
public abstract int Body{ get; }
|
||||
public virtual int Hue{ get{ return 0; } }
|
||||
|
|
@ -26,116 +26,15 @@ namespace Server.Spells.Necromancy
|
|||
|
||||
public override bool CheckCast()
|
||||
{
|
||||
/*if ( Caster.Mounted )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1042561 ); // Please dismount first.
|
||||
if( !TransformationSpellHelper.CheckCast( Caster, this ) )
|
||||
return false;
|
||||
}
|
||||
else */
|
||||
if ( Factions.Sigil.ExistsOn( Caster ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
|
||||
return false;
|
||||
}
|
||||
else if ( !Caster.CanBeginAction( typeof( PolymorphSpell ) ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1061628 ); // You can't do that while polymorphed.
|
||||
return false;
|
||||
}
|
||||
else if ( Spells.Ninjitsu.AnimalForm.UnderTransformation( Caster ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1061091 ); // You cannot cast that spell in this form.
|
||||
return false;
|
||||
}
|
||||
|
||||
return base.CheckCast();
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
Mobile caster = this.Caster;
|
||||
|
||||
/*if ( caster.Mounted )
|
||||
{
|
||||
caster.SendLocalizedMessage( 1042561 ); // Please dismount first.
|
||||
}
|
||||
else */
|
||||
if ( Factions.Sigil.ExistsOn( Caster ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
|
||||
}
|
||||
else if ( !caster.CanBeginAction( typeof( PolymorphSpell ) ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1061628 ); // You can't do that while polymorphed.
|
||||
}
|
||||
else if ( Spells.Ninjitsu.AnimalForm.UnderTransformation( Caster ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1061091 ); // You cannot cast that spell in this form.
|
||||
}
|
||||
else if ( !caster.CanBeginAction( typeof( IncognitoSpell ) ) || (caster.IsBodyMod && GetContext( caster ) == null) )
|
||||
{
|
||||
DoFizzle();
|
||||
}
|
||||
else if ( CheckSequence() )
|
||||
{
|
||||
TransformContext context = GetContext( caster );
|
||||
Type ourType = this.GetType();
|
||||
|
||||
bool wasTransformed = ( context != null );
|
||||
bool ourTransform = ( wasTransformed && context.Type == ourType );
|
||||
|
||||
if ( wasTransformed )
|
||||
{
|
||||
RemoveContext( caster, context, ourTransform );
|
||||
|
||||
if ( ourTransform )
|
||||
{
|
||||
caster.PlaySound( 0xFA );
|
||||
caster.FixedParticles( 0x3728, 1, 13, 5042, EffectLayer.Waist );
|
||||
}
|
||||
}
|
||||
|
||||
if ( !ourTransform )
|
||||
{
|
||||
List<ResistanceMod> mods = new List<ResistanceMod>();
|
||||
|
||||
if ( PhysResistOffset != 0 )
|
||||
mods.Add( new ResistanceMod( ResistanceType.Physical, PhysResistOffset ) );
|
||||
|
||||
if ( FireResistOffset != 0 )
|
||||
mods.Add( new ResistanceMod( ResistanceType.Fire, FireResistOffset ) );
|
||||
|
||||
if ( ColdResistOffset != 0 )
|
||||
mods.Add( new ResistanceMod( ResistanceType.Cold, ColdResistOffset ) );
|
||||
|
||||
if ( PoisResistOffset != 0 )
|
||||
mods.Add( new ResistanceMod( ResistanceType.Poison, PoisResistOffset ) );
|
||||
|
||||
if ( NrgyResistOffset != 0 )
|
||||
mods.Add( new ResistanceMod( ResistanceType.Energy, NrgyResistOffset ) );
|
||||
|
||||
if ( !((Body)this.Body).IsHuman )
|
||||
{
|
||||
Mobiles.IMount mt = Caster.Mount;
|
||||
|
||||
if ( mt != null )
|
||||
mt.Rider = null;
|
||||
}
|
||||
|
||||
caster.BodyMod = this.Body;
|
||||
caster.HueMod = this.Hue;
|
||||
|
||||
for ( int i = 0; i < mods.Count; ++i )
|
||||
caster.AddResistanceMod( mods[i] );
|
||||
|
||||
PlayEffect( caster );
|
||||
|
||||
Timer timer = new TransformTimer( caster, this );
|
||||
timer.Start();
|
||||
|
||||
AddContext( caster, new TransformContext( timer, mods, ourType ) );
|
||||
}
|
||||
}
|
||||
TransformationSpellHelper.OnCast( Caster, this );
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
|
@ -146,109 +45,12 @@ namespace Server.Spells.Necromancy
|
|||
{
|
||||
}
|
||||
|
||||
public virtual void PlayEffect( Mobile m )
|
||||
public virtual void DoEffect( Mobile m )
|
||||
{
|
||||
}
|
||||
|
||||
private static Hashtable m_Table = new Hashtable();
|
||||
|
||||
public static void AddContext( Mobile m, TransformContext context )
|
||||
public virtual void RemoveEffect( Mobile m )
|
||||
{
|
||||
m_Table[m] = context;
|
||||
|
||||
if ( context.Type == typeof( HorrificBeastSpell ) )
|
||||
m.Delta( MobileDelta.WeaponDamage );
|
||||
}
|
||||
|
||||
public static void RemoveContext( Mobile m, bool resetGraphics )
|
||||
{
|
||||
TransformContext context = GetContext( m );
|
||||
|
||||
if ( context != null )
|
||||
RemoveContext( m, context, resetGraphics );
|
||||
}
|
||||
|
||||
public static void RemoveContext( Mobile m, TransformContext context, bool resetGraphics )
|
||||
{
|
||||
m_Table.Remove( m );
|
||||
|
||||
List<ResistanceMod> mods = context.Mods;
|
||||
|
||||
for ( int i = 0; i < mods.Count; ++i )
|
||||
m.RemoveResistanceMod( mods[i] );
|
||||
|
||||
if ( resetGraphics )
|
||||
{
|
||||
m.HueMod = -1;
|
||||
m.BodyMod = 0;
|
||||
}
|
||||
|
||||
context.Timer.Stop();
|
||||
|
||||
if ( context.Type == typeof( HorrificBeastSpell ) )
|
||||
m.Delta( MobileDelta.WeaponDamage );
|
||||
}
|
||||
|
||||
public static TransformContext GetContext( Mobile m )
|
||||
{
|
||||
return ( m_Table[m] as TransformContext );
|
||||
}
|
||||
|
||||
public static bool UnderTransformation( Mobile m )
|
||||
{
|
||||
return ( GetContext( m ) != null );
|
||||
}
|
||||
|
||||
public static bool UnderTransformation( Mobile m, Type type )
|
||||
{
|
||||
TransformContext context = GetContext( m );
|
||||
|
||||
return ( context != null && context.Type == type );
|
||||
}
|
||||
}
|
||||
|
||||
public class TransformContext
|
||||
{
|
||||
private Timer m_Timer;
|
||||
private List<ResistanceMod> m_Mods;
|
||||
private Type m_Type;
|
||||
|
||||
public Timer Timer{ get{ return m_Timer; } }
|
||||
public List<ResistanceMod> Mods{ get{ return m_Mods; } }
|
||||
public Type Type{ get{ return m_Type; } }
|
||||
|
||||
public TransformContext( Timer timer, List<ResistanceMod> mods, Type type )
|
||||
{
|
||||
m_Timer = timer;
|
||||
m_Mods = mods;
|
||||
m_Type = type;
|
||||
}
|
||||
}
|
||||
|
||||
public class TransformTimer : Timer
|
||||
{
|
||||
private Mobile m_Mobile;
|
||||
private TransformationSpell m_Spell;
|
||||
|
||||
public TransformTimer( Mobile from, TransformationSpell spell ) : base( TimeSpan.FromSeconds( spell.TickRate ), TimeSpan.FromSeconds( spell.TickRate ) )
|
||||
{
|
||||
m_Mobile = from;
|
||||
m_Spell = spell;
|
||||
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if ( m_Mobile.Deleted || !m_Mobile.Alive || m_Mobile.Body != m_Spell.Body || m_Mobile.Hue != m_Spell.Hue )
|
||||
{
|
||||
TransformationSpell.RemoveContext( m_Mobile, true );
|
||||
Stop();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Spell.OnTick( m_Mobile );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue