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).
{zones, [
[{zoneid, 0}, {areaid, 0}, {enemy_level, 1}, {sets, []}, {maps, []}]
{0, [{areaid, 0}, {enemy_level, 1}, {sets, []}, {maps, []}]}
]}.
{temp_flags, []}.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -197,11 +197,10 @@ load_quest_xnr_zones([], _BasePos, SetsAcc, SetsPtrsAcc, ZonesAcc) ->
SetsPtrsList = lists:flatten(lists:reverse(SetsPtrsAcc)),
ZonesBin = iolist_to_binary(lists:reverse(ZonesAcc)),
{SetsBin, SetsPtrsList, ZonesBin};
load_quest_xnr_zones([Zone|Tail], BasePos, SetsAcc, SetsPtrsAcc, ZonesAcc) ->
ZoneID = proplists:get_value(zoneid, Zone),
AreaID = proplists:get_value(areaid, Zone),
EnemyLevel = proplists:get_value(enemy_level, Zone),
SetList = proplists:get_value(sets, Zone),
load_quest_xnr_zones([{ZoneID, ZoneParams}|Tail], BasePos, SetsAcc, SetsPtrsAcc, ZonesAcc) ->
AreaID = proplists:get_value(areaid, ZoneParams),
EnemyLevel = proplists:get_value(enemy_level, ZoneParams),
SetList = proplists:get_value(sets, ZoneParams),
NbSets = length(SetList),
SetsBin = iolist_to_binary([<< Set:32/little >> || Set <- SetList]),
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([], N, Acc) ->
{iolist_to_binary(lists:reverse(Acc)), N};
load_unit_title_table_rel_zones([Zone|Tail], N, Acc) ->
ZoneID = proplists:get_value(zoneid, Zone),
Maps = proplists:get_value(maps, Zone),
load_unit_title_table_rel_zones([{ZoneID, ZoneParams}|Tail], N, Acc) ->
Maps = proplists:get_value(maps, ZoneParams),
{Bin, N2} = load_unit_title_table_rel_maps(ZoneID, Maps),
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]
end.
load_unit_title_bin(Dir, Zone) ->
ZoneID = proplists:get_value(zoneid, Zone),
load_unit_title_bin(Dir, {ZoneID, _ZoneParams}) ->
Filename = io_lib:format("unit_title_~2.10.0b.bin", [ZoneID]),
TxtFilename = io_lib:format("~s~s.en_US.txt", [Dir, Filename]),
{data, Filename, egs_files:load_text_bin(TxtFilename), []}.