This repository was archived by the owner on Nov 25, 2021. It is now read-only.
Support hero compositions extraction (aka battle presets) #59
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces extraction for battle presets.
Sample output (formatted):
How to use this data in 3rd-party applications
Presets are saved on a per-region, per-slots basis. To access a preset you need to have 2 types of information: 1) the RegionTypeId a given stage is in and 2) the amount of hero slots a stage can hold. Each key is composed of
{RegionTypeId}{Stage.UserHeroesCount}
. The value of each entry is a list of hero ids.RegionTypeIds are static and currently defined in the game as:
Example
Getting the presets for
Campaign "Brimstone Path", Stage 3:
RegionTypeId
of112
.4
heroes.1124
.Clan Boss
RegionTypeId
of401
.5
heroes.4015
.Special case Kaerok Castle (Region 1).
The first region in the campaign has a slightly different setup than the rest and therefore you will find additional
101x
entries:1012
)1013
)1014
)Special case Tag Team Arena
Tag Team Arena (internally refered to as Arena3x3) uses a slot count of
4
, despite being able to select 12 heroes. Therefore the key will be6014
. The value will hold up to 12 heroes though.Normalizing the data
If your application does not care for the special case of Kaerok Castle you could simply remove
1012
, and1013
from the object and map the key to Enums directly by dividing the key by 10.1014
would become101
which maps toRegion1
,2035
would become203
and maps toMagicKeep
, and so on.