I know there are other Threads with this problem.
But i wan´t to tell you my solution to this prob.
I edit 3 files: Charactercreation.cs , Nameverification.cs and Loginstats.cs.
And i write a gump, Namechangegump.
in Charactercreation.cs find:
and change it to:
past after it:
in nameverifaction.cs find:
past at least:
in LoginStats.cs find
and paste:
then drop into your custom folder namechangegump.cs
So when a player create a new char, and his given name is in use, it´s open a gump where he have to choose a new name. he also can´t walk until he has changed his name.
But i wan´t to tell you my solution to this prob.
I edit 3 files: Charactercreation.cs , Nameverification.cs and Loginstats.cs.
And i write a gump, Namechangegump.
in Charactercreation.cs find:
Code:
private static void SetName( Mobile m, string name )
{
..............
}
Code:
private static void SetName( Mobile m, string name )
{
name = name.Trim();
if (!CheckDupe(m, name))
m.Name = "Generic Player";
else
m.Name = name;
}
Code:
public static bool CheckDupe( Mobile m, string name )
{
if( m == null || name == null || name.Length == 0 )
return false;
string nametrim = name.Trim();
string nameToLower = nametrim.ToLower();
if( !NameVerification.Validate( nameToLower, 2, 16, true, true, true, 1, NameVerification.SpaceDashPeriodQuote ) )
return false;
foreach( Mobile mob in World.Mobiles.Values )
{
if( mob is PlayerMobile && mob != m && mob.RawName != null && mob.RawName.ToLower() == nameToLower)
{
return false;
}
}
return true;
}
in nameverifaction.cs find:
Code:
private static string[] m_Disallowed = new string[]
Code:
"generic player",
"generic",
"player"
in LoginStats.cs find
Code:
private static void EventSink_Login( LoginEventArgs args )
{
int userCount = NetState.Instances.Count;
int itemCount = World.Items.Count;
int mobileCount = World.Mobiles.Count;
Mobile m = args.Mobile;
m.SendMessage( "Welcome, {0}! There {1} currently {2} user{3} online, with {4} item{5} and {6} mobile{7} in the world.",
args.Mobile.Name,
userCount == 1 ? "is" : "are",
userCount, userCount == 1 ? "" : "s",
itemCount, itemCount == 1 ? "" : "s",
mobileCount, mobileCount == 1 ? "" : "s" );
PlayerMobile pm = (PlayerMobile)m;
Code:
#region CheckName
if (!CharacterCreation.CheckDupe(m, m.Name) && m.AccessLevel == AccessLevel.Player)
{
m.CantWalk = true;
m.SendGump( new NameChangeGump( m) );
}
#endregion
then drop into your custom folder namechangegump.cs
So when a player create a new char, and his given name is in use, it´s open a gump where he have to choose a new name. he also can´t walk until he has changed his name.