Full Version : Latest RunUO 2.0 server - rev 286
xmlspawner >>Misc >>Latest RunUO 2.0 server - rev 286
<< Prev | Next >>
ArteGordon- 01-12-2007
the server was not changed in either of those, but Scripts and Data were.
Erica- 01-13-2007
hmm weird mark update somes scripts then when he got to scripts svn 141 there was 2 scripts he updated it for 141 which are Unlock.cs and BaseTreasureChest.cs and i got theses following errors

CODE
Core: Optimizing for 2 processors Scripts: Compiling C# scripts...failed (2 errors, 0 warnings) Errors: + Items/Containers/BaseTreasureChest.cs: CS0122: Line 57: 'Server.Items.LockableContainer.m_Locked' is inaccessible d
ue to its protection level
CS0122: Line 59: 'Server.Items.LockableContainer.m_Locked' is inaccessible d
ue to its protection level
CS0122: Line 60: 'Server.Items.LockableContainer.m_Locked' is inaccessible d
ue to its protection level
CS0122: Line 62: 'Server.Items.LockableContainer.m_Locked' is inaccessible d
ue to its protection level
CS0122: Line 65: 'Server.Items.LockableContainer.m_Picker' is inaccessible d
ue to its protection level
+ Spells/Third/Unlock.cs:
CS1525: Line 76: Invalid expression term 'else'
CS1002: Line 76:; expected
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.

he must of been tire or something for this to happen heres the BaseTreasureChest

CODE
using Server; using Server.Items; using Server.Network; using System; using System.Collections;
namespace Server.Items
{
public class BaseTreasureChest : LockableContainer
{
private TreasureLevel m_TreasureLevel;
private short m_MaxSpawnTime = 60;
private short m_MinSpawnTime = 10;
private TreasureResetTimer m_ResetTimer;
[CommandProperty( AccessLevel.GameMaster )]
public TreasureLevel Level
{
get
{
return m_TreasureLevel;
}
set
{
m_TreasureLevel = value;
}
}
[CommandProperty( AccessLevel.GameMaster )]
public short MaxSpawnTime
{
get
{
return m_MaxSpawnTime;
}
set
{
m_MaxSpawnTime = value;
}
}
[CommandProperty( AccessLevel.GameMaster )]
public short MinSpawnTime
{
get
{
return m_MinSpawnTime;
}
set
{
m_MinSpawnTime = value;
}
}
public override bool IsDecoContainer
{
get{ return false; }
}
public BaseTreasureChest( int itemID ) : this( itemID, TreasureLevel.Level2 )
{
}
public BaseTreasureChest( int itemID, TreasureLevel level ) : base( itemID )
{
m_TreasureLevel = level;
Locked = true;
Movable = false;
SetLockLevel();
GenerateTreasure();
}
public BaseTreasureChest( Serial serial ) : base( serial )
{
}
public override string DefaultName
{
get
{
if ( this.Locked )
return "a locked treasure chest";
return "a treasure chest";
}
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
writer.Write( (byte) m_TreasureLevel );
writer.Write( m_MinSpawnTime );
writer.Write( m_MaxSpawnTime );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
m_TreasureLevel = (TreasureLevel)reader.ReadByte();
m_MinSpawnTime = reader.ReadShort();
m_MaxSpawnTime = reader.ReadShort();
if( !Locked )
StartResetTimer();
}
protected virtual void SetLockLevel()
{
switch( m_TreasureLevel )
{
case TreasureLevel.Level1:
this.RequiredSkill = this.LockLevel = 5;
break;
case TreasureLevel.Level2:
this.RequiredSkill = this.LockLevel = 20;
break;
case TreasureLevel.Level3:
this.RequiredSkill = this.LockLevel = 50;
break;
case TreasureLevel.Level4:
this.RequiredSkill = this.LockLevel = 70;
break;
case TreasureLevel.Level5:
this.RequiredSkill = this.LockLevel = 90;
break;
case TreasureLevel.Level6:
this.RequiredSkill = this.LockLevel = 100;
break;
}
}
private void StartResetTimer()
{
if( m_ResetTimer == null )
m_ResetTimer = new TreasureResetTimer( this );
else
m_ResetTimer.Delay = TimeSpan.FromMinutes( Utility.Random( m_MinSpawnTime, m_MaxSpawnTime ));
m_ResetTimer.Start();
}
protected virtual void GenerateTreasure()
{
int MinGold = 1;
int MaxGold = 2;
switch( m_TreasureLevel )
{
case TreasureLevel.Level1:
MinGold = 100;
MaxGold = 300;
break;
case TreasureLevel.Level2:
MinGold = 300;
MaxGold = 600;
break;
case TreasureLevel.Level3:
MinGold = 600;
MaxGold = 900;
break;
case TreasureLevel.Level4:
MinGold = 900;
MaxGold = 1200;
break;
case TreasureLevel.Level5:
MinGold = 1200;
MaxGold = 5000;
break;
case TreasureLevel.Level6:
MinGold = 5000;
MaxGold = 9000;
break;
}
DropItem( new Gold( MinGold, MaxGold ) );
}
public override void LockPick( Mobile from )
{
base.LockPick( from );
StartResetTimer();
}
public void ClearContents()
{
for ( int i = Items.Count - 1; i >= 0; --i )
{
if ( i < Items.Count )
Items[i].Delete();
}
}
public void Reset()
{
if( m_ResetTimer != null )
{
if( m_ResetTimer.Running )
m_ResetTimer.Stop();
}
Locked = true;
ClearContents();
GenerateTreasure();
}
public enum TreasureLevel
{
Level1,
Level2,
Level3,
Level4,
Level5,
Level6,
};
private class TreasureResetTimer : Timer
{
private BaseTreasureChest m_Chest;
public TreasureResetTimer( BaseTreasureChest chest ) : base ( TimeSpan.FromMinutes( Utility.Random( chest.MinSpawnTime, chest.MaxSpawnTime ) ) )
{
m_Chest = chest;
Priority = TimerPriority.OneMinute;
}
protected override void OnTick()
{
m_Chest.Reset();
}
}
}
}

