This commit is contained in:
mark 2006-06-15 04:14:30 +00:00
commit 47711d616e
2644 changed files with 479454 additions and 0 deletions

View file

@ -0,0 +1,81 @@
using System;
using Server.Targeting;
using Server.Network;
namespace Server.Spells.First
{
public class ClumsySpell : Spell
{
private static SpellInfo m_Info = new SpellInfo(
"Clumsy", "Uus Jux",
SpellCircle.First,
212,
9031,
Reagent.Bloodmoss,
Reagent.Nightshade
);
public ClumsySpell( 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 );
SpellHelper.AddStatCurse( Caster, m, StatType.Dex );
if ( m.Spell != null )
m.Spell.OnCasterHurt();
m.Paralyzed = false;
m.FixedParticles( 0x3779, 10, 15, 5002, EffectLayer.Head );
m.PlaySound( 0x1DF );
int percentage = (int)(SpellHelper.GetOffsetScalar( Caster, m, true )*100);
TimeSpan length = SpellHelper.GetDuration( Caster, m );
BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.Clumsy, 1075831, length, m, percentage.ToString() ) );
}
FinishSequence();
}
private class InternalTarget : Target
{
private ClumsySpell m_Owner;
public InternalTarget( ClumsySpell 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();
}
}
}
}

View file

@ -0,0 +1,89 @@
using System;
using Server.Items;
namespace Server.Spells.First
{
public class CreateFoodSpell : Spell
{
private static SpellInfo m_Info = new SpellInfo(
"Create Food", "In Mani Ylem",
SpellCircle.First,
224,
9011,
Reagent.Garlic,
Reagent.Ginseng,
Reagent.MandrakeRoot
);
public CreateFoodSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
private static FoodInfo[] m_Food = new FoodInfo[]
{
new FoodInfo( typeof( Grapes ), "a grape bunch" ),
new FoodInfo( typeof( Ham ), "a ham" ),
new FoodInfo( typeof( CheeseWedge ), "a wedge of cheese" ),
new FoodInfo( typeof( Muffins ), "muffins" ),
new FoodInfo( typeof( FishSteak ), "a fish steak" ),
new FoodInfo( typeof( Ribs ), "cut of ribs" ),
new FoodInfo( typeof( CookedBird ), "a cooked bird" ),
new FoodInfo( typeof( Sausage ), "sausage" ),
new FoodInfo( typeof( Apple ), "an apple" ),
new FoodInfo( typeof( Peach ), "a peach" )
};
public override void OnCast()
{
if ( CheckSequence() )
{
FoodInfo foodInfo = m_Food[Utility.Random( m_Food.Length )];
Item food = foodInfo.Create();
if ( food != null )
{
Caster.AddToBackpack( food );
// You magically create food in your backpack:
Caster.SendLocalizedMessage( 1042695, true, " " + foodInfo.Name );
Caster.FixedParticles( 0, 10, 5, 2003, EffectLayer.RightHand );
Caster.PlaySound( 0x1E2 );
}
}
FinishSequence();
}
}
public class FoodInfo
{
private Type m_Type;
private string m_Name;
public Type Type{ get{ return m_Type; } set{ m_Type = value; } }
public string Name{ get{ return m_Name; } set{ m_Name = value; } }
public FoodInfo( Type type, string name )
{
m_Type = type;
m_Name = name;
}
public Item Create()
{
Item item;
try
{
item = (Item)Activator.CreateInstance( m_Type );
}
catch
{
item = null;
}
return item;
}
}
}

View file

@ -0,0 +1,81 @@
using System;
using Server.Targeting;
using Server.Network;
namespace Server.Spells.First
{
public class FeeblemindSpell : Spell
{
private static SpellInfo m_Info = new SpellInfo(
"Feeblemind", "Rel Wis",
SpellCircle.First,
212,
9031,
Reagent.Ginseng,
Reagent.Nightshade
);
public FeeblemindSpell( 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 );
SpellHelper.AddStatCurse( Caster, m, StatType.Int );
if ( m.Spell != null )
m.Spell.OnCasterHurt();
m.Paralyzed = false;
m.FixedParticles( 0x3779, 10, 15, 5004, EffectLayer.Head );
m.PlaySound( 0x1E4 );
int percentage = (int)(SpellHelper.GetOffsetScalar( Caster, m, true )*100);
TimeSpan length = SpellHelper.GetDuration( Caster, m );
BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.FeebleMind, 1075833, length, m, percentage.ToString() ) );
}
FinishSequence();
}
private class InternalTarget : Target
{
private FeeblemindSpell m_Owner;
public InternalTarget( FeeblemindSpell 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();
}
}
}
}

