#W# Initial Commit: Avatars Conquest
This commit is contained in:
commit
5df497787a
7510 changed files with 416048 additions and 0 deletions
167
Scripts/Spells/4th/ArchCure.cs
Normal file
167
Scripts/Spells/4th/ArchCure.cs
Normal file
|
|
@ -0,0 +1,167 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Spells.Fourth
|
||||
{
|
||||
public class ArchCureSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Arch Cure", "Vas An Nox",
|
||||
215,
|
||||
9061,
|
||||
Reagent.Garlic,
|
||||
Reagent.Ginseng,
|
||||
Reagent.MandrakeRoot
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Fourth; } }
|
||||
|
||||
public ArchCureSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget( this );
|
||||
}
|
||||
|
||||
// Archcure is now 1/4th of a second faster
|
||||
public override TimeSpan CastDelayBase{ get{ return base.CastDelayBase - TimeSpan.FromSeconds( 0.25 ); } }
|
||||
|
||||
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;
|
||||
Mobile m_directtarget = p as Mobile;
|
||||
|
||||
if ( map != null )
|
||||
{
|
||||
bool OldUO = true;
|
||||
|
||||
//you can target directly someone/something and become criminal if it's a criminal action
|
||||
if ( m_directtarget != null )
|
||||
targets.Add ( m_directtarget );
|
||||
|
||||
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 )
|
||||
{
|
||||
// Archcure area effect won't cure aggressors or victims, nor murderers, criminals or monsters
|
||||
// red players can cure only themselves and guildies with arch cure area.
|
||||
|
||||
if ( Caster.CanBeBeneficial( m, false ) && ( OldUO || !IsAggressor( m ) && !IsAggressed( m ) && (( IsInnocentTo ( Caster, m ) && IsInnocentTo ( m, Caster ) ) || ( IsAllyTo ( Caster, m ) )) && m != m_directtarget && m is PlayerMobile || m == Caster && m != m_directtarget ))
|
||||
targets.Add( m );
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
}
|
||||
|
||||
Effects.PlaySound( p, Caster.Map, 0x299 );
|
||||
|
||||
if ( targets.Count > 0 )
|
||||
{
|
||||
int cured = 0;
|
||||
|
||||
for ( int i = 0; i < targets.Count; ++i )
|
||||
{
|
||||
Mobile m = targets[i];
|
||||
|
||||
Caster.DoBeneficial( m );
|
||||
|
||||
Poison poison = m.Poison;
|
||||
|
||||
if ( poison != null )
|
||||
{
|
||||
int chanceToCure = 10000 + (int)(Caster.Skills[SkillName.Magery].Value * 75) - ((poison.Level + 1) * 1750);
|
||||
chanceToCure /= 100;
|
||||
chanceToCure -= 1;
|
||||
|
||||
if ( chanceToCure > Utility.Random( 100 ) && m.CurePoison( Caster ) )
|
||||
++cured;
|
||||
}
|
||||
|
||||
m.FixedParticles( 0x373A, 10, 15, 5012, EffectLayer.Waist );
|
||||
m.PlaySound( 0x1E0 );
|
||||
}
|
||||
|
||||
if ( cured > 0 )
|
||||
Caster.SendLocalizedMessage( 1010058 ); // You have cured the target of all poisons!
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private bool IsAggressor( Mobile m )
|
||||
{
|
||||
foreach ( AggressorInfo info in Caster.Aggressors )
|
||||
{
|
||||
if ( m == info.Attacker && !info.Expired )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool IsAggressed( Mobile m )
|
||||
{
|
||||
foreach ( AggressorInfo info in Caster.Aggressed )
|
||||
{
|
||||
if ( m == info.Defender && !info.Expired )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool IsInnocentTo( Mobile from, Mobile to )
|
||||
{
|
||||
return ( Notoriety.Compute( from, (Mobile)to ) == Notoriety.Innocent );
|
||||
}
|
||||
|
||||
private static bool IsAllyTo( Mobile from, Mobile to )
|
||||
{
|
||||
return ( Notoriety.Compute( from, (Mobile)to ) == Notoriety.Ally );
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private ArchCureSpell m_Owner;
|
||||
|
||||
public InternalTarget( ArchCureSpell 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
143
Scripts/Spells/4th/ArchProtection.cs
Normal file
143
Scripts/Spells/4th/ArchProtection.cs
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
using Server.Engines.PartySystem;
|
||||
|
||||
namespace Server.Spells.Fourth
|
||||
{
|
||||
public class ArchProtectionSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Arch Protection", "Vas Uus Sanct",
|
||||
215,
|
||||
9011,
|
||||
Reagent.Garlic,
|
||||
Reagent.Ginseng,
|
||||
Reagent.MandrakeRoot,
|
||||
Reagent.SulfurousAsh
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Fourth; } }
|
||||
|
||||
public ArchProtectionSpell( 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 ), (3+(int)(Caster.Skills[SkillName.Concentration].Value/20)) );
|
||||
|
||||
foreach ( Mobile m in eable )
|
||||
{
|
||||
if ( Caster.CanBeBeneficial( m, false ) )
|
||||
targets.Add( m );
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
}
|
||||
|
||||
Effects.PlaySound( p, Caster.Map, 0x299 );
|
||||
|
||||
int val = (int)(Caster.Skills[SkillName.Magery].Value/10.0 + 1);
|
||||
|
||||
Caster.CheckSkill( SkillName.Concentration, 0.0, 100.0 );
|
||||
|
||||
val = val + (int)(Caster.Skills[SkillName.Concentration].Value/20.0);
|
||||
|
||||
if ( targets.Count > 0 )
|
||||
{
|
||||
for ( int i = 0; i < targets.Count; ++i )
|
||||
{
|
||||
Mobile m = targets[i];
|
||||
|
||||
if ( m.BeginAction( typeof( ArchProtectionSpell ) ) )
|
||||
{
|
||||
Caster.DoBeneficial( m );
|
||||
m.VirtualArmorMod += val;
|
||||
new InternalTimer( m, Caster, val ).Start();
|
||||
|
||||
m.FixedParticles( 0x375A, 9, 20, 5027, EffectLayer.Waist );
|
||||
m.PlaySound( 0x1F7 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_Owner;
|
||||
private int m_Val;
|
||||
|
||||
public InternalTimer( Mobile target, Mobile caster, int val ) : base( TimeSpan.FromSeconds( 0 ) )
|
||||
{
|
||||
double time = caster.Skills[SkillName.Magery].Value * 1.2;
|
||||
if ( time > 144 )
|
||||
time = 144;
|
||||
Delay = TimeSpan.FromSeconds( time );
|
||||
Priority = TimerPriority.OneSecond;
|
||||
|
||||
m_Owner = target;
|
||||
m_Val = val;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_Owner.EndAction( typeof( ArchProtectionSpell ) );
|
||||
m_Owner.VirtualArmorMod -= m_Val;
|
||||
if ( m_Owner.VirtualArmorMod < 0 )
|
||||
m_Owner.VirtualArmorMod = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private ArchProtectionSpell m_Owner;
|
||||
|
||||
public InternalTarget( ArchProtectionSpell 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
103
Scripts/Spells/4th/Curse.cs
Normal file
103
Scripts/Spells/4th/Curse.cs
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Spells.Fourth
|
||||
{
|
||||
public class CurseSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Curse", "Des Sanct",
|
||||
227,
|
||||
9031,
|
||||
Reagent.Nightshade,
|
||||
Reagent.Garlic,
|
||||
Reagent.SulfurousAsh
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Fourth; } }
|
||||
|
||||
public CurseSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget( this );
|
||||
}
|
||||
|
||||
private static Hashtable m_UnderEffect = new Hashtable();
|
||||
|
||||
public static void RemoveEffect( object state )
|
||||
{
|
||||
Mobile m = (Mobile)state;
|
||||
|
||||
m_UnderEffect.Remove( m );
|
||||
}
|
||||
|
||||
public static bool UnderEffect( Mobile m )
|
||||
{
|
||||
return m_UnderEffect.Contains( m );
|
||||
}
|
||||
|
||||
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 ); SpellHelper.DisableSkillCheck = true;
|
||||
SpellHelper.AddStatCurse( Caster, m, StatType.Dex );
|
||||
SpellHelper.AddStatCurse( Caster, m, StatType.Int ); SpellHelper.DisableSkillCheck = false;
|
||||
|
||||
Timer t = (Timer)m_UnderEffect[m];
|
||||
|
||||
if ( Caster.Player && m.Player /*&& Caster != m */ && t == null ) //On OSI you CAN curse yourself and get this effect.
|
||||
{
|
||||
TimeSpan duration = SpellHelper.GetDuration( Caster, m );
|
||||
m_UnderEffect[m] = t = Timer.DelayCall( duration, new TimerStateCallback( RemoveEffect ), m );
|
||||
}
|
||||
|
||||
if ( m.Spell != null )
|
||||
m.Spell.OnCasterHurt();
|
||||
|
||||
m.Paralyzed = false;
|
||||
|
||||
m.FixedParticles( 0x374A, 10, 15, 5028, EffectLayer.Waist );
|
||||
m.PlaySound( 0x1E1 );
|
||||
|
||||
HarmfulSpell( m );
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private CurseSpell m_Owner;
|
||||
|
||||
public InternalTarget( CurseSpell 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
312
Scripts/Spells/4th/FireField.cs
Normal file
312
Scripts/Spells/4th/FireField.cs
Normal file
|
|
@ -0,0 +1,312 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Misc;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Spells.Fourth
|
||||
{
|
||||
public class FireFieldSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Fire Field", "In Flam Grav",
|
||||
215,
|
||||
9041,
|
||||
false,
|
||||
Reagent.BlackPearl,
|
||||
Reagent.SpidersSilk,
|
||||
Reagent.SulfurousAsh
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Fourth; } }
|
||||
|
||||
public FireFieldSpell( 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, 0x20C );
|
||||
|
||||
int itemID = eastToWest ? 0x398C : 0x3996;
|
||||
|
||||
Caster.CheckSkill( SkillName.Concentration, 0.0, 100.0 ); // PASSIVE CHECK
|
||||
|
||||
TimeSpan duration = TimeSpan.FromSeconds( ( 4.0 + (Caster.Skills[SkillName.Magery].Value * 0.5) ) + (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 FireFieldItem( itemID, loc, Caster, Caster.Map, duration, i );
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
[DispellableField]
|
||||
public class FireFieldItem : Item
|
||||
{
|
||||
private Timer m_Timer;
|
||||
private DateTime m_End;
|
||||
private Mobile m_Caster;
|
||||
private int m_Damage;
|
||||
|
||||
public override bool BlocksFit{ get{ return true; } }
|
||||
|
||||
public FireFieldItem( int itemID, Point3D loc, Mobile caster, Map map, TimeSpan duration, int val )
|
||||
: this( itemID, loc, caster, map, duration, val, 2 )
|
||||
{
|
||||
}
|
||||
|
||||
public FireFieldItem( int itemID, Point3D loc, Mobile caster, Map map, TimeSpan duration, int val, int damage ) : 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_Damage = damage;
|
||||
|
||||
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 FireFieldItem( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 2 ); // version
|
||||
|
||||
writer.Write( m_Damage );
|
||||
writer.Write( m_Caster );
|
||||
writer.WriteDeltaTime( m_End );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 2:
|
||||
{
|
||||
m_Damage = reader.ReadInt();
|
||||
goto case 1;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
if( version < 2 )
|
||||
m_Damage = 2;
|
||||
}
|
||||
|
||||
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 );
|
||||
|
||||
int damage = m_Damage;
|
||||
|
||||
if ( m.CheckSkill( SkillName.MagicResist, 0.0, 30.0 ) )
|
||||
{
|
||||
damage = 1;
|
||||
|
||||
m.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
|
||||
}
|
||||
|
||||
Ultima.Damage( m, m_Caster, damage );
|
||||
m.PlaySound( 0x208 );
|
||||
|
||||
if ( m is BaseCreature )
|
||||
((BaseCreature) m).OnHarmfulSpell( m_Caster );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private FireFieldItem m_Item;
|
||||
private bool m_InLOS, m_CanFit;
|
||||
|
||||
private static Queue m_Queue = new Queue();
|
||||
|
||||
public InternalTimer( FireFieldItem item, TimeSpan delay, bool inLOS, bool canFit ) : base( delay, TimeSpan.FromSeconds( 1.0 ) )
|
||||
{
|
||||
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, 5029 );
|
||||
}
|
||||
}
|
||||
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 )
|
||||
{
|
||||
foreach ( Mobile m in m_Item.GetMobilesInRange( 0 ) )
|
||||
{
|
||||
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 );
|
||||
}
|
||||
|
||||
while ( m_Queue.Count > 0 )
|
||||
{
|
||||
Mobile m = (Mobile)m_Queue.Dequeue();
|
||||
|
||||
if ( SpellHelper.CanRevealCaster( m ) )
|
||||
caster.RevealingAction();
|
||||
|
||||
caster.DoHarmful( m );
|
||||
|
||||
int damage = m_Item.m_Damage;
|
||||
|
||||
if ( m.CheckSkill( SkillName.MagicResist, 0.0, 30.0 ) )
|
||||
{
|
||||
damage = 1;
|
||||
|
||||
m.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
|
||||
}
|
||||
|
||||
Ultima.Damage( m, caster, damage );
|
||||
m.PlaySound( 0x208 );
|
||||
|
||||
if ( m is BaseCreature )
|
||||
((BaseCreature) m).OnHarmfulSpell( caster );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private FireFieldSpell m_Owner;
|
||||
|
||||
public InternalTarget( FireFieldSpell 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
92
Scripts/Spells/4th/GreaterHeal.cs
Normal file
92
Scripts/Spells/4th/GreaterHeal.cs
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Spells.Fourth
|
||||
{
|
||||
public class GreaterHealSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Greater Heal", "In Vas Mani",
|
||||
204,
|
||||
9061,
|
||||
Reagent.Garlic,
|
||||
Reagent.Ginseng,
|
||||
Reagent.MandrakeRoot,
|
||||
Reagent.SpidersSilk
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Fourth; } }
|
||||
|
||||
public GreaterHealSpell( 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 Golem )
|
||||
{
|
||||
Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500951 ); // You cannot heal that.
|
||||
}
|
||||
else if ( m.Poisoned )
|
||||
{
|
||||
Caster.LocalOverheadMessage( MessageType.Regular, 0x22, (Caster == m) ? 1005000 : 1010398 );
|
||||
}
|
||||
else if ( CheckBSequence( m ) )
|
||||
{
|
||||
SpellHelper.Turn( Caster, m );
|
||||
|
||||
// Algorithm: (40% of magery) + (1-10)
|
||||
|
||||
int toHeal = (int)(Caster.Skills[SkillName.Magery].Value * 0.4);
|
||||
toHeal += Utility.Random( 1, 10 );
|
||||
|
||||
//m.Heal( toHeal, Caster );
|
||||
SpellHelper.Heal( toHeal, m, Caster );
|
||||
|
||||
m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
|
||||
m.PlaySound( 0x202 );
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
public class InternalTarget : Target
|
||||
{
|
||||
private GreaterHealSpell m_Owner;
|
||||
|
||||
public InternalTarget( GreaterHealSpell 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
82
Scripts/Spells/4th/Lightning.cs
Normal file
82
Scripts/Spells/4th/Lightning.cs
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Spells.Fourth
|
||||
{
|
||||
public class LightningSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Lightning", "Por Ort Grav",
|
||||
239,
|
||||
9021,
|
||||
Reagent.MandrakeRoot,
|
||||
Reagent.SulfurousAsh
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Fourth; } }
|
||||
|
||||
public LightningSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
|
||||
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 ( CheckHSequence( m ) )
|
||||
{
|
||||
SpellHelper.Turn( Caster, m );
|
||||
|
||||
SpellHelper.CheckReflect( (int)this.Circle, Caster, ref m );
|
||||
|
||||
double damage = Utility.Random( 12, 9 );
|
||||
|
||||
if ( CheckResisted( m ) )
|
||||
{
|
||||
damage *= 0.75;
|
||||
|
||||
m.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
|
||||
}
|
||||
|
||||
damage *= GetDamageScalar( m );
|
||||
|
||||
m.BoltEffect( 0 );
|
||||
|
||||
SpellHelper.Damage( this, m, damage );
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private LightningSpell m_Owner;
|
||||
|
||||
public InternalTarget( LightningSpell 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
89
Scripts/Spells/4th/ManaDrain.cs
Normal file
89
Scripts/Spells/4th/ManaDrain.cs
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Spells.Fourth
|
||||
{
|
||||
public class ManaDrainSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Mana Drain", "Ort Rel",
|
||||
215,
|
||||
9031,
|
||||
Reagent.BlackPearl,
|
||||
Reagent.MandrakeRoot,
|
||||
Reagent.SpidersSilk
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Fourth; } }
|
||||
|
||||
public ManaDrainSpell( 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 );
|
||||
|
||||
if ( m.Spell != null )
|
||||
m.Spell.OnCasterHurt();
|
||||
|
||||
m.Paralyzed = false;
|
||||
|
||||
if ( CheckResisted( m ) )
|
||||
m.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
|
||||
else if ( m.Mana >= 100 )
|
||||
m.Mana -= Utility.Random( 1, 100 );
|
||||
else
|
||||
m.Mana -= Utility.Random( 1, m.Mana );
|
||||
|
||||
m.FixedParticles( 0x374A, 10, 15, 5032, EffectLayer.Head );
|
||||
m.PlaySound( 0x1F8 );
|
||||
|
||||
HarmfulSpell( m );
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
public override double GetResistPercent( Mobile target )
|
||||
{
|
||||
return 99.0;
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private ManaDrainSpell m_Owner;
|
||||
|
||||
public InternalTarget( ManaDrainSpell 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
131
Scripts/Spells/4th/Recall.cs
Normal file
131
Scripts/Spells/4th/Recall.cs
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Multis;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
using Server.Regions;
|
||||
|
||||
namespace Server.Spells.Fourth
|
||||
{
|
||||
public class RecallSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Recall", "Kal Ort Por",
|
||||
239,
|
||||
9031,
|
||||
Reagent.BlackPearl,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.MandrakeRoot
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Fourth; } }
|
||||
|
||||
public RecallSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetCastSkills( out double min, out double max )
|
||||
{
|
||||
base.GetCastSkills( out min, out max );
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
else if ( SpellHelper.CheckCombat( Caster ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
|
||||
return false;
|
||||
}
|
||||
else if ( Server.Misc.WeightOverloading.IsOverloaded( Caster ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 502359, "", 0x22 ); // Thou art too encumbered to move.
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Effect( Point3D loc, Map map, bool checkMulti )
|
||||
{
|
||||
if ( SpellHelper.CheckCombat( Caster ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
|
||||
}
|
||||
else if ( Server.Misc.WeightOverloading.IsOverloaded( Caster ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 502359, "", 0x22 ); // Thou art too encumbered to move.
|
||||
}
|
||||
else if ( !map.CanSpawnMobile( loc.X, loc.Y, loc.Z ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
|
||||
}
|
||||
else if ( (checkMulti && SpellHelper.CheckMulti( loc, map )) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
|
||||
}
|
||||
else if ( CheckSequence() )
|
||||
{
|
||||
BaseCreature.TeleportPets( Caster, loc, map, true );
|
||||
|
||||
Caster.PlaySound( 0x1FC );
|
||||
Caster.MoveToWorld( loc, map );
|
||||
Caster.PlaySound( 0x1FC );
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private RecallSpell m_Owner;
|
||||
|
||||
public InternalTarget( RecallSpell owner ) : base( 12, false, TargetFlags.None )
|
||||
{
|
||||
m_Owner = owner;
|
||||
|
||||
owner.Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 501029 ); // Select Marked item.
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object o )
|
||||
{
|
||||
if ( o is MagicRune )
|
||||
{
|
||||
MagicRune rune = (MagicRune)o;
|
||||
|
||||
if ( rune.Marked && rune.Owner != from )
|
||||
from.SendMessage( "This rune belongs to someone else." );
|
||||
else if ( rune.Marked )
|
||||
m_Owner.Effect( rune.Target, rune.TargetMap, true );
|
||||
else
|
||||
from.SendLocalizedMessage( 501805 ); // That rune is not yet marked.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.Send( new MessageLocalized( from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 502357, from.Name, "" ) ); // I can not recall from that object.
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnNonlocalTarget( Mobile from, object o )
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish( Mobile from )
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue