Valhalla Legends Forums Archive | Battle.net Bot Development | Diablo II

AuthorMessageTime
raylu
I want to make a bot that joins Diablo II games.

Does warden apply to D2 in-game?
Is the data on the bnetdocs cache accurate/up-to-date?
What is the sequence for joining/creating a game? How do I get the IP of MCP?
Is this difficult?
June 9, 2007, 5:19 PM
Ringo
Clicky
And yeah, warden is in D2 game servers to.

Hope this helps
June 9, 2007, 6:05 PM
raylu
Looks useful, but all the links are broken.
June 9, 2007, 6:27 PM
iago
Depends if you mean realm or open Battle.net. I rather doubt that Warden applies on open Battle.net, since there's no actual link to Battle.net servers.
June 9, 2007, 6:40 PM
dRAgoN
[quote author=iago link=topic=16775.msg169953#msg169953 date=1181414456]
Depends if you mean realm or open Battle.net. I rather doubt that Warden applies on open Battle.net, since there's no actual link to Battle.net servers.
[/quote]
Not only that but all the hacked characters that are on open, if there were much of the d2 players would be canned.
June 9, 2007, 7:41 PM
raylu
So, could someone answer the following again?

Do we have sufficient documentation for warden?
What is the sequence for joining/creating a game? How do I get the IP of MCP?
Is this difficult?

What if I only wanted to make a bot that listed games (no D2GS involvement)?
June 11, 2007, 1:52 PM
l2k-Shadow
[quote author=raylu link=topic=16775.msg169991#msg169991 date=1181569956]
So, could someone answer the following again?

Do we have sufficient documentation for warden?
What is the sequence for joining/creating a game? How do I get the IP of MCP?
Is this difficult?

What if I only wanted to make a bot that listed games (no D2GS involvement)?
[/quote]

no sufficient public documentation for warden. (not sure about private)
look into packet SID_LOGONREALMEX (0x3E), that's where the MCP IP can be retreived.
no it's not difficult, just implement the protocol correctly.

warden for d2 is only enabled on the game servers, so you don't have to worry about it while in the chat room.
June 11, 2007, 2:22 PM
raylu
[code][09:45:59]Attempting to connect...
[09:45:59]BNET: Connecting (213.248.106.204)...
[09:45:59]BNET: Connected!
[09:45:59][Bot] Using hardcoded VerByte (0xB)
[09:45:59]
0000:  FF 50 3A 00 00 00 00 00 36 38 58 49 50 58 32 44  ÿP:.....68XIPX2D
0010:  0B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ...............
0020:  00 00 00 00 00 00 00 00 55 53 41 00 55 6E 69 74  ........USA.Unit
0030:  65 64 20 53 74 61 74 65 73 00                    ed States.......
[09:45:59]0000:  FF 25 08 00 00 00 00 00                          ÿ%.............
[09:45:59]0000:  FF 25 08 00 C1 01 E2 EE                          ÿ%.âî........
[09:45:59]
0000:  FF 50 68 00 00 00 00 00 B1 AF 31 21 33 00 AA 00  ÿPh.....±¯1!3.ª.
0010:  00 20 58 7D 99 CB C6 01 76 65 72 2D 49 58 38 36  . X}™ËÆver-IX86
0020:  2D 31 2E 6D 70 71 00 43 3D 31 30 33 32 36 38 39  -1.mpq.C=1032689
0030:  30 36 31 20 41 3D 31 32 35 38 31 37 35 32 34 39  061 A=1258175249
0040:  20 42 3D 34 30 38 34 31 37 30 30 32 38 20 34 20    B=4084170028 4
0050:  41 3D 41 2B 53 20 42 3D 42 2D 43 20 43 3D 43 2B  A=A+S B=B-C C=C+
0060:  41 20 41 3D 41 2B 42 00                          A A=A+B.........
[09:45:59]
0000:  FF 51 92 00 24 C2 3F 00 00 0B 00 01 EF 07 AC C6  ÿQ’.$Â?.. .ï¬Æ
0010:  02 00 00 00 00 00 00 00 10 00 00 00 06 00 00 00  .............
0020:  C9 58 A7 00 00 00 00 00 C9 52 B9 59 B6 30 E6 74  ÉX§.....ÉR¹Y¶0æt
0030:  87 E3 10 3C 2C 08 BF 95 1B 4F 2B F9 10 00 00 00  ‡ã<,¿•O+ù...
0040:  0A 00 00 00 F4 B2 69 00 00 00 00 00 20 2D C1 11  ....ô²i..... -
0050:  AF 86 9D 46 76 AE 32 8A FC 2B 4D 81 51 17 CC 61  ¯†?Fv®2Šü+M?QÌa
0060:  47 61 6D 65 2E 65 78 65 20 30 33 2F 31 39 2F 30  Game.exe 03/19/0
0070:  37 20 30 37 3A 32 32 3A 34 37 20 32 31 32 39 39  7 07:22:47 21299
0080:  32 30 00 46 4F 20 50 2E 41 2E 57 2D 52 61 79 4C  20.FO P.A.W-RayL
0090:  75 00                                            u...............
[09:46:00]
0000:  FF 51 09 00 00 00 00 00 00                        ÿQ..............
[09:46:00]BNET: Version and CD-key check passed! (0x51)
[09:46:00]0000:  FF 14 08 00 74 65 6E 62                          ÿ.tenb........
[09:46:00]
0000:  FF 3A 2C 00 24 C2 3F 00 B1 AF 31 21 5F FF 3F C0  ÿ:,.$Â?.±¯1!_ÿ?À
0010:  E3 0A CA B7 74 A7 09 F0 EE 3E 40 FB CF C2 DD 07  ã.Ê·t§.ðî>@ûÏÂÝ
0020:  50 2E 41 2E 57 2D 52 61 79 4C 75 00              P.A.W-RayLu.....
[09:46:00]0000:  FF 4C 16 00 49 58 38 36 4D 69 6E 64 53 69 67 68  ÿL.IX86MindSigh
0010:  74 2E 6D 70 71 00                                t.mpq...........
[09:46:00]0000:  FF 3A 08 00 00 00 00 00                          ÿ:.............
[09:46:00]BNET: (0x3A-0x00) Login passed!
[09:46:00]0000:  FF 40 04 00                                      ÿ@.............
[09:46:00]
0000:  FF 40 28 00 00 00 00 00 01 00 00 00 01 00 00 00  ÿ@(...........
0010:  45 75 72 6F 70 65 00 52 65 61 6C 6D 20 66 6F 72  Europe.Realm for
0020:  20 45 75 72 6F 70 65 00                            Europe.........
[09:46:00]Found realm Europe,
0000:  FF 3E 23 00 00 00 00 00 3E 76 A6 77 4D 0D 84 1F  ÿ>#.....>v¦wM.„
0010:  84 0E 89 6A 95 A2 50 C3 C6 98 19 BE 45 75 72 6F  „‰j•¢PÃƘ¾Euro
0020:  70 65 00                                          pe..............
[09:46:00]Logging in...
[09:46:00]0000:  FF 3E 0C 00 00 00 00 00 02 00 00 80              ÿ> .......€....[/code]

Help :(
June 15, 2007, 2:48 PM
l2k-Shadow
with..?
June 15, 2007, 3:07 PM
raylu
[quote][09:46:00]0000:  FF 3E 0C 00 00 00 00 00 02 00 00 80              ÿ> .......€....[/quote]
means that my login failed.
June 15, 2007, 4:00 PM
iago
I suspect (and I could be wrong) that the issue is that your login failed.
June 15, 2007, 4:11 PM
laurion
[quote author=iago link=topic=16775.msg170124#msg170124 date=1181923914]
I suspect (and I could be wrong) that the issue is that your login failed.
[/quote]
ROFL.

Raylu, please label S->C and vice versa. Specifically, C->S for the realm login packet.
June 15, 2007, 10:33 PM
raylu
I considered labeling it but I assumed they were self-explanatory...

C->S
[code]0000:  FF 50 3A 00 00 00 00 00 36 38 58 49 50 58 32 44  ÿP:.....68XIPX2D
0010:  0B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ...............
0020:  00 00 00 00 00 00 00 00 55 53 41 00 55 6E 69 74  ........USA.Unit
0030:  65 64 20 53 74 61 74 65 73 00                    ed States.......[/code]
C->S (spoofing ping)
[code]0000:  FF 25 08 00 00 00 00 00                          ÿ%.............[/code]
S->C
[code]0000:  FF 25 08 00 C1 01 E2 EE                          ÿ%.âî........[/code]
S->C
[code]0000:  FF 50 68 00 00 00 00 00 B1 AF 31 21 33 00 AA 00  ÿPh.....±¯1!3.ª.
0010:  00 20 58 7D 99 CB C6 01 76 65 72 2D 49 58 38 36  . X}™ËÆver-IX86
0020:  2D 31 2E 6D 70 71 00 43 3D 31 30 33 32 36 38 39  -1.mpq.C=1032689
0030:  30 36 31 20 41 3D 31 32 35 38 31 37 35 32 34 39  061 A=1258175249
0040:  20 42 3D 34 30 38 34 31 37 30 30 32 38 20 34 20    B=4084170028 4
0050:  41 3D 41 2B 53 20 42 3D 42 2D 43 20 43 3D 43 2B  A=A+S B=B-C C=C+
0060:  41 20 41 3D 41 2B 42 00                          A A=A+B.........[/code]
C->S
[code]0000:  FF 51 92 00 24 C2 3F 00 00 0B 00 01 EF 07 AC C6  ÿQ’.$Â?.. .ï¬Æ
0010:  02 00 00 00 00 00 00 00 10 00 00 00 06 00 00 00  .............
0020:  C9 58 A7 00 00 00 00 00 C9 52 B9 59 B6 30 E6 74  ÉX§.....ÉR¹Y¶0æt
0030:  87 E3 10 3C 2C 08 BF 95 1B 4F 2B F9 10 00 00 00  ‡ã<,¿•O+ù...
0040:  0A 00 00 00 F4 B2 69 00 00 00 00 00 20 2D C1 11  ....ô²i..... -
0050:  AF 86 9D 46 76 AE 32 8A FC 2B 4D 81 51 17 CC 61  ¯†?Fv®2Šü+M?QÌa
0060:  47 61 6D 65 2E 65 78 65 20 30 33 2F 31 39 2F 30  Game.exe 03/19/0
0070:  37 20 30 37 3A 32 32 3A 34 37 20 32 31 32 39 39  7 07:22:47 21299
0080:  32 30 00 46 4F 20 50 2E 41 2E 57 2D 52 61 79 4C  20.FO P.A.W-RayL
0090:  75 00                                            u...............[/code]
S->C (B.net figuratively gives me a literal cookie here.)
[code]0000:  FF 51 09 00 00 00 00 00 00                        ÿQ..............[/code]
S->C, I think
[code]0000:  FF 14 08 00 74 65 6E 62                          ÿ.tenb........[/code]
C->S
[code]0000:  FF 3A 2C 00 24 C2 3F 00 B1 AF 31 21 5F FF 3F C0  ÿ:,.$Â?.±¯1!_ÿ?À
0010:  E3 0A CA B7 74 A7 09 F0 EE 3E 40 FB CF C2 DD 07  ã.Ê·t§.ðî>@ûÏÂÝ
0020:  50 2E 41 2E 57 2D 52 61 79 4C 75 00              P.A.W-RayLu.....[/code]
S->C
[code]0000:  FF 4C 16 00 49 58 38 36 4D 69 6E 64 53 69 67 68  ÿL.IX86MindSigh
0010:  74 2E 6D 70 71 00                                t.mpq...........[/code]
S->C
[code]0000:  FF 3A 08 00 00 00 00 00                          ÿ:.............[/code]
C->S (requesting realm list)
[code]0000:  FF 40 04 00                                      ÿ@.............[/code]
S->C (response with list of realms)
[code]0000:  FF 40 28 00 00 00 00 00 01 00 00 00 01 00 00 00  ÿ@(...........
0010:  45 75 72 6F 70 65 00 52 65 61 6C 6D 20 66 6F 72  Europe.Realm for
0020:  20 45 75 72 6F 70 65 00                            Europe.........[/code]
C->S (logging in)
[code]0000:  FF 3E 23 00 00 00 00 00 3E 76 A6 77 4D 0D 84 1F  ÿ>#.....>v¦wM.„
0010:  84 0E 89 6A 95 A2 50 C3 C6 98 19 BE 45 75 72 6F  „‰j•¢PÃƘ¾Euro
0020:  70 65 00                                          pe..............[/code]
S->C (no, go die)
[code]0000:  FF 3E 0C 00 00 00 00 00 02 00 00 80              ÿ> .......€....[/code]

Could the issue be not responding to the UDP test packet?
June 16, 2007, 1:24 AM
l2k-Shadow
well first of all there is no UDP in d2, so there is no 0x14 packet or udp data exchange...

second of all your client token is 0 in your sending of 0x3E.
June 16, 2007, 1:30 AM
UserLoser
I was just discussing this with Spht over MSN about 1 minute ago (literally).  You cannot use 0 as a client key for any kind of hashing in the logon
June 16, 2007, 1:35 AM
l2k-Shadow
[quote author=UserLoser link=topic=16775.msg170148#msg170148 date=1181957750]
I was just discussing this with Spht over MSN about 1 minute ago (literally).  You cannot use 0 as a client key for any kind of hashing in the logon
[/quote]

yeah, but to anyone else: note he's not using 0 for the hash, his hash is correct. the problem lies in the actual number sent. So then server does if hash(clienttoken & servertoken & hash("password")) = senthash then good login. his hash uses different token than the one he sends to the server to use.
June 16, 2007, 1:59 AM
raylu
o.0, but it's a cookie, not a client token... As far as I can tell, the first DWORD is a cookie.

Or is it actually the client token I'm doing the double hashing with?
June 16, 2007, 6:10 AM
l2k-Shadow
[quote author=raylu link=topic=16775.msg170153#msg170153 date=1181974254]
o.0, but it's a cookie, not a client token... As far as I can tell, the first DWORD is a cookie.

Or is it actually the client token I'm doing the double hashing with?
[/quote]

its not a cookie, i just explained what happens in the previous post...
June 16, 2007, 3:19 PM
raylu
Oh!

You could have just said "Yes" to my second question.
June 17, 2007, 3:05 AM
raylu
http://ersan.us/src/bnetdocs/contentafa6.html?Section=m&Code=93
So...what are the 16 DWORDs?

http://ersan.us/src/bnetdocs/content7515.html?Section=m&Code=15
says that
[quote]The first part of the MCP Chunk that must be sent to the MCP server includes the Status and Cookie DWORDS, making MCP Chunk 1 the first 4 DWORDS of the packet.[/quote]
I assume that this actually means
"The first 4 DWORDS of the MCP Chunk that must be sent to the MCP server are the Status, Cookie, and MCP Chunk 1 DWORDs."

Does this mean that the 16 DWORDs are Status, Cookie, MCP 1, MCP 2?

It also says that
[quote]Any other value indicates failure.[/quote]
with regard to the Status field. I assume this is a mistake?

And finally, even though I've used it before, I can't find the Win32 API for DWORD to IP conversion.
June 17, 2007, 3:10 AM
l2k-Shadow
[quote author=raylu link=topic=16775.msg170183#msg170183 date=1182049845]
Does this mean that the 16 DWORDs are Status, Cookie, MCP 1, MCP 2?
[/quote]

Yes, sent in the same order as received from 0x3E. You can always packet log the client and see exactly what goes on though.

[quote author=raylu link=topic=16775.msg170183#msg170183 date=1182049845]
And finally, even though I've used it before, I can't find the Win32 API for DWORD to IP conversion.
[/quote]

Clicky
if you are coding in VB and are using the mswinsck.ocx control, it is much easier to just write your own little function for it.
June 17, 2007, 3:55 AM
raylu
I'm going to assume I'm parsing the port wrong here.
[code]rCookie = .GetDWORD
rStatus = .GetDWORD
MCP1 = .GetFixedString(8)

frmMain.sckMCP.RemoteHost = GetInetStrFromPtr(.GetDWORD)
frmMain.sckMCP.RemotePort = .GetDWORD[/code]
And since when is a port 4 bytes anyway?
June 23, 2007, 8:13 AM
Barabajagal
Try getword instead then? I'm fairly certain MCP uses 6112, so just debug.print the result and see what you get.
June 23, 2007, 9:21 AM
l2k-Shadow
[quote author=raylu link=topic=16775.msg170347#msg170347 date=1182586389]
I'm going to assume I'm parsing the port wrong here.
[code]rCookie = .GetDWORD
rStatus = .GetDWORD
MCP1 = .GetFixedString(8)

frmMain.sckMCP.RemoteHost = GetInetStrFromPtr(.GetDWORD)
frmMain.sckMCP.RemotePort = .GetDWORD[/code]
And since when is a port 4 bytes anyway?
[/quote]

it's a 16-bit integer sent in TCP/IP byte order, which is big-endian, you have to convert it to little-endian first.
June 23, 2007, 4:19 PM
raylu
OK...got that working. Thanks for the help so far.

S->C
[code]0000:  3A 00 19 08 00 01 00 00 00 01 00 A4 64 F8 46 72  :......¤døFr
0010:  54 77 6F 4D 75 6C 65 00 84 80 FF FF FF FF FF FF  TwoMule.„€ÿÿÿÿÿÿ
0020:  FF FF FF FF FF 05 FF FF FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
0030:  FF 01 E0 80 FF FF 03 FF FF 00                    ÿà€ÿÿÿÿ.......[/code]
And also
[code]0000:  C9 00 19 08 00 04 00 00 00 04 00 18 4C 8C 46 72  É......LŒFr
0010:  61 79 6C 75 00 84 80 FF FF FF FF FF FF FF FF FF  aylu.„€ÿÿÿÿÿÿÿÿÿ
0020:  FF FF 02 FF FF FF FF FF FF FF FF FF FF FF 01 E1  ÿÿÿÿÿÿÿÿÿÿÿÿÿá
0030:  80 80 80 03 FF FF 00 03 51 8C 46 74 6F 74 61 6C  €€€ÿÿ.QŒFtotal
0040:  72 65 67 00 84 80 FF FF FF FF FF FF FF FF FF FF  reg.„€ÿÿÿÿÿÿÿÿÿÿ
0050:  FF 02 FF FF FF FF FF FF FF FF FF FF FF 01 81 80  ÿÿÿÿÿÿÿÿÿÿÿÿ?€
0060:  80 80 FF FF FF 00 1B 51 8C 46 63 6C 61 73 73 69  €€ÿÿÿ.QŒFclassi
0070:  63 6C 61 64 00 84 80 FF FF FF FF FF FF FF FF FF  clad.„€ÿÿÿÿÿÿÿÿÿ
0080:  FF FF 02 FF FF FF FF FF FF FF FF FF FF FF 01 C1  ÿÿÿÿÿÿÿÿÿÿÿÿÿ
0090:  80 80 80 03 FF FF 00 29 51 8C 46 65 78 70 68 61  €€€ÿÿ.)QŒFexpha
00A0:  72 64 63 6F 72 65 00 84 80 FF FF FF FF FF FF FF  rdcore.„€ÿÿÿÿÿÿÿ
00B0:  FF FF FF FF 02 FF FF FF FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
00C0:  01 A5 80 80 80 FF FF FF 00                        ¥€€€ÿÿÿ........[/code]

rTwoMule is an expansion ladder character.
raylu is exp ladder, totalreg is classic non-ladder, classiclad is classic ladder, and exphardcore is expansion and the only hardcore.

Correct me if I'm wrong, but all my flags are 0x8480...
June 24, 2007, 2:23 AM
Barabajagal
You're not wrong, BNetDocs is. That's not a flags field. See https://davnit.net/bnet/vL/index.php?topic=16240.0
June 24, 2007, 2:32 AM
Ringo
[quote author=Andy link=topic=16775.msg170379#msg170379 date=1182652354]
You're not wrong, BNetDocs is. That's not a flags field. See https://davnit.net/bnet/vL/index.php?topic=16240.0
[/quote]
I think it is a flag, its just no longer used afaik.
There is also another flag deeper in, stateing if the character is Lod, HC, Exp, etc and for the characters act.
June 24, 2007, 12:00 PM
Barabajagal
[quote author=Ringo link=topic=16775.msg170393#msg170393 date=1182686404]
[quote author=Andy link=topic=16775.msg170379#msg170379 date=1182652354]
You're not wrong, BNetDocs is. That's not a flags field. See https://davnit.net/bnet/vL/index.php?topic=16240.0
[/quote]
I think it is a flag, its just no longer used afaik.
There is also another flag deeper in, stateing if the character is Lod, HC, Exp, etc and for the characters act.
[/quote]
If it's a flag, why is it exactly the same as the StatStrings you receive in channels if you count the two bytes as part of the string? The beginning of every account is [CHARNAME], 0x84, 0x80, 0xFF...
June 24, 2007, 4:15 PM
raylu
In that case...where is the flag data?
June 24, 2007, 11:27 PM
Barabajagal
Where character flag data always is in Realm Character StatStrings.
June 24, 2007, 11:32 PM
raylu
It seems like the 25th character of the statstring is level (yay, easy to parse :D) and the 26th is flags.
0x01000000 or 0x40 is ladder, I think (that wasn't in your post) and 0x08 isn't dead.
June 25, 2007, 1:19 AM
Barabajagal
You don't even have a statstring parser? And ladder is the 29th byte (30th for how you're counting... i think you have an extra byte in there).
June 25, 2007, 1:55 AM
raylu
I might have counted wrong, o.0. I stuck the number in and was one off, so I adjusted there, thinking I had the indices wrong.

FO's statstring parser doesn't do D2.
June 25, 2007, 3:49 AM
Barabajagal
Well... I used to have my parse stats bas file in my uploads, but I guess I removed it. My bot's source code is still downloadable, but all you need is the parser...
[code]Public Function ParseD2Stats(ByVal Stats As String)
Dim d2classes(0 To 7) As String
Dim statbuf          As String
Dim P()              As Byte
Dim Server            As String
Dim Name              As String
Dim sLen              As Byte
Dim CharClass        As Byte
Dim Female            As Boolean
Dim CharLevel        As Long
Dim Hardcore          As Boolean
Dim Dead              As Boolean
Dim Ladder            As Boolean
Dim Expansion        As Boolean
Dim D2Act            As String
Dim D2Title          As Integer
    d2classes(0) = "Amazon"
    d2classes(1) = "Sorceress"
    d2classes(2) = "Necromancer"
    d2classes(3) = "Paladin"
    d2classes(4) = "Barbarian"
    d2classes(5) = "Druid"
    d2classes(6) = "Assassin"
    d2classes(7) = "unknown class"
    If Len(Stats) > 4 Then
        sLen = GetServer(Stats, Server)
        sLen = GetCharacterName(Stats, sLen, Name)
        MakeArray Mid$(Stats, sLen), P()
    End If
    If Left$(Stats, 4) = "VD2D" Then
        statbuf = statbuf & "Diablo II: "
    Else
        statbuf = statbuf & "Diablo II Lord of Destruction: "
    End If
    If Len(Stats) = 4 Then
        statbuf = statbuf & "Open Character"
    Else
        CharClass = P(13) - 1
        If (CharClass < 0) Or (CharClass > 6) Then
            CharClass = 7
        End If
        If (CharClass = 0) Or (CharClass = 1) Or (CharClass = 6) Then
            Female = True
        End If
        CharLevel = P(25)
        Hardcore = P(26) And &H4
        Dead = P(26) And &H8
        Expansion = P(26) And &H20
        Ladder = Not (P(30) = 255)
        If Left$(Stats, 4) = "PX2D" And (P(26) And &H20) Then
            Select Case P(27)
                Case &H80
                    D2Act = "1 (Normal)"
                    D2Title = 0
                Case &H82
                    D2Act = "2 (Normal)"
                    D2Title = 0
                Case &H84
                    D2Act = "3 (Normal)"
                    D2Title = 0
                Case &H86
                    D2Act = "4/5 (Normal)"
                    D2Title = 0
                Case &H88
                    D2Act = "5 (Normal)"
                    D2Title = 0
                Case &H8A
                    D2Act = "1 (Nightmare)"
                    D2Title = 1
                Case &H8C
                    D2Act = "2 (Nightmare)"
                    D2Title = 1
                Case &H8E
                    D2Act = "3 (Nightmare)"
                    D2Title = 1
                Case &H90
                    D2Act = "4/5 (Nightmare)"
                    D2Title = 1
                Case &H92
                    D2Act = "5 (Nightmare)"
                    D2Title = 1
                Case &H94
                    D2Act = "1 (Hell)"
                    D2Title = 2
                Case &H96
                    D2Act = "2 (Hell)"
                    D2Title = 2
                Case &H98
                    D2Act = "3 (Hell)"
                    D2Title = 2
                Case &H9A
                    D2Act = "4/5 (Hell)"
                    D2Title = 2
                Case &H9C
                    D2Act = "5 (Hell)"
                    D2Title = 2
                Case &H9E
                    D2Act = vbNullString
                    D2Title = 3
                Case Else
                    D2Act = vbNullString
                    D2Title = P(27)
                End Select
            Select Case D2Title
                Case &H0
                    'Nothing
                Case &H1
                    If Hardcore Then
                        statbuf = statbuf & "Destroyer "
                    Else
                        statbuf = statbuf & "Slayer "
                    End If
                Case &H2
                    If Hardcore Then
                        statbuf = statbuf & "Conquerer "
                    Else
                        statbuf = statbuf & "Champion "
                    End If
                Case &H3
                    If Hardcore Then
                        statbuf = statbuf & "Guardian "
                    Else
                        If Not Female Then
                            statbuf = statbuf & "Patriarch "
                        Else
                            statbuf = statbuf & "Matriarch "
                        End If
                    End If
                Case Else
                    statbuf = statbuf & "Unknown (0x" & Hex$(P(27)) & ")"
            End Select
        Else
            Select Case P(27)
                Case &H80
                    D2Act = "1 (Normal)"
                    D2Title = 0
                Case &H82
                    D2Act = "2 (Normal)"
                    D2Title = 0
                Case &H84
                    D2Act = "3 (Normal)"
                    D2Title = 0
                Case &H86
                    D2Act = "4 (Normal)"
                    D2Title = 0
                Case &H88
                    D2Act = "1 (Nightmare)"
                    D2Title = 1
                Case &H8A
                    D2Act = "2 (Nightmare)"
                    D2Title = 1
                Case &H8C
                    D2Act = "3 (Nightmare)"
                    D2Title = 1
                Case &H8E
                    D2Act = "4 (Nightmare)"
                    D2Title = 1
                Case &H90
                    D2Act = "1 (Hell)"
                    D2Title = 2
                Case &H92
                    D2Act = "2 (Hell)"
                    D2Title = 2
                Case &H94
                    D2Act = "3 (Hell)"
                    D2Title = 2
                Case &H96
                    D2Act = "4 (Hell)"
                    D2Title = 2
                Case &H98
                    D2Act = vbNullString
                    D2Title = 3
                Case Else
                    D2Act = vbNullString
                    D2Title = 0
            End Select
            Select Case D2Title
                Case &H0
                    'Nothing
                Case &H1
                    If Not Female Then
                        If Hardcore Then
                            statbuf = statbuf & "Count "
                        Else
                            statbuf = statbuf & "Sir "
                        End If
                    Else
                        If Hardcore Then
                            statbuf = statbuf & "Countess "
                        Else
                            statbuf = statbuf & "Dame "
                        End If
                    End If
                Case &H2
                    If Not Female Then
                        If Hardcore Then
                            statbuf = statbuf & "Duke "
                        Else
                            statbuf = statbuf & "Lord "
                        End If
                    Else
                        If Hardcore Then
                            statbuf = statbuf & "Duchess "
                        Else
                            statbuf = statbuf & "Lady "
                        End If
                    End If
                Case &H3
                    If Not Female Then
                        If Hardcore Then
                            statbuf = statbuf & "King "
                        Else
                            statbuf = statbuf & "Baron "
                        End If
                    Else
                        If Hardcore Then
                            statbuf = statbuf & "Queen "
                        Else
                            statbuf = statbuf & "Baroness "
                        End If
                    End If
                Case Else
                    statbuf = statbuf & "Unknown (0x" & Hex$(P(27)) & ")"
            End Select
        End If
        statbuf = statbuf & Name & ", a "
        If Hardcore Then
            If Dead Then
                statbuf = statbuf & "dead hardcore "
            Else
                statbuf = statbuf & "hardcore "
            End If
        End If
        statbuf = statbuf & "level " & CharLevel & " "
        If Ladder Then statbuf = statbuf & "ladder "
        statbuf = statbuf & d2classes(CharClass) & IIf(LenB(D2Act) > 0, " in act " & D2Act, "") & " on realm " & Server & IIf(Expansion, " (Expansion)", "")
    End If
    ParseD2Stats = statbuf
End Function[/code]
Sorry for the length...

Edit: And yes, I know it's a bit weirdly written... but I'm lazy.
June 25, 2007, 4:10 AM
l2k-Shadow
more like source ripped, what's the point of sprintf in VB6, use string concatenation...

EDIT: he edited his post lol.
June 25, 2007, 4:18 AM
Barabajagal
Ya, I just realized how old that code was. Also, as far as I know, I'm the only one who bothered to find out what all the act values mean... The original code was part of another bot (some d1 bot I ran across years ago), yes, but it's been quite edited. The code I've reposted was my rewritten version.

Edit: Also, I've heard rumors of another title by the name of "Archangel"... I believe Paul (Hell-Lord) mentioned an account of his on east attained it and he didn't have a clue how... I have yet to run across anything of the sort, so I didn't include it of course ;) .

Edit2: wow, I beat you to the change by ~20 seconds...
June 25, 2007, 4:47 AM

Search