#W# Initial Commit: Avatars Conquest
This commit is contained in:
commit
8eae46895e
7512 changed files with 416187 additions and 0 deletions
84
Scripts/Spells/6th/Dispel.cs
Normal file
84
Scripts/Spells/6th/Dispel.cs
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
using System;
|
||||
using Server.Misc;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Spells.Sixth
|
||||
{
|
||||
public class DispelSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Dispel", "An Ort",
|
||||
218,
|
||||
9002,
|
||||
Reagent.Garlic,
|
||||
Reagent.MandrakeRoot,
|
||||
Reagent.SulfurousAsh
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Sixth; } }
|
||||
|
||||
public DispelSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget( this );
|
||||
}
|
||||
|
||||
public class InternalTarget : Target
|
||||
{
|
||||
private DispelSpell m_Owner;
|
||||
|
||||
public InternalTarget( DispelSpell owner ) : base( 12, false, TargetFlags.Harmful )
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object o )
|
||||
{
|
||||
if ( o is Mobile )
|
||||
{
|
||||
Mobile m = (Mobile)o;
|
||||
BaseCreature bc = m as BaseCreature;
|
||||
|
||||
if ( !from.CanSee( m ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 500237 ); // Target can not be seen.
|
||||
}
|
||||
else if ( bc == null || !bc.IsDispellable )
|
||||
{
|
||||
from.SendLocalizedMessage( 1005049 ); // That cannot be dispelled.
|
||||
}
|
||||
else if ( m_Owner.CheckHSequence( m ) )
|
||||
{
|
||||
SpellHelper.Turn( from, m );
|
||||
|
||||
double dispelChance = (50.0 + ((100 * (from.Skills.Magery.Value - bc.DispelDifficulty)) / (bc.DispelFocus*2))) / 100;
|
||||
|
||||
if ( dispelChance > Utility.RandomDouble() )
|
||||
{
|
||||
Effects.SendLocationParticles( EffectItem.Create( m.Location, m.Map, EffectItem.DefaultDuration ), 0x3728, 8, 20, 5042 );
|
||||
Effects.PlaySound( m, m.Map, 0x201 );
|
||||
|
||||
m.Delete();
|
||||
}
|
||||
else
|
||||
{
|
||||
m.FixedEffect( 0x3779, 10, 20 );
|
||||
from.SendLocalizedMessage( 1010084 ); // The creature resisted the attempt to dispel it!
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish( Mobile from )
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
88
Scripts/Spells/6th/EnergyBolt.cs
Normal file
88
Scripts/Spells/6th/EnergyBolt.cs
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Spells.Sixth
|
||||
{
|
||||
public class EnergyBoltSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Energy Bolt", "Corp Por",
|
||||
230,
|
||||
9022,
|
||||
Reagent.BlackPearl,
|
||||
Reagent.Nightshade
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Sixth; } }
|
||||
|
||||
public EnergyBoltSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget( this );
|
||||
}
|
||||
|
||||
public override bool DelayedDamage{ get{ return true; } }
|
||||
|
||||
public void Target( Mobile m )
|
||||
{
|
||||
if ( !Caster.CanSee( m ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
|
||||
}
|
||||
else if ( CheckHSequence( m ) )
|
||||
{
|
||||
Mobile source = Caster;
|
||||
|
||||
SpellHelper.Turn( Caster, m );
|
||||
|
||||
SpellHelper.CheckReflect( (int)this.Circle, ref source, ref m );
|
||||
|
||||
double damage = Utility.Random( 24, 18 );
|
||||
|
||||
if ( CheckResisted( m ) )
|
||||
{
|
||||
damage *= 0.75;
|
||||
|
||||
m.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
|
||||
}
|
||||
|
||||
// Scale damage based on evalint and resist
|
||||
damage *= GetDamageScalar( m );
|
||||
|
||||
// Do the effects
|
||||
source.MovingParticles( m, 0x379F, 7, 0, false, true, 3043, 4043, 0x211 );
|
||||
source.PlaySound( 0x20A );
|
||||
|
||||
// Deal the damage
|
||||
SpellHelper.Damage( this, m, damage );
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private EnergyBoltSpell m_Owner;
|
||||
|
||||
public InternalTarget( EnergyBoltSpell owner ) : base( 12, false, TargetFlags.Harmful )
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object o )
|
||||
{
|
||||
if ( o is Mobile )
|
||||
m_Owner.Target( (Mobile)o );
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish( Mobile from )
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
121
Scripts/Spells/6th/Explosion.cs
Normal file
121
Scripts/Spells/6th/Explosion.cs
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Spells.Sixth
|
||||
{
|
||||
public class ExplosionSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Explosion", "Vas Ort Flam",
|
||||
230,
|
||||
9041,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.MandrakeRoot
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Sixth; } }
|
||||
|
||||
public ExplosionSpell( Mobile caster, Item scroll )
|
||||
: base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
|
||||
public override bool DelayedDamageStacking { get { return true; } }
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget( this );
|
||||
}
|
||||
|
||||
public override bool DelayedDamage { get { return false; } }
|
||||
|
||||
public void Target( Mobile m )
|
||||
{
|
||||
if ( !Caster.CanSee( m ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
|
||||
}
|
||||
else if ( Caster.CanBeHarmful( m ) && CheckSequence() )
|
||||
{
|
||||
Mobile attacker = Caster, defender = m;
|
||||
|
||||
SpellHelper.Turn( Caster, m );
|
||||
|
||||
SpellHelper.CheckReflect( (int) this.Circle, Caster, ref m );
|
||||
|
||||
InternalTimer t = new InternalTimer( this, attacker, defender, m );
|
||||
t.Start();
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private MagerySpell m_Spell;
|
||||
private Mobile m_Target;
|
||||
private Mobile m_Attacker, m_Defender;
|
||||
|
||||
public InternalTimer( MagerySpell spell, Mobile attacker, Mobile defender, Mobile target ): base( TimeSpan.FromSeconds( 2.5 ) )
|
||||
{
|
||||
m_Spell = spell;
|
||||
m_Attacker = attacker;
|
||||
m_Defender = defender;
|
||||
m_Target = target;
|
||||
|
||||
if ( m_Spell != null )
|
||||
m_Spell.StartDelayedDamageContext( attacker, this );
|
||||
|
||||
Priority = TimerPriority.FiftyMS;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if ( m_Attacker.HarmfulCheck( m_Defender ) )
|
||||
{
|
||||
double damage = Utility.Random( 23, 22 );
|
||||
|
||||
if ( m_Spell.CheckResisted( m_Target ) )
|
||||
{
|
||||
damage *= 0.75;
|
||||
|
||||
m_Target.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
|
||||
}
|
||||
|
||||
damage *= m_Spell.GetDamageScalar( m_Target );
|
||||
|
||||
m_Target.FixedParticles( 0x36BD, 20, 10, 5044, EffectLayer.Head );
|
||||
m_Target.PlaySound( 0x307 );
|
||||
|
||||
SpellHelper.Damage( m_Spell, m_Target, damage );
|
||||
|
||||
if ( m_Spell != null )
|
||||
m_Spell.RemoveDelayedDamageContext( m_Attacker );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private ExplosionSpell m_Owner;
|
||||
|
||||
public InternalTarget( ExplosionSpell owner )
|
||||
: base( 12, false, TargetFlags.Harmful )
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object o )
|
||||
{
|
||||
if ( o is Mobile )
|
||||
m_Owner.Target( (Mobile) o );
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish( Mobile from )
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
125
Scripts/Spells/6th/Invisibility.cs
Normal file
125
Scripts/Spells/6th/Invisibility.cs
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Targeting;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Spells.Sixth
|
||||
{
|
||||
public class InvisibilitySpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Invisibility", "An Lor Xen",
|
||||
206,
|
||||
9002,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.Nightshade
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Sixth; } }
|
||||
|
||||
public InvisibilitySpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget( this );
|
||||
}
|
||||
|
||||
public void Target( Mobile m )
|
||||
{
|
||||
if ( !Caster.CanSee( m ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
|
||||
}
|
||||
else if ( m is Mobiles.BaseVendor || m is Mobiles.PlayerVendor || m is Mobiles.PlayerBarkeeper || m.AccessLevel > Caster.AccessLevel )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 501857 ); // This spell won't work on that!
|
||||
}
|
||||
else if ( CheckBSequence( m ) )
|
||||
{
|
||||
SpellHelper.Turn( Caster, m );
|
||||
|
||||
Effects.SendLocationParticles( EffectItem.Create( new Point3D( m.X, m.Y, m.Z + 16 ), Caster.Map, EffectItem.DefaultDuration ), 0x376A, 10, 15, 5045 );
|
||||
m.PlaySound( 0x3C4 );
|
||||
|
||||
m.Hidden = true;
|
||||
m.Combatant = null;
|
||||
m.Warmode = false;
|
||||
|
||||
RemoveTimer( m );
|
||||
|
||||
Caster.CheckSkill( SkillName.Concentration, 0.0, 100.0 ); // PASSIVE CHECK
|
||||
|
||||
TimeSpan duration = TimeSpan.FromSeconds( (( 1.2 * Caster.Skills.Magery.Fixed) / 10 ) + (Caster.Skills[SkillName.Concentration].Value/5) );
|
||||
|
||||
Timer t = new InternalTimer( m, duration );
|
||||
|
||||
m_Table[m] = t;
|
||||
|
||||
t.Start();
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private static Hashtable m_Table = new Hashtable();
|
||||
|
||||
public static bool HasTimer( Mobile m )
|
||||
{
|
||||
return m_Table[m] != null;
|
||||
}
|
||||
|
||||
public static void RemoveTimer( Mobile m )
|
||||
{
|
||||
Timer t = (Timer)m_Table[m];
|
||||
|
||||
if ( t != null )
|
||||
{
|
||||
t.Stop();
|
||||
m_Table.Remove( m );
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_Mobile;
|
||||
|
||||
public InternalTimer( Mobile m, TimeSpan duration ) : base( duration )
|
||||
{
|
||||
Priority = TimerPriority.OneSecond;
|
||||
m_Mobile = m;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_Mobile.RevealingAction();
|
||||
RemoveTimer( m_Mobile );
|
||||
}
|
||||
}
|
||||
|
||||
public class InternalTarget : Target
|
||||
{
|
||||
private InvisibilitySpell m_Owner;
|
||||
|
||||
public InternalTarget( InvisibilitySpell owner ) : base( 12, false, TargetFlags.Beneficial )
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object o )
|
||||
{
|
||||
if ( o is Mobile )
|
||||
{
|
||||
m_Owner.Target( (Mobile)o );
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish( Mobile from )
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
99
Scripts/Spells/6th/Mark.cs
Normal file
99
Scripts/Spells/6th/Mark.cs
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Regions;
|
||||
|
||||
namespace Server.Spells.Sixth
|
||||
{
|
||||
public class MarkSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Mark", "Kal Por Ylem",
|
||||
218,
|
||||
9002,
|
||||
Reagent.BlackPearl,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.MandrakeRoot
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Sixth; } }
|
||||
|
||||
public MarkSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget( this );
|
||||
}
|
||||
|
||||
public override bool CheckCast()
|
||||
{
|
||||
if ( Server.Engines.Harvest.Fishing.IsOnBoat( Caster ) )
|
||||
{
|
||||
Caster.SendMessage( "The waves of the sea are distracting you from casting this spell!" );
|
||||
Caster.FixedEffect( 0x3735, 6, 30 );
|
||||
Caster.PlaySound( 0x5C );
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( !base.CheckCast() )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Target( MagicRune rune )
|
||||
{
|
||||
if ( !Caster.CanSee( rune ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
|
||||
}
|
||||
else if ( SpellHelper.CheckMulti( Caster.Location, Caster.Map, true ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
|
||||
}
|
||||
else if ( !rune.IsChildOf( Caster.Backpack ) )
|
||||
{
|
||||
Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1062422 ); // You must have this rune in your backpack in order to mark it.
|
||||
}
|
||||
else if ( CheckSequence() )
|
||||
{
|
||||
rune.Mark( Caster );
|
||||
|
||||
Caster.PlaySound( 0x1FA );
|
||||
Effects.SendLocationEffect( Caster, Caster.Map, 14201, 16 );
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private MarkSpell m_Owner;
|
||||
|
||||
public InternalTarget( MarkSpell owner ) : base( 12, false, TargetFlags.None )
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object o )
|
||||
{
|
||||
if ( o is MagicRune )
|
||||
{
|
||||
m_Owner.Target( (MagicRune) o );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.Send( new MessageLocalized( from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 501797, from.Name, "" ) ); // I cannot mark that object.
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish( Mobile from )
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
108
Scripts/Spells/6th/MassCurse.cs
Normal file
108
Scripts/Spells/6th/MassCurse.cs
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server.Misc;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Spells.Sixth
|
||||
{
|
||||
public class MassCurseSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Mass Curse", "Vas Des Sanct",
|
||||
218,
|
||||
9031,
|
||||
false,
|
||||
Reagent.Garlic,
|
||||
Reagent.Nightshade,
|
||||
Reagent.MandrakeRoot,
|
||||
Reagent.SulfurousAsh
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Sixth; } }
|
||||
|
||||
public MassCurseSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget( this );
|
||||
}
|
||||
|
||||
public void Target( IPoint3D p )
|
||||
{
|
||||
if ( !Caster.CanSee( p ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
|
||||
}
|
||||
else if ( SpellHelper.CheckTown( p, Caster ) && CheckSequence() )
|
||||
{
|
||||
SpellHelper.Turn( Caster, p );
|
||||
|
||||
SpellHelper.GetSurfaceTop( ref p );
|
||||
|
||||
List<Mobile> targets = new List<Mobile>();
|
||||
|
||||
Map map = Caster.Map;
|
||||
|
||||
if ( map != null )
|
||||
{
|
||||
Caster.CheckSkill( SkillName.Concentration, 0.0, 100.0 ); // PASSIVE CHECK
|
||||
|
||||
IPooledEnumerable eable = map.GetMobilesInRange( new Point3D( p ), (2+(int)(Caster.Skills[SkillName.Concentration].Value/20)) );
|
||||
|
||||
foreach ( Mobile m in eable )
|
||||
{
|
||||
if ( SpellHelper.ValidIndirectTarget( Caster, m ) && Caster.CanSee( m ) && Caster.CanBeHarmful( m, false ) )
|
||||
targets.Add( m );
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
}
|
||||
|
||||
for ( int i = 0; i < targets.Count; ++i )
|
||||
{
|
||||
Mobile m = targets[i];
|
||||
|
||||
Caster.DoHarmful( m );
|
||||
|
||||
SpellHelper.AddStatCurse( Caster, m, StatType.Str ); SpellHelper.DisableSkillCheck = true;
|
||||
SpellHelper.AddStatCurse( Caster, m, StatType.Dex );
|
||||
SpellHelper.AddStatCurse( Caster, m, StatType.Int ); SpellHelper.DisableSkillCheck = false;
|
||||
|
||||
m.FixedParticles( 0x374A, 10, 15, 5028, EffectLayer.Waist );
|
||||
m.PlaySound( 0x1FB );
|
||||
|
||||
HarmfulSpell( m );
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private MassCurseSpell m_Owner;
|
||||
|
||||
public InternalTarget( MassCurseSpell owner ) : base( 12, true, TargetFlags.None )
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object o )
|
||||
{
|
||||
IPoint3D p = o as IPoint3D;
|
||||
|
||||
if ( p != null )
|
||||
m_Owner.Target( p );
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish( Mobile from )
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
224
Scripts/Spells/6th/ParalyzeField.cs
Normal file
224
Scripts/Spells/6th/ParalyzeField.cs
Normal file
|
|
@ -0,0 +1,224 @@
|
|||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
using Server.Misc;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Spells.Sixth
|
||||
{
|
||||
public class ParalyzeFieldSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Paralyze Field", "In Ex Grav",
|
||||
230,
|
||||
9012,
|
||||
false,
|
||||
Reagent.BlackPearl,
|
||||
Reagent.Ginseng,
|
||||
Reagent.SpidersSilk
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Sixth; } }
|
||||
|
||||
public ParalyzeFieldSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget( this );
|
||||
}
|
||||
|
||||
public void Target( IPoint3D p )
|
||||
{
|
||||
if ( !Caster.CanSee( p ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
|
||||
}
|
||||
else if ( SpellHelper.CheckTown( p, Caster ) && CheckSequence() )
|
||||
{
|
||||
SpellHelper.Turn( Caster, p );
|
||||
|
||||
SpellHelper.GetSurfaceTop( ref p );
|
||||
|
||||
int dx = Caster.Location.X - p.X;
|
||||
int dy = Caster.Location.Y - p.Y;
|
||||
int rx = (dx - dy) * 44;
|
||||
int ry = (dx + dy) * 44;
|
||||
|
||||
bool eastToWest;
|
||||
|
||||
if ( rx >= 0 && ry >= 0 )
|
||||
eastToWest = false;
|
||||
else if ( rx >= 0 )
|
||||
eastToWest = true;
|
||||
else if ( ry >= 0 )
|
||||
eastToWest = true;
|
||||
else
|
||||
eastToWest = false;
|
||||
|
||||
Effects.PlaySound( p, Caster.Map, 0x20B );
|
||||
|
||||
int itemID = eastToWest ? 0x3967 : 0x3979;
|
||||
|
||||
Caster.CheckSkill( SkillName.Concentration, 0.0, 100.0 ); // PASSIVE CHECK
|
||||
|
||||
TimeSpan duration = TimeSpan.FromSeconds( 3.0 + (Caster.Skills[SkillName.Magery].Value / 3.0) + (Caster.Skills[SkillName.Concentration].Value / 10.0) );
|
||||
|
||||
for ( int i = -2; i <= 2; ++i )
|
||||
{
|
||||
Point3D loc = new Point3D( eastToWest ? p.X + i : p.X, eastToWest ? p.Y : p.Y + i, p.Z );
|
||||
bool canFit = SpellHelper.AdjustField( ref loc, Caster.Map, 12, false );
|
||||
|
||||
if ( !canFit )
|
||||
continue;
|
||||
|
||||
Item item = new InternalItem( Caster, itemID, loc, Caster.Map, duration );
|
||||
item.ProcessDelta();
|
||||
|
||||
Effects.SendLocationParticles( EffectItem.Create( loc, Caster.Map, EffectItem.DefaultDuration ), 0x376A, 9, 10, 5048 );
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
[DispellableField]
|
||||
public class InternalItem : Item
|
||||
{
|
||||
private Timer m_Timer;
|
||||
private Mobile m_Caster;
|
||||
private DateTime m_End;
|
||||
|
||||
public override bool BlocksFit{ get{ return true; } }
|
||||
|
||||
public InternalItem( Mobile caster, int itemID, Point3D loc, Map map, TimeSpan duration ) : base( itemID )
|
||||
{
|
||||
Visible = false;
|
||||
Movable = false;
|
||||
Light = LightType.Circle300;
|
||||
|
||||
MoveToWorld( loc, map );
|
||||
|
||||
if ( caster.InLOS( this ) )
|
||||
Visible = true;
|
||||
else
|
||||
Delete();
|
||||
|
||||
if ( Deleted )
|
||||
return;
|
||||
|
||||
m_Caster = caster;
|
||||
|
||||
m_Timer = new InternalTimer( this, duration );
|
||||
m_Timer.Start();
|
||||
|
||||
m_End = DateTime.Now + duration;
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
if ( m_Timer != null )
|
||||
m_Timer.Stop();
|
||||
}
|
||||
|
||||
public InternalItem( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( m_Caster );
|
||||
writer.WriteDeltaTime( m_End );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_Caster = reader.ReadMobile();
|
||||
m_End = reader.ReadDeltaTime();
|
||||
|
||||
m_Timer = new InternalTimer( this, m_End - DateTime.Now );
|
||||
m_Timer.Start();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnMoveOver( Mobile m )
|
||||
{
|
||||
if ( Visible && m_Caster != null && SpellHelper.ValidIndirectTarget( m_Caster, m ) && m_Caster.CanBeHarmful( m, false ) )
|
||||
{
|
||||
if ( SpellHelper.CanRevealCaster( m ) )
|
||||
m_Caster.RevealingAction();
|
||||
|
||||
m_Caster.DoHarmful( m );
|
||||
|
||||
double duration = 7.0 + (m_Caster.Skills[SkillName.Magery].Value * 0.2);
|
||||
|
||||
m.Paralyze( TimeSpan.FromSeconds( duration ) );
|
||||
|
||||
m.PlaySound( 0x204 );
|
||||
m.FixedEffect( 0x376A, 10, 16 );
|
||||
|
||||
if ( m is BaseCreature )
|
||||
((BaseCreature) m).OnHarmfulSpell( m_Caster );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Item m_Item;
|
||||
|
||||
public InternalTimer( Item item, TimeSpan duration ) : base( duration )
|
||||
{
|
||||
Priority = TimerPriority.OneSecond;
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_Item.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private ParalyzeFieldSpell m_Owner;
|
||||
|
||||
public InternalTarget( ParalyzeFieldSpell owner ) : base( 12, true, TargetFlags.None )
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object o )
|
||||
{
|
||||
if ( o is IPoint3D )
|
||||
m_Owner.Target( (IPoint3D)o );
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish( Mobile from )
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
121
Scripts/Spells/6th/Reveal.cs
Normal file
121
Scripts/Spells/6th/Reveal.cs
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server.Misc;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Spells.Sixth
|
||||
{
|
||||
public class RevealSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Reveal", "Wis Quas",
|
||||
206,
|
||||
9002,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.SulfurousAsh
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Sixth; } }
|
||||
|
||||
public RevealSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget( this );
|
||||
}
|
||||
|
||||
public void Target( IPoint3D p )
|
||||
{
|
||||
if ( !Caster.CanSee( p ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
|
||||
}
|
||||
else if ( CheckSequence() )
|
||||
{
|
||||
SpellHelper.Turn( Caster, p );
|
||||
|
||||
SpellHelper.GetSurfaceTop( ref p );
|
||||
|
||||
List<Mobile> targets = new List<Mobile>();
|
||||
|
||||
Map map = Caster.Map;
|
||||
|
||||
if ( map != null )
|
||||
{
|
||||
Caster.CheckSkill( SkillName.Concentration, 0.0, 100.0 ); // PASSIVE CHECK
|
||||
IPooledEnumerable eable = map.GetMobilesInRange( new Point3D( p ), 1 + (int)(Caster.Skills[SkillName.Magery].Value / 20.0) + (int)(Caster.Skills[SkillName.Concentration].Value / 20.0) );
|
||||
|
||||
foreach ( Mobile m in eable )
|
||||
{
|
||||
if ( m.Hidden && (m.AccessLevel == AccessLevel.Player || Caster.AccessLevel > m.AccessLevel) && CheckDifficulty( Caster, m ) )
|
||||
targets.Add( m );
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
}
|
||||
|
||||
for ( int i = 0; i < targets.Count; ++i )
|
||||
{
|
||||
Mobile m = targets[i];
|
||||
|
||||
m.RevealingAction();
|
||||
|
||||
m.FixedParticles( 0x375A, 9, 20, 5049, EffectLayer.Head );
|
||||
m.PlaySound( 0x1FD );
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
// Reveal uses magery and detect hidden vs. hide and stealth
|
||||
private static bool CheckDifficulty( Mobile from, Mobile m )
|
||||
{
|
||||
// Reveal always reveals vs. invisibility spell
|
||||
if ( InvisibilitySpell.HasTimer( m ) )
|
||||
return true;
|
||||
|
||||
int magery = from.Skills[SkillName.Magery].Fixed;
|
||||
int search = from.Skills[SkillName.Searching].Fixed;
|
||||
|
||||
int hiding = m.Skills[SkillName.Hiding].Fixed;
|
||||
int stealth = m.Skills[SkillName.Stealth].Fixed;
|
||||
int divisor = hiding + stealth;
|
||||
|
||||
int chance;
|
||||
if ( divisor > 0 )
|
||||
chance = 50 * (magery + search) / divisor;
|
||||
else
|
||||
chance = 100;
|
||||
|
||||
return chance > Utility.Random( 100 );
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private RevealSpell m_Owner;
|
||||
|
||||
public InternalTarget( RevealSpell owner ) : base( 12, true, TargetFlags.None )
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object o )
|
||||
{
|
||||
IPoint3D p = o as IPoint3D;
|
||||
|
||||
if ( p != null )
|
||||
m_Owner.Target( p );
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish( Mobile from )
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue