crawlit-dofus-encyclopedia-parser icon indicating copy to clipboard operation
crawlit-dofus-encyclopedia-parser copied to clipboard

Spells Parser

Open remi-dupre opened this issue 5 years ago • 1 comments

Hi !

Thanks for your nice work! I was really happy to find out that some people started working on such an api and making it as open as it can be for the community!

I noticed that you tool didn't fully support spells (and read #19 later), I was interested in such a feature so I started an implementation today.

There is probably still many work to do: at least support the english language (also touch/wakfu... :() and probably a lot of other things I missed. However I already got a nice result, I think now is a good time to ask if I am going in the right direction.

Here are some issues I can think of so far:

  • I store some hardcoded french content from Dofus site here. I don't think it is consistant with the existing codebase, and it seems quite ugly and highly not robust.
  • --maxItem limits the number of spells outputed, but they will occur once for each possible level. For example if maxItem is set to 2 and the two outputed spells can reach level 3, there will be 6 items in the output. The reason for this is that I didn't find any cheap way to find out what was the maximum level of each spell of a class.

The structure of resulting data is currently like so:

[
    {
        "_id": 0,
        "ankamaId": 12841,
        "name": "Pile ou Face",
        "level": 1,
        "type": "spell",
        "imgUrl": "https://s.ankama.com/www/static.ankama.com/dofus/ng/img/../../../dofus/www/game/spells/55/sort_102.png",
        "url": "https://www.dofus.com/fr/mmorpg/encyclopedie/sorts/details?id=12841&level=1&selector=1&characterlevel=1&showlevel=0&startingspell=0",
        "description": "Occasionne des dommages Terre.\nLes dommages du sort sont réduits au tour suivant.",
        "required_level": 1,
        "caracs": {
            "pa": 3,
            "po": [
                1,
                5
            ],
            "critical": 5,
            "cooldown": 0,
            "per_turn_cast": 3,
            "per_player_turn_cast": 2,
            "changeable_range": true,
            "line_of_sight": true,
            "line_cast": false,
            "free_cell": false
        },
        "effects": [
            "15 à 17 (dommages Terre)",
            "10 à 12 (dommages Terre)",
            "État 'Pile ou Face' (1 tour)",
            "6% Critique (infini)",
            "La Pièce d'Ecaflip"
        ],
        "effects_critical": [
            "19 à 21 (dommages Terre)",
            "13 à 15 (dommages Terre)",
            "État 'Pile ou Face' (1 tour)"
        ]
    }
]

Here is the result of a full run: spell.json.gz

remi-dupre avatar Aug 01 '19 16:08 remi-dupre

Hello @remi-dupre, I appreciate your interest on this particular part of the project. The way you choose to parse the spells is interesting. I notice few points that can be enhanced to get a final great result. I will try to come back to you as soon as I can.

Meanwhile, I invite you to join our Discord channel to discuss all these points with us if you want :smile: ! http://discord.dofapi.fr/

raczak avatar Aug 02 '19 13:08 raczak