#W# Initial Commit: Avatars Conquest

This commit is contained in:
WarrentyExpired 2026-07-03 20:19:48 -04:00
commit 8eae46895e
7512 changed files with 416187 additions and 0 deletions

View file

@ -0,0 +1,72 @@
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 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 );
}
FinishSequence();
}
private class InternalTarget : Target
{
private BlessSpell m_Owner;
public InternalTarget( BlessSpell 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,84 @@
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 = 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( 0x44B );
SpellHelper.Damage( this, m, damage );
}
FinishSequence();
}
private class InternalTarget : Target
{
private FireballSpell m_Owner;
public InternalTarget( FireballSpell 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,124 @@
using System;
using Server.Targeting;
using Server.Network;
using Server.Items;
using Server.Regions;
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 )
{
// 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();
}
public void Targets( BaseDoor targ )
{
if ( !(Caster.Region is DungeonRegion) )
{
Caster.SendMessage( "This spell only works on dungeon doors." );
}
else if ( targ.Sealed > DateTime.Now )
{
Caster.SendMessage( "That door is already magically locked." );
}
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 door is now locked!
Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 502401 );
double time = Caster.Skills[SkillName.Magery].Value + Caster.Skills[SkillName.Concentration].Value + 20.0;
DateTime currentTime = DateTime.Now;
DateTime laterTime = currentTime.AddSeconds(time);
targ.Sealed = laterTime;
}
FinishSequence();
}
private class InternalTarget : Target
{
private MagicLockSpell m_Owner;
public InternalTarget( MagicLockSpell owner ) : base( 12, false, TargetFlags.None )
{
m_Owner = owner;
}
protected override void OnTarget( Mobile from, object o )
{
if ( o is LootChest )
((LootChest)o).Setup();
if ( o is LockableContainer )
m_Owner.Target( (LockableContainer)o );
else if ( o is BaseDoor )
m_Owner.Targets( (BaseDoor)o );
else
from.SendMessage( "Target must be an unlocked chest or dungeon door." );
}
protected override void OnTargetFinish( Mobile from )
{
m_Owner.FinishSequence();
}
}
}
}

View file

@ -0,0 +1,103 @@
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;
double total = Caster.Skills[SkillName.Magery].Value + Caster.Skills[SkillName.Poisoning].Value;
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 > 170.0 )
level = 2;
else if ( total > 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( 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,112 @@
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( 12, false, TargetFlags.None )
{
m_Owner = owner;
}
protected override void OnTarget( Mobile from, object o )
{
if ( o is LootChest )
((LootChest)o).Setup();
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 );
}
}

View file

@ -0,0 +1,121 @@
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 ( Server.Misc.WeightOverloading.IsOverloaded( Caster ) )
{
Caster.SendLocalizedMessage( 502359, "", 0x22 ); // Thou art too encumbered to move.
return false;
}
return true;
}
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 );
if ( Server.Misc.WeightOverloading.IsOverloaded( Caster ) )
{
Caster.SendLocalizedMessage( 502359, "", 0x22 ); // Thou art too encumbered to move.
}
else if ( map == null || !map.CanSpawnMobile( p.X, p.Y, p.Z ) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( SpellHelper.CheckMulti( new Point3D( p ), map ) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( CheckSequence() )
{
SpellHelper.Turn( Caster, orig );
Mobile m = Caster;
Point3D from = m.Location;
Point3D to = new Point3D( p );
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( 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();
}
}
}
}

View file

@ -0,0 +1,104 @@
using System;
using Server.Targeting;
using Server.Network;
using Server.Items;
using Server.Regions;
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( 12, false, TargetFlags.None )
{
m_Owner = owner;
}
protected override void OnTarget( Mobile from, object o )
{
if ( o is LootChest )
((LootChest)o).Setup();
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 BaseDoor )
{
BaseDoor door = (BaseDoor)o;
if ( door.Sealed < DateTime.Now )
from.SendMessage( "That does not need to be unlocked." );
else
{
door.Sealed = DateTime.MinValue;
}
}
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 + from.Skills[SkillName.Concentration].Value ) * 0.4) - 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();
}
}
}
}

View file

@ -0,0 +1,213 @@
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.Now + 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.Now );
m_Timer.Start();
break;
}
case 0:
{
TimeSpan duration = TimeSpan.FromSeconds( 10.0 );
m_Timer = new InternalTimer( this, duration );
m_Timer.Start();
m_End = DateTime.Now + duration;
break;
}
}
}
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( 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();
}
}
}
}