Table of Contents

From Anarchy Online to Age of Conan at protocol level

It was to be expected. The Anarchy Online (AO) community has fully embraced bots and spawned entire development teams. It was only a matter of time before bots pop up in Age of Conan (AoC).
After spending some time sniffing data, decyphering packets and digging around the RDB files with a hex editor, I managed to create a fully working prototype that connects and interacts with the AoC chat server.
My goal of this article is to make the transition from AO bots to AoC bots a little bit easier. I will outline the large changes on protocol level.

Out of the box your AO chat library will not function properly on AoC. However, you don't have to throw it away completely.
With a few modifications which I will outline in this article you should be up and running in no time.

1. Name lookup (Incoming packet 21)

The packet structure has changed by only 1 byte, however this was enough to properly break your library.<br /> The original syntax was:

[unsigned int: CharacterID] [short: CharacterNameLength] [string: CharacterName]

The new syntax is:

[unsigned int: CharacterID] [byte: Unknown] [unsigned short: CharacterNameLength] [string: CharacterName]

2. Adding/removing friends (Outgoing packet 120)

The way we add friends has changed completely. It now uses a ChatCommand packet and the CharacterName rather than the CharacterID to identify the character.
The syntax of ChatCommand is:

[unsigned short: AmountOfStrings] [[unsigned short: StringLength] [string: String] ..]

The command supports a variable amount of strings. To add a friend we need 2 strings.
The syntax of adding a friend is:

[unsigned short: "2"] [unsigned short: "8"] [string: "addbuddy"] [unsigned short: CharacterNameLength] [string: CharacterName]

The syntax of removing a friend is:

[unsigned short: "2"] [unsigned short: "8"] [string: "rembuddy"] [unsigned short: CharacterNameLength] [string: CharacterName]

3. Friend status (Incoming packet 40)

The friend status packet changed completely. It took some time to decypher it, but it was absolutely worth it.
Due to the changes we're now able to get a character's class, level, location and last seen date directly from the chat server.
The meaning of the data inside the packet varies, so I'll post the structure twice. Once for online and once for offline.
If the character is offline the syntax is as following:

[unsigned int: CharacterID] [boolean: "false"] [byte: Level] [unsigned int: LastSeenTimestamp] [byte: Class]

If the character is online the syntax is as following:

[unsigned int: CharacterID] [boolean: "true"] [byte: Level] [unsigned int: Location] [byte: Class]

Class is a numeric value that is mapped as following:

Conqueror = 22
Dark Templar = 31
Guardian = 20
Bear Shaman = 29
Priest of Mitra = 24
Scoin of Set = 26
Tempest of Set = 28
Assassin = 34
Barbarian = 16
Ranger = 39
Demonologist = 44
Herald of Xolti = 43
Lich = 42
Necromancer = 41

Please note if the character is logged in using something other than the official client, class will be 0.

4. Private channel

There is some bad news about the private channel. While it is implemented on the chat server in exactly the same way as it is in AO, the game client does not allow you to properly use it.
You can invite players into a private channel, however the game client does not allow players to talk in private channels.
There is also no visual feedback when leaving a private channel in the game client.
We can only assume FC has intentionally removed this feature.

Conclusion

In conclusion, we lost some and we gained some.
The new friends system will allow us to new and interesting things, however the loss of the private channel is a heavy one.
What you can do with these changes, I'll leave up to you.