03. Wholesale Lot Trading (isOfferWholesale)
Wholesale mode allows a seller to place a multi-item bundle onto the counter at a flat percentage discount (e.g. -30 for 30% off the entire lot). This subsystem powers Billy's Act 3 Medbay theft, the Greytide Scavenger, the Lower Levels Chemist, the Underground Arms Dealer, and V's Act 3 corporate vault heist.
Required Setup
- Set
sc.clientIntent = StoreClient.ClientIntent.SELL; - Set
sc.isOfferWholesale = true; - Set
sc.wholesaleDiscount = -30(negative integer representing the percentage discount); - Call
PlayerStore.Instance.AddDirectSellingItemToTable(...)for each item in the lot insidesc.mainDialogue's finalSetEndAction.
Code Example: 30%-Off Vault Heist Wholesale Lot
csharp
private static StoreClient CreateVaultWholesaleSeller()
{
var sc = new StoreClient
{
identifier = "v_act3_heist",
displayName = NpcFrameworkSdk.T("佣兵 V", "Mercenary V"),
spriteName = "v_normal",
clientFaction = "FACTION_BLACK_MARKET",
clientIntent = StoreClient.ClientIntent.SELL,
isOfferWholesale = true,
wholesaleDiscount = -30
};
sc.mainDialogue
.SetText(sc.displayName, NpcFrameworkSdk.T("金库被我们掀了个底朝天,剩下的尖端货全在这儿了。", "Cleaned out their vault. Brought the rest of the high-tech loot straight to you."))
.NextDialogue()
.SetText(sc.displayName, NpcFrameworkSdk.T("义体芯片、指挥官门禁卡、高能电池和冲锋枪,整包七折让给你!", "Aug chips, command keycards, hypertech battery, and an SMG. 30% off the whole lot!"))
.SetEndAction(() =>
{
var ps = PlayerStore.Instance;
if (ps == null) return;
ps.AddDirectSellingItemToTable("aug_chip", false, false, false, 0);
ps.AddDirectSellingItemToTable("command_keycard", false, false, false, 0);
ps.AddDirectSellingItemToTable("sci_keycard", false, false, false, 0);
ps.AddDirectSellingItemToTable("energy_credit_hyp", false, false, false, 0);
ps.AddDirectSellingItemToTable("smg", false, false, false, 0);
});
sc.CompleteClientCreation(false);
return sc;
}