quests: Convert the zones to a proplist of proplists rather than a list of proplists.

This commit is contained in:
Loïc Hoguin 2010-11-17 02:19:10 +01:00
parent 7fadf362b3
commit 9efb734c63
8 changed files with 47 additions and 50 deletions

View File

@ -29,7 +29,7 @@
%% @todo Default enemy_level to 1 if unspecified (lobbies). %% @todo Default enemy_level to 1 if unspecified (lobbies).
{zones, [ {zones, [
[{zoneid, 0}, {areaid, 0}, {enemy_level, 1}, {sets, []}, {maps, []}] {0, [{areaid, 0}, {enemy_level, 1}, {sets, []}, {maps, []}]}
]}. ]}.
{temp_flags, []}. {temp_flags, []}.

View File

@ -27,15 +27,15 @@
%% @todo Default enemy_level to 1 if unspecified (lobbies). %% @todo Default enemy_level to 1 if unspecified (lobbies).
%% @todo Default sets to [100] if unspecified (lobbies). %% @todo Default sets to [100] if unspecified (lobbies).
{zones, [ {zones, [
[{zoneid, 0}, {areaid, 2}, {enemy_level, 1}, {sets, [100]}, {maps, [1, 2, 3, 4]}], { 0, [{areaid, 2}, {enemy_level, 1}, {sets, [100]}, {maps, [1, 2, 3, 4]}]},
[{zoneid, 1}, {areaid, 2}, {enemy_level, 1}, {sets, [100]}, {maps, [9001]}], { 1, [{areaid, 2}, {enemy_level, 1}, {sets, [100]}, {maps, [9001]}]},
[{zoneid, 2}, {areaid, 2}, {enemy_level, 1}, {sets, [100]}, {maps, [9000]}], { 2, [{areaid, 2}, {enemy_level, 1}, {sets, [100]}, {maps, [9000]}]},
[{zoneid, 3}, {areaid, 2}, {enemy_level, 1}, {sets, [100]}, {maps, [9102]}], { 3, [{areaid, 2}, {enemy_level, 1}, {sets, [100]}, {maps, [9102]}]},
[{zoneid, 4}, {areaid, 2}, {enemy_level, 1}, {sets, [100]}, {maps, [9010]}], { 4, [{areaid, 2}, {enemy_level, 1}, {sets, [100]}, {maps, [9010]}]},
[{zoneid, 7}, {areaid, 2}, {enemy_level, 1}, {sets, [100]}, {maps, [9200, 9202]}], { 7, [{areaid, 2}, {enemy_level, 1}, {sets, [100]}, {maps, [9200, 9202]}]},
[{zoneid, 11}, {areaid, 2}, {enemy_level, 1}, {sets, [100]}, {maps, [5, 100, 101, 102, 103, 110]}], {11, [{areaid, 2}, {enemy_level, 1}, {sets, [100]}, {maps, [5, 100, 101, 102, 103, 110]}]},
[{zoneid, 12}, {areaid, 2}, {enemy_level, 1}, {sets, [100]}, {maps, [100, 101, 102]}], {12, [{areaid, 2}, {enemy_level, 1}, {sets, [100]}, {maps, [100, 101, 102]}]},
[{zoneid, 13}, {areaid, 2}, {enemy_level, 1}, {sets, [100]}, {maps, [100, 101, 102]}] {13, [{areaid, 2}, {enemy_level, 1}, {sets, [100]}, {maps, [100, 101, 102]}]}
]}. ]}.
{temp_flags, []}. {temp_flags, []}.

View File

@ -28,16 +28,16 @@
%% @todo Default sets to [100] if unspecified (lobbies). %% @todo Default sets to [100] if unspecified (lobbies).
{zones, [ {zones, [
[{zoneid, 0}, {areaid, 3}, {enemy_level, 1}, {sets, [100]}, {maps, [1, 2, 3]}], { 0, [{areaid, 3}, {enemy_level, 1}, {sets, [100]}, {maps, [1, 2, 3]}]},
[{zoneid, 1}, {areaid, 3}, {enemy_level, 1}, {sets, [100]}, {maps, [9000]}], { 1, [{areaid, 3}, {enemy_level, 1}, {sets, [100]}, {maps, [9000]}]},
[{zoneid, 2}, {areaid, 3}, {enemy_level, 1}, {sets, [100]}, {maps, [9010]}], { 2, [{areaid, 3}, {enemy_level, 1}, {sets, [100]}, {maps, [9010]}]},
[{zoneid, 3}, {areaid, 3}, {enemy_level, 1}, {sets, [100]}, {maps, [9101]}], { 3, [{areaid, 3}, {enemy_level, 1}, {sets, [100]}, {maps, [9101]}]},
[{zoneid, 4}, {areaid, 3}, {enemy_level, 1}, {sets, [100]}, {maps, [9100]}], { 4, [{areaid, 3}, {enemy_level, 1}, {sets, [100]}, {maps, [9100]}]},
[{zoneid, 5}, {areaid, 3}, {enemy_level, 1}, {sets, [100]}, {maps, [9030]}], { 5, [{areaid, 3}, {enemy_level, 1}, {sets, [100]}, {maps, [9030]}]},
[{zoneid, 7}, {areaid, 3}, {enemy_level, 1}, {sets, [100]}, {maps, [9200, 9201, 9203, 9209]}], { 7, [{areaid, 3}, {enemy_level, 1}, {sets, [100]}, {maps, [9200, 9201, 9203, 9209]}]},
[{zoneid, 11}, {areaid, 3}, {enemy_level, 1}, {sets, [100]}, {maps, [4, 100, 200]}], {11, [{areaid, 3}, {enemy_level, 1}, {sets, [100]}, {maps, [4, 100, 200]}]},
[{zoneid, 12}, {areaid, 3}, {enemy_level, 1}, {sets, [100]}, {maps, [100]}], {12, [{areaid, 3}, {enemy_level, 1}, {sets, [100]}, {maps, [100]}]},
[{zoneid, 13}, {areaid, 3}, {enemy_level, 1}, {sets, [100]}, {maps, [100]}] {13, [{areaid, 3}, {enemy_level, 1}, {sets, [100]}, {maps, [100]}]}
]}. ]}.
{temp_flags, ["ACC_BIT_FLG_01"]}. {temp_flags, ["ACC_BIT_FLG_01"]}.

View File

@ -28,15 +28,15 @@
%% @todo Default sets to [100] if unspecified (lobbies). %% @todo Default sets to [100] if unspecified (lobbies).
{zones, [ {zones, [
[{zoneid, 0}, {areaid, 4}, {enemy_level, 1}, {sets, [100]}, {maps, [1]}], { 0, [{areaid, 4}, {enemy_level, 1}, {sets, [100]}, {maps, [1]}]},
[{zoneid, 1}, {areaid, 4}, {enemy_level, 1}, {sets, [100]}, {maps, [9000]}], { 1, [{areaid, 4}, {enemy_level, 1}, {sets, [100]}, {maps, [9000]}]},
[{zoneid, 2}, {areaid, 4}, {enemy_level, 1}, {sets, [100]}, {maps, [9010]}], { 2, [{areaid, 4}, {enemy_level, 1}, {sets, [100]}, {maps, [9010]}]},
[{zoneid, 3}, {areaid, 4}, {enemy_level, 1}, {sets, [100]}, {maps, [9100]}], { 3, [{areaid, 4}, {enemy_level, 1}, {sets, [100]}, {maps, [9100]}]},
[{zoneid, 4}, {areaid, 4}, {enemy_level, 1}, {sets, [100]}, {maps, [9120]}], { 4, [{areaid, 4}, {enemy_level, 1}, {sets, [100]}, {maps, [9120]}]},
[{zoneid, 7}, {areaid, 4}, {enemy_level, 1}, {sets, [100]}, {maps, [9300, 9301, 9302, 9305]}], { 7, [{areaid, 4}, {enemy_level, 1}, {sets, [100]}, {maps, [9300, 9301, 9302, 9305]}]},
[{zoneid, 11}, {areaid, 4}, {enemy_level, 1}, {sets, [100]}, {maps, [3, 100, 200]}], {11, [{areaid, 4}, {enemy_level, 1}, {sets, [100]}, {maps, [3, 100, 200]}]},
[{zoneid, 12}, {areaid, 4}, {enemy_level, 1}, {sets, [100]}, {maps, [100]}], {12, [{areaid, 4}, {enemy_level, 1}, {sets, [100]}, {maps, [100]}]},
[{zoneid, 13}, {areaid, 4}, {enemy_level, 1}, {sets, [100]}, {maps, [100]}] {13, [{areaid, 4}, {enemy_level, 1}, {sets, [100]}, {maps, [100]}]}
]}. ]}.
{temp_flags, []}. {temp_flags, []}.

