From 7dd80e0faf0afeffced3769b094bd1a6673b9e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Fri, 2 Jul 2010 19:15:45 +0200 Subject: [PATCH] characters: Small findings and improvements. TNL currently broken though. --- src/egs_game.erl | 1 + src/psu_characters.erl | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/egs_game.erl b/src/egs_game.erl index 084f441..f6f3517 100644 --- a/src/egs_game.erl +++ b/src/egs_game.erl @@ -1249,6 +1249,7 @@ send_0d01(User) -> 0:7744, OptionsBin/binary >>). %% @doc Send the character list for selection. +%% @todo There's a few odd values blanked, also the last known location apparently. send_0d03(Data0, Data1, Data2, Data3) -> [{status, Status0}, {char, Char0}|_] = Data0, diff --git a/src/psu_characters.erl b/src/psu_characters.erl index aa3ae25..9136b0f 100644 --- a/src/psu_characters.erl +++ b/src/psu_characters.erl @@ -44,22 +44,24 @@ character_tuple_to_binary(Tuple) -> %% @doc Convert a character tuple into a binary to be sent to clients. %% Contains everything from character_tuple_to_binary/1 along with location, stats, SE and more. -%% @todo One or the other QuestID list is the previous area IDs, not the current one. +%% @todo The second QuestID list is for the previous area, not the current one. %% @todo The second StatsBin seems unused. Not sure what it's for. %% @todo Find out what the big block of 0 is at the end. character_user_to_binary(User) -> #users{gid=CharGID, lid=CharLID, character=Character, questid=QuestID, zoneid=ZoneID, mapid=MapID, entryid=EntryID} = User, - #characters{stats=Stats, se=SE, currenthp=CurrentHP, maxhp=MaxHP} = Character, + #characters{mainlevel=Level, stats=Stats, se=SE, currenthp=CurrentHP, maxhp=MaxHP} = Character, + #level{number=LV} = Level, CharBin = psu_characters:character_tuple_to_binary(Character), StatsBin = psu_characters:stats_tuple_to_binary(Stats), SEBin = psu_characters:se_list_to_binary(SE), - TNL = 1000000, - << 16#00001200:32, CharGID:32/little-unsigned-integer, 0:64, CharLID:32/little-unsigned-integer, 0:32, QuestID:32/little-unsigned-integer, + EXPNextLevel = 100, + EXPPreviousLevel = 0, + << 16#00001200:32, CharGID:32/little-unsigned-integer, 0:64, CharLID:32/little-unsigned-integer, 16#0000ffff:32, QuestID:32/little-unsigned-integer, ZoneID:32/little-unsigned-integer, MapID:32/little-unsigned-integer, EntryID:32/little-unsigned-integer, 0:192, QuestID:32/little-unsigned-integer, ZoneID:32/little-unsigned-integer, MapID:32/little-unsigned-integer, EntryID:32/little-unsigned-integer, CharBin/binary, - TNL:32/little-unsigned-integer, 0:32, MaxHP:32/little-unsigned-integer, % not sure if this one is current or max - StatsBin/binary, 0:32, SEBin/binary, 0:64, StatsBin/binary, CurrentHP:32/little-unsigned-integer, MaxHP:32/little-unsigned-integer, 0:2304 >>. + EXPNextLevel:32/little-unsigned-integer, EXPPreviousLevel:32/little-unsigned-integer, MaxHP:32/little-unsigned-integer, % not sure if this one is current or max + StatsBin/binary, 0:32, SEBin/binary, 0:32, LV:32/little-unsigned-integer, StatsBin/binary, CurrentHP:32/little-unsigned-integer, MaxHP:32/little-unsigned-integer, 0:2304 >>. %% @doc Convert a class atom into a binary to be sent to clients.