diff --git a/include/maps.hrl b/include/maps.hrl index cbb1e04..f1b936d 100644 --- a/include/maps.hrl +++ b/include/maps.hrl @@ -182,6 +182,13 @@ %% Various appearance configuration counters don't have any quest-related data. They use the CounterID 65535. -define(COUNTERS, [ - {0, [{quests, "data/missions/colony.counter.ll.pack"}, {options, << 16#01a92800:32, 3, 3, 0, 3, 3, 3, 3, 0:48, 3, 3, 3, 3, 3, 0:176 >>}]}, - {1, [{quests, "data/missions/colony.counter.docks.pack"}, {options, << 16#01805400:32, 3, 3, 0, 0, 0, 0, 3, 3, 3, 3, 0:40, 3, 3, 3, 3, 0:40, 3, 0, 3, 0, 0:448 >>}]} + % Phantom Ruins, Unsafe Passage + { 0, [{quests, "data/missions/colony.counter.ll.pack"}, {bg, 16#ffbda10b}, {options, << 16#01a92800:32, 3, 3, 0, 3, 3, 3, 3, 0:48, 3, 3, 3, 3, 3, 0:176 >>}]}, + % Phantom Ruins, Dark Satellite C-S, S2, S3, Familiar Trees (crash), Boss quest category (crash), Unit category (crash), Enemy category (crash) + { 1, [{quests, "data/missions/colony.counter.docks.pack"}, {bg, 16#ff4f140b}, {options, << 16#01805400:32, 3, 3, 0, 0, 0, 0, 3, 3, 3, 3, 0:40, 3, 3, 3, 3, 0:40, 3, 0, 3, 0, 0:448 >>}]}, + % Episode 2 C rank, B rank, A rank, Episode 3 C rank, B rank, A rank, Winter event 1, Winter event 2, MAG event, Side story C rank, Side story B rank, Side story A rank, Old event missions + {115, [{quests, "data/missions/colony.counter.guardians.pack"}, {bg, 16#0418f40b}, {options, << 16#01807800:32, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, % EP2 + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, % EP3 + 0:248, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0:48, 3, 3, 3, 0:32 >>}]} % Side story, MAG' and stuff ]). diff --git a/src/egs_game.erl b/src/egs_game.erl index 4acca91..583916b 100644 --- a/src/egs_game.erl +++ b/src/egs_game.erl @@ -651,7 +651,7 @@ handle(16#0c01, CSocket, GID, _, Orig) -> handle(16#0c05, CSocket, GID, _, _) -> User = egs_db:users_select(GID), - [{quests, Filename}, {options, _}] = proplists:get_value(User#users.entryid, ?COUNTERS), + [{quests, Filename}, {bg, _}, {options, _}] = proplists:get_value(User#users.entryid, ?COUNTERS), {ok, << File/bits >>} = file:read_file(Filename), Packet = << 16#0c060300:32, 0:288, 1:32/little-unsigned-integer, File/binary >>, egs_proto:packet_send(CSocket, Packet); @@ -675,7 +675,7 @@ handle(16#0c0e, CSocket, GID, _, _) -> handle(16#0c0f, CSocket, GID, _, _) -> User = egs_db:users_select(GID), - [{quests, _}, {options, Options}] = proplists:get_value(User#users.entryid, ?COUNTERS), + [{quests, _}, {bg, _}, {options, Options}] = proplists:get_value(User#users.entryid, ?COUNTERS), Packet = << 16#0c100300:32, 0:32, 16#00011300:32, GID:32/little-unsigned-integer, 0:64, 16#00011300:32, GID:32/little-unsigned-integer, 0:64, Options/binary >>, egs_proto:packet_send(CSocket, Packet); @@ -746,11 +746,13 @@ handle(16#1709, CSocket, GID, _, _) -> handle(16#170b, CSocket, GID, _, _) -> send_packet_170c(CSocket, GID); -%% @doc Counter initialization handler? +%% @doc Counter initialization handler? Send the code for the background image to use. %% @todo Handle correctly. handle(16#1710, CSocket, GID, _, _) -> - Packet = << 16#17110300:32, 0:160, 16#00011300:32, GID:32/little-unsigned-integer, 0:96 >>, + User = egs_db:users_select(GID), + [{quests, _}, {bg, Background}, {options, _}] = proplists:get_value(User#users.entryid, ?COUNTERS), + Packet = << 16#17110300:32, 0:160, 16#00011300:32, GID:32/little-unsigned-integer, 0:64, Background:32 >>, egs_proto:packet_send(CSocket, Packet); %% @doc Dialog request handler. Do what we can.