diff --git a/p/lumilass-flesh-female.bin b/p/lumilass-flesh-female.bin deleted file mode 100755 index 84763c7..0000000 Binary files a/p/lumilass-flesh-female.bin and /dev/null differ diff --git a/p/lumilass-flesh-male.bin b/p/lumilass-flesh-male.bin deleted file mode 100755 index 13ef631..0000000 Binary files a/p/lumilass-flesh-male.bin and /dev/null differ diff --git a/p/lumilass-metal-female.bin b/p/lumilass-metal-female.bin deleted file mode 100755 index d65387f..0000000 Binary files a/p/lumilass-metal-female.bin and /dev/null differ diff --git a/p/lumilass-metal-male.bin b/p/lumilass-metal-male.bin deleted file mode 100755 index fbba179..0000000 Binary files a/p/lumilass-metal-male.bin and /dev/null differ diff --git a/priv/lumilass.conf b/priv/lumilass.conf new file mode 100644 index 0000000..40cbc1c --- /dev/null +++ b/priv/lumilass.conf @@ -0,0 +1,117 @@ +%% This file is part of EGS. +%% +%% EGS is free software: you can redistribute it and/or modify +%% it under the terms of the GNU Affero General Public License as +%% published by the Free Software Foundation, 16#either version 3 of the +%% License, 16#or (at your option) any later version. +%% +%% EGS is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +%% GNU Affero General Public License for more details. +%% +%% You should have received a copy of the GNU Affero General Public License +%% along with EGS. If not, 16#see . + +%% @doc Male hairstyles. Common to fleshies and metal characters. +{{hairstyles, male}, [ + 16#00000005, 16#00010005, 16#00020005, 16#00030005, 16#00040005, 16#00050005, + 16#000a0005, 16#000b0005, 16#000c0005, 16#000d0005, 16#000e0005, 16#000f0005, + 16#00140005, 16#00150005, 16#00160005, 16#00170005, 16#00180005, 16#00190005, + 16#001e0005, 16#001f0005, 16#00200005, 16#00210005, 16#00220005, 16#00230005, + 16#00280005, 16#00290005, 16#002a0005, 16#002b0005, 16#002c0005, 16#002d0005, + 16#00320005, 16#00330005, 16#00340005, 16#00350005, 16#00360005, 16#00370005, + 16#003c0005, 16#003d0005, 16#003e0005, 16#003f0005, 16#00400005, 16#00410005, + 16#00460005, 16#00470005, 16#00480005, 16#00490005, 16#004a0005, 16#004b0005, + 16#00500005, 16#00510005, 16#00520005, 16#00530005, 16#00540005, 16#00550005, + 16#005a0005, 16#005b0005, 16#005c0005, 16#005d0005, 16#005e0005, 16#005f0005, + 16#00640005, 16#00650005, 16#00660005, 16#00670005, 16#00680005, 16#00690005, + 16#006e0005, 16#006f0005, 16#00700005, 16#00710005, 16#00720005, 16#00730005, + 16#00780005, 16#00790005, 16#007a0005, 16#007b0005, 16#007c0005, 16#007d0005, + 16#00820005, 16#00830005, 16#00840005, 16#00850005, 16#00860005, 16#00870005, + 16#008c0005, 16#008d0005, 16#008e0005, 16#008f0005, 16#00900005, 16#00910005, + 16#00960005, 16#00970005, 16#00980005, 16#00990005, 16#009a0005, 16#009b0005, + 16#00a00005, 16#00a10005, 16#00a20005, 16#00a30005, + 16#00aa0005, 16#00ab0005, 16#00ac0005, 16#00ad0005, + 16#00c80005, 16#00c90005, 16#00ca0005, 16#00cb0005, 16#00cc0005, 16#00cd0005, 16#00ce0005, 16#00cf0005, + 16#00d20005, 16#00d30005, 16#00d40005, 16#00d50005, 16#00d60005, 16#00d70005, 16#00d80005, 16#00d90005, + 16#00dc0005, 16#00dd0005, 16#00de0005, 16#00df0005, 16#00e00005, 16#00e10005, 16#00e20005, 16#00e30005, + 16#00e60005, 16#00e70005, 16#00e80005, 16#00e90005, 16#00ea0005, 16#00eb0005, 16#00ec0005, 16#00ed0005, + 16#00f00005, 16#00f10005, 16#00f20005, 16#00f30005, 16#00f40005, 16#00f50005, 16#00f60005, 16#00f70005, + 16#002c0105, 16#002d0105, 16#002e0105, 16#002f0105, 16#00300105, 16#00310105, 16#00320105, 16#00330105, + 16#00360105, 16#00370105, 16#00380105, 16#00390105, 16#003a0105, 16#003b0105, 16#003c0105, 16#003d0105, + 16#00400105, 16#00410105, 16#00420105, 16#00430105, 16#00440105, 16#00450105, 16#00460105, 16#00470105, + 16#004a0105, 16#004b0105, 16#004c0105, 16#004d0105, 16#004e0105, 16#004f0105, 16#00500105, 16#00510105, + 16#00540105, 16#00550105, 16#00560105, 16#00570105, 16#00580105, 16#00590105, 16#005a0105, 16#005b0105, + 16#00900105, 16#00910105, 16#00920105, 16#00930105, 16#00940105, 16#00950105, 16#00960105, 16#00970105, + 16#009a0105, 16#009b0105, 16#009c0105, 16#009d0105, 16#009e0105, 16#009f0105, 16#00a00105, 16#00a10105, + 16#00a40105, 16#00a50105, 16#00a60105, 16#00a70105, 16#00a80105, 16#00a90105, 16#00aa0105, 16#00ab0105, + 16#00ae0105, 16#00af0105, 16#00b00105, 16#00b10105, 16#00b20105, 16#00b30105, 16#00b40105, 16#00b50105, + 16#00b80105, 16#00b90105, 16#00ba0105, 16#00bb0105, 16#00bc0105, 16#00bd0105, 16#00be0105, 16#00bf0105, + 16#00580205, 16#00590205, 16#005a0205, 16#005b0205, 16#005c0205, 16#005d0205, 16#005e0205, 16#005f0205, + 16#00620205, 16#00630205, 16#00640205, 16#00650205, 16#00660205, 16#00670205, 16#00680205, 16#00690205, + 16#006c0205, 16#006d0205, 16#006e0205, 16#006f0205, 16#00700205, 16#00710205, 16#00720205, 16#00730205, + 16#00760205, 16#00770205, 16#00780205, 16#00790205, 16#007a0205, 16#007b0205, 16#007c0205, 16#007d0205, + 16#00800205, 16#00810205, 16#00820205, 16#00830205, 16#00840205, 16#00850205, 16#00860205, 16#00870205, + 16#00bc0205, 16#00bd0205, 16#00be0205, 16#00bf0205, 16#00c00205, 16#00c10205, 16#00c20205, 16#00c30205, + 16#00c60205, 16#00c70205, 16#00c80205, 16#00c90205, 16#00ca0205, 16#00cb0205, 16#00cc0205, 16#00cd0205, + 16#00d00205, 16#00d10205, 16#00d20205, 16#00d30205, 16#00d40205, 16#00d50205, 16#00d60205, 16#00d70205, + 16#00da0205, 16#00db0205, 16#00dc0205, 16#00dd0205, 16#00de0205, 16#00df0205, 16#00e00205, 16#00e10205, + 16#00e40205, 16#00e50205, 16#00e60205, 16#00e70205, 16#00e80205, 16#00e90205, 16#00ea0205, 16#00eb0205, + 16#00ee0205, 16#00ef0205, 16#00f00205, 16#00f10205, 16#00f20205, 16#00f30205, 16#00f40205, 16#00f50205, 16#00f60205, 16#00f70205, + 16#00f80205, 16#00f90205, 16#00fa0205, 16#00fb0205, 16#00fc0205, 16#00fd0205, 16#00fe0205, 16#00ff0205, 16#00000305, 16#00010305, + 16#00020305, 16#00030305, 16#00040305, 16#00050305, 16#00060305, 16#00070305, 16#00080305, 16#00090305, 16#000a0305, 16#000b0305 +]}. + +%% @doc Female hairstyles. Common to fleshies and metal characters. +{{hairstyles, female}, [ + 16#00001005, 16#00011005, 16#00021005, 16#00031005, 16#00041005, 16#00051005, + 16#000a1005, 16#000b1005, 16#000c1005, 16#000d1005, 16#000e1005, 16#000f1005, + 16#00141005, 16#00151005, 16#00161005, 16#00171005, 16#00181005, 16#00191005, + 16#001e1005, 16#001f1005, 16#00201005, 16#00211005, 16#00221005, 16#00231005, + 16#00281005, 16#00291005, 16#002a1005, 16#002b1005, 16#002c1005, 16#002d1005, + 16#00321005, 16#00331005, 16#00341005, 16#00351005, 16#00361005, 16#00371005, + 16#003c1005, 16#003d1005, 16#003e1005, 16#003f1005, 16#00401005, 16#00411005, + 16#00461005, 16#00471005, 16#00481005, 16#00491005, 16#004a1005, 16#004b1005, + 16#00501005, 16#00511005, 16#00521005, 16#00531005, 16#00541005, 16#00551005, + 16#005a1005, 16#005b1005, 16#005c1005, 16#005d1005, 16#005e1005, 16#005f1005, + 16#00641005, 16#00651005, 16#00661005, 16#00671005, 16#00681005, 16#00691005, + 16#006e1005, 16#006f1005, 16#00701005, 16#00711005, 16#00721005, 16#00731005, + 16#00781005, 16#00791005, 16#007a1005, 16#007b1005, 16#007c1005, 16#007d1005, + 16#00821005, 16#00831005, 16#00841005, 16#00851005, 16#00861005, 16#00871005, + 16#008c1005, 16#008d1005, 16#008e1005, 16#008f1005, 16#00901005, 16#00911005, + 16#00961005, 16#00971005, 16#00981005, 16#00991005, + 16#00a01005, 16#00a11005, 16#00a21005, 16#00a31005, + 16#00c81005, 16#00c91005, 16#00ca1005, 16#00cb1005, 16#00cc1005, 16#00cd1005, 16#00ce1005, 16#00cf1005, + 16#00d21005, 16#00d31005, 16#00d41005, 16#00d51005, 16#00d61005, 16#00d71005, 16#00d81005, 16#00d91005, + 16#00dc1005, 16#00dd1005, 16#00de1005, 16#00df1005, 16#00e01005, 16#00e11005, 16#00e21005, 16#00e31005, + 16#00e61005, 16#00e71005, 16#00e81005, 16#00e91005, 16#00ea1005, 16#00eb1005, 16#00ec1005, 16#00ed1005, + 16#00f01005, 16#00f11005, 16#00f21005, 16#00f31005, 16#00f41005, 16#00f51005, 16#00f61005, 16#00f71005, + 16#002c1105, 16#002d1105, 16#002e1105, 16#002f1105, 16#00301105, 16#00311105, 16#00321105, 16#00331105, + 16#00361105, 16#00371105, 16#00381105, 16#00391105, 16#003a1105, 16#003b1105, 16#003c1105, 16#003d1105, + 16#00401105, 16#00411105, 16#00421105, 16#00431105, 16#00441105, 16#00451105, 16#00461105, 16#00471105, + 16#004a1105, 16#004b1105, 16#004c1105, 16#004d1105, 16#004e1105, 16#004f1105, 16#00501105, 16#00511105, + 16#00541105, 16#00551105, 16#00561105, 16#00571105, 16#00581105, 16#00591105, 16#005a1105, 16#005b1105, + 16#00901105, 16#00911105, 16#00921105, 16#00931105, 16#00941105, 16#00951105, 16#00961105, 16#00971105, + 16#009a1105, 16#009b1105, 16#009c1105, 16#009d1105, 16#009e1105, 16#009f1105, 16#00a01105, 16#00a11105, + 16#00a41105, 16#00a51105, 16#00a61105, 16#00a71105, 16#00a81105, 16#00a91105, 16#00aa1105, 16#00ab1105, + 16#00ae1105, 16#00af1105, 16#00b01105, 16#00b11105, 16#00b21105, 16#00b31105, 16#00b41105, 16#00b51105, + 16#00b81105, 16#00b91105, 16#00ba1105, 16#00bb1105, 16#00bc1105, 16#00bd1105, 16#00be1105, 16#00bf1105, + 16#00581205, 16#00591205, 16#005a1205, 16#005b1205, 16#005c1205, 16#005d1205, 16#005e1205, 16#005f1205, + 16#00621205, 16#00631205, 16#00641205, 16#00651205, 16#00661205, 16#00671205, 16#00681205, 16#00691205, + 16#006c1205, 16#006d1205, 16#006e1205, 16#006f1205, 16#00701205, 16#00711205, 16#00721205, 16#00731205, + 16#00761205, 16#00771205, 16#00781205, 16#00791205, 16#007a1205, 16#007b1205, 16#007c1205, 16#007d1205, + 16#00801205, 16#00811205, 16#00821205, 16#00831205, 16#00841205, 16#00851205, 16#00861205, 16#00871205, + 16#00bc1205, 16#00bd1205, 16#00be1205, 16#00bf1205, 16#00c01205, 16#00c11205, 16#00c21205, 16#00c31205, + 16#00c61205, 16#00c71205, 16#00c81205, 16#00c91205, 16#00ca1205, 16#00cb1205, 16#00cc1205, 16#00cd1205, + 16#00d01205, 16#00d11205, 16#00d21205, 16#00d31205, 16#00d41205, 16#00d51205, 16#00d61205, 16#00d71205, + 16#00da1205, 16#00db1205, 16#00dc1205, 16#00dd1205, 16#00de1205, 16#00df1205, 16#00e01205, 16#00e11205, + 16#00e41205, 16#00e51205, 16#00e61205, 16#00e71205, 16#00e81205, 16#00e91205, 16#00ea1205, 16#00eb1205, + 16#00ee1205, 16#00ef1205, 16#00f01205, 16#00f11205, 16#00f21205, 16#00f31205, 16#00f41205, 16#00f51205, 16#00f61205, 16#00f71205, + 16#00f81205, 16#00f91205, 16#00fa1205, 16#00fb1205, 16#00fc1205, 16#00fd1205, 16#00fe1205, 16#00ff1205, 16#00001305, 16#00011305, + 16#00021305, 16#00031305, 16#00041305, 16#00051305, 16#00061305, 16#00071305, 16#00081305, 16#00091305, 16#000a1305, 16#000b1305 +]}. + +%% @doc Number of headtypes for CASTs characters. +{{headtypes, male, cast}, 14}. +{{headtypes, female, cast}, 14}. diff --git a/src/egs_game.erl b/src/egs_game.erl index 4595933..8de342f 100644 --- a/src/egs_game.erl +++ b/src/egs_game.erl @@ -435,8 +435,9 @@ event({item_unequip, ItemIndex, TargetGID, TargetLID, A, B}, #state{gid=GID}) -> event(lobby_transport_request, _State) -> psu_game:send_0c08(true); -event(lumilass_options_request, _State) -> - psu_game:send_1a03(); +event(lumilass_options_request, State=#state{gid=GID}) -> + {ok, User} = egs_user_model:read(GID), + psu_proto:send_1a03(User, State); %% @todo Probably replenish the player HP when entering a non-mission area rather than when aborting the mission? event(mission_abort, State=#state{gid=GID}) -> diff --git a/src/psu/psu_game.erl b/src/psu/psu_game.erl index 8e37ff1..04dd2f9 100644 --- a/src/psu/psu_game.erl +++ b/src/psu/psu_game.erl @@ -677,20 +677,6 @@ send_170c() -> send_1711(Background) -> send(<< (header(16#1711))/binary, Background:32/little-unsigned-integer >>). -%% @doc Lumilass handler. Possibly more. -%% @todo Figure out how Lumilass work exactly. The 4 bytes before the file may vary. -send_1a03() -> - {ok, User} = egs_user_model:read(get(gid)), - Character = User#egs_user_model.character, - Filename = case {Character#characters.race, Character#characters.gender} of - {cast, male} -> "p/lumilass-metal-male.bin"; - {cast, female} -> "p/lumilass-metal-female.bin"; - {_, male} -> "p/lumilass-flesh-male.bin"; - {_, female} -> "p/lumilass-flesh-female.bin" - end, - {ok, File} = file:read_file(Filename), - send(<< (header(16#1a03))/binary, 0:32, File/binary >>). - %% @doc PP cube handler. %% @todo The 4 bytes before the file may vary. Everything past that is the same. Figure things out. send_1a04() -> diff --git a/src/psu/psu_proto.erl b/src/psu/psu_proto.erl index a00d226..9d33de5 100644 --- a/src/psu/psu_proto.erl +++ b/src/psu/psu_proto.erl @@ -1414,6 +1414,18 @@ send_1a02(A, B, C, D, #state{socket=Socket, gid=DestGID}) -> packet_send(Socket, << 16#1a020300:32, 0:160, 16#00011300:32, DestGID:32/little, 0:96, A:16/little, B:16/little, C:16/little, D:16/little >>). +%% @doc Lumilass available hairstyles/headtypes handler. +%% @todo Handle the LID properly. +send_1a03(CharUser, #state{socket=Socket, gid=DestGID}) -> + {ok, Conf} = file:consult("priv/lumilass.conf"), + Character = CharUser#egs_user_model.character, + NbHeadtypes = proplists:get_value({headtypes, Character#characters.gender, Character#characters.race}, Conf, 0), + HairstylesList = proplists:get_value({hairstyles, Character#characters.gender}, Conf), + NbHairstyles = length(HairstylesList), + HairstylesBin = iolist_to_binary([ << N:32 >> || N <- HairstylesList]), + packet_send(Socket, << 16#1a030300:32, 0:160, 16#00011300:32, DestGID:32/little, 0:96, + NbHairstyles:32/little, NbHeadtypes:32/little, 0:416, HairstylesBin/binary, 0:32 >>). + %% @doc Available types handler. Enable all 16 types. send_1a07(#state{socket=Socket, gid=DestGID, lid=DestLID}) -> packet_send(Socket, << 16#1a070300:32, DestLID:16/little, 0:144, 16#00011300:32, DestGID:32/little, 0:160,