diff --git a/include/maps.hrl b/include/maps.hrl index e44670d..6539730 100644 --- a/include/maps.hrl +++ b/include/maps.hrl @@ -108,9 +108,13 @@ { [1104000,0,900], [{type, spaceport}, {name, "Spaceport"}, {quest, "data/lobby/spaceport.quest.nbl"}, {zone, "data/lobby/spaceport.zone.nbl"}, {entries, [0]}] } ]). -%% EGS counters settings. Associate counter QuestID with the QuestID and ZoneID of the lobby containing the counter. +%% EGS counters settings. -define(COUNTERS, [ - { 10497, [1100000, 0] }, % Colony 4th Floor - { 731394, [1100000,11] } % Colony 3rd, Lumilass + % Colony mission counters + { 10497, [{lobby, [1100000, 0]}, {data, [ + {0, "data/missions/colony.counter.ll.pack"} + ]}] }, + % Lumilass + { 731394, [{lobby, [1100000,11]}, {data, none}] } ]). diff --git a/src/egs_game.erl b/src/egs_game.erl index d4f8b1a..05fd989 100644 --- a/src/egs_game.erl +++ b/src/egs_game.erl @@ -627,7 +627,7 @@ handle(16#0811, CSocket, GID, _, Orig) -> handle(16#0812, CSocket, GID, _, _) -> User = egs_db:users_select(GID), - [QuestID, ZoneID] = proplists:get_value(User#users.quest, ?COUNTERS, [1100000, 0]), + [{lobby, [QuestID, ZoneID]}, {data, _}] = proplists:get_value(User#users.quest, ?COUNTERS, [1100000, 0]), lobby_load(CSocket, GID, QuestID, ZoneID, User#users.maptype, User#users.mapnumber); %% @doc Start mission handler. @@ -646,8 +646,11 @@ handle(16#0c01, CSocket, GID, _, Orig) -> %% @doc Counter quests files request handler? Send huge number of quest files. %% @todo Handle correctly. -handle(16#0c05, CSocket, _, _, _) -> - {ok, << File/bits >>} = file:read_file("data/missions/colony.counter.ll.pack"), +handle(16#0c05, CSocket, GID, _, _) -> + User = egs_db:users_select(GID), + [{lobby, _}, {data, Data}] = proplists:get_value(User#users.quest, ?COUNTERS), + Filename = proplists:get_value(User#users.mapentry, Data), + {ok, << File/bits >>} = file:read_file(Filename), Packet = << 16#0c060300:32, 0:288, 1:32/little-unsigned-integer, File/binary, 0:32 >>, egs_proto:packet_send(CSocket, Packet);