From d443deebb13e1c029e9e96c6d3d3574ddcf0df35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 28 Sep 2010 18:02:12 +0200 Subject: [PATCH] items: Add EX traps to the default inventory. Fix Stun Trap EX description. --- include/psu/items.hrl | 1 + priv/items/0c020b00.txt | Bin 156 -> 154 bytes src/egs_char_select.erl | 3 +++ src/psu/psu_game.erl | 6 ++++++ 4 files changed, 10 insertions(+) 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 361ce491a4e9451bfa03d7ee8887937cbf1a602d..eaa0f07ffe5348a04ca65900595a84fa090a3252 100644 GIT binary patch literal 154 zcmW-a?G1o12t@C){H1VTpt8TA82?+;}1Kwv)&@R)BHWiJ^RGSV(=&BAn yLmPC|gf6EcfJfi1@RR?6Ng~WYR9qiCF&x1F literal 156 zcmW-a!41MN5CrF)DpCMS5qa>W0DcZJU;#lQCJ*YRj0iHePOID9+q?V!4n*E!re#my zZbc>@JQ-z0?`Y(qW@Zv6uBOkdyzE2W&UB`Z@ {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) ->