meraki-analytics / lolstaticdata

Accurate League of Legends static data for champions and items
MIT License
63 stars 22 forks source link

Source wiki syntax for ability descriptions #70

Closed DanyYanev closed 10 months ago

DanyYanev commented 1 year ago

Warning: This code was scraped together in an afternoon, it's for illustrative purposes only.

I got curious about why the wiki syntax is missing from the descriptions. So I snooped around the wiki and found a way to pull the descriptions from the source of the article. Edited the code a bit to do that automatically and it seems to work with a few flaws.

I'm not sure if we can build the ability object from that source. It's possible to add this syntax to brin.

How it works: The rich syntax (like the one available for items) can be found at https://leagueoflegends.fandom.com/wiki/Template:Data_{champion}/{ability_name}?action=edit

Example - https://leagueoflegends.fandom.com/wiki/Template:Data_Aatrox/Deathbringer_Stance?action=edit Both without and with a fandom account. Then the source is inside <textarea ... class="mw-editfont-default">

Issues:

Other than that seems to work. Some examples of the changes for Aatrox/Deathbringer_Stance -

Innate: Periodically, Aatrox empowers his next basic attack to gain 50 bonus range and deal bonus magic damage equal to 4% − 12% (based on level) of the target's maximum health, capped at 100 against monsters. Aatrox heals for 80% of the post-mitigation bonus damage dealt, reduced to 25% against minions.
{{sbc|Innate:}} Periodically, '''Aatrox''' empowers his next [[basic attack]] to gain {{sti|range|50 '''bonus''' range}} and deal {{as|'''bonus''' magic damage}} equal to {{as|{{pp|key=%|4 to 12}} of the target's '''maximum''' health}}, capped at 100 against {{tip|monsters}}.<br/> '''Aatrox''' {{tip|heals}} for 80% of the {{tt|post-mitigation '''bonus''' damage|Damage calculated after modifiers}} dealt, reduced to 25% against {{tip|minions}}.

Would you guys be interested in merging this sort of functionality (assuming the PR is good). Perhaps behind some feature flag so it's backward compatible?