Register for your free account! | Forgot your password?


You last visited: Today at 05:50

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

Advertisement




Character visual change

Discussion on Character visual change within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2021
Posts: 33
Received Thanks: 39
Character visual change

Hello community,
i am wondering if the GameServer sending a custom packet to whoever spawns in the fortresswar areas during fortresswar time to switch their equipped item into a colored uniform i thought of charactervisualchange.txt i tried to replace those lines



with FreePVP mode to force change character visuality while wearing pvp cap to the uniform and it worked , which means somehow the client determines player's location if isfortresswar region and fortresswar time then the client changes his equipped item to the suit.
i hope you get what i am looking for, thanks in advance.
#KB is offline  
Thanks
1 User
Old 04/10/2021, 20:30   #2
 
elite*gold: 0
Join Date: Sep 2015
Posts: 327
Received Thanks: 52
Quote:
Originally Posted by #KB View Post
Hello community,
i am wondering if the GameServer sending a custom packet to whoever spawns in the fortresswar areas during fortresswar time to switch their equipped item into a colored uniform i thought of charactervisualchange.txt i tried to replace those lines



with FreePVP mode to force change character visuality while wearing pvp cap to the uniform and it worked , which means somehow the client determines player's location if isfortresswar region and fortresswar time then the client changes his equipped item to the suit.
i hope you get what i am looking for, thanks in advance.
+1
i think = change char icon
sigel123456789 is offline  
Old 04/10/2021, 20:31   #3
 
elite*gold: 0
Join Date: Sep 2018
Posts: 285
Received Thanks: 488
You could try to check the region from character location directly.
They are pretty close to make a quick check about it.


I left here a quick example to detect if it's inside some fortress:
JellyBitz is offline  
Thanks
2 Users
Old 04/10/2021, 23:38   #4
 
elite*gold: 0
Join Date: Feb 2021
Posts: 33
Received Thanks: 39
Quote:
Originally Posted by JellyBitz View Post
You could try to check the region from character location directly.
They are pretty close to make a quick check about it.


I left here a quick example to detect if it's inside some fortress:
Hey jelly,
i appreciate your reply, but you misunderstand, my problem isn't determines player if he is in the fortress or no, my problem is how to change character suit by entering a specific region.
thanks.
#KB is offline  
Old 04/11/2021, 01:16   #5
 
elite*gold: 0
Join Date: Sep 2018
Posts: 285
Received Thanks: 488
Quote:
Originally Posted by #KB View Post
... my problem is how to change character suit by entering a specific region.
I get it, and yes. It's easy to find out checking the packet logs inside there.

I doubt it's something coded into the client, it should be a packet handling this information because there is no item on any inventory slot (I checked some videos).

Maybe has something to do with the packet 0x3058 if I can remember correctly, which applies client effects on objects like potions usage, scrolls usage, maybe others. I didn't check futher more last time.
JellyBitz is offline  
Old 04/11/2021, 13:22   #6
 
elite*gold: 0
Join Date: Oct 2012
Posts: 141
Received Thanks: 28
I think you can make a auto buff which has change the character visual (just like the way how new job suit work by using skill implement on it) and then when the player teleport into specific place then using that buff. xD
chipno0p is offline  
Old 04/11/2021, 18:15   #7
 
elite*gold: 0
Join Date: Feb 2021
Posts: 33
Received Thanks: 39
Quote:
Originally Posted by JellyBitz View Post
I get it, and yes. It's easy to find out checking the packet logs inside there.

I doubt it's something coded into the client, it should be a packet handling this information because there is no item on any inventory slot (I checked some videos).

Maybe has something to do with the packet 0x3058 if I can remember correctly, which applies client effects on objects like potions usage, scrolls usage, maybe others. I didn't check futher more last time.
Thank you bro i appreciate your every single word you wrote to help me.
but i don't think so , 0x3058 is never sent while teleporting to GATE 1 of fortresswar while fortresswar time,
by retrying i discovered something, if ignored the whole packet 0x385F gameserver won't recognize that there's a fortresswar and you won't even be able to check if theres a running fortresswar or no, i believe it is something related to 0x385F.


