Skip to content

Commit

Permalink
Added support for item in inventory
Browse files Browse the repository at this point in the history
1) Now in Developer Mode the following items appear in the inventory: 10x Red Potion, 10x Jellopy, +5 Novice Knife

2) Currently only items_stackable_type = 7 and items_nonstackable_type = 8 is supported.

New parameters "items_stackable_type" and "items_nonstackable_type" have been added to the servertypes.txt file.
  • Loading branch information
ya4ept committed Dec 23, 2024
1 parent 5ca4667 commit d11f96c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
40 changes: 40 additions & 0 deletions src/Poseidon/RagnarokServer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1292,9 +1292,49 @@ sub PerformMapLoadedTasks {

# Show an item on ground
SendShowItemOnGround($self, $client, $msg, $index, $itemID, 512, $posX + 1, $posY - 1);

# Show an item in inventory
if ($self->{type}->{$config{server_type}}->{items_stackable_type} eq '7') {
SendShowItemInInventory($self, $client, $msg);
}
}
}

sub SendShowItemInInventory {
my ($self, $client, $msg) = @_;

# Send item_list_start
SendData($client, pack("v2 C", 0x0B08, 5, ''));

# Send item_list_stackable
# itemInfo
my $data = pack("v", 0x0B09) .
pack("v", 73) . # len
pack("C", 0) . # type
# type7: len = 34
# a2 V C v V a16 l C
# ID nameID type amount type_equip cards expire identified
pack("a2 V C v V a16 l C", 0, 501, 0, 10, 0, '', '', 1). # 10x Red Potion
pack("a2 V C v V a16 l C", 1, 909, 3, 10, 0, '', '', 1); # 10x Jellopy
SendData($client, $data);

if ($self->{type}->{$config{server_type}}->{items_nonstackable_type} eq '8') {
# Send item_list_nonstackable
# itemInfo
$data = pack("v", 0x0B0A) .
pack("v", 72) . # len
pack("C", 0) . # type
# type8: len = 67
# a2 V C V2 C a16 l v2 C a25 C
# ID nameID type type_equip equipped upgrade cards expire bindOnEquipType sprite_id num_options options identified
pack("a2 V C V2 C a16 l v2 C a25 C", 2, 1243, 5, 2, 0, 5, '', 0, 0, 0, 0, '', 1); # +5 Novice Knife
SendData($client, $data);
}

# Send item_list_end
SendData($client, pack("v C2", 0x0B0B, 0, 0));
}

1;

# 0064 packet thanks to abt123
Expand Down
3 changes: 3 additions & 0 deletions src/Poseidon/servertypes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ item_list_start 0B08
expandedItemID 1
actor_info 0A30
actor_name 0095
send_load_confirm
items_stackable_type
items_nonstackable_type

[cRO_2021-06-25]
account_server_info 0AC9
Expand Down

0 comments on commit d11f96c

Please sign in to comment.