Server Crash Report
===================

RunUO Version 0.5, Build 5378.29362
Operating System: Microsoft Windows NT 6.1.7601 Service Pack 1
.NET Framework: 4.0.30319.34209
Time: 3/4/2016 4:52:34 AM
Mobiles: 39946
Items: 210759
Exception:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Server.Custom.AdvancedPlayerGate.UseGate(Mobile m)
at Server.Items.Moongate.BeginConfirmation(Mobile from)
at Server.Timer.Slice() in c:\Users\Mike\Desktop\SERVUO\Server\Timer.cs:line 387
at Server.Core.Main(String[] args) in c:\Users\Mike\Desktop\SERVUO\Server\Main.cs:line 622

Clients:
- Count: 1
+ 127.0.0.1: (account = Krislegend) (mobile = 0xF 'Vanquisher')




When Using Advanced Player Gate server crashes and this error comes up
 
With this very little bit of information it looks like you set up the gate with more entries than it can hold. So you may have to increase the gates location array.

But thats like all that can be seen with just the error message and not the code of it
 
I dont know what version you run nor the changes you did so that is hard to say (and apparently it is for setting skills or something?)
 
public override void UseGate( Mobile m )
{
OptimizeItemsList();
// Murderers are not allowed to use the gate.
if ( m.Kills >= 5 )
{
m.SendLocalizedMessage( 1019004 );
}
// If you cast a spell, you are too busy to use the gate.
else if ( m.Spell != null )
{
m.SendLocalizedMessage( 1049616 );
}
else if ( m_PlayerCountMax <= m_PlayersPassed && m_PlayerCountLimited )
{
m.SendMessage( m_PlayerCountExeededMessage );
}
else
{
if (_ChangesStats)
{
m.Str = this.m_Str;
m.Dex = this.m_Dex;
m.Int = this.m_Int;
}

if (_DoesResurrect && !m.Alive)
{
// THIS PART IS FOR "PERMADEATH" SHARDS...(or Semi-Permanent)
// We (optionally) rename the character to show that the original
// character 'died' and the new one takes their place.
// Essentially, the 'New' character is like a child, who must start new
// but inherits the property of the parent.
if (_DoesRename)
{
string nam = m.Name;
int last = nam.Length;
if (nam.Substring(last-2,2) == " I") nam = nam + "I";
else if (nam.Substring(last-3,3) == " II") nam = nam + "I";
else if (nam.Substring(last-3,3) == "III") nam = nam.Substring(0,last-2) + "V";
else if (nam.Substring(last-2,2) == "IV") nam = nam.Substring(0,last-2) + "V";
else if (nam.EndsWith(" V"))
{
if ( m.Female )
nam = NameList.RandomName( "female" );
else
nam = NameList.RandomName( "male" );
}
else nam = nam + " II";

m.Name = nam;
}
m.Resurrect();
}

if (_DoesTeleport)
{
m.Map = this.TargetMap;
m.Location = this.Target;
}

if (_ChangesSkills)
{
Server.Skills skills = m.Skills;
for ( int i = 0; i < skills.Length; ++i ) skills.Base = gAllSkills;
}

if (_ChangesCaps)
{
Server.Skills skills = m.Skills;
for ( int i = 0; i < skills.Length; ++i ) skills.Cap = gAllSkillCaps;
}

if (_ChangesHue) m.Hue = this.Hue;

if (_SkillsGiveItems)
{
Server.Skills s = m.Skills;
for ( int i = 0; i < s.Length; ++i )
if (gAllSkills >= _SkillsItemsMin)
SkillsItems((SkillName)i, m);
}

if (m_TitleAdds)
{
m.Title = this.m_TitleToAdd;
}

//TODO: Create Method for how the Gate knows that you previously passed through...
if ( m_TakesBackGivenItems )
{
if ( MC_ItemsToGive.Count > 0 )
{
for( int i = 0; i < MC_ItemsToGive.Count; i++)
{
if (MC_ItemsToGive is Item)
{
m.Backpack.ConsumeUpTo( ((Item)(MC_ItemsToGive)).GetType(), ((Item)(MC_ItemsToGive)).Amount );
}
}
}
}

//TODO: Create Method for how to tell the Gate what Items are included in this list...
if (m_GivesItems)
{
if ( MC_ItemsToGive.Count > 0 )
{
for( int i = 0; i < MC_ItemsToGive.Count; i++)
{
if (MC_ItemsToGive is Item)
{
Item item = (Item)MC_ItemsToGive;
if (m_GivesBlessedItems)
{
item.LootType = LootType.Blessed;
}

if( item.Stackable )
PackItem( item, m ) ;
else
{
int times = 0;
int amount = item.Amount;
item.Amount = 1;
while( times < amount )
{
m.Backpack.AddItem( item );
times++;
}
}
}
}
}
}


m.PlaySound( 0x1FE );
m_PlayersPassed++;
}
}
 