Quote:
Originally Posted by chipno0p View Post
I think you can make a auto buff which has change the character visual (just like the way how new job suit work by using skill implement on it) and then when the player teleport into specific place then using that buff. xD
Hello chipno0p, first thanks for your reply, i thought of this but i will have to send 0xB070 everytime someone trying to teleport to the specific region.
#KB is offline  
Old 04/11/2021, 19:17   #8
 
elite*gold: 0
Join Date: Sep 2016
Posts: 184
Received Thanks: 52
Quote:
Originally Posted by #KB View Post
Hello community,
i am wondering if the GameServer sending a custom packet to whoever spawns in the fortresswar areas during fortresswar time to switch their equipped item into a colored uniform i thought of charactervisualchange.txt i tried to replace those lines



with FreePVP mode to force change character visuality while wearing pvp cap to the uniform and it worked , which means somehow the client determines player's location if isfortresswar region and fortresswar time then the client changes his equipped item to the suit.
i hope you get what i am looking for, thanks in advance.
the idea it's working only with event time such as fortress , arena,ctf and ofc region also but mostlay depend on event time
Over56 is offline  
Old 04/11/2021, 20:41   #9
 
elite*gold: 0
Join Date: Feb 2021
Posts: 33
Received Thanks: 39
Quote:
Originally Posted by Over56 View Post
the idea it's working only with event time such as fortress , arena,ctf and ofc region also but mostlay depend on event time
Yea recently i recognized that, no event no suit, but it is still there's a packet is being sent to the client to switch the player's uniform
#KB is offline  
Old 04/12/2021, 02:20   #10
 
elite*gold: 0
Join Date: Sep 2018
Posts: 285
Received Thanks: 488
0x385F is all about fortress war notifications.

Looks like it is handled 50% internally by client since it still requires that packet.
You can try to inject to the client these and confirm that behavior.

Quote:
Opcode: 0x385F
Data: 02 // Fortress War started
Quote:
Opcode: 0x385F
Data: 06 // Fortress War ended
JellyBitz is offline  
Thanks
1 User
Old 04/12/2021, 03:20   #11
 
elite*gold: 0
Join Date: Jan 2009
Posts: 283
Received Thanks: 592
Quote:
Originally Posted by JellyBitz View Post
You could try to check the region from character location directly.
They are pretty close to make a quick check about it.


I left here a quick example to detect if it's inside some fortress:
You should consider decomposing the RID bits into it's 3 components.
Code:
//(MSB)                                                                       (LSB)
// | 15 | 14 | 13 | 12 | 11 | 10 | 09 | 08 | 07 | 06 | 05 | 04 | 03 | 02 | 01 | 00 |
// | DB |               Z (0-127)          |              X (0 - 255)              |
// DB = DungeonBit
Build a struct that access those Information from the backing field (ushort).

If that is to complicated you are lucky because altho we don't have language features to create bit fields in C# we can create a make-shift union with StructLayout because the major components happen be 8 bits.
Code:
        [StructLayout(LayoutKind.Explicit)]
        private struct RID : IEquatable<RID>
        {
            private const int DUNGEON_MASK = 0b10000000_00000000;

            [FieldOffset(0)]
            private ushort _value;

            [FieldOffset(0)]
            private byte _x;

            [FieldOffset(1)]
            private byte _z;

            public bool IsDungeon => (_value & DUNGEON_MASK) != 0;
            public byte X => _x;
            public byte Z => _z;

            public RID(byte x, byte z)
            {
                _value = 0;
                _x = x;
                _z = z;
            }

            public RID(ushort value)
            {
                _x = 0;
                _z = 0;
                _value = value;
            }

            public RID(short value)
            {
                _x = 0;
                _z = 0;
                _value = unchecked((ushort)value);
            }

            public override string ToString() => $"{_value} [{_x}x{_z}]";

            public override int GetHashCode() => _value.GetHashCode();

            public bool Equals(RID other) => _value == other._value;

            public override bool Equals(object obj) => obj is RID other && this.Equals(other);

            public static bool operator ==(RID left, RID right) => left.Equals(right);

            public static bool operator !=(RID left, RID right) => !left.Equals(right);

            public static implicit operator ushort(RID id) => id._value;

            public static implicit operator short(RID id) => unchecked((short)id._value);

            public static implicit operator RID(ushort id) => new RID(id);

            public static implicit operator RID(short id) => new RID(id);
        }
