dofapi / crawlit-dofus-encyclopedia-parser

Encyclopedia parser for Dofus and Dofus-Touch : used to populate Dofapi API, you can use it to build your own dofus API & applications like Dofus-book
https://dofapi.fr/
Other
58 stars 28 forks source link

Weapons crit #42

Open Le-Polemil opened 5 years ago

Le-Polemil commented 5 years ago

Hello, I've seen a problem that come from dofus encyclopedia : %cc wepons basis is wrote this way : 1/x but x is the real value in % Example : "Hache Teroide" is 40% in game, but they wrote 1/40 on their page (which means 2.5%) "Epee saigneur guerrier" is wrote 1/5 (= 20%) but is 5% in game.

What I did in my server is a simple regex :

if (name === 'CC') {
        const [rateToFix, boostToFix] = values.split(' ');

        const rate = rateToFix && rateToFix.replace(/^1\//, '');
        const boost = boostToFix && boostToFix.replace(/\(|\)|\+]/gi, '')

        values = { rate, boost };
}

Then I have "CC": { rate: 40, boost: 7 } instead of "CC": "1/40 (+7)" which makes the boost more usable :)

raczak commented 5 years ago

Thanks @Cobelt for this information, I will try your fix and come back to you :)

Le-Polemil commented 5 years ago

Hello, I have another request about weapons.

I think it could make more sense to get weapons damages (ex: "(air damages)") in characteristics instead of statistics (and without the "( )")

What do you think about that ?