|
You last visited: Today at 04:21
Advertisement
[Request]Guides
Discussion on [Request]Guides within the CO2 Private Server forum part of the Conquer Online 2 category.
09/24/2008, 17:11
|
#91
|
elite*gold: 0
Join Date: Jan 2008
Posts: 145
Received Thanks: 91
|
Protection for same gender marriage
Code:
if (AttackType == 8)//Marriage Proposal
{
fixed (byte* Ptr = Data)
{
uint TargetUID = *(uint*)(Ptr + 12);
Character Target = (Character)World.AllChars[TargetUID];
*(uint*)(Ptr + 8) = MyChar.UID;
{
if (MyChar.Model == 2001 || MyChar.Model == 2002)
{
if (Target.Model == 1003 || Target.Model == 1004)
{
Target.MyClient.SendPacket(Data);
}
else
{
SendPacket(General.MyPackets.NPCSay("Only girl and boy can be marriage."));
SendPacket(General.MyPackets.NPCLink("I see.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
if (MyChar.Model == 1003 || MyChar.Model == 1004)
{
if (Target.Model == 2001 || Target.Model == 2002)
{
Target.MyClient.SendPacket(Data);
}
else
{
SendPacket(General.MyPackets.NPCSay("Only girl and boy can be marriage."));
SendPacket(General.MyPackets.NPCLink("I see.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
}
}
}
if (AttackType == 9)//Marriage Accept
{
fixed (byte* Ptr = Data)
{
uint UID = *(uint*)(Ptr + 12);
Character Char = (Character)World.AllChars[UID];
{
if (Char.Model == 2001 || Char.Model == 2002)
{
if (MyChar.Model == 1003 || MyChar.Model == 1004)
{
Char.Spouse = MyChar.Name;
MyChar.Spouse = Char.Name;
MyChar.SaveSpouse();
}
else
{
SendPacket(General.MyPackets.NPCSay("Only girl and boy can be marriage."));
SendPacket(General.MyPackets.NPCLink("I see.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
if (Char.Model == 1003 || Char.Model == 1004)
{
if (MyChar.Model == 2001 || MyChar.Model == 2002)
{
Char.Spouse = MyChar.Name;
MyChar.Spouse = Char.Name;
MyChar.SaveSpouse();
}
else
{
SendPacket(General.MyPackets.NPCSay("Only girl and boy can be marriage."));
SendPacket(General.MyPackets.NPCLink("I see.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
}
}
}
hope this is valid
|
|
|
09/24/2008, 17:24
|
#92
|
elite*gold: 0
Join Date: Jun 2007
Posts: 20
Received Thanks: 0
|
I'm french, for understant how i can put the code, i need a detail where this code i can put.
Example :
Quote:
|
Originally Posted by Hayz
public static byte[] MarriageMouse(uint CharUID)
{
byte[] Mouse = new byte[24];
fixed (byte* Ptr = Mouse)
{
*(ushort*)(Ptr + 0) = 24;
*(ushort*)(Ptr + 2) = 1010;
*(uint*)(Ptr + 8) = CharUID;
*(uint*)(Ptr + 12) = 1067;
*(uint*)(Ptr + 22) = 116;
return Mouse;
}
}
|
Where ? in packet.cs ? Client.cs ?
And that : Client.Send(Packets.MarriageMouse(Client.Char.UID) ); i dont know where ^^
Thank u for helping
|
|
|
09/24/2008, 17:53
|
#93
|
elite*gold: 0
Join Date: Jan 2008
Posts: 145
Received Thanks: 91
|
@Kratos59
thats in the Packet.cs and the one is in the Client.cs
im still looking how can a player see his/her spouse in the Status option
|
|
|
09/24/2008, 18:03
|
#94
|
elite*gold: 20
Join Date: Jan 2008
Posts: 1,042
Received Thanks: 252
|
Quote:
Originally Posted by pauldexter
@Kratos59
thats in the Packet.cs and the one is in the Client.cs
im still looking how can a player see his/her spouse in the Status option
|
Search the Source for string Spuse = "None"; and thats your problem... i explained all the char info packets will need changing cause they are locally defined as "None"; instead of Client.Char.Spouse
so change it to that :P
|
|
|
09/24/2008, 18:20
|
#95
|
elite*gold: 0
Join Date: Jun 2007
Posts: 20
Received Thanks: 0
|
Ah i see ^^
i have add : public static byte[] MarriageMouse(uint CharUID)
{
byte[] Mouse = new byte[24];
fixed (byte* Ptr = Mouse)
{
*(ushort*)(Ptr + 0) = 24;
*(ushort*)(Ptr + 2) = 1010;
*(uint*)(Ptr + 8) = CharUID;
*(uint*)(Ptr + 12) = 1067;
*(uint*)(Ptr + 22) = 116;
return Mouse;
}
}
in packet.cs it's good.
But a error code : Client.Send(Packets.MarriageMouse(Client.Char.UID) ); in client cs.
then for fast ^^ you can juste modify for me and it's fix ^^ :
if (Control == 2)
{
SendPacket(General.MyPackets.NPCSay("Cliquez a votre amoureux(se) pour demander le mariage."));
SendPacket(General.MyPackets.NPCLink("OK", 4));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
if (Control == 4)
/*Marriage Packet
const uint dwUnknown = 0x0000042B;
DataPacket Data = new DataPacket(null);
Data.ID = DataIDs.MarriageMouse;
Data.UID = Client.Entity.UID;
Data.lParam = dwUnknown;
MarriageMouse = 0x74;
PacketType = 0x3f2;*/
In control 4 for mouse packet ^^
thank u for helping
|
|
|
09/24/2008, 18:33
|
#96
|
elite*gold: 0
Join Date: Jan 2008
Posts: 145
Received Thanks: 91
|
i found string Spouse = "None" in Packet.cs but still no happen when i changed it
i already add an row in the character table name Spouse
thats only my problem and the firework effect after the marriage, hehe
|
|
|
09/24/2008, 19:12
|
#97
|
elite*gold: 20
Join Date: Jan 2008
Posts: 1,042
Received Thanks: 252
|
Quote:
Originally Posted by pauldexter
i found string Spouse = "None" in Packet.cs but still no happen when i changed it
i already add an row in the character table name Spouse
thats only my problem and the firework effect after the marriage, hehe
|
theres more than one that needs changing
|
|
|
09/24/2008, 20:42
|
#98
|
elite*gold: 0
Join Date: Mar 2008
Posts: 62
Received Thanks: 6
|
what is variables for marriage?
|
|
|
09/24/2008, 20:44
|
#99
|
elite*gold: 0
Join Date: Feb 2008
Posts: 668
Received Thanks: 160
|
Quote:
Originally Posted by © Haydz
theres more than one that needs changing
|
If there's more needed to change than only change the string Spouse = "None", Could you please tell us what to change?
|
|
|
09/24/2008, 20:55
|
#100
|
elite*gold: 0
Join Date: Jun 2007
Posts: 390
Received Thanks: 92
|
lol.. yep cause when i click accept on invitation i can't see spouse name .
|
|
|
09/24/2008, 21:10
|
#101
|
elite*gold: 0
Join Date: Mar 2008
Posts: 31
Received Thanks: 95
|
Quote:
Originally Posted by stephanyd
lol.. yep cause when i click accept on invitation i can't see spouse name . 
|
u fix the error Client.Char?
|
|
|
09/25/2008, 00:14
|
#102
|
elite*gold: 0
Join Date: Feb 2008
Posts: 1,590
Received Thanks: 154
|
Quote:
Originally Posted by © Haydz
hmmm i may be wrong but if you decrypt the monster.dat file in the Ini folder im sure theres a Size= variable in there... try changing that and then encrypting again... however i may be wrong cause ive never tested it
|
I meant server side you can't change the size, you can change it client sided(and distribute a patch), but you can't make it bigger in the server.
|
|
|
09/25/2008, 02:47
|
#103
|
elite*gold: 0
Join Date: Jan 2008
Posts: 145
Received Thanks: 91
|
This is my code:
Code:
public static byte[] MarriageMouse(uint CharUID)
{
byte[] Mouse = new byte[24];
fixed (byte* Ptr = Mouse)
{
*(ushort*)(Ptr + 0) = 24;
*(ushort*)(Ptr + 2) = 1010;
*(uint*)(Ptr + 8) = CharUID;
*(uint*)(Ptr + 12) = 1067;
*(uint*)(Ptr + 22) = 116;
return Mouse;
}
}
Code:
if (AttackType == 8)//Marriage Proposal
{
fixed (byte* Ptr = Data)
{
uint TargetUID = *(uint*)(Ptr + 12);
Character Target = (Character)World.AllChars[TargetUID];
*(uint*)(Ptr + 8) = MyChar.UID;
{
if (MyChar.Model == 2001 || MyChar.Model == 2002)
{
if (Target.Model == 1003 || Target.Model == 1004)
{
if (Target.Spouse == "")
{
Target.MyClient.SendPacket(Data);
}
else
{
SendPacket(General.MyPackets.NPCSay(Target.Name + " has already an Spouse."));
SendPacket(General.MyPackets.NPCLink("Ok.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
else
{
SendPacket(General.MyPackets.NPCSay("Only girl and boy can be marriage."));
SendPacket(General.MyPackets.NPCLink("I see.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
if (MyChar.Model == 1003 || MyChar.Model == 1004)
{
if (Target.Model == 2001 || Target.Model == 2002)
{
if (Target.Spouse == "")
{
Target.MyClient.SendPacket(Data);
}
else
{
SendPacket(General.MyPackets.NPCSay(Target.Name + " has already an Spouse."));
SendPacket(General.MyPackets.NPCLink("Ok.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
else
{
SendPacket(General.MyPackets.NPCSay("Only girl and boy can be marriage."));
SendPacket(General.MyPackets.NPCLink("I see.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
}
}
}
if (AttackType == 9)//Marriage Accept
{
fixed (byte* Ptr = Data)
{
uint UID = *(uint*)(Ptr + 12);
Character Char = (Character)World.AllChars[UID];
{
if (Char.Model == 2001 || Char.Model == 2002)
{
if (MyChar.Model == 1003 || MyChar.Model == 1004)
{
Char.Spouse = MyChar.Name;
MyChar.Spouse = Char.Name;
MyChar.SaveSpouse();
Char.SaveSpouse();
World.SendMsgToAll(Char.Name + " and " + MyChar.Name + " has been promoted as husband and wife!", "LoveStone", 2011);
}
else
{
SendPacket(General.MyPackets.NPCSay("Only girl and boy can be marriage."));
SendPacket(General.MyPackets.NPCLink("I see.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
if (Char.Model == 1003 || Char.Model == 1004)
{
if (MyChar.Model == 2001 || MyChar.Model == 2002)
{
Char.Spouse = MyChar.Name;
MyChar.Spouse = Char.Name;
MyChar.SaveSpouse();
Char.SaveSpouse();
World.SendMsgToAll(Char.Name + " and " + MyChar.Name + " has been promoted as husband and wife!", "LoveStone", 2011);
}
else
{
SendPacket(General.MyPackets.NPCSay("Only girl and boy can be marriage."));
SendPacket(General.MyPackets.NPCLink("I see.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
}
}
}
Code:
if (CurrentNPC == 390)
{
if (MyChar.Spouse == "")
{
SendPacket(General.MyPackets.NPCSay("Do you wish to propose to your sweetheart?"));
SendPacket(General.MyPackets.NPCSay("Remember that marriage is a serious commitment, do not enter into it lightly."));
SendPacket(General.MyPackets.NPCLink("Yes I want to propose", 1));
SendPacket(General.MyPackets.NPCLink("Nooo I'm not ready", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
else
{
SendPacket(General.MyPackets.NPCSay("You have already spouse."));
SendPacket(General.MyPackets.NPCLink("Sorry", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
Code:
if (CurrentNPC == 390)
{
if (Control == 1)
{
SendPacket(General.MyPackets.NPCSay("Click on your sweetheart to propose to them"));
SendPacket(General.MyPackets.NPCLink("OK", 2));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
if (Control == 2)
{
MyChar.MyClient.SendPacket(Packets.MarriageMouse(MyChar.UID));
}
}
Code:
public void SaveSpouse()
{
if (MyClient.There)
if (MyClient.Online)
DataBase.SaveSpouse(this);
}
Code:
public string Spouse = "";
Code:
Charr.Spouse = (string)DR["Spouse"];
Code:
public static void SaveSpouse(Character Charr)
{
try
{
MySqlCommand Command = new MySqlCommand("UPDATE `Characters` SET `Spouse` = '" + Charr.Spouse + "' WHERE `Account` = '" + Charr.MyClient.Account + "'", Connection);
Command.ExecuteNonQuery();
}
catch (Exception Exc)
{
General.WriteLine(Convert.ToString(Exc));
Connection.Close();
Connect("username(mysql)", "password(mysql)");
if (World.SaveAllChars())
{
General.WriteLine("Connection to mysql server reinitiated");
}
else
{
General.WriteLine("Connection Error, server restarting! " + DateTime.Now);
General.ServerRestart();
}
}
}
i don't need someone tell me where to put all these codes, figure it out yourself
i already add a row in database.
almost finish, i just need the one that you can show your spouse in the status
|
|
|
09/25/2008, 03:07
|
#104
|
elite*gold: 0
Join Date: Jun 2007
Posts: 390
Received Thanks: 92
|
Quote:
Originally Posted by pauldexter
This is my code:
Code:
public static byte[] MarriageMouse(uint CharUID)
{
byte[] Mouse = new byte[24];
fixed (byte* Ptr = Mouse)
{
*(ushort*)(Ptr + 0) = 24;
*(ushort*)(Ptr + 2) = 1010;
*(uint*)(Ptr + 8) = CharUID;
*(uint*)(Ptr + 12) = 1067;
*(uint*)(Ptr + 22) = 116;
return Mouse;
}
}
Code:
if (AttackType == 8)//Marriage Proposal
{
fixed (byte* Ptr = Data)
{
uint TargetUID = *(uint*)(Ptr + 12);
Character Target = (Character)World.AllChars[TargetUID];
*(uint*)(Ptr + 8) = MyChar.UID;
{
if (MyChar.Model == 2001 || MyChar.Model == 2002)
{
if (Target.Model == 1003 || Target.Model == 1004)
{
if (Target.Spouse == "")
{
Target.MyClient.SendPacket(Data);
}
else
{
SendPacket(General.MyPackets.NPCSay(Target.Name + " has already an Spouse."));
SendPacket(General.MyPackets.NPCLink("Ok.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
else
{
SendPacket(General.MyPackets.NPCSay("Only girl and boy can be marriage."));
SendPacket(General.MyPackets.NPCLink("I see.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
if (MyChar.Model == 1003 || MyChar.Model == 1004)
{
if (Target.Model == 2001 || Target.Model == 2002)
{
if (Target.Spouse == "")
{
Target.MyClient.SendPacket(Data);
}
else
{
SendPacket(General.MyPackets.NPCSay(Target.Name + " has already an Spouse."));
SendPacket(General.MyPackets.NPCLink("Ok.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
else
{
SendPacket(General.MyPackets.NPCSay("Only girl and boy can be marriage."));
SendPacket(General.MyPackets.NPCLink("I see.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
}
}
}
if (AttackType == 9)//Marriage Accept
{
fixed (byte* Ptr = Data)
{
uint UID = *(uint*)(Ptr + 12);
Character Char = (Character)World.AllChars[UID];
{
if (Char.Model == 2001 || Char.Model == 2002)
{
if (MyChar.Model == 1003 || MyChar.Model == 1004)
{
Char.Spouse = MyChar.Name;
MyChar.Spouse = Char.Name;
MyChar.SaveSpouse();
Char.SaveSpouse();
World.SendMsgToAll(Char.Name + " and " + MyChar.Name + " has been promoted as husband and wife!", "LoveStone", 2011);
}
else
{
SendPacket(General.MyPackets.NPCSay("Only girl and boy can be marriage."));
SendPacket(General.MyPackets.NPCLink("I see.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
if (Char.Model == 1003 || Char.Model == 1004)
{
if (MyChar.Model == 2001 || MyChar.Model == 2002)
{
Char.Spouse = MyChar.Name;
MyChar.Spouse = Char.Name;
MyChar.SaveSpouse();
Char.SaveSpouse();
World.SendMsgToAll(Char.Name + " and " + MyChar.Name + " has been promoted as husband and wife!", "LoveStone", 2011);
}
else
{
SendPacket(General.MyPackets.NPCSay("Only girl and boy can be marriage."));
SendPacket(General.MyPackets.NPCLink("I see.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
}
}
}
Code:
if (CurrentNPC == 390)
{
if (MyChar.Spouse == "")
{
SendPacket(General.MyPackets.NPCSay("Do you wish to propose to your sweetheart?"));
SendPacket(General.MyPackets.NPCSay("Remember that marriage is a serious commitment, do not enter into it lightly."));
SendPacket(General.MyPackets.NPCLink("Yes I want to propose", 1));
SendPacket(General.MyPackets.NPCLink("Nooo I'm not ready", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
else
{
SendPacket(General.MyPackets.NPCSay("You have already spouse."));
SendPacket(General.MyPackets.NPCLink("Sorry", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
Code:
if (CurrentNPC == 390)
{
if (Control == 1)
{
SendPacket(General.MyPackets.NPCSay("Click on your sweetheart to propose to them"));
SendPacket(General.MyPackets.NPCLink("OK", 2));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
if (Control == 2)
{
MyChar.MyClient.SendPacket(Packets.MarriageMouse(MyChar.UID));
}
}
Code:
public void SaveSpouse()
{
if (MyClient.There)
if (MyClient.Online)
DataBase.SaveSpouse(this);
}
Code:
public string Spouse = "";
Code:
Charr.Spouse = (string)DR["Spouse"];
Code:
public static void SaveSpouse(Character Charr)
{
try
{
MySqlCommand Command = new MySqlCommand("UPDATE `Characters` SET `Spouse` = '" + Charr.Spouse + "' WHERE `Account` = '" + Charr.MyClient.Account + "'", Connection);
Command.ExecuteNonQuery();
}
catch (Exception Exc)
{
General.WriteLine(Convert.ToString(Exc));
Connection.Close();
Connect("username(mysql)", "password(mysql)");
if (World.SaveAllChars())
{
General.WriteLine("Connection to mysql server reinitiated");
}
else
{
General.WriteLine("Connection Error, server restarting! " + DateTime.Now);
General.ServerRestart();
}
}
}
i don't need someone tell me where to put all these codes, figure it out yourself
i already add a row in database.
almost finish, i just need the one that you can show your spouse in the status
|
Ehere do i put this line?
Quote:
|
Charr.Spouse = (string)DR["Spouse"];
|
|
|
|
09/25/2008, 03:23
|
#105
|
elite*gold: 0
Join Date: Jan 2008
Posts: 145
Received Thanks: 91
|
@stephanyd
don't quote the whole post.
im good now, in DataBase.cs at public static void GetCharInfo
then put the codes in that area there.
|
|
|
 |
|
Similar Threads
|
[Request]Richtige Guides ??
09/10/2010 - Starcraft 2 - 5 Replies
Hey Stracraft Suchtis :P ,
Wollte mal fragen wo es denn richtige Guides gibt. Sprich Baureihenfolge usw. Habe bis jetzt nur einen gefunden der nicht wirklich hilfreich war xD Bedanke mich schon mal im Voraus.
|
Request Guides! :D
08/16/2010 - Runescape - 11 Replies
Guides!
Hey. I've been trying as hard as I can to help you with all of your needs, now it is time for you to help me you. You can do this simply by posting here any guides you want me to make, I will either make a video, or picture, or both.
I need this to be organized, so I will be monitoring this thread daily, and i will be posting new polls, and deleting poll to see what i should make my number one priority.
How to Post!:
Posting should be like this:
|
[REQUEST] Killer guides
09/15/2009 - Aion - 15 Replies
moin,
hat jmd die Killer guides für aion parat?
(Aion Complete Guide Package)
komplett oder einzeln ich, alle gern gesehn :)
ooooder:
|
[Request]More Coding Guides. C#
08/29/2009 - CO2 Private Server - 13 Replies
Yo guys, if you want less people asking questions/leaching then just make "how to code guides". Not only are you keeping people from taking other people's work, but your also giving other people the chance to create more stuff and ideas so we can all be pros at coding to make our own servers. Honestly, if you people released useful guides, I will read everyone of them until I know how to code then I'll take my time to complete servers 100%. Well thats it, I hope this encouraged people to take...
|
All times are GMT +1. The time now is 04:21.
|
|