any ideas and heres the Unlock

CODE
using System; using Server.Targeting; using Server.Network; using Server.Items; namespace Server.Spells.Third
{
public class UnlockSpell : Spell
{
private static SpellInfo m_Info = new SpellInfo(
"Unlock Spell", "Ex Por",
SpellCircle.Third,
215,
9001,
Reagent.Bloodmoss,
Reagent.SulfurousAsh
);
public UnlockSpell( 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.CheckSecured( targ ) )
{
// You cannot cast this on a secure item.
Caster.SendLocalizedMessage( 503098 );
}
else if ( CheckSequence() )
{
SpellHelper.Turn( Caster, targ );
Point3D loc = targ.GetWorldLocation();
Effects.SendLocationParticles(
EffectItem.Create( loc, targ.Map, EffectItem.DefaultDuration ),
0x376A, 9, 32, 5024 );
Effects.PlaySound( loc, targ.Map, 0x1FF );
if ( targ.Locked && targ.LockLevel != 0 )
{
double magery = Caster.Skills[SkillName.Magery].Value;
int level = (int)(magery * 0.8) - 4;
if ( level >= targ.RequiredSkill && !(targ is TreasureMapChest && ((TreasureMapChest)targ).Level > 2) )
{
targ.Locked = false;
if ( targ.LockLevel == -255 )
targ.LockLevel = targ.RequiredSkill - 10;
if ( targ.LockLevel == 0 )
targ.LockLevel = -1;
}
else
{
// My spell does not seem to have an effect on that lock.
Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503099 );
}
}
else
{
// That did not need to be unlocked.
Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503101 );
}
}
FinishSequence();
}
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 LockableContainer )
m_Owner.Target( (LockableContainer)o );
else
from.SendLocalizedMessage( 501666 ); // You can't unlock that!
// TODO: Really we can cast on anything, even mobiles, but it will effect and say 'That did not need to be unlocked'
}
protected override void OnTargetFinish( Mobile from )
{
m_Owner.FinishSequence();
}
}
}
}

