#W# Initial Commit: Avatars Conquest
This commit is contained in:
commit
5df497787a
7510 changed files with 416048 additions and 0 deletions
102
Scripts/Spells/5th/BladeSpirits.cs
Normal file
102
Scripts/Spells/5th/BladeSpirits.cs
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
using System;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Spells.Fifth
|
||||
{
|
||||
public class BladeSpiritsSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Blade Spirits", "In Jux Hur Ylem",
|
||||
266,
|
||||
9040,
|
||||
false,
|
||||
Reagent.BlackPearl,
|
||||
Reagent.MandrakeRoot,
|
||||
Reagent.Nightshade
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Fifth; } }
|
||||
|
||||
public BladeSpiritsSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
|
||||
public override TimeSpan GetCastDelay()
|
||||
{
|
||||
return base.GetCastDelay() + TimeSpan.FromSeconds( 6.0 );
|
||||
}
|
||||
|
||||
public override bool CheckCast()
|
||||
{
|
||||
if ( !base.CheckCast() )
|
||||
return false;
|
||||
|
||||
if( (Caster.Followers + 1) > Caster.FollowersMax )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1049645 ); // You have too many followers to summon that creature.
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget( this );
|
||||
}
|
||||
|
||||
public void Target( IPoint3D p )
|
||||
{
|
||||
Map map = Caster.Map;
|
||||
|
||||
SpellHelper.GetSurfaceTop( ref p );
|
||||
|
||||
if ( map == null || !map.CanSpawnMobile( p.X, p.Y, p.Z ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
|
||||
}
|
||||
else if ( SpellHelper.CheckTown( p, Caster ) && CheckSequence() )
|
||||
{
|
||||
Caster.CheckSkill( SkillName.Concentration, 0.0, 100.0 );
|
||||
|
||||
TimeSpan duration = TimeSpan.FromSeconds( Utility.Random( 80, 40 ) + (Caster.Skills.Concentration.Value / 5) );
|
||||
|
||||
BaseCreature.Summon( new BladeSpirits(), false, Caster, new Point3D( p ), 0x212, duration );
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private BladeSpiritsSpell m_Owner;
|
||||
|
||||
public InternalTarget( BladeSpiritsSpell 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 OnTargetOutOfLOS( Mobile from, object o )
|
||||
{
|
||||
from.SendLocalizedMessage( 501943 ); // Target cannot be seen. Try again.
|
||||
from.Target = new InternalTarget( m_Owner );
|
||||
from.Target.BeginTimeout( from, TimeoutTime - DateTime.Now );
|
||||
m_Owner = null;
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish( Mobile from )
|
||||
{
|
||||
if ( m_Owner != null )
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
88
Scripts/Spells/5th/DispelField.cs
Normal file
88
Scripts/Spells/5th/DispelField.cs
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
using Server.Misc;
|
||||
|
||||
namespace Server.Spells.Fifth
|
||||
{
|
||||
public class DispelFieldSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Dispel Field", "An Grav",
|
||||
206,
|
||||
9002,
|
||||
Reagent.BlackPearl,
|
||||
Reagent.SpidersSilk,
|
||||
Reagent.SulfurousAsh,
|
||||
Reagent.Garlic
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Fifth; } }
|
||||
|
||||
public DispelFieldSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget( this );
|
||||
}
|
||||
|
||||
public void Target( Item item )
|
||||
{
|
||||
Type t = item.GetType();
|
||||
|
||||
if ( !Caster.CanSee( item ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
|
||||
}
|
||||
else if ( !t.IsDefined( typeof( DispellableFieldAttribute ), false ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1005049 ); // That cannot be dispelled.
|
||||
}
|
||||
else if ( item is Magicgate && !((Magicgate)item).Dispellable )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1005047 ); // That magic is too chaotic
|
||||
}
|
||||
else if ( CheckSequence() )
|
||||
{
|
||||
SpellHelper.Turn( Caster, item );
|
||||
|
||||
Effects.SendLocationParticles( EffectItem.Create( item.Location, item.Map, EffectItem.DefaultDuration ), 0x376A, 9, 20, 5042 );
|
||||
Effects.PlaySound( item.GetWorldLocation(), item.Map, 0x201 );
|
||||
|
||||
item.Delete();
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private DispelFieldSpell m_Owner;
|
||||
|
||||
public InternalTarget( DispelFieldSpell owner ) : base( 12, false, TargetFlags.None )
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object o )
|
||||
{
|
||||
if ( o is Item )
|
||||
{
|
||||
m_Owner.Target( (Item)o );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Owner.Caster.SendLocalizedMessage( 1005049 ); // That cannot be dispelled.
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish( Mobile from )
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
176
Scripts/Spells/5th/Incognito.cs
Normal file
176
Scripts/Spells/5th/Incognito.cs
Normal file
|
|
@ -0,0 +1,176 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Misc;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
using Server.Spells;
|
||||
using Server.Spells.Seventh;
|
||||
|
||||
namespace Server.Spells.Fifth
|
||||
{
|
||||
public class IncognitoSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Incognito", "Kal In Ex",
|
||||
206,
|
||||
9002,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.Garlic,
|
||||
Reagent.Nightshade
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Fifth; } }
|
||||
|
||||
public IncognitoSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
|
||||
public override bool CheckCast()
|
||||
{
|
||||
if ( !Caster.CanBeginAction( typeof( IncognitoSpell ) ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1005559 ); // This spell is already in effect.
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if ( !Caster.CanBeginAction( typeof( IncognitoSpell ) ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1005559 ); // This spell is already in effect.
|
||||
}
|
||||
else if ( Caster.BodyMod == 183 || Caster.BodyMod == 184 )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1042402 ); // You cannot use incognito while wearing body paint
|
||||
}
|
||||
else if ( DisguiseTimers.IsDisguised( Caster ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1061631 ); // You can't do that while disguised.
|
||||
}
|
||||
else if ( !Caster.CanBeginAction( typeof( PolymorphSpell ) ) || Caster.IsBodyMod )
|
||||
{
|
||||
DoFizzle();
|
||||
}
|
||||
else if ( CheckSequence() )
|
||||
{
|
||||
if ( Caster.BeginAction( typeof( IncognitoSpell ) ) )
|
||||
{
|
||||
DisguiseTimers.StopTimer( Caster );
|
||||
|
||||
Caster.HueMod = Caster.Race.RandomSkinHue();
|
||||
Caster.NameMod = Caster.Female ? NameList.RandomName( "female" ) : NameList.RandomName( "male" );
|
||||
|
||||
PlayerMobile pm = Caster as PlayerMobile;
|
||||
|
||||
if ( pm != null && pm.Race != null )
|
||||
{
|
||||
pm.SetHairMods( pm.Race.RandomHair( pm.Female ), pm.Race.RandomFacialHair( pm.Female ) );
|
||||
pm.HairHue = pm.Race.RandomHairHue();
|
||||
pm.FacialHairHue = pm.Race.RandomHairHue();
|
||||
}
|
||||
|
||||
Caster.FixedParticles( 0x373A, 10, 15, 5036, EffectLayer.Head );
|
||||
Caster.PlaySound( 0x3BD );
|
||||
|
||||
BaseArmor.ValidateMobile( Caster );
|
||||
BaseClothing.ValidateMobile( Caster );
|
||||
|
||||
StopTimer( Caster );
|
||||
|
||||
Caster.CheckSkill( SkillName.Concentration, 0.0, 100.0 ); // PASSIVE CHECK
|
||||
|
||||
int timeVal = (int)(((6 * Caster.Skills.Magery.Fixed) / 50) + 1 + (Caster.Skills[SkillName.Concentration].Value/5) );
|
||||
|
||||
if( timeVal > 144 )
|
||||
timeVal = 144;
|
||||
|
||||
TimeSpan length = TimeSpan.FromSeconds( timeVal );
|
||||
|
||||
Timer t = new InternalTimer( Caster, length );
|
||||
|
||||
m_Timers[Caster] = t;
|
||||
|
||||
t.Start();
|
||||
}
|
||||
else
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1079022 ); // You're already incognitoed!
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private static Hashtable m_Timers = new Hashtable();
|
||||
|
||||
public static bool StopTimer( Mobile m )
|
||||
{
|
||||
Timer t = (Timer)m_Timers[m];
|
||||
|
||||
if ( t != null )
|
||||
{
|
||||
t.Stop();
|
||||
m_Timers.Remove( m );
|
||||
}
|
||||
|
||||
return ( t != null );
|
||||
}
|
||||
|
||||
private static int[] m_HairIDs = new int[]
|
||||
{
|
||||
0x2044, 0x2045, 0x2046,
|
||||
0x203C, 0x203B, 0x203D,
|
||||
0x2047, 0x2048, 0x2049,
|
||||
0x204A, 0x0000
|
||||
};
|
||||
|
||||
private static int[] m_BeardIDs = new int[]
|
||||
{
|
||||
0x203E, 0x203F, 0x2040,
|
||||
0x2041, 0x204B, 0x204C,
|
||||
0x204D, 0x0000
|
||||
};
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_Owner;
|
||||
|
||||
public InternalTimer( Mobile owner, TimeSpan length ) : base( length )
|
||||
{
|
||||
m_Owner = owner;
|
||||
|
||||
/*
|
||||
int val = ((6 * owner.Skills.Magery.Fixed) / 50) + 1;
|
||||
|
||||
if ( val > 144 )
|
||||
val = 144;
|
||||
|
||||
Delay = TimeSpan.FromSeconds( val );
|
||||
* */
|
||||
Priority = TimerPriority.OneSecond;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if ( !m_Owner.CanBeginAction( typeof( IncognitoSpell ) ) )
|
||||
{
|
||||
if ( m_Owner is PlayerMobile )
|
||||
((PlayerMobile)m_Owner).SetHairMods( -1, -1 );
|
||||
|
||||
m_Owner.BodyMod = 0;
|
||||
m_Owner.HueMod = -1;
|
||||
m_Owner.NameMod = null;
|
||||
m_Owner.EndAction( typeof( IncognitoSpell ) );
|
||||
|
||||
BaseArmor.ValidateMobile( m_Owner );
|
||||
BaseClothing.ValidateMobile( m_Owner );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
77
Scripts/Spells/5th/MagicReflect.cs
Normal file
77
Scripts/Spells/5th/MagicReflect.cs
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Spells.Fifth
|
||||
{
|
||||
public class MagicReflectSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Magic Reflection", "In Jux Sanct",
|
||||
242,
|
||||
9012,
|
||||
Reagent.Garlic,
|
||||
Reagent.MandrakeRoot,
|
||||
Reagent.SpidersSilk
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Fifth; } }
|
||||
|
||||
public MagicReflectSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
|
||||
public override bool CheckCast()
|
||||
{
|
||||
if ( Caster.MagicDamageAbsorb > 0 )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1005559 ); // This spell is already in effect.
|
||||
return false;
|
||||
}
|
||||
else if ( !Caster.CanBeginAction( typeof( DefensiveSpell ) ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1005385 ); // The spell will not adhere to you at this time.
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private static Hashtable m_Table = new Hashtable();
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if ( Caster.MagicDamageAbsorb > 0 )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1005559 ); // This spell is already in effect.
|
||||
}
|
||||
else if ( !Caster.CanBeginAction( typeof( DefensiveSpell ) ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1005385 ); // The spell will not adhere to you at this time.
|
||||
}
|
||||
else if ( CheckSequence() )
|
||||
{
|
||||
if ( Caster.BeginAction( typeof( DefensiveSpell ) ) )
|
||||
{
|
||||
Caster.CheckSkill( SkillName.Concentration, 0.0, 100.0 ); // PASSIVE CHECK
|
||||
|
||||
int value = (int)(Caster.Skills[SkillName.Magery].Value + Caster.Skills[SkillName.Concentration].Value);
|
||||
value = (int)(8 + (value/200)*7.0);//absorb from 8 to 15 "circles"
|
||||
|
||||
Caster.MagicDamageAbsorb = value;
|
||||
|
||||
Caster.FixedParticles( 0x375A, 10, 15, 5037, EffectLayer.Waist );
|
||||
Caster.PlaySound( 0x1E9 );
|
||||
}
|
||||
else
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1005385 ); // The spell will not adhere to you at this time.
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
116
Scripts/Spells/5th/MindBlast.cs
Normal file
116
Scripts/Spells/5th/MindBlast.cs
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Spells.Fifth
|
||||
{
|
||||
public class MindBlastSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Mind Blast", "Por Corp Wis",
|
||||
218,
|
||||
9032,
|
||||
Reagent.BlackPearl,
|
||||
Reagent.MandrakeRoot,
|
||||
Reagent.Nightshade,
|
||||
Reagent.SulfurousAsh
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Fifth; } }
|
||||
|
||||
public MindBlastSpell( 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 from = Caster, target = m;
|
||||
|
||||
SpellHelper.Turn( from, target );
|
||||
|
||||
SpellHelper.CheckReflect( (int)this.Circle, ref from, ref target );
|
||||
|
||||
// Algorithm: (highestStat - lowestStat) / 2 [- 50% if resisted]
|
||||
|
||||
int highestStat = target.Str, lowestStat = target.Str;
|
||||
|
||||
if ( target.Dex > highestStat )
|
||||
highestStat = target.Dex;
|
||||
|
||||
if ( target.Dex < lowestStat )
|
||||
lowestStat = target.Dex;
|
||||
|
||||
if ( target.Int > highestStat )
|
||||
highestStat = target.Int;
|
||||
|
||||
if ( target.Int < lowestStat )
|
||||
lowestStat = target.Int;
|
||||
|
||||
if ( highestStat > 150 )
|
||||
highestStat = 150;
|
||||
|
||||
if ( lowestStat > 150 )
|
||||
lowestStat = 150;
|
||||
|
||||
double damage = GetDamageScalar(m)*(highestStat - lowestStat) / 4;//less damage
|
||||
|
||||
if ( damage > 45 )
|
||||
damage = 45;
|
||||
|
||||
if ( CheckResisted( target ) )
|
||||
{
|
||||
damage /= 2;
|
||||
target.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
|
||||
}
|
||||
|
||||
from.FixedParticles( 0x374A, 10, 15, 2038, EffectLayer.Head );
|
||||
|
||||
target.FixedParticles( 0x374A, 10, 15, 5038, EffectLayer.Head );
|
||||
target.PlaySound( 0x213 );
|
||||
|
||||
SpellHelper.Damage( this, target, damage );
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
public override double GetSlayerDamageScalar( Mobile target )
|
||||
{
|
||||
return 1.0; //This spell isn't affected by slayer spellbooks
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private MindBlastSpell m_Owner;
|
||||
|
||||
public InternalTarget( MindBlastSpell 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
85
Scripts/Spells/5th/Paralyze.cs
Normal file
85
Scripts/Spells/5th/Paralyze.cs
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
using System;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Spells.Fifth
|
||||
{
|
||||
public class ParalyzeSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Paralyze", "An Ex Por",
|
||||
218,
|
||||
9012,
|
||||
Reagent.Garlic,
|
||||
Reagent.MandrakeRoot,
|
||||
Reagent.SpidersSilk
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Fifth; } }
|
||||
|
||||
public ParalyzeSpell( 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 ( CheckHSequence( m ) )
|
||||
{
|
||||
SpellHelper.Turn( Caster, m );
|
||||
|
||||
SpellHelper.CheckReflect( (int)this.Circle, Caster, ref m );
|
||||
|
||||
double duration;
|
||||
|
||||
// Algorithm: ((20% of magery) + 7) seconds [- 50% if resisted]
|
||||
|
||||
Caster.CheckSkill( SkillName.Concentration, 0.0, 100.0 ); // PASSIVE CHECK
|
||||
|
||||
duration = 7.0 + (Caster.Skills[SkillName.Magery].Value * 0.2) + (Caster.Skills[SkillName.Concentration].Value/10);
|
||||
|
||||
if ( CheckResisted( m ) )
|
||||
duration *= 0.75;
|
||||
|
||||
m.Paralyze( TimeSpan.FromSeconds( duration ) );
|
||||
|
||||
m.PlaySound( 0x204 );
|
||||
m.FixedEffect( 0x376A, 6, 1 );
|
||||
|
||||
HarmfulSpell( m );
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
public class InternalTarget : Target
|
||||
{
|
||||
private ParalyzeSpell m_Owner;
|
||||
|
||||
public InternalTarget( ParalyzeSpell 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
285
Scripts/Spells/5th/PoisonField.cs
Normal file
285
Scripts/Spells/5th/PoisonField.cs
Normal file
|
|
@ -0,0 +1,285 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Misc;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Spells.Fifth
|
||||
{
|
||||
public class PoisonFieldSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Poison Field", "In Nox Grav",
|
||||
230,
|
||||
9052,
|
||||
false,
|
||||
Reagent.BlackPearl,
|
||||
Reagent.Nightshade,
|
||||
Reagent.SpidersSilk
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Fifth; } }
|
||||
|
||||
public PoisonFieldSpell( 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 ? 0x3915 : 0x3922;
|
||||
|
||||
Caster.CheckSkill( SkillName.Concentration, 0.0, 100.0 ); // PASSIVE CHECK
|
||||
|
||||
TimeSpan duration = TimeSpan.FromSeconds( 3 + (Caster.Skills.Magery.Fixed / 25) + (Caster.Skills[SkillName.Concentration].Value/10) );
|
||||
|
||||
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 );
|
||||
|
||||
new InternalItem( itemID, loc, Caster, Caster.Map, duration, i );
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
[DispellableField]
|
||||
public class InternalItem : Item
|
||||
{
|
||||
private Timer m_Timer;
|
||||
private DateTime m_End;
|
||||
private Mobile m_Caster;
|
||||
|
||||
public override bool BlocksFit{ get{ return true; } }
|
||||
|
||||
public InternalItem( int itemID, Point3D loc, Mobile caster, Map map, TimeSpan duration, int val ) : base( itemID )
|
||||
{
|
||||
bool canFit = SpellHelper.AdjustField( ref loc, map, 12, false );
|
||||
|
||||
Visible = false;
|
||||
Movable = false;
|
||||
Light = LightType.Circle300;
|
||||
|
||||
MoveToWorld( loc, map );
|
||||
|
||||
m_Caster = caster;
|
||||
|
||||
m_End = DateTime.Now + duration;
|
||||
|
||||
m_Timer = new InternalTimer( this, TimeSpan.FromSeconds( Math.Abs( val ) * 0.2 ), caster.InLOS( this ), canFit );
|
||||
m_Timer.Start();
|
||||
}
|
||||
|
||||
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) 1 ); // 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 1:
|
||||
{
|
||||
m_Caster = reader.ReadMobile();
|
||||
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_End = reader.ReadDeltaTime();
|
||||
|
||||
m_Timer = new InternalTimer( this, TimeSpan.Zero, true, true );
|
||||
m_Timer.Start();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ApplyPoisonTo( Mobile m )
|
||||
{
|
||||
if ( m_Caster == null )
|
||||
return;
|
||||
|
||||
Poison p = Poison.Regular;
|
||||
|
||||
if ( m.ApplyPoison( m_Caster, p ) == ApplyPoisonResult.Poisoned )
|
||||
if ( SpellHelper.CanRevealCaster( m ) )
|
||||
m_Caster.RevealingAction();
|
||||
|
||||
if ( m is BaseCreature )
|
||||
( (BaseCreature) m ).OnHarmfulSpell( m_Caster );
|
||||
}
|
||||
|
||||
public override bool OnMoveOver( Mobile m )
|
||||
{
|
||||
if ( Visible && m_Caster != null && SpellHelper.ValidIndirectTarget( m_Caster, m ) && m_Caster.CanBeHarmful( m, false ) )
|
||||
{
|
||||
m_Caster.DoHarmful( m );
|
||||
|
||||
ApplyPoisonTo( m );
|
||||
m.PlaySound( 0x474 );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private InternalItem m_Item;
|
||||
private bool m_InLOS, m_CanFit;
|
||||
|
||||
private static Queue m_Queue = new Queue();
|
||||
|
||||
public InternalTimer( InternalItem item, TimeSpan delay, bool inLOS, bool canFit ) : base( delay, TimeSpan.FromSeconds( 1.5 ) )
|
||||
{
|
||||
m_Item = item;
|
||||
m_InLOS = inLOS;
|
||||
m_CanFit = canFit;
|
||||
|
||||
Priority = TimerPriority.FiftyMS;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if ( m_Item.Deleted )
|
||||
return;
|
||||
|
||||
if ( !m_Item.Visible )
|
||||
{
|
||||
if ( m_InLOS && m_CanFit )
|
||||
m_Item.Visible = true;
|
||||
else
|
||||
m_Item.Delete();
|
||||
|
||||
if ( !m_Item.Deleted )
|
||||
{
|
||||
m_Item.ProcessDelta();
|
||||
Effects.SendLocationParticles( EffectItem.Create( m_Item.Location, m_Item.Map, EffectItem.DefaultDuration ), 0x376A, 9, 10, 5040 );
|
||||
}
|
||||
}
|
||||
else if ( DateTime.Now > m_Item.m_End )
|
||||
{
|
||||
m_Item.Delete();
|
||||
Stop();
|
||||
}
|
||||
else
|
||||
{
|
||||
Map map = m_Item.Map;
|
||||
Mobile caster = m_Item.m_Caster;
|
||||
|
||||
if ( map != null && caster != null )
|
||||
{
|
||||
bool eastToWest = ( m_Item.ItemID == 0x3915 );
|
||||
IPooledEnumerable eable = map.GetMobilesInBounds( new Rectangle2D( m_Item.X - (eastToWest ? 0 : 1), m_Item.Y - (eastToWest ? 1 : 0), (eastToWest ? 1 : 2), (eastToWest ? 2 : 1) ) );
|
||||
|
||||
foreach ( Mobile m in eable )
|
||||
{
|
||||
if ( (m.Z + 16) > m_Item.Z && (m_Item.Z + 12) > m.Z && SpellHelper.ValidIndirectTarget( caster, m ) && caster.CanBeHarmful( m, false ) )
|
||||
m_Queue.Enqueue( m );
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
|
||||
while ( m_Queue.Count > 0 )
|
||||
{
|
||||
Mobile m = (Mobile)m_Queue.Dequeue();
|
||||
|
||||
caster.DoHarmful( m );
|
||||
|
||||
m_Item.ApplyPoisonTo( m );
|
||||
m.PlaySound( 0x474 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private PoisonFieldSpell m_Owner;
|
||||
|
||||
public InternalTarget( PoisonFieldSpell 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
90
Scripts/Spells/5th/SummonCreature.cs
Normal file
90
Scripts/Spells/5th/SummonCreature.cs
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
using System;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Spells.Fifth
|
||||
{
|
||||
public class SummonCreatureSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Summon Creature", "Kal Xen",
|
||||
16,
|
||||
false,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.MandrakeRoot,
|
||||
Reagent.SpidersSilk
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Fifth; } }
|
||||
|
||||
public SummonCreatureSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
|
||||
// NOTE: Creature list based on 1hr of summon/release on OSI.
|
||||
|
||||
private static Type[] m_Types = new Type[]
|
||||
{
|
||||
typeof( PolarBear ),
|
||||
typeof( GrizzlyBear ),
|
||||
typeof( BlackBear ),
|
||||
typeof( Walrus ),
|
||||
typeof( Chicken ),
|
||||
typeof( Scorpion ),
|
||||
typeof( GiantSerpent ),
|
||||
typeof( Alligator ),
|
||||
typeof( GreyWolf ),
|
||||
typeof( Slime ),
|
||||
typeof( Eagle ),
|
||||
typeof( Gorilla ),
|
||||
typeof( SnowLeopard ),
|
||||
typeof( Pig ),
|
||||
typeof( Deer ),
|
||||
typeof( Rabbit )
|
||||
};
|
||||
|
||||
public override bool CheckCast()
|
||||
{
|
||||
if ( !base.CheckCast() )
|
||||
return false;
|
||||
|
||||
if ( (Caster.Followers + 2) > Caster.FollowersMax )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1049645 ); // You have too many followers to summon that creature.
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if ( CheckSequence() )
|
||||
{
|
||||
try
|
||||
{
|
||||
BaseCreature creature = (BaseCreature)Activator.CreateInstance( m_Types[Utility.Random( m_Types.Length )] );
|
||||
|
||||
creature.ControlSlots = 2;
|
||||
|
||||
Caster.CheckSkill( SkillName.Concentration, 0.0, 100.0 );
|
||||
|
||||
TimeSpan duration = TimeSpan.FromSeconds( (4.0 * Caster.Skills[SkillName.Magery].Value) + (4.0 * Caster.Skills[SkillName.Concentration].Value) );
|
||||
|
||||
SpellHelper.Summon( creature, Caster, 0x215, duration, false, false );
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
public override TimeSpan GetCastDelay()
|
||||
{
|
||||
return base.GetCastDelay() + TimeSpan.FromSeconds( 6.0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue