cRO packets changed

Wrote new code? Fixed a bug? Want to discuss technical stuff? Feel free to post it here.

Moderator: Moderators

johnny
Noob
Noob
Posts: 9
Joined: 14 Apr 2008, 04:46

cRO packets changed

#1 Post by johnny »

Code: Select all

Index: Receive.pm

===================================================================

--- Receive.pm	(revision 6488)

+++ Receive.pm	(working copy)

@@ -80,7 +80,7 @@

 		'0073' => ['map_loaded', 'V a3', [qw(syncMapSync coords)]],
 		'0075' => ['changeToInGameState'],
 		'0077' => ['changeToInGameState'],
		'0078' => ['actor_display', 'a4 v14 a4 x7 C1 a3 x2 C1 v1', [qw(ID walk_speed param1 param2 param3 type hair_style weapon lowhead shield tophead midhead hair_color clothes_color head_dir guildID sex coords act lv)]],
+		# cRO got 1 byte at the beginning ... '0078' => ['actor_display', 'C1 a4 v14 a4 x7 C1 a3 x2 C1 v1', [qw(npcinfo ID walk_speed param1 param2 param3 type hair_style weapon lowhead shield tophead midhead hair_color clothes_color head_dir guildID sex coords act lv)]],
 		'0079' => ['actor_display', 'a4 v14 a4 x7 C1 a3 x2 v1',    [qw(ID walk_speed param1 param2 param3 type hair_style weapon lowhead shield tophead midhead hair_color clothes_color head_dir guildID sex coords lv)]],
 		'007A' => ['changeToInGameState'],
 		'007B' => ['actor_display', 'a4 v8 x4 v6 a4 x7 C1 a5 x3 v1',     [qw(ID walk_speed param1 param2 param3 type hair_style weapon lowhead shield tophead midhead hair_color clothes_color head_dir guildID sex coords lv)]],
@@ -334,6 +334,11 @@

 		'02AD' => ['login_pin_code_request', 'v1 V', [qw(flag key)]],
 		# Packet Prefix encryption Support
 		'02AE' => ['initialize_message_id_encryption', 'V1 V1', [qw(param1 param2)]],
+		# Some new packets (cRO)
+		'02EB' => ['map_loaded', 'V a3', [qw(syncMapSync coords)]],
+		'02D0' => ['inventory_items_nonstackable'],
+		'02D4' => ['inventory_item_added', 'v1 v1 v1 C1 C1 C1 a8 v1 C1 C1 a4', [qw(index amount nameID identified broken upgrade cards type_equip type fail cards_ext)]],
+		'02E8' => ['inventory_items_stackable'],
 	};
 
 	return bless \%self, $class;
@@ -3341,6 +3345,7 @@

 	$self->decrypt(\$newmsg, substr($args->{RAW_MSG}, 4));
 	my $msg = substr($args->{RAW_MSG}, 0, 4) . $newmsg;
 	my $psize = ($args->{switch} eq '0295') ? 24 : 20;
+	my $psize = ($args->{switch} eq '02D0') ? 26 : 20;
 
 	for (my $i = 4; $i < $args->{RAW_MSG_SIZE}; $i += $psize) {
 		my $index = unpack("v1", substr($msg, $i, 2));
@@ -3388,6 +3393,7 @@

 	$self->decrypt(\$newmsg, substr($args->{RAW_MSG}, 4));
 	my $msg = substr($args->{RAW_MSG}, 0, 4).$newmsg;
 	my $psize = ($args->{switch} eq "00A3") ? 10 : 18;
+	my $psize = ($args->{switch} eq "02E8") ? 22 : 18;
 
 	for (my $i = 4; $i < $args->{RAW_MSG_SIZE}; $i += $psize) {
 		my $index = unpack("v1", substr($msg, $i, 2));
i don't know if
+ '02D4' => ['inventory_item_added', 'v1 v1 v1 C1 C1 C1 a8 v1 C1 C1 a4', [qw(index amount nameID identified broken upgrade cards type_equip type fail cards_ext)]], is correct, but at least it now adds items to inventory on pick up ^^
Bibian
Perl Monk
Perl Monk
Posts: 416
Joined: 04 Apr 2008, 03:08

Re: cRO packets changed

#2 Post by Bibian »

please make a new servertype for this (extend the current one if possible/usefull)
johnny
Noob
Noob
Posts: 9
Joined: 14 Apr 2008, 04:46

Re: cRO packets changed

#3 Post by johnny »

how to define such thing in a new servertype?

Code: Select all

'0078' => ['actor_display', 'a4 v14 a4 x7 C1 a3 x2 C1 v1', [qw(ID walk_speed param1 param2 param3 type hair_style weapon lowhead shield tophead midhead hair_color clothes_color head_dir guildID sex coords act lv)]],
if it must override the old, but i don't want to add all of them?

it's not cRO >_< found out it should be tRO/thRO or twRO. A lot of packets changed :/
every actor_display, actor_spawned got 1 Byte after the packet header...