View file

@ -0,0 +1,104 @@
using System;
using Server;
using Server.Targeting;
using Server.Network;
using Server.Mobiles;
namespace Server.Spells.First
{
public class HealSpell : Spell
{
private static SpellInfo m_Info = new SpellInfo(
"Heal", "In Mani",
SpellCircle.First,
224,
9061,
Reagent.Garlic,
Reagent.Ginseng,
Reagent.SpidersSilk
);
public HealSpell( 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.IsDeadBondedPet )
{
Caster.SendLocalizedMessage( 1060177 ); // You cannot heal a creature that is already dead!
}
else if ( m is BaseCreature && ((BaseCreature)m).IsAnimatedDead )
{
Caster.SendLocalizedMessage( 1061654 ); // You cannot heal that which is not alive.
}
else if ( m is Golem )
{
Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500951 ); // You cannot heal that.
}
else if ( m.Poisoned || Server.Items.MortalStrike.IsWounded( m ) )
{
Caster.LocalOverheadMessage( MessageType.Regular, 0x22, (Caster == m) ? 1005000 : 1010398 );
}
else if ( CheckBSequence( m ) )
{
SpellHelper.Turn( Caster, m );
int toHeal;
if ( Core.AOS )
{
toHeal = Caster.Skills.Magery.Fixed / 120;
toHeal += Utility.RandomMinMax( 1, 4 );
if( Core.SE && Caster != m )
toHeal = (int)(toHeal * 1.5);
}
else
{
toHeal = (int)(Caster.Skills[SkillName.Magery].Value * 0.1);
toHeal += Utility.Random( 1, 5 );
}
m.Heal( toHeal );
m.FixedParticles( 0x376A, 9, 32, 5005, EffectLayer.Waist );
m.PlaySound( 0x1F2 );
}
FinishSequence();
}
public class InternalTarget : Target
{
private HealSpell m_Owner;
public InternalTarget( HealSpell 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();
}
}
}
}

View file

@ -0,0 +1,96 @@
using System;
using Server.Targeting;
using Server.Network;
namespace Server.Spells.First
{
public class MagicArrowSpell : Spell
{
private static SpellInfo m_Info = new SpellInfo(
"Magic Arrow", "In Por Ylem",
SpellCircle.First,
212,
9041,
Reagent.SulfurousAsh
);
public MagicArrowSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override bool DelayedDamageStacking { get { return !Core.AOS; } }
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( source, m );
SpellHelper.CheckReflect( (int)this.Circle, ref source, ref m );
double damage;
if ( Core.AOS )
{
damage = GetNewAosDamage( 10, 1, 4, m );
}
else
{
damage = Utility.Random( 4, 4 );
if ( CheckResisted( m ) )
{
damage *= 0.75;
m.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
}
damage *= GetDamageScalar( m );
}
source.MovingParticles( m, 0x36E4, 5, 0, false, true, 3006, 4006, 0 );
source.PlaySound( 0x1E5 );
SpellHelper.Damage( this, m, damage, 0, 100, 0, 0, 0 );
}
FinishSequence();
}
private class InternalTarget : Target
{
private MagicArrowSpell m_Owner;
public InternalTarget( MagicArrowSpell 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();
}
}
}
}

View file

@ -0,0 +1,75 @@
using System;
using Server.Targeting;
using Server.Network;
using Server;
namespace Server.Spells.First
{
public class NightSightSpell : Spell
{
private static SpellInfo m_Info = new SpellInfo(
"Night Sight", "In Lor",
SpellCircle.First,
236,
9031,
Reagent.SulfurousAsh,
Reagent.SpidersSilk
);
public NightSightSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override void OnCast()
{
Caster.Target = new NightSightTarget( this );
}
private class NightSightTarget : Target
{
private Spell m_Spell;
public NightSightTarget( Spell spell ) : base( 12, false, TargetFlags.Beneficial )
{
m_Spell = spell;
}
protected override void OnTarget( Mobile from, object targeted )
{
if ( targeted is Mobile && m_Spell.CheckBSequence( (Mobile) targeted ) )
{
Mobile targ = (Mobile)targeted;
SpellHelper.Turn( m_Spell.Caster, targ );
if ( targ.BeginAction( typeof( LightCycle ) ) )
{
new LightCycle.NightSightTimer( targ ).Start();
int level = (int)( LightCycle.DungeonLevel * ( (Core.AOS ? targ.Skills[SkillName.Magery].Value : from.Skills[SkillName.Magery].Value )/ 100 ) );
if ( level < 0 )
level = 0;
targ.LightLevel = level;
targ.FixedParticles( 0x376A, 9, 32, 5007, EffectLayer.Waist );
targ.PlaySound( 0x1E3 );
BuffInfo.AddBuff( targ, new BuffInfo( BuffIcon.NightSight, 1075643 ) ); //Night Sight/You ignore lighting effects
}
else
{
from.SendMessage( "{0} already have nightsight.", from == targ ? "You" : "They" );
}
}
m_Spell.FinishSequence();
}
protected override void OnTargetFinish( Mobile from )
{
m_Spell.FinishSequence();
}
}
}
}

