#W# Source and Scripts added. Added Scripts/Settings.cs to expose some basic tweak able settings.
This commit is contained in:
parent
b51c58f514
commit
3045c83799
3512 changed files with 627673 additions and 0 deletions
90
Scripts/Spells/Third/Bless.cs
Normal file
90
Scripts/Spells/Third/Bless.cs
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Spells.Third
|
||||
{
|
||||
public class BlessSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Bless", "Rel Sanct",
|
||||
203,
|
||||
9061,
|
||||
Reagent.Garlic,
|
||||
Reagent.MandrakeRoot
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Third; } }
|
||||
|
||||
public BlessSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
|
||||
public override bool CheckCast()
|
||||
{
|
||||
if ( Engines.ConPVP.DuelContext.CheckSuddenDeath( Caster ) )
|
||||
{
|
||||
Caster.SendMessage( 0x22, "You cannot cast this spell when in sudden death." );
|
||||
return false;
|
||||
}
|
||||
|
||||
return base.CheckCast();
|
||||
}
|
||||
|
||||
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 ( CheckBSequence( m ) )
|
||||
{
|
||||
SpellHelper.Turn( Caster, m );
|
||||
|
||||
SpellHelper.AddStatBonus( Caster, m, StatType.Str ); SpellHelper.DisableSkillCheck = true;
|
||||
SpellHelper.AddStatBonus( Caster, m, StatType.Dex );
|
||||
SpellHelper.AddStatBonus( Caster, m, StatType.Int ); SpellHelper.DisableSkillCheck = false;
|
||||
|
||||
m.FixedParticles( 0x373A, 10, 15, 5018, EffectLayer.Waist );
|
||||
m.PlaySound( 0x1EA );
|
||||
|
||||
int percentage = (int)(SpellHelper.GetOffsetScalar(Caster, m, false) * 100);
|
||||
TimeSpan length = SpellHelper.GetDuration(Caster, m);
|
||||
|
||||
string args = String.Format("{0}\t{1}\t{2}", percentage, percentage, percentage);
|
||||
|
||||
BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Bless, 1075847, 1075848, length, m, args.ToString()));
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private BlessSpell m_Owner;
|
||||
|
||||
public InternalTarget( BlessSpell owner ) : base( Core.ML ? 10 : 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
93
Scripts/Spells/Third/Fireball.cs
Normal file
93
Scripts/Spells/Third/Fireball.cs
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Spells.Third
|
||||
{
|
||||
public class FireballSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Fireball", "Vas Flam",
|
||||
203,
|
||||
9041,
|
||||
Reagent.BlackPearl
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Third; } }
|
||||
|
||||
public FireballSpell( 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( source, m );
|
||||
|
||||
SpellHelper.CheckReflect( (int)this.Circle, ref source, ref m );
|
||||
|
||||
double damage;
|
||||
|
||||
if ( Core.AOS )
|
||||
{
|
||||
damage = GetNewAosDamage( 19, 1, 5, m );
|
||||
}
|
||||
else
|
||||
{
|
||||
damage = Utility.Random( 10, 7 );
|
||||
|
||||
if ( CheckResisted( m ) )
|
||||
{
|
||||
damage *= 0.75;
|
||||
|
||||
m.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
|
||||
}
|
||||
|
||||
damage *= GetDamageScalar( m );
|
||||
}
|
||||
|
||||
source.MovingParticles( m, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160 );
|
||||
source.PlaySound( Core.AOS ? 0x15E : 0x44B );
|
||||
|
||||
SpellHelper.Damage( this, m, damage, 0, 100, 0, 0, 0 );
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private FireballSpell m_Owner;
|
||||
|
||||
public InternalTarget( FireballSpell owner ) : base( Core.ML ? 10 : 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
87
Scripts/Spells/Third/MagicLock.cs
Normal file
87
Scripts/Spells/Third/MagicLock.cs
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Spells.Third
|
||||
{
|
||||
public class MagicLockSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Magic Lock", "An Por",
|
||||
215,
|
||||
9001,
|
||||
Reagent.Garlic,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.SulfurousAsh
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Third; } }
|
||||
|
||||
public MagicLockSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget( this );
|
||||
}
|
||||
|
||||
public void Target( LockableContainer targ )
|
||||
{
|
||||
if ( Multis.BaseHouse.CheckLockedDownOrSecured( targ ) )
|
||||
{
|
||||
// You cannot cast this on a locked down item.
|
||||
Caster.LocalOverheadMessage( MessageType.Regular, 0x22, 501761 );
|
||||
}
|
||||
else if ( targ.Locked || targ.LockLevel == 0 || targ is ParagonChest )
|
||||
{
|
||||
// Target must be an unlocked chest.
|
||||
Caster.SendLocalizedMessage( 501762 );
|
||||
}
|
||||
else if ( CheckSequence() )
|
||||
{
|
||||
SpellHelper.Turn( Caster, targ );
|
||||
|
||||
Point3D loc = targ.GetWorldLocation();
|
||||
|
||||
Effects.SendLocationParticles(
|
||||
EffectItem.Create( loc, targ.Map, EffectItem.DefaultDuration ),
|
||||
0x376A, 9, 32, 5020 );
|
||||
|
||||
Effects.PlaySound( loc, targ.Map, 0x1FA );
|
||||
|
||||
// The chest is now locked!
|
||||
Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 501763 );
|
||||
|
||||
targ.LockLevel = -255; // signal magic lock
|
||||
targ.Locked = true;
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private MagicLockSpell m_Owner;
|
||||
|
||||
public InternalTarget( MagicLockSpell owner ) : base( Core.ML ? 10 : 12, false, TargetFlags.None )
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object o )
|
||||
{
|
||||
if ( o is LockableContainer )
|
||||
m_Owner.Target( (LockableContainer)o );
|
||||
else
|
||||
from.SendLocalizedMessage( 501762 ); // Target must be an unlocked chest.
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish( Mobile from )
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
147
Scripts/Spells/Third/Poison.cs
Normal file
147
Scripts/Spells/Third/Poison.cs
Normal file
|
|
@ -0,0 +1,147 @@
|
|||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Spells.Third
|
||||
{
|
||||
public class PoisonSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Poison", "In Nox",
|
||||
203,
|
||||
9051,
|
||||
Reagent.Nightshade
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Third; } }
|
||||
|
||||
public PoisonSpell( 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
|
||||
{
|
||||
int level;
|
||||
|
||||
if ( Core.AOS )
|
||||
{
|
||||
if ( Caster.InRange( m, 2 ) )
|
||||
{
|
||||
int total = (Caster.Skills.Magery.Fixed + Caster.Skills.Poisoning.Fixed) / 2;
|
||||
|
||||
if ( total >= 1000 )
|
||||
level = 3;
|
||||
else if ( total > 850 )
|
||||
level = 2;
|
||||
else if ( total > 650 )
|
||||
level = 1;
|
||||
else
|
||||
level = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
level = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//double total = Caster.Skills[SkillName.Magery].Value + Caster.Skills[SkillName.Poisoning].Value;
|
||||
|
||||
#region Dueling
|
||||
double total = Caster.Skills[SkillName.Magery].Value;
|
||||
|
||||
if ( Caster is Mobiles.PlayerMobile )
|
||||
{
|
||||
Mobiles.PlayerMobile pm = (Mobiles.PlayerMobile)Caster;
|
||||
|
||||
if ( pm.DuelContext != null && pm.DuelContext.Started && !pm.DuelContext.Finished && !pm.DuelContext.Ruleset.GetOption( "Skills", "Poisoning" ) )
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
total += Caster.Skills[SkillName.Poisoning].Value;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
total += Caster.Skills[SkillName.Poisoning].Value;
|
||||
}
|
||||
#endregion
|
||||
|
||||
double dist = Caster.GetDistanceToSqrt( m );
|
||||
|
||||
if ( dist >= 3.0 )
|
||||
total -= (dist - 3.0) * 10.0;
|
||||
|
||||
if ( total >= 200.0 && 1 > Utility.Random( 10 ) )
|
||||
level = 3;
|
||||
else if ( total > (Core.AOS ? 170.1 : 170.0) )
|
||||
level = 2;
|
||||
else if ( total > (Core.AOS ? 130.1 : 130.0) )
|
||||
level = 1;
|
||||
else
|
||||
level = 0;
|
||||
}
|
||||
|
||||
m.ApplyPoison( Caster, Poison.GetPoison( level ) );
|
||||
}
|
||||
|
||||
m.FixedParticles( 0x374A, 10, 15, 5021, EffectLayer.Waist );
|
||||
m.PlaySound( 0x205 );
|
||||
|
||||
HarmfulSpell( m );
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private PoisonSpell m_Owner;
|
||||
|
||||
public InternalTarget( PoisonSpell owner ) : base( Core.ML ? 10 : 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
109
Scripts/Spells/Third/Telekinesis.cs
Normal file
109
Scripts/Spells/Third/Telekinesis.cs
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Regions;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Spells.Third
|
||||
{
|
||||
public class TelekinesisSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Telekinesis", "Ort Por Ylem",
|
||||
203,
|
||||
9031,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.MandrakeRoot
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Third; } }
|
||||
|
||||
public TelekinesisSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget( this );
|
||||
}
|
||||
|
||||
public void Target( ITelekinesisable obj )
|
||||
{
|
||||
if ( CheckSequence() )
|
||||
{
|
||||
SpellHelper.Turn( Caster, obj );
|
||||
|
||||
obj.OnTelekinesis( Caster );
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
public void Target( Container item )
|
||||
{
|
||||
if ( CheckSequence() )
|
||||
{
|
||||
SpellHelper.Turn( Caster, item );
|
||||
|
||||
object root = item.RootParent;
|
||||
|
||||
if ( !item.IsAccessibleTo( Caster ) )
|
||||
{
|
||||
item.OnDoubleClickNotAccessible( Caster );
|
||||
}
|
||||
else if ( !item.CheckItemUse( Caster, item ) )
|
||||
{
|
||||
}
|
||||
else if ( root != null && root is Mobile && root != Caster )
|
||||
{
|
||||
item.OnSnoop( Caster );
|
||||
}
|
||||
else if ( item is Corpse && !((Corpse)item).CheckLoot( Caster, null ) )
|
||||
{
|
||||
}
|
||||
else if ( Caster.Region.OnDoubleClick( Caster, item ) )
|
||||
{
|
||||
Effects.SendLocationParticles( EffectItem.Create( item.Location, item.Map, EffectItem.DefaultDuration ), 0x376A, 9, 32, 5022 );
|
||||
Effects.PlaySound( item.Location, item.Map, 0x1F5 );
|
||||
|
||||
item.OnItemUsed( Caster, item );
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
public class InternalTarget : Target
|
||||
{
|
||||
private TelekinesisSpell m_Owner;
|
||||
|
||||
public InternalTarget( TelekinesisSpell owner ) : base( Core.ML ? 10 : 12, false, TargetFlags.None )
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object o )
|
||||
{
|
||||
if ( o is ITelekinesisable )
|
||||
m_Owner.Target( (ITelekinesisable)o );
|
||||
else if ( o is Container )
|
||||
m_Owner.Target( (Container)o );
|
||||
else
|
||||
from.SendLocalizedMessage( 501857 ); // This spell won't work on that!
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish( Mobile from )
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace Server
|
||||
{
|
||||
public interface ITelekinesisable : IPoint3D
|
||||
{
|
||||
void OnTelekinesis( Mobile from );
|
||||
}
|
||||
}
|
||||
140
Scripts/Spells/Third/Teleport.cs
Normal file
140
Scripts/Spells/Third/Teleport.cs
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Regions;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Spells.Third
|
||||
{
|
||||
public class TeleportSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Teleport", "Rel Por",
|
||||
215,
|
||||
9031,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.MandrakeRoot
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Third; } }
|
||||
|
||||
public TeleportSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
|
||||
public override bool CheckCast()
|
||||
{
|
||||
if ( Factions.Sigil.ExistsOn( Caster ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
|
||||
return false;
|
||||
}
|
||||
else if ( Server.Misc.WeightOverloading.IsOverloaded( Caster ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 502359, "", 0x22 ); // Thou art too encumbered to move.
|
||||
return false;
|
||||
}
|
||||
|
||||
return SpellHelper.CheckTravel( Caster, TravelCheckType.TeleportFrom );
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget( this );
|
||||
}
|
||||
|
||||
public void Target( IPoint3D p )
|
||||
{
|
||||
IPoint3D orig = p;
|
||||
Map map = Caster.Map;
|
||||
|
||||
SpellHelper.GetSurfaceTop( ref p );
|
||||
|
||||
Point3D from = Caster.Location;
|
||||
Point3D to = new Point3D( p );
|
||||
|
||||
if ( Factions.Sigil.ExistsOn( Caster ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
|
||||
}
|
||||
else if ( Server.Misc.WeightOverloading.IsOverloaded( Caster ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 502359, "", 0x22 ); // Thou art too encumbered to move.
|
||||
}
|
||||
else if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.TeleportFrom ) )
|
||||
{
|
||||
}
|
||||
else if ( !SpellHelper.CheckTravel( Caster, map, to, TravelCheckType.TeleportTo ) )
|
||||
{
|
||||
}
|
||||
else if ( map == null || !map.CanSpawnMobile( p.X, p.Y, p.Z ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
|
||||
}
|
||||
else if ( SpellHelper.CheckMulti( to, map ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 502831 ); // Cannot teleport to that spot.
|
||||
}
|
||||
else if ( Region.Find( to, map ).GetRegion( typeof( HouseRegion ) ) != null )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 502829 ); // Cannot teleport to that spot.
|
||||
}
|
||||
else if ( CheckSequence() )
|
||||
{
|
||||
SpellHelper.Turn( Caster, orig );
|
||||
|
||||
Mobile m = Caster;
|
||||
|
||||
m.Location = to;
|
||||
m.ProcessDelta();
|
||||
|
||||
if ( m.Player )
|
||||
{
|
||||
Effects.SendLocationParticles( EffectItem.Create( from, m.Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 2023 );
|
||||
Effects.SendLocationParticles( EffectItem.Create( to, m.Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 5023 );
|
||||
}
|
||||
else
|
||||
{
|
||||
m.FixedParticles( 0x376A, 9, 32, 0x13AF, EffectLayer.Waist );
|
||||
}
|
||||
|
||||
m.PlaySound( 0x1FE );
|
||||
|
||||
IPooledEnumerable eable = m.GetItemsInRange( 0 );
|
||||
|
||||
foreach ( Item item in eable )
|
||||
{
|
||||
if ( item is Server.Spells.Sixth.ParalyzeFieldSpell.InternalItem || item is Server.Spells.Fifth.PoisonFieldSpell.InternalItem || item is Server.Spells.Fourth.FireFieldSpell.FireFieldItem )
|
||||
item.OnMoveOver( m );
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
public class InternalTarget : Target
|
||||
{
|
||||
private TeleportSpell m_Owner;
|
||||
|
||||
public InternalTarget( TeleportSpell owner ) : base( Core.ML ? 11 : 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
89
Scripts/Spells/Third/Unlock.cs
Normal file
89
Scripts/Spells/Third/Unlock.cs
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Spells.Third
|
||||
{
|
||||
public class UnlockSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Unlock Spell", "Ex Por",
|
||||
215,
|
||||
9001,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.SulfurousAsh
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Third; } }
|
||||
|
||||
public UnlockSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget( this );
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private UnlockSpell m_Owner;
|
||||
|
||||
public InternalTarget( UnlockSpell owner ) : base( Core.ML ? 10 : 12, false, TargetFlags.None )
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object o )
|
||||
{
|
||||
IPoint3D loc = o as IPoint3D;
|
||||
|
||||
if ( loc == null )
|
||||
return;
|
||||
|
||||
if ( m_Owner.CheckSequence() ) {
|
||||
SpellHelper.Turn( from, o );
|
||||
|
||||
Effects.SendLocationParticles( EffectItem.Create( new Point3D( loc ), from.Map, EffectItem.DefaultDuration ), 0x376A, 9, 32, 5024 );
|
||||
|
||||
Effects.PlaySound( loc, from.Map, 0x1FF );
|
||||
|
||||
if ( o is Mobile )
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503101 ); // That did not need to be unlocked.
|
||||
else if ( !( o is LockableContainer ) )
|
||||
from.SendLocalizedMessage( 501666 ); // You can't unlock that!
|
||||
else {
|
||||
LockableContainer cont = (LockableContainer)o;
|
||||
|
||||
if ( Multis.BaseHouse.CheckSecured( cont ) )
|
||||
from.SendLocalizedMessage( 503098 ); // You cannot cast this on a secure item.
|
||||
else if ( !cont.Locked )
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503101 ); // That did not need to be unlocked.
|
||||
else if ( cont.LockLevel == 0 )
|
||||
from.SendLocalizedMessage( 501666 ); // You can't unlock that!
|
||||
else {
|
||||
int level = (int)(from.Skills[SkillName.Magery].Value * 0.8) - 4;
|
||||
|
||||
if ( level >= cont.RequiredSkill && !(cont is TreasureMapChest && ((TreasureMapChest)cont).Level > 2) ) {
|
||||
cont.Locked = false;
|
||||
|
||||
if ( cont.LockLevel == -255 )
|
||||
cont.LockLevel = cont.RequiredSkill - 10;
|
||||
}
|
||||
else
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503099 ); // My spell does not seem to have an effect on that lock.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish( Mobile from )
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
226
Scripts/Spells/Third/WallOfStone.cs
Normal file
226
Scripts/Spells/Third/WallOfStone.cs
Normal file
|
|
@ -0,0 +1,226 @@
|
|||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Misc;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Spells.Third
|
||||
{
|
||||
public class WallOfStoneSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Wall of Stone", "In Sanct Ylem",
|
||||
227,
|
||||
9011,
|
||||
false,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.Garlic
|
||||
);
|
||||
|
||||
public override SpellCircle Circle { get { return SpellCircle.Third; } }
|
||||
|
||||
public WallOfStoneSpell( 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, 0x1F6 );
|
||||
|
||||
for ( int i = -1; i <= 1; ++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, 22, true );
|
||||
|
||||
//Effects.SendLocationParticles( EffectItem.Create( loc, Caster.Map, EffectItem.DefaultDuration ), 0x376A, 9, 10, 5025 );
|
||||
|
||||
if ( !canFit )
|
||||
continue;
|
||||
|
||||
Item item = new InternalItem( loc, Caster.Map, Caster );
|
||||
|
||||
Effects.SendLocationParticles( item, 0x376A, 9, 10, 5025 );
|
||||
|
||||
//new InternalItem( loc, Caster.Map, Caster );
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
[DispellableField]
|
||||
private class InternalItem : Item
|
||||
{
|
||||
private Timer m_Timer;
|
||||
private DateTime m_End;
|
||||
private Mobile m_Caster;
|
||||
|
||||
public override bool BlocksFit{ get{ return true; } }
|
||||
|
||||
public InternalItem( Point3D loc, Map map, Mobile caster ) : base( 0x82 )
|
||||
{
|
||||
Visible = false;
|
||||
Movable = false;
|
||||
|
||||
MoveToWorld( loc, map );
|
||||
|
||||
m_Caster = caster;
|
||||
|
||||
if ( caster.InLOS( this ) )
|
||||
Visible = true;
|
||||
else
|
||||
Delete();
|
||||
|
||||
if ( Deleted )
|
||||
return;
|
||||
|
||||
m_Timer = new InternalTimer( this, TimeSpan.FromSeconds( 10.0 ) );
|
||||
m_Timer.Start();
|
||||
|
||||
m_End = DateTime.UtcNow + TimeSpan.FromSeconds( 10.0 );
|
||||
}
|
||||
|
||||
public InternalItem( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 1 ); // version
|
||||
|
||||
writer.WriteDeltaTime( m_End );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_End = reader.ReadDeltaTime();
|
||||
|
||||
m_Timer = new InternalTimer( this, m_End - DateTime.UtcNow );
|
||||
m_Timer.Start();
|
||||
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
TimeSpan duration = TimeSpan.FromSeconds( 10.0 );
|
||||
|
||||
m_Timer = new InternalTimer( this, duration );
|
||||
m_Timer.Start();
|
||||
|
||||
m_End = DateTime.UtcNow + duration;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnMoveOver( Mobile m )
|
||||
{
|
||||
int noto;
|
||||
|
||||
if ( m is PlayerMobile )
|
||||
{
|
||||
noto = Notoriety.Compute( m_Caster, m );
|
||||
if ( noto == Notoriety.Enemy || noto == Notoriety.Ally )
|
||||
return false;
|
||||
}
|
||||
return base.OnMoveOver( m );
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
if ( m_Timer != null )
|
||||
m_Timer.Stop();
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private InternalItem m_Item;
|
||||
|
||||
public InternalTimer( InternalItem item, TimeSpan duration ) : base( duration )
|
||||
{
|
||||
Priority = TimerPriority.OneSecond;
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_Item.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private WallOfStoneSpell m_Owner;
|
||||
|
||||
public InternalTarget( WallOfStoneSpell owner ) : base( Core.ML ? 10 : 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue