Register for your free account! | Forgot your password?

You last visited: Today at 14:28

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Guide]How To Put Marriage !

Discussion on [Guide]How To Put Marriage ! within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
davidcerv's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 224
Received Thanks: 79
[Guide]How To Put Marriage !

In Packet.cs find:
Code:

public unsafe class Packets
{

After it add:
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;
}
}

In Client.cs find:
Code:

public void GetPacket(byte[] data)

Replace it with:
Code:

public unsafe void GetPacket(byte[] data)

Next, In Client.cs find:
Code:

if (AttackType == 2 || AttackType == 25)

Above it add:
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.Spouse == "None")
{
Target.MyClient.SendPacket(Data);
}
else
{
SendPacket(General.MyPackets.NPCSay(Target.Name + " has already got an Spouse."));
SendPacket(General.MyPackets.NPCLink("Ok.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
else
{
SendPacket(General.MyPackets.NPCSay("No Marriage For Same Gender."));
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.Spouse == "None")
{
Target.MyClient.SendPacket(Data);
}
else
{
SendPacket(General.MyPackets.NPCSay(Target.Name + " has already got an Spouse."));
SendPacket(General.MyPackets.NPCLink("Ok.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
else
{
SendPacket(General.MyPackets.NPCSay("No Marriage For Same Gender."));
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();
SendPacket(General.MyPackets.CharacterInfo(MyChar) );
World.SendMsgToAll(Char.Name + " and " + MyChar.Name + " has been united as husband and wife!", "LoveStone", 2011);
}
else
{
SendPacket(General.MyPackets.NPCSay("No Marriage For Same Gender."));
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();
SendPacket(General.MyPackets.CharacterInfo(MyChar) );
World.SendMsgToAll(Char.Name + " and " + MyChar.Name + " has been united as husband and wife!", "LoveStone", 2011);
}
else
{
SendPacket(General.MyPackets.NPCSay("No Marriage For Same Gender."));
SendPacket(General.MyPackets.NPCLink("I see.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
}
}
}

For the NPC Dialog, near in Case 2031: find:
Code:

if (CurrentNPC == 390)

Replace the whole code with:
Code:

if (CurrentNPC == 390)
{
if (MyChar.Spouse == "" || MyChar.Spouse == "None")
{
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());
}
}

For the controls:
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)
{
if (MyChar.Spouse == "" || MyChar.Spouse == "None")
{
MyChar.MyClient.SendPacket(Packets.MarriageMouse(M yChar.UID));
}
}
}

Next, in Character.cs find:
Code:

public void Save()

Above add:
Code:

public void SaveSpouse()
{
if (MyClient.There)
if (MyClient.Online)
DataBase.SaveSpouse(this);
}

Find:
Code:

public string Name = "";

Below add:
Code:

public string Spouse = "";

In DataBase.cs find:
Code:

Charr.Name = (string)DR["CharName"];

Below add:
Code:

Charr.Spouse = (string)DR["Spouse"];


Find:
Code:

public static void SaveChar(Character Charr)

Above add:
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)); }
}

In Packets.cs, change your public byte[] ViewEquip(Character Char) with:
Code:

public byte[] ViewEquip(Character Char)
{
ushort PacketType = 0x3f7;
string Spouse = Char.Spouse;

byte[] Packet = new byte[11 + Spouse.Length];

fixed (byte* p = Packet)
{
*((ushort*)p) = (ushort)Packet.Length;
*((ushort*)(p + 2)) = (ushort)PacketType;
*((uint*)(p + 4)) = (uint)Char.UID;
*(p + 8) = 0x10;
*(p + 9) = 0x01;
*(p + 10) = (byte)Spouse.Length;

for (int i = 0; i < Spouse.Length; i++)
{
*(p + 11 + i) = Convert.ToByte(Spouse[i]);
}
}
return Packet;
}

and public byte[] CharacterInfo(Character Charr) with:
Code:

public byte[] CharacterInfo(Character Charr)
{
byte[] Packet = new byte[70 + Charr.Name.Length + Charr.Spouse.Length];
long Model = Convert.ToInt64(Convert.ToString(Charr.Avatar) + Convert.ToString(Charr.Model));

fixed (byte* p = Packet)
{
*((ushort*)p) = (ushort)Packet.Length;
*((ushort*)(p + 2)) = 1006;
*((uint*)(p + 4)) = (uint)Charr.UID;
*((uint*)(p + 8)) = (uint)Model;
*((ushort*)(p + 12)) = (ushort)Charr.Hair;
*((uint*)(p + 14)) = (uint)Charr.Silvers;
*((uint*)(p + 18)) = (uint)Charr.CPs;
*((uint*)(p + 22)) = (uint)Charr.Exp;
*((ushort*)(p + 42)) = (ushort)5130;
*((ushort*)(p + 46)) = (ushort)Charr.Str;
*((ushort*)(p + 48)) = (ushort)Charr.Agi;
*((ushort*)(p + 50)) = (ushort)Charr.Vit;
*((ushort*)(p + 52)) = (ushort)Charr.Spi;
*((ushort*)(p + 54)) = (ushort)Charr.StatP;
*((ushort*)(p + 56)) = (ushort)Charr.CurHP;
*((ushort*)(p + 58)) = (ushort)Charr.MaxMana();
*((ushort*)(p + 60)) = (ushort)Charr.PKPoints;
*(p + 62) = Charr.Level;
*(p + 63) = Charr.Job;
*(p + 66) = 1;
*(p + 67) = 2;
*(p + 68) = (byte)Charr.Name.Length;

Packet[69 + Charr.Name.Length] = (byte)Charr.Spouse.Length;

for (sbyte i = 0; i < Charr.Name.Length; i++)
{
*(p + 69 + i) = (byte)Charr.Name[i];
}
for (sbyte i = 0; i < Charr.Spouse.Length; i++)
{
*(p + 70 + Charr.Name.Length + i) = (byte)Charr.Spouse[i];
}

}
return Packet;
}
Dont critice me
XDD
davidcerv is offline  
Old 12/30/2008, 17:39   #2
 
turk55's Avatar
 
elite*gold: 130
Join Date: Oct 2007
Posts: 1,652
Received Thanks: 701
double post
turk55 is offline  
Old 12/30/2008, 21:54   #3
 
© Haydz's Avatar
 
elite*gold: 20
Join Date: Jan 2008
Posts: 1,042
Received Thanks: 252
Yeah, because you made that yourself.
© Haydz is offline  
Old 12/30/2008, 22:34   #4
 
Tw3ak's Avatar
 
elite*gold: 20
Join Date: Jun 2005
Posts: 1,489
Received Thanks: 301
Why would you post a guide that there has been at least 4 others released ??

ALL you did was copy+paste some one elses guilde again in another thread.
Tw3ak is offline  
Old 12/30/2008, 22:35   #5
 
LetterX's Avatar
 
elite*gold: 20
Join Date: May 2007
Posts: 1,125
Received Thanks: 332
"6 years playing" in signature.
LetterX is offline  
Old 12/31/2008, 09:59   #6


 
KraHen's Avatar
 
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 793
I lolled.
#request close, people can search for this
KraHen is offline  
Old 12/31/2008, 10:45   #7
 
davidcerv's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 224
Received Thanks: 79
Quote:
Originally Posted by turk55 View Post
double post
Double Post ?? o.o??
davidcerv is offline  
Old 12/31/2008, 19:20   #8
 
sherwin9's Avatar
 
elite*gold: 0
Join Date: Oct 2006
Posts: 222
Received Thanks: 27
Quote:
Originally Posted by ElDeRnEcRo View Post
I lolled.
#request close, people can search for this
You can't close this thread HAHAH nuub.

You guys always say ppl are lazy right, and now you guys are whining again... GOOOSSSHHH. Well I guess we've just found someone that helps us with our lazyness. Just don't give him +k...

Ciao!
sherwin9 is offline  
Reply


Similar Threads Similar Threads
Guide for marriage :)
05/03/2010 - CO2 PServer Guides & Releases - 23 Replies
Ok this is something simple and for all those who have not yet managed to get their marriage system working. I have gay marriage on mine also lol. For the marriage system to work you only need to take out a line or two This is the script you will see in marriage.cs if (GC.MyChar.Spouse != "None") { GC.LocalMessage(2005, "You are married."); return; } if (TargetMarry.Spouse != "None") { GC.LocalMessage(2005, "The target is married."); return; } { GC.LocalMessage(2005, "You are...
[REQ] Marriage (CoEmu v2)
07/16/2009 - CO2 Private Server - 3 Replies
I already have the codes does someone knows how to get the (balbla wants to marry with you) popping up? and if you click yes i wanna propose to someone the icons come up? If someone knows it and say it i will release the marriage system it already works i just need to get the things pop up.. Help will be appreciated kk:) Xellios.
Help marriage!
01/10/2009 - CO2 Private Server - 8 Replies
How to fix this errors ? :confused:
Cant marriage!!!
01/12/2008 - Conquer Online 2 - 7 Replies
I hawe 131 lvl archer and want to marriage with my others noobs!! Maybe its 131 lvl bug? Or any1 can help me?
marriage xp?
08/13/2006 - Conquer Online 2 - 8 Replies
is ther really a way to marry a male to a male archer AND get marriage xp for plvling? thanks :D



All times are GMT +2. The time now is 14:28.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.