View file

@ -0,0 +1,133 @@
using System;
using System.Collections;
using Server.Targeting;
using Server.Network;
namespace Server.Spells.First
{
public class ReactiveArmorSpell : Spell
{
private static SpellInfo m_Info = new SpellInfo(
"Reactive Armor", "Flam Sanct",
SpellCircle.First,
236,
9011,
Reagent.Garlic,
Reagent.SpidersSilk,
Reagent.SulfurousAsh
);
public ReactiveArmorSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override bool CheckCast()
{
if ( Core.AOS )
return true;
if ( Caster.MeleeDamageAbsorb > 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 ( Core.AOS )
{
/* The reactive armor spell increases the caster's physical resistance, while lowering the caster's elemental resistances.
* 15 + (Inscription/20) Physcial bonus
* -5 Elemental
* The reactive armor spell has an indefinite duration, becoming active when cast, and deactivated when re-cast.
* Reactive Armor, Protection, and Magic Reflection will stay on—even after logging out, even after dying—until you “turn them off” by casting them again.
* (+20 physical -5 elemental at 100 Inscription)
*/
if ( CheckSequence() )
{
Mobile targ = Caster;
ResistanceMod[] mods = (ResistanceMod[])m_Table[targ];
if ( mods == null )
{
targ.PlaySound( 0x1E9 );
targ.FixedParticles( 0x376A, 9, 32, 5008, EffectLayer.Waist );
mods = new ResistanceMod[5]
{
new ResistanceMod( ResistanceType.Physical, 15 + (int)(targ.Skills[SkillName.Inscribe].Value / 20) ),
new ResistanceMod( ResistanceType.Fire, -5 ),
new ResistanceMod( ResistanceType.Cold, -5 ),
new ResistanceMod( ResistanceType.Poison, -5 ),
new ResistanceMod( ResistanceType.Energy, -5 )
};
m_Table[targ] = mods;
for ( int i = 0; i < mods.Length; ++i )
targ.AddResistanceMod( mods[i] );
}
else
{
targ.PlaySound( 0x1ED );
targ.FixedParticles( 0x376A, 9, 32, 5008, EffectLayer.Waist );
m_Table.Remove( targ );
for ( int i = 0; i < mods.Length; ++i )
targ.RemoveResistanceMod( mods[i] );
}
}
FinishSequence();
}
else
{
if ( Caster.MeleeDamageAbsorb > 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 ) ) )
{
int value = (int)(Caster.Skills[SkillName.Magery].Value + Caster.Skills[SkillName.Meditation].Value + Caster.Skills[SkillName.Inscribe].Value);
value /= 3;
if ( value < 0 )
value = 1;
else if ( value > 75 )
value = 75;
Caster.MeleeDamageAbsorb = value;
Caster.FixedParticles( 0x376A, 9, 32, 5008, EffectLayer.Waist );
Caster.PlaySound( 0x1F2 );
}
else
{
Caster.SendLocalizedMessage( 1005385 ); // The spell will not adhere to you at this time.
}
}
FinishSequence();
}
}
}
}

View file

@ -0,0 +1,81 @@
using System;
using Server.Targeting;
using Server.Network;
namespace Server.Spells.First
{
public class WeakenSpell : Spell
{
private static SpellInfo m_Info = new SpellInfo(
"Weaken", "Des Mani",
SpellCircle.First,
212,
9031,
Reagent.Garlic,
Reagent.Nightshade
);
public WeakenSpell( 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 );
SpellHelper.AddStatCurse( Caster, m, StatType.Str );
if ( m.Spell != null )
m.Spell.OnCasterHurt();
m.Paralyzed = false;
m.FixedParticles( 0x3779, 10, 15, 5009, EffectLayer.Waist );
m.PlaySound( 0x1E6 );
int percentage = (int)(SpellHelper.GetOffsetScalar( Caster, m, true )*100);
TimeSpan length = SpellHelper.GetDuration( Caster, m );
BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.Weaken, 1075837, length, m, percentage.ToString() ) );
}
FinishSequence();
}
public class InternalTarget : Target
{
private WeakenSpell m_Owner;
public InternalTarget( WeakenSpell 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();
}
}
}
}