Код: Выделить всё
sub sendDrop {
my ($self, $index, $amount) = @_;
my $msg;
$msg = pack("C*", 0x7E, 0x00) . pack("v1", $amount). pack("v1", $index) ;
###7E 00 01 00 02 00
$self->sendToServer($msg);
debug "Sent drop: $index x $amount\n", "sendPacket", 2;
}
sub sendGetPlayerInfo {
my ($self, $ID) = @_;
my $msg;
$msg = pack("C*", 0x93, 0x01) . pack("x3"). $ID ;
$self->sendToServer($msg);
debug "Sent get player info: ID - ".getHex($ID)."\n", "sendPacket", 2;
###0> 93 01/31 39 00/6E 70 63 31 ..19.npc1
}
sub sendMapLogin {
my $self = shift;
my $accountID = shift;
my $charID = shift;
my $sessionID = shift;
my $sex = shift;
my $msg;
$sex = 0 if ($sex > 1 || $sex < 0); # Sex can only be 0 (female) or 1 (male)
$msg = pack("C*", 0xF3, 0) . pack("x3") . $charID . $accountID . pack("x1") . $sessionID . pack("x9") . pack("V", getTickCount()) . pack("C*", $sex) . pack("x5");
$self->sendToServer($msg);
###3 193.0.3.121:1576 81.177.13.23:5000 37 Send
#0000 F3 00/jj jj jj/ch ch ch ch/ac ac ac ac/jj/ss ss ..67......g....6
#0010 ss ss/jj jj jj jj jj jj jj jj jj/tt tt tt tt/ee/ ..17cc7411...G..
#0020 /jj jj jj jj jj af0d.
}
sub sendMove {
my $self = shift;
my $x = int scalar shift;
my $y = int scalar shift;
my $msg;
$msg = pack("C*", 0x85, 0) . pack("x4") . getCoordString($x, $y, 1) . pack("x3") ;
$self->sendToServer($msg);
debug "Sent move to: $x, $y\n", "sendPacket", 2;
###0> 85 00/34 30 63 00/0C 06 F0/31 35 00
}
sub sendSync {
my ($self, $initialSync) = @_;
my $msg;
# XKore mode 1 lets the client take care of syncing.
return if ($self->{net}->version == 1);
$syncSync = pack("V", getTickCount());
$msg = pack("C*", 0xA7, 0) . pack("x2") . pack("x4") .$syncSync;
$self->sendToServer($msg);
debug "Sent Sync\n", "sendPacket", 2;
###A7 00/30 00/34 65 38 00/BF D5 6C 00
}
sub sendTake {
my $self = shift;
my $itemID = shift; # $itemID = long
my $msg;
$msg = pack("C*", 0x16, 0x01) . $itemID;
$self->sendToServer($msg);
debug "Sent take\n", "sendPacket", 2;
### 16 01/69 74 6D 31
}