View File

@ -28,16 +28,16 @@
%% @todo Default sets to [100] if unspecified (lobbies). %% @todo Default sets to [100] if unspecified (lobbies).
{zones, [ {zones, [
[{zoneid, 0}, {areaid, 5}, {enemy_level, 1}, {sets, [100]}, {maps, [1]}], { 0, [{areaid, 5}, {enemy_level, 1}, {sets, [100]}, {maps, [1]}]},
[{zoneid, 1}, {areaid, 5}, {enemy_level, 1}, {sets, [100]}, {maps, [9010]}], { 1, [{areaid, 5}, {enemy_level, 1}, {sets, [100]}, {maps, [9010]}]},
[{zoneid, 3}, {areaid, 5}, {enemy_level, 1}, {sets, [100]}, {maps, [9101]}], { 3, [{areaid, 5}, {enemy_level, 1}, {sets, [100]}, {maps, [9101]}]},
[{zoneid, 4}, {areaid, 5}, {enemy_level, 1}, {sets, [100]}, {maps, [9202]}], { 4, [{areaid, 5}, {enemy_level, 1}, {sets, [100]}, {maps, [9202]}]},
[{zoneid, 5}, {areaid, 5}, {enemy_level, 1}, {sets, [100]}, {maps, [9030]}], { 5, [{areaid, 5}, {enemy_level, 1}, {sets, [100]}, {maps, [9030]}]},
[{zoneid, 6}, {areaid, 5}, {enemy_level, 1}, {sets, [100]}, {maps, [9040]}], { 6, [{areaid, 5}, {enemy_level, 1}, {sets, [100]}, {maps, [9040]}]},
[{zoneid, 7}, {areaid, 5}, {enemy_level, 1}, {sets, [100]}, {maps, [9300, 9302, 9304]}], { 7, [{areaid, 5}, {enemy_level, 1}, {sets, [100]}, {maps, [9300, 9302, 9304]}]},
[{zoneid, 11}, {areaid, 5}, {enemy_level, 1}, {sets, [100]}, {maps, [2, 100, 101, 200]}], {11, [{areaid, 5}, {enemy_level, 1}, {sets, [100]}, {maps, [2, 100, 101, 200]}]},
[{zoneid, 12}, {areaid, 5}, {enemy_level, 1}, {sets, [100]}, {maps, [100]}], {12, [{areaid, 5}, {enemy_level, 1}, {sets, [100]}, {maps, [100]}]},
[{zoneid, 13}, {areaid, 5}, {enemy_level, 1}, {sets, [100]}, {maps, [100]}] {13, [{areaid, 5}, {enemy_level, 1}, {sets, [100]}, {maps, [100]}]}
]}. ]}.
{temp_flags, []}. {temp_flags, []}.

View File

@ -29,7 +29,7 @@
%% @todo Default enemy_level to 1 if unspecified (lobbies). %% @todo Default enemy_level to 1 if unspecified (lobbies).
{zones, [ {zones, [
[{zoneid, 0}, {areaid, 2}, {enemy_level, 1}, {sets, []}, {maps, [900]}] {0, [{areaid, 2}, {enemy_level, 1}, {sets, []}, {maps, [900]}]}
]}. ]}.
{temp_flags, []}. {temp_flags, []}.

