Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 15:49

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

Advertisement



A couple of questions about marriage.

Discussion on A couple of questions about marriage. within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2007
Posts: 220
Received Thanks: 63
A couple of questions about marriage.

so i was playing around with marriage, and decided to build a divorce NPC, so i built this
Code:
if (CurrentNPC == 104820)

{

if (Control == 1)

{

if ( MyChar.Spouse == "" || MyChar.Spouse == "None")

{

SendPacket(General.MyPackets.NPCSay("You are not even married, what do you want from me?!"));

SendPacket(General.MyPackets.NPCLink("Ahh, whoops sorry", 255));

SendPacket(General.MyPackets.NPCSetFace(30));

SendPacket(General.MyPackets.NPCFinish());

}

else

{

MyChar.Spouse = "";

SendPacket(General.MyPackets.NPCSay("You are divorced, enjoy your single life"));

SendPacket(General.MyPackets.NPCLink("Thank you", 255));

SendPacket(General.MyPackets.NPCSetFace(30));

SendPacket(General.MyPackets.NPCFinish());

}

}

}


it works and all, but i got one problem, it may divorce me from my spouse, but it doesn't divorce my spouse from me O.O i mean i tried every single thing, nothing worked for some reason any ideas? thx.



my second question, if i get married it doesn't show my spouse name in "My stats" where it shows my level, name, guildname and other stuff, any ideas? thx =)
BlooD-BoY is offline  
Old 10/13/2008, 03:39   #2
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
The only reason this only divorces you is because you are only "divorcing" yourself with that code. You have to "divorce" your spouse aswell.
kinshi88 is offline  
Old 10/13/2008, 03:42   #3
 
elite*gold: 0
Join Date: Jan 2007
Posts: 220
Received Thanks: 63
Quote:
Originally Posted by kinshi88 View Post
The only reason this only divorces you is because you are only "divorcing" yourself with that code. You have to "divorce" your spouse aswell.
well true i know that, the problem is i found the char.spouse thingy, added it but it can't find "Char.Spouse" for some reason...but i can see it in the source O.O
BlooD-BoY is offline  
Old 10/13/2008, 05:37   #4
 
nTL3fTy's Avatar
 
elite*gold: 0
Join Date: Jun 2005
Posts: 692
Received Thanks: 353
Best method that I can come up with in 10 minutes (not compiled, not tested):
Code:
uint SpouseUID = 0;
foreach (DictionaryEntry DE in World.AllChars)
{
    Character c = (Character)DE.Value;
    if (c.Name == MyChar.Spouse)
    {
        SpouseUID = c.UID;
        break;
    }
}
if (SpouseUID == 0)
{
    SendPacket(General.MyPackets.NPCSay("Your spouse is offline. Please try again when your spouse is online."));
    SendPacket(General.MyPackets.NPCLink("Ok.", 255));
    SendPacket(General.MyPackets.NPCSetFace(30));
    SendPacket(General.MyPackets.NPCFinish());
}
else
{
    MyChar.Spouse = "None";
    ((Character)World.AllChars[SpouseUID]).Spouse = "None";
    SendPacket(General.MyPackets.NPCSay("Your spouse has been divorced."));
    SendPacket(General.MyPackets.NPCLink("Thank you for your service.", 255));
    SendPacket(General.MyPackets.NPCSetFace(30));
    SendPacket(General.MyPackets.NPCFinish());
}
nTL3fTy is offline  
Old 10/13/2008, 22:35   #5
 
InfamousNoone's Avatar
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,012
Received Thanks: 2,885
Only works if the spouse is online :P
InfamousNoone is offline  
Old 10/13/2008, 23:58   #6
 
elite*gold: 0
Join Date: Jan 2007
Posts: 220
Received Thanks: 63
Quote:
Originally Posted by InfamousNoone View Post
Only works if the spouse is online :P
kk i already got it working not perfectly like 95%, ty for any help guys =)
btw both chars need to log off for MySQL to update i kinda did the "Drop();" thingy for the char. that is divorcing, but how can i do it for the spouse? any idea? thx ;P
BlooD-BoY is offline  
Old 10/14/2008, 01:55   #7
 
nTL3fTy's Avatar
 
elite*gold: 0
Join Date: Jun 2005
Posts: 692
Received Thanks: 353
Quote:
Originally Posted by BlooD-BoY View Post
kk i already got it working not perfectly like 95%, ty for any help guys =)
btw both chars need to log off for MySQL to update i kinda did the "Drop();" thingy for the char. that is divorcing, but how can i do it for the spouse? any idea? thx ;P
Loop through World.AllChars until you come to the character with the same name as your spouse and then use the MyClient variable of the character to drop it.