ArteGordon- 01-13-2007
yeah, this change to the Lock property

CODE
[CommandProperty( AccessLevel.GameMaster )] public override bool Locked { get { return m_Locked; } set { if ( m_Locked != value ) {
m_Locked = value;
if ( !m_Locked )
StartResetTimer();
else
m_Picker = null;
InvalidateProperties();
}
}
}

makes invalid reference to the private m_Locked and m_Picker properties. There are different fixes, but they will have to decide how they want to handle it. The easiest way at the moment, is to simply mark those properties public in LockableContainer.cs for now.
public bool m_Locked;
public Mobile m_Picker;
or just wait for the fix which I'm sure will be soon
Erica- 01-13-2007
Ah ok i figure i'll wait leave the ones i had before hehe thanks.
ArteGordon- 01-13-2007
then in unlock.cs there is simply an extra else at line 76. It should just be deleted.
ArteGordon- 01-13-2007
rev 142 just up that fixes those files.
Erica- 01-13-2007
Ah Ok Thanks Again.
Erica- 01-13-2007
When i double clicked unlock icon and target the chest caught a crash

CODE
Server Crash Report =================== RunUO Version 2.0, Build 2564.7233 Operating System: Microsoft Windows NT 5.1.2600 Service Pack 2 .NET Framework: 2.0.50727.42
Time: 1/13/2007 10:41:28 AM
Mobiles: 5095
Items: 293710
Exception:
System.InvalidCastException: Specified cast is not valid.
at Server.Spells.Third.UnlockSpell.InternalTarget.OnTarget(Mobile from, Object o) in c:\Program Files\RunUO 2.0 SVN 138\Scripts\Spells\Third\Unlock.cs:line 47
at Server.Targeting.Target.Invoke(Mobile from, Object targeted)
at Server.Network.PacketHandlers.TargetResponse(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)

lol any idea or maybe he will figure it out mark hehe.
ArteGordon- 01-13-2007
yeah, this code is just wrong

CODE
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( (Point3D)loc, from.Map, EffectItem.DefaultDuration ), 0x376A, 9, 32, 5024 );

it is casting an IPoint3D as a Point3D. in the EffectItem.Create call. Cant do that.
Erica- 01-13-2007
was reported to RunUO Bug Track was fixed on svn 143 lol.
Erica- 01-13-2007
Core change and scripts Svn 145
Erica- 01-19-2007
SVN 149 Now ! Updated
Erica- 01-23-2007
Scripts got Updated to SVN 155.
Erica- 02-10-2007
SVN 157 Latest Update.
Red- 02-20-2007
SVN 159 is out, but I seem to crash on log in. I think I will go back and try 157 since it was the last posted here, and I haven't seen any complaints.
Server Crash Report
===================
RunUO Version 2.0, Build 2607.25681
Operating System: Microsoft Windows NT 5.1.2600 Service Pack 2
.NET Framework: 2.0.50727.42
Time: 2/20/2007 2:26:53 PM
Mobiles: 29792
Items: 227332
Exception:
System.InvalidCastException: Specified cast is not valid.
at Server.Spells.SpecialMove.ClearAllMoves(Mobile m) in e:\RunUO159\runuo 159\Scripts\Spells\Base\SpecialMove.cs:line 174
at Server.Mobiles.PlayerMobile.ClearSpecialMovesCallback(Object state) in e:\RunUO159\runuo 159\Scripts\Custom\SYSTEMS\FS Animal Taming\Distros\PlayerMobile.cs:line 833
at Server.Timer.DelayStateCallTimer.OnTick()
at Server.Timer.Slice()
at Server.Core.Main(String[] args)