Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spells Parser #47

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Spells Parser #47

wants to merge 4 commits into from

Conversation

remi-dupre
Copy link

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 remi-dupre force-pushed the master branch 5 times, most recently from bbab784 to 51d656b Compare August 1, 2019 16:29
@raczak
Copy link
Collaborator

raczak commented Aug 2, 2019

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 😄 ! http://discord.dofapi.fr/

@raczak raczak assigned raczak and remi-dupre and unassigned raczak Aug 2, 2019
@raczak raczak added the enhancement New feature or request label Aug 2, 2019
@raczak raczak added this to the All categories parsed milestone Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants