ده Npc بياخد منك
1,000,000
Cps مقابل امو يغير اسم الشخصيه
بس فى شرط انك متكننش عامل Guild
الشرح
خش فى
Characters.cs
ابحث عن
كود:
public bool WeaponSkill(ushort AX, ushort AY, uint T)
حط فوقيها
كود:
public static bool ValidName(string Name, Character C)
{
if (Name.Length < 3 || Name.Length > 16)
return false;
if (Name.IndexOfAny(new char[15] { ' ', '~', '[', ']', '#', '*', '\', '/', '', ':', '"', '|', '?', '=' }) > -1) //this is all windows folder invalids characters
{
return false;
}
return true;
}
ابحث عن
كود:
public int DoubleExpLeft;
حط فوقيها
كود:
public string OldName;
خش فى
Database.cs
ابحث عن
كود:
public static void SaveSkill(Skill p, Character C)
حط ده فوقيه
كود:
public static void NewName(Character C)
{
if (C.MyGuild == null)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
cmd.Update("characters").Set("Name", C.Name).Where("EntityID", C.EntityID).Execute();
MySqlCommand cmd1 = new MySqlCommand(MySqlCommandType.UPDATE);
cmd1.Update("accounts").Set("Character", C.Name).Where("EntityID", C.EntityID).Execute();
MySqlCommand cmd2 = new MySqlCommand(MySqlCommandType.UPDATE);
cmd2.Update("tradepartner").Set("PartenerName", C.Name).Where("PartenerID", C.EntityID).Execute();
C.MyClient.Disconnect();
Database.SaveEmpire();
}
else
C.MyClient.LocalMessage(2005, System.Drawing.Color.Blue, "You Must Disapend Your Guild 1st");
}
حط ده فى
NpcDialog.cs
كود:
#region Change Your Name
case 5464564:
{
if (option == 0)
{
GC.SendPacket(Packets.NPCSay("Welcome I Can Change Your Name But You Must Don't Have Guild And You Name Not Contains Inligal Characters And You Must Be Have 1,000,000 CPs"));
GC.SendPacket(Packets.NPCLink("Im ready.", 1));
GC.SendPacket(Packets.NPCLink("I See", 255));
GC.SendPacket(Packets.NPCSetFace(15));
GC.SendPacket(Packets.NPCFinish());
}
if (option == 1)
{
GC.SendPacket(Packets.NPCSay("Write Your New Name"));
GC.SendPacket(Packets.NPCLink2("Here", 2));
GC.SendPacket(Packets.NPCLink("I See", 255));
GC.SendPacket(Packets.NPCSetFace(15));
GC.SendPacket(Packets.NPCFinish());
}
string Name = "";
if (option == 2 && GC.MyChar.CPs >= 1000000 &&(Game.Character.ValidName(ReadString(Data), GC.MyChar)))
{
Name = ReadString(Data);
MySqlCommand cmd5 = new MySqlCommand(MySqlCommandType.SELECT);
cmd5.Select("Characters").Where("Name", Name);
MySqlReader r = new MySqlReader(cmd5);
if (!r.Read())
{
GC.MyChar.OldName = GC.MyChar.Name;
GC.MyChar.CPs -= 1000000;
GC.MyChar.Name = ReadString(Data);
string path = (@"OldCODB\GM\ChangeName.txt");
http://TripLe.H StreamWriter H;
if (File.Exists(path))
{
H = File.AppendText(path);
H.WriteLine(DateTime.Now + " : " + GC.MyChar.OldName + " He/She Change Here Name To " + GC.MyChar.Name + " His ID and IP " + GC.MyChar.EntityID + ", " + GC.Soc.RemoteEndPoint.ToString().Split(':')[0].ToString() + "", FileMode.OpenOrCreate);
H.WriteLine("__________________________________________________________", FileMode.OpenOrCreate);
H.Close();
}
Database.NewName(GC.MyChar);
}
}
break;
}
#endregion
فى Npcs.Txt
حط ده
كود:
5464564 6000 2 0 1036 304 219
خش فى
كود:
bin\Debug\OldCODB\GM
اعمل ملف سميه
كود:
ChangeName.txt
ده هينزل فيه بيانات الهـ غير اسمو
مثال
كود:
2/11/2011 2:14:23 PM : Abdallah He/She Change Here Name To TripLe.H His ID and IP 1000225, ***.***.***
__________________________________________________________
طيعا *** ده الاى بى بتاعى
فى TelePort.cs
دور على
كود:
Game.World.Spawns(GC.MyChar, true);
حط ده تحتيه
كود:
MySqlCommand cmds10 = new MySqlCommand(MySqlCommandType.UPDATE);
cmds10.Update("accounts").Set("EntityID", GC.MyChar.EntityID).Where("Character", GC.MyChar.Name).Execute();
بعدين روح عن Navicat
وحط Fiedl جديد
فى accounts
Name
EntityID
Tybe
bigint
Length
255
Decimals
0
وعلم على Unsigned