SHARE
TWEET

Untitled

a guest Oct 16th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Roulette System [Yommy]
  2.     parseable_packet(0x0A19,2,clif_parse_roulette_open,0); // CZ_REQ_OPEN_ROULETTE
  3.     packet(0x0A1A,23); // ZC_ACK_OPEN_ROULETTE
  4.     parseable_packet(0x0A1B,2,clif_parse_roulette_info,0); // CZ_REQ_ROULETTE_INFO
  5.     packet(0x0A1C,-1); // ZC_ACK_ROULETTE_INFO
  6.     parseable_packet(0x0A1D,2,clif_parse_roulette_close,0); // CZ_REQ_CLOSE_ROULETTE
  7.     packet(0x0A1E,3); // ZC_ACK_CLOSE_ROULETTE
  8.     parseable_packet(0x0A1F,2,clif_parse_roulette_generate,0); // CZ_REQ_GENERATE_ROULETTE
  9.     packet(0x0A20,21); // ZC_ACK_GENERATE_ROULETTE
  10.     parseable_packet(0x0A21,3,clif_parse_roulette_item,2); // CZ_RECV_ROULETTE_ITEM
  11.     packet(0x0A22,5); // ZC_RECV_ROULETTE_ITEM
  12.  
  13.  
  14.  
  15.     #RECV
  16.     /// 0A1A <result>.B <serial>.L <stage>.B <price index>.B <additional item id>.W <gold>.L <silver>.L <bronze>.L (ZC_ACK_OPEN_ROULETTE)
  17. '0A1A' => ['roulette_open_result', 'C V C2 v V3', [qw(result serial stage price_index additional_itemID gold silver bronze)]],
  18. sub roulette_open_result {
  19.     my ($self, $args) = @_;
  20.     $roulette = {};
  21.     $roulette->{price_index} = $args->{price_index};
  22.     $roulette->{additional_itemID} = $args->{additional_itemID};
  23.     $roulette->{gold} = $args->{gold};
  24.     $roulette->{silver} = $args->{silver};
  25.     $roulette->{bronze} = $args->{bronze};
  26. }
  27.  
  28. /// 0A1C <length>.W <serial>.L { { <level>.W <column>.W <item>.W <amount>.W } * MAX_ROULETTE_COLUMNS } * MAX_ROULETTE_LEVEL (ZC_ACK_ROULEITTE_INFO)
  29. /// 0A1C <length>.W <serial>.L { { <level>.W <column>.W <item>.L <amount>.L } * MAX_ROULETTE_COLUMNS } * MAX_ROULETTE_LEVEL (ZC_ACK_ROULEITTE_INFO) >= 20180516
  30.  
  31. '0A1A' => ['roulette_info', 'v V a*', [qw(len serial roulette_level_data)]],
  32. sub roulette_info {
  33.     my ($self, $args) = @_;
  34.     my $count = 0;
  35.     $roulette->{info} = {}
  36.     #todo
  37.     for (my $i = 0; $i < length($args->{roulette_level_data}); $i += 14) {
  38.         $roulette->{info}[$count]->{level} = unpack("v", substr($args->{roulette_level_data}, i+2,2));
  39.         $roulette->{info}[$count]->{column} = unpack("v", substr($args->{roulette_level_data}, i+2,4));
  40.         $roulette->{info}[$count]->{item} = unpack("v", substr($args->{roulette_level_data}, i+2,6));
  41.         $roulette->{info}[$count]->{amount} = unpack("v", substr($args->{roulette_level_data}, i+2,8));
  42.         $count++;
  43.     }
  44. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top