This is old code and I didn't care to implement any fancy logic to create a Dungeon RID at that time and I'll leave the rest as homework to you.

Now onto the topic...

Quote:
Originally Posted by #KB View Post
if ignored the whole packet 0x385F gameserver won't recognize that there's a fortresswar and you won't even be able to check if theres a running fortresswar or no, i believe it is something related to 0x385F.
0x385F - SERVER_AGENT_SIEGE_UPDATE has a lot of SiegeUpdateTypes. It manages everything the client knows about fortress war but it does not specify the suit a given character is wearing. By default every character in a siege region during war period is wearing the green suit. Siege period is controlled by 0x385F. But the color of the suit is determined by the guild information about the other character, the client adjusts this automatically.

The left picture shows the character after spawn injection (0x3015).
The right picture shows the character after guild assign injection (0x30FF).

FLAGWAR (CTF) and BARENA (Battle Arena) are different tho. This is mostly off the top of my head because I didn't bother checking but here the suit is determined by the PKFlag from the spawn packet. The only proof I currently have for that is, that UIIT_MSG_FLAGWAR_PICKUP_MASTERKEY is only shown if the PKFlag of your player is the same as specified in the message (packet) which I assume to be from the triggering player...
There is no packet I know off, that updates the PKFlag of an entity in the client.

So with all that out of the way...

Quote:
Originally Posted by #KB View Post
Yea recently i recognized that, no event no suit, but it is still there's a packet is being sent to the client to switch the player's uniform
I don't know any packet that does that and I've analyzed, named and documented about 1000 of them.

Quote:
Originally Posted by #KB View Post
i will have to send 0xB070 everytime someone trying to teleport to the specific region.
This is currently your easiest option.

Now we come to the advanced/experimental solution.
Code:
// 0 = Green
// 3 = Red
// 4 = Blue
/setoptimizecloth 0
/setoptimizecloth 3
/setoptimizecloth 4
The GM console command /setoptimizecloth is able to do just what you want and an easy entry to reverse engineer and replicate how and where the client calls 00A60F90. Being able to call this from a custom packet is the first step. But every equipment change remove this effect. A more advanced way would be to hook 9DB940. This function evaluates whether or not optimized clothing should be applied whenever equipment changes. You may add your own logic to it to work with your World- or RegionIDs.
DaxterSoul is offline  
Thanks
3 Users
Old 05/10/2021, 05:05   #12
 
elite*gold: 0
Join Date: May 2021
Posts: 2
Received Thanks: 1
Quote:
Originally Posted by DaxterSoul View Post
You should consider decomposing the RID bits into it's 3 components.
Code:
//(MSB)                                                                       (LSB)
// | 15 | 14 | 13 | 12 | 11 | 10 | 09 | 08 | 07 | 06 | 05 | 04 | 03 | 02 | 01 | 00 |
// | DB |               Z (0-127)          |              X (0 - 255)              |
// DB = DungeonBit
Build a struct that access those Information from the backing field (ushort).

If that is to complicated you are lucky because altho we don't have language features to create bit fields in C# we can create a make-shift union with StructLayout because the major components happen be 8 bits.
Code:
        [StructLayout(LayoutKind.Explicit)]
        private struct RID : IEquatable<RID>
        {
            private const int DUNGEON_MASK = 0b10000000_00000000;

            [FieldOffset(0)]
            private ushort _value;

            [FieldOffset(0)]
            private byte _x;

            [FieldOffset(1)]
            private byte _z;

            public bool IsDungeon => (_value & DUNGEON_MASK) != 0;
            public byte X => _x;
            public byte Z => _z;

            public RID(byte x, byte z)
            {
                _value = 0;
                _x = x;
                _z = z;
            }

            public RID(ushort value)
            {
                _x = 0;
                _z = 0;
                _value = value;
            }

            public RID(short value)
            {
                _x = 0;
                _z = 0;
                _value = unchecked((ushort)value);
            }

            public override string ToString() => $"{_value} [{_x}x{_z}]";

            public override int GetHashCode() => _value.GetHashCode();

            public bool Equals(RID other) => _value == other._value;

            public override bool Equals(object obj) => obj is RID other && this.Equals(other);

            public static bool operator ==(RID left, RID right) => left.Equals(right);

            public static bool operator !=(RID left, RID right) => !left.Equals(right);

            public static implicit operator ushort(RID id) => id._value;

            public static implicit operator short(RID id) => unchecked((short)id._value);

            public static implicit operator RID(ushort id) => new RID(id);

            public static implicit operator RID(short id) => new RID(id);
        }
