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

Reforging in core for Cata #4226

Closed
wants to merge 14 commits into from
Closed

Conversation

ToxicKevinFerm
Copy link
Contributor

@ToxicKevinFerm ToxicKevinFerm commented Feb 27, 2024

RFC: Reforging

Background

With Cataclysm on the horizon, I thought it's time to start adding functionality. Reforging is one of those we can add easily without disturbing other things in the core sim.
The functionality of reforging is quite simple.
The main issue will be implementing the UI to work with it.

Example item loadout with reforging:

{"items": [
    {"id":51286,"enchant":3817,"gems":[41398,40112]},
    {"id":50633,"gems":[40112]},
    {"id":51288,"enchant":3808,"gems":[40112]},
    {"id":47546,"enchant":3605,"gems":[42143]},
    {"id":51289,"enchant":3832,"gems":[40112,40112]},
    {"id":50655,"enchant":3845,"gems":[40112,0]},
    {"id":51285,"enchant":3604,"gems":[40112,0]},
    {"id":50688,"enchant":3601,"gems":[40148,42143,42143]},
    {"id":50645,"enchant":3823,"gems":[49110,40112,40150]},
    {"id":54577,"enchant":3606,"gems":[40148,40148]},
    {"id":50618,"gems":[45879]},
    {"id":54576,"gems":[40148]},
    {"id":50363},
    {"id":54590},
    {"id":50735,"enchant":3827,"gems":[40112,40112,40112]},
    {},
    {"id":50733,"enchant":3608,"gems":[40112], "reforging":115}
]}

Everything here is optional, so it shouldn't affect current sims at all.

How reforging works

Reforging takes a secondary stat on the item from a list of allowed stats:

  • Spirit (Spirit is counted for the purpose of reforging)
  • Dodge
  • Parry
  • Hit
  • Crit
  • Haste
  • Expertise
  • Mastery (In Cata)

Then it takes 40% and adds it to another allowed stat and floors the result.
Relevant code from Simulationcraft:

  reforged_from = s1;
  reforged_to   = s2;

  double amount = floor( base_stats.get_stat( reforged_from ) * 0.4 );
  stats.add_stat( reforged_from, -amount );
  stats.add_stat( reforged_to,    amount );

  is_reforged   = true;

Implementation

  • Added a ReforgeStat proto
  • Added a Reforging property to the ItemSpec proto
  • Apply reforging (when exists) in the euipment Stats() function

Found reforging ids on https://www.wowhead.com/tooltips and the object structure WH are likely to use at https://web.archive.org/web/20120201045249js_/http://www.wowhead.com/data=item-scaling

Todo

  • Modify UI to allow reforging (and visually show them)

@ToxicKevinFerm ToxicKevinFerm marked this pull request as ready for review March 2, 2024 13:02
@ToxicKevinFerm ToxicKevinFerm changed the title Draft: WIP/RFC: Reforging in core Reforging in core for Cata Mar 2, 2024
@kayla-glick
Copy link
Contributor

Forked the Cata repo from this branch https://github.com/wowsims/cata. Closing this PR 🙏

@kayla-glick kayla-glick closed this Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants