CoreNetwork / TradeCraft

Custom villager tiers, trades and rebalancing. [No longer updated]
MIT License
2 stars 6 forks source link

Award experience for completing trades #44

Open riddle opened 9 years ago

riddle commented 9 years ago

Trading award experience in vanilla game. We need to add it.

Baseline

There should be one master config node allowing to specify range of experience points awarded for completing a trade.

Experience:
  Basic: 3,6
  Willing: 8,11

The second one is used when the villagers are willing to breed (Willing NBT being 1). I think we should have this for free in TC because this also influences if villager want to breed. Wiki explains it as

Willing: 1 or 0 (true/false) - true if the villager is willing to mate. Becomes true after certain trades (those which would cause offers to be refreshed), and false after mating.

Type

There should be an option to restrict experience only for selling, buying or both. Selling happens when result is defined as currency. Everything else is defined as buying.

Experience:
  …
  AwardForBuying: true
  AwardForSelling: true

Per-trade tweaks

And finally we can change experience on per-trade basis. Those nodes always overwrite aforementioned config values.

So if global experience for trades is 0 and a trade defines it as 3,4 points, it takes precedence. Same if it’s globally defined as 3,6 and trade defines it as 0.

Same, if experience for selling items is disabled globally, it can be enabled in a specific selling trade by adding a node.

Tiers: yaml
  Farmer:
    '0':
    - trade:
        comment: buying wheat
        itemA:
          item: wheat
          amount: 18,22
        result:
          currency: 1
        experience:
          basic: 1
          willing: 2

Please support single values (0 included) and ranges. Negative values are invalid.

Kongolan commented 9 years ago

I don't know why exactly, but most about the villagers from the wiki is wrong. Willing state should reset on mating and as long you trade with them in that time, it should give more Experience.

Though it's not like this. Only if a refresh of a trade, so on the first usage of an offer or on the 20% chance, it gives the additional of xp += 5, which is before random between 3 and 6. Also the popularity isn't affected by the last trade traded in vanilla, it is also bound to the refresh chance.

Strange overall what is true and what is not here, the information basis is really low, but the praxis shows other results.