Register for your free account! | Forgot your password?

Go Back   elitepvpers › MMORPGs › Conquer Online 2 › CO2 Private Server
You last visited: Today at 20:54

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

Advertisement



Hair - COFuture - 5017

Discussion on Hair - COFuture - 5017 within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2011
Posts: 46
Received Thanks: 1
Hair - COFuture - 5017

Hello,

So the past couple weeks I've been messing around with COFuture. I am now having problems.

I don't know if there was a need for this, but I took it out of COEmu:

I put:
Code:
public int Hair2 = 0;
in the Characters void.

I put:
Code:
HairStyle = 26,
in the UpdateChar void

My problem is making the command.
I've got this so far:
Code:
  else if (Command[0] == "/hair")
                    {
                        int Hair2 = Convert.ToInt32(Command[1]);
                        Character.Hair2 = Hair2;
But I can't figure out which packet to send, or make a new one.

Any help will be appreciated.
Thank you
xElement is offline  
Old   #2
 
elite*gold: 0
Join Date: Jan 2011
Posts: 470
Received Thanks: 97
the update for hair is 27 in 5017.
Spirited42 is offline  
Old   #3
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,386
To go over what I said on msn...


general data packet using the subtype 27. Not sure which value holds the style but shouldn't take much experimenting.
pro4never is offline  
Old   #4
 
elite*gold: 0
Join Date: Feb 2011
Posts: 46
Received Thanks: 1
I am trying this command (Although I don't think it's right, and it ain't working. However, when I logged in my character was bold.

else if (Command[0] == "/hair")
{
int Hair = Convert.ToInt32(Command[1]);
Character.Hair = Hair;
Con.Send(UpdatePacket.Character((uint)Character.Pl ayerID, UpdateChar.Hair, (uint)Character.Hair));

}
xElement is offline  
Old   #5
 
elite*gold: 0
Join Date: Jan 2011
Posts: 470
Received Thanks: 97
Quote:
Originally Posted by xElement View Post
I am trying this command (Although I don't think it's right, and it ain't working. However, when I logged in my character was bold.

else if (Command[0] == "/hair")
{
int Hair = Convert.ToInt32(Command[1]);
Character.Hair = Hair;
Con.Send(UpdatePacket.Character((uint)Character.Pl ayerID, UpdateChar.Hair, (uint)Character.Hair));

}
That means nothing without the base code behind it. What's the enum equal too... what's the packet you're using? etc.
Spirited42 is offline  
Old   #6
 
elite*gold: 0
Join Date: Feb 2011
Posts: 46
Received Thanks: 1
Quote:
Originally Posted by Spirited View Post
That means nothing without the base code behind it. What's the enum equal too... what's the packet you're using? etc.
enum:
Code:
27
packet:
Code:
[B]unsafe public static byte[] Character(uint UID, UpdateChar PacketID, uint NewValue)
        {
            byte[] Packet = new byte[0x1C];
            fixed (byte* Ptr = Packet)
            {
                *((ushort*)(Ptr)) = 0x1C;
                *((ushort*)(Ptr + 2)) = 0x3F9;
                *((uint*)(Ptr + 4)) = UID;
                *((byte*)(Ptr + 8)) = 1;
                *((byte*)(Ptr + 12)) = (byte)PacketID;
                *((uint*)(Ptr + 16)) = NewValue;
            }
            return Packet;
        }[/B]
__________________________________________________ __________________________

Also I tried this command:
Code:
 [B]else if (Command[0] == "/hair")
                    {
                        int Hair = Convert.ToInt32(Command[1]);
                        Character.Hair = Hair;
                        Con.Send(SpawnPlayer.Packet(Character));

                    }[/B]
packet:
Code:
[B] unsafe public static byte[] Packet(Characters Character)
        {
            ushort PacketType = 0x3f6;
            byte[] Packet = new byte[85 + Character.PlayerName.Length];
            fixed (byte* Ptr = Packet)
            {
                *((ushort*)(Ptr)) = (ushort)Packet.Length;
                *((ushort*)(Ptr + 2)) = (ushort)PacketType;
                *((uint*)(Ptr + 4)) = (uint)Character.PlayerID;
                *((uint*)(Ptr + 8)) = (uint)Character.Model;
                *((uint*)(Ptr + 12)) = (uint)Character.Status;
                *((ushort*)(Ptr + 20)) = (ushort)Character.Guild.GuildID;
                *((byte*)(Ptr + 23)) = (byte)Character.GuildPosition;
                if (Character.Equipment[Convert.ToInt32(ItemType.Garment)] != null)
                    *((uint*)(Ptr + 24)) = (uint)Character.Equipment[Convert.ToInt32(ItemType.Garment)].ItemID;
                if (Character.Equipment[Convert.ToInt32(ItemType.Helm)] != null)
                    *((uint*)(Ptr + 28)) = (uint)Character.Equipment[Convert.ToInt32(ItemType.Helm)].ItemID;
                if (Character.Equipment[Convert.ToInt32(ItemType.Armor)] != null)
                    *((uint*)(Ptr + 32)) = (uint)Character.Equipment[Convert.ToInt32(ItemType.Armor)].ItemID;
                if (Character.Equipment[Convert.ToInt32(ItemType.RightHand)] != null)
                    *((uint*)(Ptr + 36)) = (uint)Character.Equipment[Convert.ToInt32(ItemType.RightHand)].ItemID;
                if (Character.Equipment[Convert.ToInt32(ItemType.LeftHand)] != null)
                    *((uint*)(Ptr + 40)) = (uint)Character.Equipment[Convert.ToInt32(ItemType.LeftHand)].ItemID;
                *((ushort*)(Ptr + 52)) = (ushort)Character.PosX;
                *((ushort*)(Ptr + 54)) = (ushort)Character.PosY;
                *((ushort*)(Ptr + 56)) = (ushort)Character.Hair;
                *((byte*)(Ptr + 58)) = (byte)Character.Direction;
                *((byte*)(Ptr + 59)) = (byte)Character.Action;
                *((byte*)(Ptr + 60)) = (byte)Character.Reborn;
                *((byte*)(Ptr + 61)) = 0x00;
                *((byte*)(Ptr + 62)) = (byte)Character.Level;
                // +17
                *((byte*)(Ptr + 80)) = 1;
                *((byte*)(Ptr + 81)) = (byte)Character.PlayerName.Length;
                for (int i = 0; i < Character.PlayerName.Length; i++)
                {
                    *((byte*)(Ptr + 82 + i)) = Convert.ToByte(Character.PlayerName[i]);
                }
            }
            return Packet;
        }[/B]
xElement is offline  
Old   #7
 
elite*gold: 0
Join Date: Jan 2011
Posts: 470
Received Thanks: 97
what source is that? That doesn't look anything like what's in CoFuture... it looks like something from my source or Chris's source. The enum is correct, so if that packet is correct, it should work. I'm going to class right now so i can't check the hexes.
Spirited42 is offline  
Old   #8
 
elite*gold: 0
Join Date: Feb 2011
Posts: 46
Received Thanks: 1
Trust me, it's COFuture.
xElement is offline  
Old   #9
 
drakejoe67's Avatar
 
elite*gold: 0
Join Date: Feb 2008
Posts: 322
Received Thanks: 121
For example, what "ID" / int do you use for 1 hair. You might be using wrong ids. Because the second command packet that you last posted seems to be fine.

as for this

For hair we use like 11 - 41.
For an instance: Hair is used like this: First digit: HairColor, then 2 last digits, hair id.

Might be 835 <- color + hair ID.

If you only want to change your hairstyle your command would look like.

else if (Command[0] == "/hair")
{
if (Command[1] != null || Command[1] != "")
{
Character.Hair = Convert.ToInt32(Convert.ToString(Character.Hair[0]) + Command[1])) ;
Con.Send(SpawnPlayer.Packet(Character));
}
}

Hope this helped?
drakejoe67 is offline  
Old   #10
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,254
Received Thanks: 879
Let me get this straight, You should not be re-sending the Character info packet. Once its loaded I dont think its ever used again. Spawnpacket is different from CharacterInfo.

You should be checking the offset that the Hairstyle sets to the spawnpacket.

such as hairstyle on 5165 is
Code:
PacketBuilder.WriteUInt16(value, SpawnPacket, 56);
                                              ^Offset.
_DreadNought_ is offline  
Old   #11
 
drakejoe67's Avatar
 
elite*gold: 0
Join Date: Feb 2008
Posts: 322
Received Thanks: 121
Quote:
Originally Posted by _DreadNought_ View Post
Let me get this straight, You should not be re-sending the Character info packet. Once its loaded I dont think its ever used again. Spawnpacket is different from CharacterInfo.

You should be checking the offset that the Hairstyle sets to the spawnpacket.

such as hairstyle on 5165 is
Code:
PacketBuilder.WriteUInt16(value, SpawnPacket, 56);
                                              ^Offset.
the offeset in 5017 is 56 aswell.
Should be nothing wrong in that

He should use the packet that he use to update his "CurHP" "Money" "CPs" etc with.

in my case lotf has this

Code:
public byte[] Vital(long CharId, int Type, ulong Value)
        {
            ushort PacketType = 1017;
            byte[] Packet = new byte[28];

            fixed (byte* p = Packet)
            {
                *((ushort*)p) = (ushort)Packet.Length;
                *((ushort*)(p + 2)) = (ushort)PacketType;
                *((uint*)(p + 4)) = (uint)CharId;
                *(p + 8) = 1;
                *((uint*)(p + 12)) = (uint)Type;
                *((ulong*)(p + 16)) = (ulong)Value;
            }

            return Packet;
        }
Where the type for hair would then be 27 to update hair.
Can make a void to run this for whoever can see you including yourself.

for Spawn should be offset 56, and for character info I guess 12 or something like that
drakejoe67 is offline  
Old   #12
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,254
Received Thanks: 879
Okay so to sum up whats been said.

Spawn Hair offset: 56
Character Info offset: 12
Update Packet offset: 27

Send the update packet with the type of 27 then re-spawn the character with the Spawn Hair offset.
_DreadNought_ is offline  
Old   #13
 
elite*gold: 0
Join Date: Jan 2011
Posts: 470
Received Thanks: 97
Quote:
Originally Posted by _DreadNought_ View Post
Okay so to sum up whats been said.

Spawn Hair offset: 56
Character Info offset: 12
Update Packet offset: 27

Send the update packet with the type of 27 then re-spawn the character with the Spawn Hair offset.
You should never have to respawn a character ever to the screen. Just send the update packet to the viewers with the central character's identification.
Spirited42 is offline  
Old   #14
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,254
Received Thanks: 879
I didnt make it clear, You have to update the spawn entity packet for it to be done.
_DreadNought_ is offline  
Old   #15
 
elite*gold: 0
Join Date: Jan 2011
Posts: 470
Received Thanks: 97
Quote:
Originally Posted by _DreadNought_ View Post
I didnt make it clear, You have to update the spawn entity packet for it to be done.
Ah ._. yah. That is rather important for future spawning. Hopefully that's explanatory.
Spirited42 is offline  
Reply


Similar Threads Similar Threads
COFuture 5017 Problems
05/09/2011 - CO2 Private Server - 3 Replies
Figured it out. Mods can close this now. Thanks
How to have custom hair (more than 1 or 2 hair models )
03/03/2009 - Perfect World - 0 Replies
I found people that have custom hair more than 1... 1. Poony tails 2. Red bandage 3. spike (bold) The result is like the SPARTAN in 300 movies... COOL..! I forgot to captured it....



All times are GMT +1. The time now is 20:54.


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.