Ok, so i don't really know too much about this script, but the part that was suspicious for me was the following

Code:
//TODO: Create Method for how the Gate knows that you previously passed through...
if ( m_TakesBackGivenItems )
{
	if ( MC_ItemsToGive.Count > 0 )
	{
		for( int i = 0; i < MC_ItemsToGive.Count; i++)
		{
			if (MC_ItemsToGive is Item)
			{
				m.Backpack.ConsumeUpTo( ((Item)(MC_ItemsToGive)).GetType(), ((Item)(MC_ItemsToGive)).Amount );
			}
		}
	}
}

//TODO: Create Method for how to tell the Gate what Items are included in this list...
if (m_GivesItems)
{
	if ( MC_ItemsToGive.Count > 0 )
	{
		for( int i = 0; i < MC_ItemsToGive.Count; i++)
		{
			if (MC_ItemsToGive is Item)
			{
				Item item = (Item)MC_ItemsToGive;
				if (m_GivesBlessedItems)
				{
					item.LootType = LootType.Blessed;
				}

				if( item.Stackable )
					PackItem( item, m ) ;
				else
				{
					int times = 0;
					int amount = item.Amount;
					item.Amount = 1;
					while( times < amount )
					{
						m.Backpack.AddItem( item );
						times++;
					}
				}
			}
		}
	}
}

I don't know what MC_ItemsToGive is, but it looks like a list to me. Why are you turning the *entire* list into a single item? I think you are missing a \[i\] after every mention of MC_ItemsToGive.

Try copy/pasting the following code and see if you get the same error

Code:
//TODO: Create Method for how the Gate knows that you previously passed through...
if ( m_TakesBackGivenItems )
{
	if ( MC_ItemsToGive.Count > 0 )
	{
		for( int i = 0; i < MC_ItemsToGive.Count; i++)
		{
			if (MC_ItemsToGive[i] is Item)
			{
				m.Backpack.ConsumeUpTo( ((Item)(MC_ItemsToGive[i])).GetType(), ((Item)(MC_ItemsToGive[i])).Amount );
			}
		}
	}
}

//TODO: Create Method for how to tell the Gate what Items are included in this list...
if (m_GivesItems)
{
	if ( MC_ItemsToGive.Count > 0 )
	{
		for( int i = 0; i < MC_ItemsToGive.Count; i++)
		{
			if (MC_ItemsToGive[i] is Item)
			{
				Item item = (Item)MC_ItemsToGive[i];
				if (m_GivesBlessedItems)
				{
					item.LootType = LootType.Blessed;
				}

				if( item.Stackable )
					PackItem( item, m ) ;
				else
				{
					int times = 0;
					int amount = item.Amount;
					item.Amount = 1;
					while( times < amount )
					{
						m.Backpack.AddItem( item );
						times++;
					}
				}
			}
		}
	}
}
 
Back