osama
2019-06-19, 11:21 PM
اول حاجة هنحل مشكلة تغير الاسم الى طبعا معظم الناس بتواجهم لما يغيرو الاسم اللانبى سى بيدى للى بيغر اسمة 1 سبس بدل ما ياخد منة 810
معنا انهردة حل المشكلة دى
اول حاجة هنخش على المسار دة فى السورس
Network هنختار منها ملف اسمو
PacketHandler.cs او MsgItemHandler.cs
هنفتحو
وبعدين هنبحث عن
#region ChangeName (2080)
وهبدلة كلة بى دة
#region ChangeName (2080)
case 0x820:
Mr_Panda.Network.GamePackets.NameChange change = new Mr_Panda.Network.GamePackets.NameChange(false);
change.Deserialize(packet);
if (change.Action == Mr_Panda.Network.GamePackets.NameChange.NameChange Action.Request)
{
string name = Encoding.Default.GetString(packet, 10, 0x10).TrimEnd(new char[1]);
packet[6] = (byte)client.namechanges;
packet[8] = (byte)(100 - client.namechanges);
change.Send(client);
client.Send(change);
if ((name != "") && (name != ""))
{
if (!Npcs.InvalidCharacters(name) || !Npcs.InvalidCharacters3(name) || name.Contains("[") || name.Contains("]"))
{
NpcReply reply = new NpcReply(6, "im sorry not allowed now close the dialog and try again");
reply.OptionID = 0xff;
client.Send(reply.ToArray());
return;
}
Database.MySqlReader reader = new Database.MySqlReader(new Database.MySqlCommand(Database.MySqlCommandType.SE LECT).Select("entities").Where("name", name));
if (reader.Read())
{
packet[4] = 2;
change.Send(client);
client.Send(change);
return;
}
if (client.Player.ConquerPoints >= 810)
{
client.Player.ConquerPoints -= 810;
client.NewName = name;
Mr_Panda.Console.WriteLine(client.Player.Name + ", Changed hes Name to : " + name);
Kernel.SendWorldMessage(new Mr_Panda.Network.GamePackets.Message(client.Player .Name + ", Changed He's/Hers Name to " + name + ", Will be affected after Maint.", System.Drawing.Color.Red, 0x7d0), Program.Values);
client.namechanges += 1;
packet[4] = 1;
change.Send(client);
client.Send(change);
NpcReply reply = new NpcReply(6, "Your new name is : " + name + ", After server Restart You will get your new name.")
{
OptionID = 0xff
};
client.Send(reply.ToArray());
client.ChangeName(client);
}
else
{
NpcReply reply = new NpcReply(6, "Come back when you have " + 810 + " CPS.")
{
OptionID = 0xff
};
client.Send(reply.ToArray());
}
}
}
return;
#endregion ChangeName (2080)
وكدة الانبى سى اشتغل تمام وجربة هتلقية شغال 100% انشاء الله
تانى مشكلة الى هيا بتعا التحويل لولد او بنت
كل الى عليك هتفتح باكيت Npcs.cs
وهنبحث عن *****
#region Change Sex
وهنبدلة كلة بى دة
#region Change Sex
case 11002:
{
switch (npcRequest.OptionID)
{
case 0:
{
dialog.Text("Hello my friend " + client.Player.Name + " . I can help you to Change your Sex , this change for 1075 CPs , need to change ?");
dialog.Option("Yes Please.", 1);
dialog.Option("I don't care..", 255);
dialog.Avatar(110);
dialog.Send();
break;
}
case 1:
{
dialog.Text("Please choose now , need change from boy to girl ? or girl to boy ?");
dialog.Option("Boy To Girl.", 3);
dialog.Option("Girl To Boy.", 2);
dialog.Avatar(110);
dialog.Send();
break;
}
case 2:
{
dialog.Text("Please choose now , need size of your email big or small boy?");
dialog.Option("Small Boy.", 5);
dialog.Avatar(110);
dialog.Send();
break;
}
case 3:
{
dialog.Text("Please choose now , need size of your email big or small girl?");
dialog.Option("Big Girl.", 6);
dialog.Option("Small Girl.", 7);
dialog.Avatar(110);
dialog.Send();
break;
}
case 4:
{
if (client.Player.ConquerPoints >= 1075)
{
if (client.Player.Body == 2001 || client.Player.Body == 2002)
{
client.Equipment.Remove(9);
if (client.Equipment.Objects[9] != null)
client.Equipment.Objects[9] = null;
ClientEquip equips = new ClientEquip();
equips.DoEquips(client);
client.Send(equips);
client.NobilityInformation.Gender = 1;
client.Player.Spouse = "None";
client.Player.ConquerPoints -= 1075;
client.Player.Body = 1004;
client.NobilityInformation.Mesh = client.Player.Mesh;
client.Equipment.UpdateEntityPacket();
Database.EntityTable.SaveEntity(client);
client.Disconnect();
}
else
{
dialog.Text("Error");
}
}
else
{
dialog.Text("Sorry you Don't Have 1075 Cps?");
dialog.Option("Alright, Thank you.", 255);
}
break;
}
case 5:
{
if (client.Player.ConquerPoints >= 1075)
{
if (client.Player.Body == 2001 || client.Player.Body == 2002)
{
client.Equipment.Remove(9);
if (client.Equipment.Objects[9] != null)
client.Equipment.Objects[9] = null;
ClientEquip equips = new ClientEquip();
equips.DoEquips(client);
client.Send(equips);
client.NobilityInformation.Gender = 1;
client.Player.Spouse = "None";
client.Player.ConquerPoints -= 1075;
client.Player.Body = 1003;
client.NobilityInformation.Mesh = client.Player.Mesh;
client.Equipment.UpdateEntityPacket();
Database.EntityTable.SaveEntity(client);
client.Disconnect();
}
else
{
dialog.Text("Error");
}
}
else
{
dialog.Text("Sorry you Don't Have 1075 Cps?");
dialog.Option("Alright, Thank you.", 255);
}
break;
}
case 6:
{
if (client.Player.ConquerPoints >= 1075)
{
if (client.Player.Body == 1003 || client.Player.Body == 1004)
{
client.Equipment.Remove(9);
if (client.Equipment.Objects[9] != null)
client.Equipment.Objects[9] = null;
ClientEquip equips = new ClientEquip();
equips.DoEquips(client);
client.Send(equips);
client.NobilityInformation.Gender = 0;
client.Player.Spouse = "None";
client.Player.ConquerPoints -= 1075;
client.Player.Body = 2002;
client.NobilityInformation.Mesh = client.Player.Mesh;
client.Equipment.UpdateEntityPacket();
Database.EntityTable.SaveEntity(client);
client.Disconnect();
}
else
{
dialog.Text("Error");
}
}
else
{
dialog.Text("Sorry you Don't Have 1075 Cps?");
dialog.Option("Alright, Thank you.", 255);
}
break;
}
case 7:
{
if (client.Player.ConquerPoints >= 1075)
{
if (client.Player.Body == 1003 || client.Player.Body == 1004)
{
client.Equipment.Remove(9);
if (client.Equipment.Objects[9] != null)
client.Equipment.Objects[9] = null;
ClientEquip equips = new ClientEquip();
equips.DoEquips(client);
client.Send(equips);
client.NobilityInformation.Gender = 0;
client.Player.Spouse = "None";
client.Player.ConquerPoints -= 1075;
client.Player.Body = 2002;
client.NobilityInformation.Mesh = client.Player.Mesh;
client.Equipment.UpdateEntityPacket();
Database.EntityTable.SaveEntity(client);
client.Disconnect();
}
else
{
dialog.Text("Error");
}
}
else
{
dialog.Text("Sorry you Don't Have 1075 Cps?");
dialog.Option("Alright, Thank you.", 255);
}
break;
}
}
break;
}
#endregion
اى مشكلة تواجهوها اتركو كومنت هنا وسوف يتم الرد انشاء الله
وانشاء الله هيبئا مفيش مشكلة خالص بالتوفيق
معنا انهردة حل المشكلة دى
اول حاجة هنخش على المسار دة فى السورس
Network هنختار منها ملف اسمو
PacketHandler.cs او MsgItemHandler.cs
هنفتحو
وبعدين هنبحث عن
#region ChangeName (2080)
وهبدلة كلة بى دة
#region ChangeName (2080)
case 0x820:
Mr_Panda.Network.GamePackets.NameChange change = new Mr_Panda.Network.GamePackets.NameChange(false);
change.Deserialize(packet);
if (change.Action == Mr_Panda.Network.GamePackets.NameChange.NameChange Action.Request)
{
string name = Encoding.Default.GetString(packet, 10, 0x10).TrimEnd(new char[1]);
packet[6] = (byte)client.namechanges;
packet[8] = (byte)(100 - client.namechanges);
change.Send(client);
client.Send(change);
if ((name != "") && (name != ""))
{
if (!Npcs.InvalidCharacters(name) || !Npcs.InvalidCharacters3(name) || name.Contains("[") || name.Contains("]"))
{
NpcReply reply = new NpcReply(6, "im sorry not allowed now close the dialog and try again");
reply.OptionID = 0xff;
client.Send(reply.ToArray());
return;
}
Database.MySqlReader reader = new Database.MySqlReader(new Database.MySqlCommand(Database.MySqlCommandType.SE LECT).Select("entities").Where("name", name));
if (reader.Read())
{
packet[4] = 2;
change.Send(client);
client.Send(change);
return;
}
if (client.Player.ConquerPoints >= 810)
{
client.Player.ConquerPoints -= 810;
client.NewName = name;
Mr_Panda.Console.WriteLine(client.Player.Name + ", Changed hes Name to : " + name);
Kernel.SendWorldMessage(new Mr_Panda.Network.GamePackets.Message(client.Player .Name + ", Changed He's/Hers Name to " + name + ", Will be affected after Maint.", System.Drawing.Color.Red, 0x7d0), Program.Values);
client.namechanges += 1;
packet[4] = 1;
change.Send(client);
client.Send(change);
NpcReply reply = new NpcReply(6, "Your new name is : " + name + ", After server Restart You will get your new name.")
{
OptionID = 0xff
};
client.Send(reply.ToArray());
client.ChangeName(client);
}
else
{
NpcReply reply = new NpcReply(6, "Come back when you have " + 810 + " CPS.")
{
OptionID = 0xff
};
client.Send(reply.ToArray());
}
}
}
return;
#endregion ChangeName (2080)
وكدة الانبى سى اشتغل تمام وجربة هتلقية شغال 100% انشاء الله
تانى مشكلة الى هيا بتعا التحويل لولد او بنت
كل الى عليك هتفتح باكيت Npcs.cs
وهنبحث عن *****
#region Change Sex
وهنبدلة كلة بى دة
#region Change Sex
case 11002:
{
switch (npcRequest.OptionID)
{
case 0:
{
dialog.Text("Hello my friend " + client.Player.Name + " . I can help you to Change your Sex , this change for 1075 CPs , need to change ?");
dialog.Option("Yes Please.", 1);
dialog.Option("I don't care..", 255);
dialog.Avatar(110);
dialog.Send();
break;
}
case 1:
{
dialog.Text("Please choose now , need change from boy to girl ? or girl to boy ?");
dialog.Option("Boy To Girl.", 3);
dialog.Option("Girl To Boy.", 2);
dialog.Avatar(110);
dialog.Send();
break;
}
case 2:
{
dialog.Text("Please choose now , need size of your email big or small boy?");
dialog.Option("Small Boy.", 5);
dialog.Avatar(110);
dialog.Send();
break;
}
case 3:
{
dialog.Text("Please choose now , need size of your email big or small girl?");
dialog.Option("Big Girl.", 6);
dialog.Option("Small Girl.", 7);
dialog.Avatar(110);
dialog.Send();
break;
}
case 4:
{
if (client.Player.ConquerPoints >= 1075)
{
if (client.Player.Body == 2001 || client.Player.Body == 2002)
{
client.Equipment.Remove(9);
if (client.Equipment.Objects[9] != null)
client.Equipment.Objects[9] = null;
ClientEquip equips = new ClientEquip();
equips.DoEquips(client);
client.Send(equips);
client.NobilityInformation.Gender = 1;
client.Player.Spouse = "None";
client.Player.ConquerPoints -= 1075;
client.Player.Body = 1004;
client.NobilityInformation.Mesh = client.Player.Mesh;
client.Equipment.UpdateEntityPacket();
Database.EntityTable.SaveEntity(client);
client.Disconnect();
}
else
{
dialog.Text("Error");
}
}
else
{
dialog.Text("Sorry you Don't Have 1075 Cps?");
dialog.Option("Alright, Thank you.", 255);
}
break;
}
case 5:
{
if (client.Player.ConquerPoints >= 1075)
{
if (client.Player.Body == 2001 || client.Player.Body == 2002)
{
client.Equipment.Remove(9);
if (client.Equipment.Objects[9] != null)
client.Equipment.Objects[9] = null;
ClientEquip equips = new ClientEquip();
equips.DoEquips(client);
client.Send(equips);
client.NobilityInformation.Gender = 1;
client.Player.Spouse = "None";
client.Player.ConquerPoints -= 1075;
client.Player.Body = 1003;
client.NobilityInformation.Mesh = client.Player.Mesh;
client.Equipment.UpdateEntityPacket();
Database.EntityTable.SaveEntity(client);
client.Disconnect();
}
else
{
dialog.Text("Error");
}
}
else
{
dialog.Text("Sorry you Don't Have 1075 Cps?");
dialog.Option("Alright, Thank you.", 255);
}
break;
}
case 6:
{
if (client.Player.ConquerPoints >= 1075)
{
if (client.Player.Body == 1003 || client.Player.Body == 1004)
{
client.Equipment.Remove(9);
if (client.Equipment.Objects[9] != null)
client.Equipment.Objects[9] = null;
ClientEquip equips = new ClientEquip();
equips.DoEquips(client);
client.Send(equips);
client.NobilityInformation.Gender = 0;
client.Player.Spouse = "None";
client.Player.ConquerPoints -= 1075;
client.Player.Body = 2002;
client.NobilityInformation.Mesh = client.Player.Mesh;
client.Equipment.UpdateEntityPacket();
Database.EntityTable.SaveEntity(client);
client.Disconnect();
}
else
{
dialog.Text("Error");
}
}
else
{
dialog.Text("Sorry you Don't Have 1075 Cps?");
dialog.Option("Alright, Thank you.", 255);
}
break;
}
case 7:
{
if (client.Player.ConquerPoints >= 1075)
{
if (client.Player.Body == 1003 || client.Player.Body == 1004)
{
client.Equipment.Remove(9);
if (client.Equipment.Objects[9] != null)
client.Equipment.Objects[9] = null;
ClientEquip equips = new ClientEquip();
equips.DoEquips(client);
client.Send(equips);
client.NobilityInformation.Gender = 0;
client.Player.Spouse = "None";
client.Player.ConquerPoints -= 1075;
client.Player.Body = 2002;
client.NobilityInformation.Mesh = client.Player.Mesh;
client.Equipment.UpdateEntityPacket();
Database.EntityTable.SaveEntity(client);
client.Disconnect();
}
else
{
dialog.Text("Error");
}
}
else
{
dialog.Text("Sorry you Don't Have 1075 Cps?");
dialog.Option("Alright, Thank you.", 255);
}
break;
}
}
break;
}
#endregion
اى مشكلة تواجهوها اتركو كومنت هنا وسوف يتم الرد انشاء الله
وانشاء الله هيبئا مفيش مشكلة خالص بالتوفيق