Skip to content

11. Custom Gunsmith Orders (BuildCustomGunOrder) ​

When a customer visits with ClientIntent.GUNSMITH, NpcFrameworkSdk.BuildCustomGunOrder constructs a GunOrderData contract containing both mandatory requirements and bonus requirements across 18 firearm stat tags.


SDK Signature & Stat Tags ​

csharp
public static GunOrderData BuildCustomGunOrder(
    int tier,
    int baseReward,
    string dialogText,
    bool isBestOrder,
    IList<(string statTag, int minVal, int bonusReward, bool isMandatory)> requirements)

Supported statTag values: "GUN_CALIBER_TAG", "GUN_SUPPRESSED_TAG", "GUN_FIREPOWER_TAG", "GUN_ACCURACY_TAG", "GUN_RELIABILITY_TAG", "GUN_ERGONOMICS_TAG", "GUN_RECOIL_TAG", "GUN_REPAIRBILITY_TAG", "GUN_STYLE_TAG", "GUN_FRAME_TAG", "GUN_SIZE_TAG".


Code Example ​

csharp
sc.clientIntent = StoreClient.ClientIntent.GUNSMITH;
sc.gunOrderData = NpcFrameworkSdk.BuildCustomGunOrder(
    tier: 2,
    baseReward: 380,
    dialogText: NpcFrameworkSdk.T("帮我改一把带消音器、高火力且精准可靠的潜行武器。", "Build me a suppressed, high-firepower sidearm with clean accuracy."),
    isBestOrder: true,
    requirements: new List<(string statTag, int minVal, int bonusReward, bool isMandatory)>
    {
        ("GUN_SUPPRESSED_TAG", 1, 80, true),
        ("GUN_FIREPOWER_TAG", 45, 100, true),
        ("GUN_ACCURACY_TAG", 60, 120, false),
        ("GUN_RELIABILITY_TAG", 70, 90, false)
    }
);

Custom NPC Framework Documentation