Equipment Enchantment

Overview

Each piece of equipment you take rolls 1 to 3 random bonuses (enchantments) of its own. Bonuses are drawn by weight from six options (attack, defense, hp, speed, critical, luck) and shown on the piece’s row as text such as attack +12 / hp +50. You can spend coins to reroll the bonuses or to add one more.

How to try it

  1. Press Deposit under Get coins to put 100 free coins into Free balance under Your coins.
  2. Press Take next to an equipment name under Take equipment. The piece appears under Your equipment and its bonuses, and the first time it is read it rolls 1 to 3 bonuses (one is most likely, three is rare).
  3. Press Reroll on a piece to pay 10 coins and draw the same number of bonuses again.
  4. Press Add bonus to pay 30 coins and draw one more bonus. If the piece already holds the maximum of 3, the press fails and no coins are taken.
  5. If the bag runs out of room, press Expand under Equipment bag to add 2 slots (up to 10).

How enchanting works states the rules for how many bonuses a piece gets and what each press costs. Two pieces with the same name are separate items, and each rolls its own bonuses.

GS2 services used

  • GS2-Enchant: GS2-Enchant’s rarity parameter model standard defines the maximum of 3 bonuses, the weights for how many are rolled, and the six options with their values. Bonuses are kept per piece (the item set’s propertyId); rerolling uses Gs2Enchant:ReDrawRarityParameterStatusByUserId and adding uses Gs2Enchant:AddRarityParameterStatusByUserId.
  • GS2-Exchange: GS2-Exchange rate models define Reroll and Add bonus as single transactions that take the coins and change the enchantment, run atomically on the server. Taking equipment, expanding the bag and depositing free coins also go through exchange rates.
  • GS2-Inventory: GS2-Inventory holds the equipment the player has taken and the bag it goes in (4 slots to start, 10 at most).
  • GS2-Money2: A GS2-Money2 wallet holds the coins; Reroll withdraws 10 and Add bonus withdraws 30.

Use it in GS2 Studio

In GS2 Studio’s Simple mode, open Add features and press Add on Equipment Enchantment to bring this feature into your own project. To point at the package directly, choose Add from GitHub and enter the package below.

https://github.com/gs2io/gs2-studio-package/tree/main/micro-economy-equipment-enchant/packages/micro-economy-equipment-enchant
  • Owner: gs2io
  • Repository: gs2-studio-package
  • Subdirectory: micro-economy-equipment-enchant/packages/micro-economy-equipment-enchant

Source code