GS2-Enchant

enchant random parameter function

Enchantments and random parameters can be added to equipment and characters.

Two types of random parameters are available.

  • Balance parameter
  • Rarity parameter

Balance Parameter

Balance parameters randomly distribute multiple prepared parameters in a defined total amount. For example, if two parameters, attack and defense, are prepared and the total amount is set to 100, and attack power is drawn at 60, defense power will be drawn at 40.

Redrawing

Balance parameters can be redrawn. When redrawing, some parameter values can be fixed. Fixing some parameters provides a way for players to optimize parameters more efficiently.

Initial values

The initial values of the balance parameters can be random or average.

Rarity parameter

The rarity parameter does not distribute a value to a certain parameter like the balance parameter, It can be used in cases where additional parameters are given to equipment or skills with a certain probability.

In the master data, the lottery probability of the number of parameters to be granted is first set. Next, set the type of parameter to be granted and its probability. Now, additional parameters can be assigned based on the probabilities.

Redrawing

The granted parameters can be redrawn. When redrawing, only the type of parameters granted will change, not the number. As with balance parameters, it is possible to fix some of the parameters to be redrawn.

Add.

Rarity parameters can be added later. When adding, the already existing parameters remain unchanged and the specified number of parameters can be added.

Example implementation

Balance Parameters

Parameter initialization/retrieval

When parameter information is retrieved for the first time, a parameter drawing process is created.

    var item = await gs2.Enchant.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).BalanceParameterStatus(
        parameterName: "balance-0001",
        propertyId: "property-0001"
    ).ModelAsync();
    const auto item = Gs2->Enchant->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        AccessToken
    )->BalanceParameterStatus(
        "balance-0001", // parameterName
        "property-0001" // propertyId
    ).Model();

Parameter redrawing

Redrawing cannot be handled by the SDK for game engines.

Rarity parameters

Initialize/retrieve parameters

The parameter draw process is created when the parameter information is retrieved for the first time.

    var item = await gs2.Enchant.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).RarityParameterStatus(
        parameterName: "balance-0001",
        propertyId: "property-0001"
    ).ModelAsync();
    const auto item = Gs2->Enchant->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        AccessToken
    )->RarityParameterStatus(
        "balance-0001", // parameterName
        "property-0001" // propertyId
    ).Model();

parameter redraw

Redrawing cannot be handled by the SDK for game engines.

Adding parameters

Adding parameters cannot be handled by the SDK for game engines.

Advanced Reference.