This is old code and I didn't care to implement any fancy logic to create a Dungeon RID at that time and I'll leave the rest as homework to you.

Now onto the topic...


0x385F - SERVER_AGENT_SIEGE_UPDATE has a lot of SiegeUpdateTypes. It manages everything the client knows about fortress war but it does not specify the suit a given character is wearing. By default every character in a siege region during war period is wearing the green suit. Siege period is controlled by 0x385F. But the color of the suit is determined by the guild information about the other character, the client adjusts this automatically.

The left picture shows the character after spawn injection (0x3015).
The right picture shows the character after guild assign injection (0x30FF).

FLAGWAR (CTF) and BARENA (Battle Arena) are different tho. This is mostly off the top of my head because I didn't bother checking but here the suit is determined by the PKFlag from the spawn packet. The only proof I currently have for that is, that UIIT_MSG_FLAGWAR_PICKUP_MASTERKEY is only shown if the PKFlag of your player is the same as specified in the message (packet) which I assume to be from the triggering player...
There is no packet I know off, that updates the PKFlag of an entity in the client.

So with all that out of the way...


I don't know any packet that does that and I've analyzed, named and documented about 1000 of them.


This is currently your easiest option.

Now we come to the advanced/experimental solution.
Code:
// 0 = Green
// 3 = Red
// 4 = Blue
/setoptimizecloth 0
/setoptimizecloth 3
/setoptimizecloth 4
The GM console command /setoptimizecloth is able to do just what you want and an easy entry to reverse engineer and replicate how and where the client calls 00A60F90. Being able to call this from a custom packet is the first step. But every equipment change remove this effect. A more advanced way would be to hook 9DB940. This function evaluates whether or not optimized clothing should be applied whenever equipment changes. You may add your own logic to it to work with your World- or RegionIDs.
can you share hook 9DB940 func?

Quote:
Originally Posted by nouvolx01 View Post
can you share hook 9DB940 func?
Quote:
void CICUser::Func_16() {
reinterpret_cast<void(__thiscall*)(CICUser*)>(0x00 9db940)(this);
}
I tried but nothing changed
nouvolx01 is offline  
Reply


Similar Threads Similar Threads
[QS] Character Visual Change Error
02/22/2019 - SRO Private Server - 6 Replies
Yo bois, I've faced this error while trying to make a client, it happens with anything related to charactervisualchange.txt at the Media. Like devil spirit, avatars..etc http://i.epvpimg.com/i0Lcaab.png The error has a number which is 0xC100022E in hexadecimal, and I remember this type of numbers especially at this type of things, I mean effects, it's a effect ID. http://i.epvpimg.com/LGZBeab.png
[QUESTION]how to change price to change character??
07/08/2010 - EO PServer Hosting - 8 Replies
hi all..can help me?to change price to change character...:handsdown:
Visual C++ (C++), Visual Basic, oder AutoIT?
06/24/2010 - .NET Languages - 11 Replies
Hallo Zusammen Ich würde gerne mit dem Programmieren anfangen. Meine Vorstellungen: Es müsste möglich sein, eigene Programme zu schreiben wie z. B. MSN, Emule oder ähnliches. Natürlich nie in dieser Grösse nur als Beispiel. Als weiteres sollte mit der gleichen Programmiersprache auch die Möglichkeit bestehen einen WoW Bot zu schreiben. Habe gehört die meisten Bots sind in Auto IT geschrieben. Gibt es unterschiede wegen des Warden schutzes oder kommt es nicht darauf an?



All times are GMT +1. The time now is 05:50.


Powered by vBulletin®
Copyright ©2000 - 2022, 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 ©2021 elitepvpers All Rights Reserved.