MelvorIdle / melvoridle.github.io

128 stars 21 forks source link

Summoning has incorrect cost reduction at 99 mastery #1137

Closed Tykothorpe closed 3 years ago

Tykothorpe commented 3 years ago

Describe the bug At 99 mastery the leprechaun familiar costs 550gp to create. According to the "Item Mastery Unlocks" for summoning there should be a cost reduction of 5% every 10 mastery levels (which works) and a final 5% reduction at level 99 mastery (which does not work).

The same problem applies to the cyclops familiar, which starts at 1000 slayer coins cost, drops to 550 at level 90 mastery, but does not drop to 500 slayer coins at 99 mastery like it should. I assume it applies to all familiars, but is most obvious on those with a high cost where 5% is a noticeable amount!

To Reproduce Steps to reproduce the behavior:

  1. Reach 99 mastery on the leprechaun familiar
  2. Go to summoning familiars creation page
  3. Observe the cost is 550gp (plus shards), not 500gp

Expected behavior It should cost 500gp - the original cost was 1000gp, so after ten reductions at 5% each time, it should be a total of 50% off.

Browser Firefox

Are you using any scripts? None

MelvorIdle commented 3 years ago

Fixed in Alpha v0.21

MelvorIdle commented 3 years ago

Fixed in Alpha v0.21

Tykothorpe commented 3 years ago

I'm not convinced this was fixed in 0.21 Issue is still there for me

snell-matthew-a commented 3 years ago

Yeah, it doesn't look like there's anything in getSummoningRecipeQty in summoning.js that gives the 5% cost reduction for Mastery level 99.

Math.floor(mastery level / 10) gives the 5% cost reduction for each 10 levels, but there isn't anything that gives it for level 99 as far as I can tell

let recipeGPCostReduction=Math.floor(getMasteryLevel(CONSTANTS.skill.Summoning,items[itemID].masteryID[1])/10); recipeGPCost=recipeGPCost*(1-(recipeGPCostReduction*5)/100); if(items[itemID].summoningReq[recipeID][recipeItemIndex].id===-4)qty=recipeGPCost; else if(items[itemID].summoningReq[recipeID][recipeItemIndex].id===-5)qty=recipeGPCost;

I think

let recipeGPCostReduction=Math.floor(getMasteryLevel(CONSTANTS.skill.Summoning,items[itemID].masteryID[1])/10); if(getMasteryLevel(CONSTANTS.skill.Summoning,items[itemID].masteryID[1]>=99)recipeGPCostReduction++;

would fix it?