Code:
foreach (DictionaryEntry DE in World.AllChars)
{
    Character c = (Character)DE.Value;
    if (c.Name == MyChar.Spouse)
        c.MyClient.Drop();
}
If you already have the UID of the spouse:
Code:
((Character)World.AllChars[SpouseUID]).MyClient.Drop();
nTL3fTy is offline  
Old 10/14/2008, 02:14   #8
 
elite*gold: 0
Join Date: Jan 2007
Posts: 220
Received Thanks: 63
Quote:
Originally Posted by nTL3fTy View Post
Loop through World.AllChars until you come to the character with the same name as your spouse and then use the MyClient variable of the character to drop it.

Code:
foreach (DictionaryEntry DE in World.AllChars)
{
    Character c = (Character)DE.Value;
    if (c.Name == MyChar.Spouse)
        c.MyClient.Drop();
}
If you already have the UID of the spouse:
Code:
((Character)World.AllChars[SpouseUID]).MyClient.Drop();
lolz thx, didn't know which code to use to dc the spouse, so i just took the "((Character)World.AllChars[SpouseUID]).MyClient.Drop();" and it worked, so thx ;P
btw have any idea on how to make my spouses name show in my status? O.O
BlooD-BoY is offline  
Old 10/14/2008, 12:48   #9
 
elite*gold: 0
Join Date: Jan 2008
Posts: 145
Received Thanks: 91
@BlooD-BoY
to show your spouse name in your status you need to change CharacterInfo.
and it goes like this.
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;
        }
pauldexter is offline  
Old 10/14/2008, 13:33   #10
 
elite*gold: 0
Join Date: Jan 2007
Posts: 220
Received Thanks: 63
Quote:
Originally Posted by pauldexter View Post
@BlooD-BoY
to show your spouse name in your status you need to change CharacterInfo.
and it goes like this.
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;
        }
lolz thx man, i've been looking for that shit for so long, thx
BlooD-BoY is offline  
Old 10/14/2008, 21:48   #11
 
InfamousNoone's Avatar
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,012
Received Thanks: 2,885
No, you should only send the character info packet ONCE; and thats when they log in. >_>;
InfamousNoone is offline  
Old 10/14/2008, 22:11   #12
 
elite*gold: 20
Join Date: Aug 2005
Posts: 1,734
Received Thanks: 1,001
And for the rest you use the 0x3F9 update packet. (or string packet for spouse?)
tanelipe is offline  
Old 10/14/2008, 22:18   #13
 
InfamousNoone's Avatar
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,012
Received Thanks: 2,885
string packet
InfamousNoone is offline  
Reply


Similar Threads Similar Threads
A couple of questions.
10/14/2009 - CO2 Private Server - 9 Replies
I want to know what in a source determines what client version the source is compatible with. Can anybody explain that to me? This next question is for those who know the AndreaCo/FutureCo Source that xelios released. How can I set up my LOTF Source to have the NPCDialog.cs like they do? And how do I add a new map to my server? I would like to add that new map that TQ added to Conquer, its a Ice Dungeon or something. All help is appreciated.
[HELP]Just a couple of questions
05/21/2009 - CO2 Private Server - 5 Replies
what is a static ip and how do i get one? if i made a new item fo rmy server does the image have to be saved as dds? How ot make a Gold cup? like whats the UID for talismans? More to come*
Just a couple of Questions
04/24/2008 - Conquer Online 2 - 2 Replies
Hey guys i just wanted to know if some1 could show me the link to a met spammer. I also wanted to know if anyone could do some edits for conquer for me. I posted the edits i wantes before but i guess a mod said no. If you can help me i would appreciate very much.
A couple of questions
11/18/2007 - Conquer Online 2 - 1 Replies
hey can someone answer a few questions for me please? thanks :) 1.What is the fastest way to get alot of dbs? 2.How can i get back my warehouse passwrod, i forgot it. Thanks in Advance :)
Couple o Questions
12/05/2006 - Conquer Online 2 - 2 Replies
First of is it just a prob for me or every1 is experenceing it, did elitepvpers take out the conquer Hacks section or what &#092;and secondly does any1 have a med lvlers? thanks for info



All times are GMT +1. The time now is 15:49.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

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