chris1212
Member
So I have two scripts working perfectly on my shard but I copied them, changed the class names to the new items and mob and I get constant fatal errors and I'm out of ideas. I'll post the two old scripts and the two new scripts.
Old working scripts:
These are the scripts creating issues with other scripts and causing an error.
The error is:
Error:
System.ArgumentException: The path is not of a legal form.
at System.IO.Path.NormalizePathFast(String path, Boolean fullCheck)
at System.IO.Path.GetFullPath(String path)
at Server.ScriptCompiler.Display(CompilerResults results)
at Server.ScriptCompiler.CompileCSScripts(Boolean debug, Assembly& assembly)
at Server.ScriptCompiler.Compile(Boolean debug)
at Server.Core.Main(String[] args)
This exception is fatal, press return to exit
Old working scripts:
Code:
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.ContextMenus;
using Server.Misc;
using Server.Targeting;
using Server.Items;
using Server.Spells;
using Server.Network;
namespace Server.Mobiles
{
[CorpseName( "Trinas corpse" )]
public class HolyAdminTrina : BaseCreature
{
private Timer m_Timer;
public override bool IsScaryToPets{ get{ return true; } }
public override bool BardImmune { get { return !Core.SE; } }
public override bool Unprovokable { get { return true; } }
[Constructable]
public HolyAdminTrina() : base( AIType.AI_Animal, FightMode.Closest, 10, 1, 0.02, 0.04 )
{
Name = "The Holy Admin Trina";
Body = 0x7A;
Hue = 2391;
SetStr( 760, 850 );
SetDex( 102, 150 );
SetInt( 152, 200 );
SetHits( 200000 );
SetHits( 360000, 520000 );
SetDamage( 67, 84 );
SetResistance( ResistanceType.Physical, 70, 80 );
SetResistance( ResistanceType.Fire, 55, 65 );
SetResistance( ResistanceType.Cold, 55, 65 );
SetResistance( ResistanceType.Poison, 55, 65 );
SetResistance( ResistanceType.Energy, 55, 65 );
SetSkill( SkillName.MagicResist, 70.4, 80.0 );
SetSkill( SkillName.Tactics, 100.1, 120.0 );
SetSkill( SkillName.Wrestling, 190.1, 200.0 );
SetSkill( SkillName.Swords, 80.1, 95.0 );
SetSkill( SkillName.Macing, 80.1, 90.0 );
SetSkill( SkillName.Fencing, 80.1, 90.0 );
SetSkill( SkillName.Anatomy, 75.5, 80.0 );
SetSkill( SkillName.Magery, 60.1, 70.0 );
SetSkill( SkillName.EvalInt, 55.1, 60.0 );
SetSkill( SkillName.Meditation, 55.1, 60.0 );
Fame = 1000000;
Karma = 1000000;
Tamable = false;
VirtualArmor = 100000;
BreathOfOnslaught weapon = new BreathOfOnslaught();
weapon.Hue = 2447;
weapon.Movable = false;
AddItem( weapon );
m_Timer = new TeleportTimer( this );
m_Timer.Start();
}
public override void OnGotMeleeAttack( Mobile attacker )
{
base.OnGotMeleeAttack( attacker );
if (attacker is BaseCreature )
attacker.Kill();
}
public override void AlterMeleeDamageFrom( Mobile from, ref int damage )
{
if ( from is BaseCreature )
{
BaseCreature bc = (BaseCreature)from;
if ( bc.Controlled || bc.BardTarget == this )
damage = 0;
}
}
public override void OnGaveMeleeAttack( Mobile defender )
{
base.OnGaveMeleeAttack( defender );
if ( 0.75 >= Utility.RandomDouble() )
PoisonStrike();
else
if (defender is BaseCreature )
defender.Kill();
}
public void PoisonStrike()
{
Map map = this.Map;
if ( map == null )
return;
ArrayList targets = new ArrayList();
foreach ( Mobile m in this.GetMobilesInRange( 18 ) )
{
if ( m == this || !CanBeHarmful( m ) )
continue;
if ( m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != this.Team) )
targets.Add( m );
else if ( m.Player )
targets.Add( m );
}
PlaySound( 0x229 );
for ( int i = 0; i < targets.Count; ++i )
{
Mobile m = (Mobile)targets[i];
double damage = m.Hits * 0.95;
if ( damage < 450.0 )
damage = 450.0;
else if ( damage > 525.0 )
damage = 525.0;
DoHarmful( m );
AOS.Damage( m, this, (int)damage, 0, 100, 100, 100, 100 );
if ( m.Alive && m.Body.IsHuman && !m.Mounted )
m.Animate( 20, 7, 1, true, false, 0 );
Effects.SendLocationParticles( EffectItem.Create( m.Location, m.Map, EffectItem.DefaultDuration ), 0x36B0, 1, 14, 63, 7, 9915, 0 );
}
}
public override bool OnBeforeDeath()
{
if (Utility.Random(100) < 30) // 20% chance to drop
switch (Utility.Random(22))
{
case 0: PackItem(new TrinasCloak()); break;
case 1: PackItem(new Hermessandals()); break;
case 2: PackItem(new Tokens(10000, 25000)); break;
case 3: PackItem(new HexBottleCap()); break;
case 4: PackItem(new TemhotaBottleCap()); break;
case 5: PackItem(new VincentValentineBottleCap()); break;
case 6: PackItem(new ZinjBottleCap()); break;
case 7: PackItem(new MysticaBottleCap()); break;
case 8: PackItem(new LordDudeBottleCap()); break;
case 9: PackItem(new TheIllusionistBottleCap()); break;
case 10: PackItem(new TrinaBottleCap()); break;
case 11: PackItem(new TrinaBottleCap()); break;
case 12: PackItem(new TrinaBottleCap()); break;
case 13: PackItem(new TrinaBottleCap()); break;
case 14: PackItem(new TrinaBottleCap()); break;
case 15: PackItem(new TrinaBottleCap()); break;
case 16: PackItem(new TrinaBottleCap()); break;
case 17: PackItem(new TrinaBottleCap()); break;
case 18: PackItem(new TrinaBottleCap()); break;
case 19: PackItem(new TrinaBottleCap()); break;
case 20: PackItem(new Tokens(10000, 25000)); break;
case 21: PackItem(new Tokens(10000, 25000)); break;
}
return base.OnBeforeDeath();
}
public static void DistributeArtifact(Mobile to, Item artifact)
{
if (to == null || artifact == null)
return;
Container pack = to.Backpack;
if (pack == null || !pack.TryDropItem(to, artifact, false))
to.BankBox.DropItem(artifact);
to.SendLocalizedMessage(1062317); // For your valor in combating the fallen beast, a special artifact has been bestowed on you.
}
public HolyAdminTrina( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
private class TeleportTimer : Timer
{
private Mobile m_Owner;
private static int[] m_Offsets = new int[]
{
-1, -1,
-1, 0,
-1, 1,
0, -1,
0, 1,
1, -1,
1, 0,
1, 1
};
public TeleportTimer( Mobile owner ) : base( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 3.0 ) )
{
m_Owner = owner;
}
protected override void OnTick()
{
if ( m_Owner.Deleted )
{
Stop();
return;
}
Map map = m_Owner.Map;
if ( map == null )
return;
if ( 0.9 < Utility.RandomDouble() )
return;
Mobile toTeleport = null;
foreach ( Mobile m in m_Owner.GetMobilesInRange( 19 ) )
{
if ( m != m_Owner && m.Player && m_Owner.CanBeHarmful( m ) && m_Owner.CanSee( m ) )
{
toTeleport = m;
break;
}
}
if ( toTeleport != null )
{
int offset = Utility.Random( 8 ) * 2;
Point3D to = m_Owner.Location;
for ( int i = 0; i < m_Offsets.Length; i += 2 )
{
int x = m_Owner.X + m_Offsets[(offset + i) % m_Offsets.Length];
int y = m_Owner.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];
if ( map.CanSpawnMobile( x, y, m_Owner.Z ) )
{
to = new Point3D( x, y, m_Owner.Z );
break;
}
else
{
int z = map.GetAverageZ( x, y );
if ( map.CanSpawnMobile( x, y, z ) )
{
to = new Point3D( x, y, z );
break;
}
}
}
Mobile m = toTeleport;
Point3D from = m.Location;
m.Location = to;
Server.Spells.SpellHelper.Turn( m_Owner, toTeleport );
Server.Spells.SpellHelper.Turn( toTeleport, m_Owner );
m.ProcessDelta();
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 );
m.PlaySound( 1383 );
m_Owner.Combatant = toTeleport;
}
}
}
}
}
Code:
//Created By Fleshwound
using System;
namespace Server.Items
{
[FlipableAttribute( 0x2FB8, 0x3172 )]
public class FleshwoundsAllSeeingEyes : BaseArmor
{
public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Plate; } }
[Constructable]
public FleshwoundsAllSeeingEyes() : base( 0x2FB8 )
{
Name = "Fleshwounds All Seeing Eyes";
Hue = 0;
Weight = 1.0;
Layer = Layer.Talisman;
Attributes.BonusHits = 60;
Attributes.BonusStr = 45;
Attributes.BonusInt = 100;
Attributes.CastRecovery = 3;
Attributes.CastSpeed = 1;
Attributes.LowerManaCost = 25;
Attributes.LowerRegCost = 100;
Attributes.Luck = 2250;
Attributes.NightSight = 1;
}
public FleshwoundsAllSeeingEyes( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}
These are the scripts creating issues with other scripts and causing an error.
Code:
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.ContextMenus;
using Server.Misc;
using Server.Targeting;
using Server.Items;
using Server.Spells;
using Server.Network;
namespace Server.Mobiles
{
[CorpseName( "Sutats's Corpse" )]
public class SutatsObserver : BaseCreature
{
private Timer m_Timer;
public override bool IsScaryToPets{ get{ return true; } }
public override bool BardImmune { get { return !Core.SE; } }
public override bool Unprovokable { get { return true; } }
[Constructable]
public SutatsObserver() : base( AIType.AI_Animal, FightMode.Closest, 10, 1, 0.02, 0.04 )
{
Name = "Sutats The Observer";
Body = 22;
Hue = 2614;
SetStr( 760, 850 );
SetDex( 102, 150 );
SetInt( 152, 200 );
SetHits( 300000, 650000 );
SetDamage( 120, 181 );
SetResistance( ResistanceType.Physical, 91, 99 );
SetResistance( ResistanceType.Fire, 80, 90 );
SetResistance( ResistanceType.Cold, 80, 90 );
SetResistance( ResistanceType.Poison, 80, 90 );
SetResistance( ResistanceType.Energy, 80, 90 );
SetSkill( SkillName.MagicResist, 120.4, 160.0 );
SetSkill( SkillName.Tactics, 100.1, 120.0 );
SetSkill( SkillName.Wrestling, 190.1, 200.0 );
SetSkill( SkillName.Swords, 190.1, 200.0 );
SetSkill( SkillName.Macing, 190.1, 200.0 );
SetSkill( SkillName.Fencing, 190.1, 200.0 );
SetSkill( SkillName.Anatomy, 90.5, 100.0 );
SetSkill( SkillName.Magery, 90.1, 100.0 );
SetSkill( SkillName.EvalInt, 90.1, 100.0 );
SetSkill( SkillName.Meditation, 90.1, 100.0 );
Fame = 1000000;
Karma = 1000000;
Tamable = false;
VirtualArmor = 500000;
BreathOfOnslaught weapon = new BreathOfOnslaught();
weapon.Hue = 2447;
weapon.Movable = false;
AddItem( weapon );
m_Timer = new TeleportTimer( this );
m_Timer.Start();
}
public override void OnGotMeleeAttack( Mobile attacker )
{
base.OnGotMeleeAttack( attacker );
if (attacker is BaseCreature )
attacker.Kill();
}
public override void AlterMeleeDamageFrom( Mobile from, ref int damage )
{
if ( from is BaseCreature )
{
BaseCreature bc = (BaseCreature)from;
if ( bc.Controlled || bc.BardTarget == this )
damage = 0;
}
}
public override void OnGaveMeleeAttack( Mobile defender )
{
base.OnGaveMeleeAttack( defender );
if ( 0.75 >= Utility.RandomDouble() )
PoisonStrike();
else
if (defender is BaseCreature )
defender.Kill();
}
public void PoisonStrike()
{
Map map = this.Map;
if ( map == null )
return;
ArrayList targets = new ArrayList();
foreach ( Mobile m in this.GetMobilesInRange( 18 ) )
{
if ( m == this || !CanBeHarmful( m ) )
continue;
if ( m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != this.Team) )
targets.Add( m );
else if ( m.Player )
targets.Add( m );
}
PlaySound( 0x229 );
for ( int i = 0; i < targets.Count; ++i )
{
Mobile m = (Mobile)targets[i];
double damage = m.Hits * 0.95;
if ( damage < 450.0 )
damage = 450.0;
else if ( damage > 525.0 )
damage = 525.0;
DoHarmful( m );
AOS.Damage( m, this, (int)damage, 0, 100, 100, 100, 100 );
if ( m.Alive && m.Body.IsHuman && !m.Mounted )
m.Animate( 20, 7, 1, true, false, 0 );
Effects.SendLocationParticles( EffectItem.Create( m.Location, m.Map, EffectItem.DefaultDuration ), 0x36B0, 1, 14, 63, 7, 9915, 0 );
}
}
public override bool OnBeforeDeath()
{
if (Utility.Random(100) < 20) // 3% chance to drop
switch (Utility.Random(22))
{
case 0: PackItem(new SutatsEyes()); break;
case 1: PackItem(new Tokens(10000, 25000)); break;
case 2: PackItem(new HexBottleCap()); break;
case 3: PackItem(new TemhotaBottleCap()); break;
case 4: PackItem(new VincentValentineBottleCap()); break;
case 5: PackItem(new ZinjBottleCap()); break;
case 6: PackItem(new MysticaBottleCap()); break;
case 7: PackItem(new LordDudeBottleCap()); break;
case 8: PackItem(new TheIllusionistBottleCap()); break;
}
return base.OnBeforeDeath();
}
public static void DistributeArtifact(Mobile to, Item artifact)
{
if (to == null || artifact == null)
return;
Container pack = to.Backpack;
if (pack == null || !pack.TryDropItem(to, artifact, false))
to.BankBox.DropItem(artifact);
to.SendLocalizedMessage(1062317); // For your valor in combating the fallen beast, a special artifact has been bestowed on you.
}
public SutatsObserver( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
private class TeleportTimer : Timer
{
private Mobile m_Owner;
private static int[] m_Offsets = new int[]
{
-1, -1,
-1, 0,
-1, 1,
0, -1,
0, 1,
1, -1,
1, 0,
1, 1
};
public TeleportTimer( Mobile owner ) : base( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 3.0 ) )
{
m_Owner = owner;
}
protected override void OnTick()
{
if ( m_Owner.Deleted )
{
Stop();
return;
}
Map map = m_Owner.Map;
if ( map == null )
return;
if ( 0.9 < Utility.RandomDouble() )
return;
Mobile toTeleport = null;
foreach ( Mobile m in m_Owner.GetMobilesInRange( 19 ) )
{
if ( m != m_Owner && m.Player && m_Owner.CanBeHarmful( m ) && m_Owner.CanSee( m ) )
{
toTeleport = m;
break;
}
}
if ( toTeleport != null )
{
int offset = Utility.Random( 8 ) * 2;
Point3D to = m_Owner.Location;
for ( int i = 0; i < m_Offsets.Length; i += 2 )
{
int x = m_Owner.X + m_Offsets[(offset + i) % m_Offsets.Length];
int y = m_Owner.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];
if ( map.CanSpawnMobile( x, y, m_Owner.Z ) )
{
to = new Point3D( x, y, m_Owner.Z );
break;
}
else
{
int z = map.GetAverageZ( x, y );
if ( map.CanSpawnMobile( x, y, z ) )
{
to = new Point3D( x, y, z );
break;
}
}
}
Mobile m = toTeleport;
Point3D from = m.Location;
m.Location = to;
Server.Spells.SpellHelper.Turn( m_Owner, toTeleport );
Server.Spells.SpellHelper.Turn( toTeleport, m_Owner );
m.ProcessDelta();
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 );
m.PlaySound( 1383 );
m_Owner.Combatant = toTeleport;
}
}
}
}
}
Code:
using System;
namespace Server.Items
{
[FlipableAttribute( 0x2FB8, 0x3172 )]
public class SutatsEyes : BaseArmor
{
public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Plate; } }
[Constructable]
public SutatsEyes() : base( 0x2FB8 )
{
Name = "<Body bgcolor=Black; text=white><center>Sutats's Vengful Eyes";
Hue = 2255;
Weight = 1.0;
Layer = Layer.Talisman;
Attributes.BonusHits - 65
Attributes.RegenHits = 55;
Attributes.BonusStr = 35;
Attributes.BonusInt = 50;
Attributes.CastRecovery = 3;
Attributes.LowerRegCost = 100;
Attributes.Luck = 1250;
}
public SutatsEyes( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}
The error is:
Error:
System.ArgumentException: The path is not of a legal form.
at System.IO.Path.NormalizePathFast(String path, Boolean fullCheck)
at System.IO.Path.GetFullPath(String path)
at Server.ScriptCompiler.Display(CompilerResults results)
at Server.ScriptCompiler.CompileCSScripts(Boolean debug, Assembly& assembly)
at Server.ScriptCompiler.Compile(Boolean debug)
at Server.Core.Main(String[] args)
This exception is fatal, press return to exit
Last edited: