psu_proto: Review and move send_0117 to psu_proto.
This commit is contained in:
parent
f0a88e1b19
commit
c029f98deb
@ -656,12 +656,16 @@ event({player_options_change, Options}, #state{gid=GID}) ->
|
||||
file:write_file(io_lib:format("save/~s/~b-character.options", [User#egs_user_model.folder, (User#egs_user_model.character)#characters.slot]), Options);
|
||||
|
||||
%% @todo If the player has a scape, use it! Otherwise red screen.
|
||||
%% @todo Right now we force revive and don't update the player's HP.
|
||||
event(player_death, _State) ->
|
||||
%% @todo Right now we force revive with a dummy HP value.
|
||||
event(player_death, State=#state{gid=GID}) ->
|
||||
% @todo send_0115(get(gid), 16#ffffffff, LV=1, EXP=idk, Money=1000), % apparently sent everytime you die...
|
||||
%% use scape:
|
||||
NewHP = 10,
|
||||
psu_game:send_0117(NewHP),
|
||||
{ok, User} = egs_user_model:read(GID),
|
||||
Char = User#egs_user_model.character,
|
||||
User2 = User#egs_user_model{character=Char#characters{currenthp=NewHP}},
|
||||
egs_user_model:write(User2),
|
||||
psu_proto:send_0117(User2#egs_user_model{lid=0}, State),
|
||||
psu_game:send_1022(NewHP);
|
||||
%% red screen with return to lobby choice:
|
||||
%~ psu_game:send_0111(3, 1);
|
||||
|
@ -289,13 +289,6 @@ send_0113() ->
|
||||
GID = get(gid),
|
||||
send(<< 16#01130300:32, 0:64, GID:32/little-unsigned-integer, 0:64, 16#00011300:32, GID:32/little-unsigned-integer, 0:64, GID:32/little-unsigned-integer, File/binary >>).
|
||||
|
||||
%% @doc Revive player?
|
||||
%% @todo Figure out more of it.
|
||||
send_0117(HP) ->
|
||||
GID = get(gid),
|
||||
send(<< 16#01170300:32, 0:64, GID:32/little-unsigned-integer, 0:64, 16#00011300:32, GID:32/little-unsigned-integer, 0:64,
|
||||
GID:32/little-unsigned-integer, 0:96, HP:32/little-unsigned-integer, 0:32 >>).
|
||||
|
||||
%% @doc Send the zone initialization notification.
|
||||
send_0200(ZoneType) ->
|
||||
case ZoneType of
|
||||
|
@ -1198,6 +1198,13 @@ build_char_level(#characters{type=Type, mainlevel=#level{number=Level, exp=EXP},
|
||||
end,
|
||||
<< Level:32/little, BlastBar:16/little, Luck:8, 0:40, EXP:32/little, 0:32, Money:32/little, PlayTime:32/little, ClassesBin/binary >>.
|
||||
|
||||
%% @doc Revive player with optional SEs.
|
||||
%% @todo SEs.
|
||||
send_0117(#egs_user_model{id=CharGID, lid=CharLID, character=#characters{currenthp=HP}}, #state{socket=Socket, gid=DestGID, lid=DestLID}) ->
|
||||
SE = << 0:64 >>,
|
||||
packet_send(Socket, << 16#01170300:32, DestLID:16/little, 0:48, CharGID:32/little, 0:64, 16#00011300:32, DestGID:32/little, 0:64,
|
||||
CharGID:32/little, CharLID:32/little, SE/binary, HP:32/little, 0:32 >>).
|
||||
|
||||
%% @doc Send character location, appearance and other information.
|
||||
send_0201(CharUser, #state{socket=Socket, gid=DestGID}) ->
|
||||
[CharTypeID, GameVersion] = case (CharUser#egs_user_model.character)#characters.type of
|
||||
|
Loading…
Reference in New Issue
Block a user