View File

@ -197,11 +197,10 @@ load_quest_xnr_zones([], _BasePos, SetsAcc, SetsPtrsAcc, ZonesAcc) ->
SetsPtrsList = lists:flatten(lists:reverse(SetsPtrsAcc)), SetsPtrsList = lists:flatten(lists:reverse(SetsPtrsAcc)),
ZonesBin = iolist_to_binary(lists:reverse(ZonesAcc)), ZonesBin = iolist_to_binary(lists:reverse(ZonesAcc)),
{SetsBin, SetsPtrsList, ZonesBin}; {SetsBin, SetsPtrsList, ZonesBin};
load_quest_xnr_zones([Zone|Tail], BasePos, SetsAcc, SetsPtrsAcc, ZonesAcc) -> load_quest_xnr_zones([{ZoneID, ZoneParams}|Tail], BasePos, SetsAcc, SetsPtrsAcc, ZonesAcc) ->
ZoneID = proplists:get_value(zoneid, Zone), AreaID = proplists:get_value(areaid, ZoneParams),
AreaID = proplists:get_value(areaid, Zone), EnemyLevel = proplists:get_value(enemy_level, ZoneParams),
EnemyLevel = proplists:get_value(enemy_level, Zone), SetList = proplists:get_value(sets, ZoneParams),
SetList = proplists:get_value(sets, Zone),
NbSets = length(SetList), NbSets = length(SetList),
SetsBin = iolist_to_binary([<< Set:32/little >> || Set <- SetList]), SetsBin = iolist_to_binary([<< Set:32/little >> || Set <- SetList]),
SetsBin2 = << SetsBin/binary, BasePos:32/little, NbSets:32/little >>, SetsBin2 = << SetsBin/binary, BasePos:32/little, NbSets:32/little >>,
@ -308,9 +307,8 @@ load_unit_title_table_rel_zones(Zones) ->
load_unit_title_table_rel_zones(Zones, 0, []). load_unit_title_table_rel_zones(Zones, 0, []).
load_unit_title_table_rel_zones([], N, Acc) -> load_unit_title_table_rel_zones([], N, Acc) ->
{iolist_to_binary(lists:reverse(Acc)), N}; {iolist_to_binary(lists:reverse(Acc)), N};
load_unit_title_table_rel_zones([Zone|Tail], N, Acc) -> load_unit_title_table_rel_zones([{ZoneID, ZoneParams}|Tail], N, Acc) ->
ZoneID = proplists:get_value(zoneid, Zone), Maps = proplists:get_value(maps, ZoneParams),
Maps = proplists:get_value(maps, Zone),
{Bin, N2} = load_unit_title_table_rel_maps(ZoneID, Maps), {Bin, N2} = load_unit_title_table_rel_maps(ZoneID, Maps),
load_unit_title_table_rel_zones(Tail, N + N2, [Bin|Acc]). load_unit_title_table_rel_zones(Tail, N + N2, [Bin|Acc]).

View File

@ -112,8 +112,7 @@ load_unit_title_bin_files(Dir, ConfFilename) ->
[load_unit_title_bin(Dir, Zone) || Zone <- Zones] [load_unit_title_bin(Dir, Zone) || Zone <- Zones]
end. end.
load_unit_title_bin(Dir, Zone) -> load_unit_title_bin(Dir, {ZoneID, _ZoneParams}) ->
ZoneID = proplists:get_value(zoneid, Zone),
Filename = io_lib:format("unit_title_~2.10.0b.bin", [ZoneID]), Filename = io_lib:format("unit_title_~2.10.0b.bin", [ZoneID]),
TxtFilename = io_lib:format("~s~s.en_US.txt", [Dir, Filename]), TxtFilename = io_lib:format("~s~s.en_US.txt", [Dir, Filename]),
{data, Filename, egs_files:load_text_bin(TxtFilename), []}. {data, Filename, egs_files:load_text_bin(TxtFilename), []}.