diff --git a/include/psu/items.hrl b/include/psu/items.hrl index acf4ed9..6987686 100644 --- a/include/psu/items.hrl +++ b/include/psu/items.hrl @@ -32,6 +32,7 @@ -record(psu_consumable_item_variables, {quantity}). -record(psu_special_item_variables, {}). -record(psu_striking_weapon_item_variables, {is_active=0, slot=0, current_pp, max_pp, element, pa=#psu_pa{type=0, level=0}}). +-record(psu_trap_item_variables, {quantity}). %% Items. diff --git a/priv/items/0c020b00.txt b/priv/items/0c020b00.txt index 361ce49..eaa0f07 100644 Binary files a/priv/items/0c020b00.txt and b/priv/items/0c020b00.txt differ diff --git a/src/egs_char_select.erl b/src/egs_char_select.erl index a3a806a..157dc9e 100644 --- a/src/egs_char_select.erl +++ b/src/egs_char_select.erl @@ -82,6 +82,9 @@ event({char_select_enter, Slot, _BackToPreviousField}, State=#state{gid=GID}) -> {16#03010000, #psu_consumable_item_variables{quantity=10}}, {16#03020000, #psu_consumable_item_variables{quantity=3}}, {16#03010900, #psu_consumable_item_variables{quantity=1}}, + {16#0c020900, #psu_trap_item_variables{quantity=10}}, + {16#0c020a00, #psu_trap_item_variables{quantity=10}}, + {16#0c020b00, #psu_trap_item_variables{quantity=10}}, {16#01010900, #psu_striking_weapon_item_variables{current_pp=99, max_pp=100, element=#psu_element{type=1, percent=50}}}, {16#01010a00, #psu_striking_weapon_item_variables{current_pp=99, max_pp=100, element=#psu_element{type=2, percent=50}}}, {16#01010b00, #psu_striking_weapon_item_variables{current_pp=99, max_pp=100, element=#psu_element{type=3, percent=50}}}]}, diff --git a/src/psu/psu_game.erl b/src/psu/psu_game.erl index 1c8d759..eddaba6 100644 --- a/src/psu/psu_game.erl +++ b/src/psu/psu_game.erl @@ -438,6 +438,12 @@ build_0a0a_item_variables([{ItemID, #psu_special_item_variables{}}|Tail], Acc) - 16#11020200 -> << 0:32 >> end, Bin = << 0:32, ItemIndex:32/little, ItemID:32, 0:24, 16#80:8, 0:56, 16#80:8, 0:32, Action/binary, 0:32 >>, + build_0a0a_item_variables(Tail, [Bin|Acc]); +build_0a0a_item_variables([{ItemID, #psu_trap_item_variables{quantity=Quantity}}|Tail], Acc) -> + #psu_item{rarity=Rarity, data=#psu_trap_item{max_quantity=MaxQuantity}} = proplists:get_value(ItemID, ?ITEMS), + ItemIndex = 0, + RarityInt = Rarity - 1, + Bin = << 0:32, ItemIndex:32/little, ItemID:32, Quantity:32/little, MaxQuantity:32/little, 0:24, RarityInt:8, 0:96 >>, build_0a0a_item_variables(Tail, [Bin|Acc]). build_0a0a_item_constants([], Acc) ->