SetItemStatsBatch
setItemStatsBatch
AVAILABLE FROM UPDATE 0.1.9
Planned for 0.1.9; not yet publicly released. Not included in public 0.1.8. See the scope and validation notes below.
Patches several item types in one validated transaction.
Syntax
accepted, error, revision = setItemStatsBatch(items)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
items |
table |
yes | Map of item keys to property/value tables, not an array of item records. |
Returns
Three values: accepted (boolean), error (string; empty on success), revision (decimal string). Check accepted before using the revision. Success means server acceptance, not visual/client completion. A no-op may return the unchanged revision.
Examples
local ok, why = setItemStatsBatch({
["1h_sword_short_02"]={damage=60},
mercenary={resistanceEdge=80},
itfo_potion_mana_03={mana=31}
})
assert(ok, why)
Notes
- Planned for G1R:MP 0.1.9; not yet publicly released and not included in public 0.1.8. This documents the implemented development API, not a release announcement. See Item type stats for scope and remaining in-game validation.
- Server-side only. Profiles affect every copy of the same type on this server, across dimensions; not individual item instances.
- Use matching supported client and server builds. Server acceptance and a client application report do not prove the native gameplay effect.
- Active overrides are owned per item type by the calling resource. Another resource cannot change that owned type. Resource stop removes its overrides.
- Validation is atomic for the submitted transaction. Unsupported fields, wrong families, invalid/non-finite values, duplicate item/property aliases or ownership conflicts reject it.
- A numeric 0 is an explicit value where allowed, not reset. Use resetItemStats to remove an override. Profiles are not automatically persisted.
- Do not expose this setter directly to untrusted remote events. See getItemStatDefinitions and Item stat properties.
- This merges fields. Types/fields omitted from the batch retain their previous overrides; use replaceItemStatsProfile for full replacement.